• Home
  • Textbooks
  • Introductory Combinatorics
  • Generating Permutations and Combinations

Introductory Combinatorics

Richard A. Brualdi

Chapter 4

Generating Permutations and Combinations - all with Video Answers

Educators


Chapter Questions

01:52

Problem 1

Which permutation of $\{1,2,3,4,5\}$ follows 31524 in using the algorithm described in Section 4.1? Which permutation comes before $31524 ?$

WM
William Mead
Numerade Educator
00:15

Problem 2

Determine the mobile integers in

Ali Soave
Ali Soave
Numerade Educator
02:11

Problem 3

Use the algorithm of Section $4.1$ to generate the first 50 permutations $\{1,2,3,4,5\}$.
starting with $\begin{array}{llll}1 & 2 & 3 & 4 & 5\end{array}$

Trinity Steen
Trinity Steen
Numerade Educator
01:07

Problem 4

Prove that in the algorithm of Section $4.1$, which generates directly the permutations of $\{1,2, \ldots, n\}$, the directions of 1 and 2 never change.

Sneha Ravi
Sneha Ravi
Numerade Educator
01:24

Problem 5

Let $i_{1} i_{2} \cdots i_{n}$ be a permutation of $\{1,2, \ldots, n\}$ with inversion sequence $b_{1}, b_{2}, \ldots, b$ and let $k=b_{1}+b_{2}+\cdots+b_{n} .$ Show by induction that we cannot bring $i_{1} i_{2} \cdots i_{n}$ to $12 \cdots n$ by fewer than $k$ successive switches of adjacent terms.

Vishnu P
Vishnu P
Numerade Educator
02:52

Problem 6

Determine the inversion sequences of the following permutations of $\{1,2, \ldots, 8\}$ :
(a) 35168274
(b) 83476215

James Chok
James Chok
Numerade Educator
05:27

Problem 7

Construct the permutations of $\{1,2, \ldots, 8\}$ whose inversion sequences are
(a) $2,5,5,0,2,1,1,0$
(b) $6,6,1,4,2,1,0,0$

Anas Venkitta
Anas Venkitta
Numerade Educator
01:13

Problem 8

How many permutations of $\{1,2,3,4,5,6\}$ have
(a) exactly 15 inversions?
(b) exactly 14 inversions?
(c) exactly 13 inversions?

Vysakh M
Vysakh M
Numerade Educator
01:39

Problem 9

Show that the largest number of inversions of a permutation of $\{1,2, \ldots, n\}$ equals $n(n-1) / 2$. Determine the unique permutation with $n(n-1) / 2$ inversions. Also determine all those permutations with one fewer inversion.

Lindsay El
Lindsay El
Numerade Educator
01:28

Problem 10

Bring the permutations 256143 and 436251 to 123456 by successive switches of adjacent numbers.

James Chok
James Chok
Numerade Educator
00:29

Problem 11

Let $S=\left\{x_{7}, x_{6}, \ldots, x_{1}, x_{0}\right\} .$ Determine the 8 -tuples of $0 \mathrm{~s}$ and 1 s corresponding to the following subsets of $S$ :
(a) $\left\{x_{5}, x_{4}, x_{3}\right\}$
(b) $\left\{x_{7}, x_{5}, x_{3}, x_{1}\right\}$
(c) $\left\{x_{6}\right\}$

AG
Ankit Gupta
Numerade Educator
00:26

Problem 12

Let $S=\left\{x_{7}, x_{6}, \ldots, x_{1}, x_{0}\right\} .$ Determine the subsets of $S$ corresponding to the following 8 -tuples:
(a) 00011011
(b) 01010101
(c) 00001111

AG
Ankit Gupta
Numerade Educator
16:04

Problem 13

Generate the 5-tuples of 0 s and 1 s by using the base 2 arithmetic generating scheme and identify them with subsets of the set $\left\{x_{4}, x_{3}, x_{2}, x_{1}, x_{0}\right\}$.

Chris Trentman
Chris Trentman
Numerade Educator
00:42

Problem 14

Repeat Exercise 13 for the 6 -tuples of 0 s and 1 s.

James Kiss
James Kiss
Numerade Educator
00:29

Problem 15

For each of the following subsets of $\left\{x_{7}, x_{6}, \ldots, x_{1}, x_{0}\right\}$, determine the subset that immediately follows it by using the base 2 arithmetic generating scheme:
(a) $\left\{x_{4}, x_{1}, x_{0}\right\}$
(h) $\left\{x_{7}, x_{5}, x_{3}\right\}$
(c) $\left\{x_{7}, x_{5}, x_{4}, x_{3}, x_{2}, x_{1}, x_{0}\right\}$
(d) $\left\{x_{0}\right\}$

AG
Ankit Gupta
Numerade Educator
00:35

Problem 16

For each of the subsets (a), (b), (c), and (d) in the preceding exercise, determine the subset that immediately precedes it in the base 2 arithmetic generating scheme.

Mohamed Mohamed
Mohamed Mohamed
Numerade Educator
00:48

Problem 17

Which subset of $\left\{x_{7}, x_{6}, \ldots, x_{1}, x_{0}\right\}$ is 150 th on the list of subsets of $S$ when the base 2 arithmetic generating scheme is used? 200th? 250th? (As in Section 4.3, the places on the list are numbered beginning with $0 .$ )

Kristof Mueller
Kristof Mueller
Numerade Educator
00:40

Problem 18

Build (the corners and edges of) the 4-cube, and indicate the reflected Gray code on it.

Prathan Jarupoonphol
Prathan Jarupoonphol
Numerade Educator
02:24

Problem 19

Give an example of a noncyclic Gray code of order 3 .

Ryan Mcalister
Ryan Mcalister
Numerade Educator
00:33

Problem 20

Give an example of a cyclic Gray code of order 3 that is not the reflected Gray code.

Sam Limsuwannarot
Sam Limsuwannarot
Numerade Educator
01:46

Problem 21

Construct the reflected Gray code of order 5 by
(a) using the inductive definition, and
(b) using the Gray code algorithm.

Carson Merrill
Carson Merrill
Numerade Educator
00:56

Problem 22

Determine the reflected Gray code of order 6 .

Kayla Laughman
Kayla Laughman
Numerade Educator
02:12

Problem 23

Determine the immediate successors of the following 9 -tuples in the reflected Gray code of order 9 :
(a) 010100110
(b) 110001100
(c) 111111111

Aaron Goree
Aaron Goree
Numerade Educator
00:19

Problem 24

Determine the predecessors of each of the 9 -tuples in Exercise 23 in the reflected Gray code of order $9 .$

James Kiss
James Kiss
Numerade Educator
01:46

Problem 25

*. The reflected Gray code of order $n$ is properly called the reflected binary Gray code since it is a listing of the $n$ -tuples of $0 \mathrm{~s}$ and 1 s. It can be generalized to any base system, in particular the ternary and decimal system. Thus, the reflected decimal Gray code of order $n$ is a listing of all the decimal numbers of $n$ digits such that consecutive numbers in the list differ in only one place and the absolute value of the difference is $1 .$ Determine the reflected decimal Gray codes of orders 1 and 2 . (Note that we have not said precisely what a reflected decimal Gray code is. Part of the problem is to discover what it is.) Also, determine the reflected ternary Gray codes of orders 1,2 , and 3 .

Carson Merrill
Carson Merrill
Numerade Educator
01:58

Problem 26

Generate the 2-subsets of $\{1,2,3,4,5\}$ in lexicographic order by using the algorithm described in Section $4.4$.

Nick Johnson
Nick Johnson
Numerade Educator
01:36

Problem 27

Generate the 3-subsets of $\{1,2,3,4,5,6\}$ in lexicographic order by using the algorithm described in Section $4.4$.

Nick Johnson
Nick Johnson
Numerade Educator
00:26

Problem 28

Determine the 6-subset of $\{1,2, \ldots, 10\}$ that immediately follows $2,3,4,6,9,10$ in the lexicographic order. Determine the 6-subset that immediately precedes $2,3,4,6,9,10$

AG
Ankit Gupta
Numerade Educator
00:29

Problem 29

Determine the 7-subset of $\{1,2, \ldots, 15\}$ that immediately follows $1,2,4,6,8,14,15$ in the lexicographic order. Then determine the 7-subset that immediately precedes $1,2,4,6,8,14,15$.

AG
Ankit Gupta
Numerade Educator
01:24

Problem 30

Generate the inversion sequences of the permutations of $\{1,2,3\}$ in the lexicographic order, and write down the corresponding permutations. Repeat for the inversion sequences of permutations of $\{1,2,3,4\}$.

Lourence Gonhovi
Lourence Gonhovi
Numerade Educator
01:36

Problem 31

Generate the 3-permutations of $\{1,2,3,4,5\}$.

Nick Johnson
Nick Johnson
Numerade Educator
03:01

Problem 32

Generate the 4-permutations of $\{1,2,3,4,5,6\}$.

Muhammad Nawaz
Muhammad Nawaz
Numerade Educator
01:22

Problem 33

In which position does the subset 2489 occur in the lexicographic order of the 4-subsets of $\{1,2,3,4,5,6,7,8,9\} ?$

Clarissa Noh
Clarissa Noh
Numerade Educator
01:45

Problem 34

Consider the $r$ -subsets of $\{1,2, \ldots, n\}$ in lexicographic order.
(a) What are the first $(n-r+1) r$ -subsets?
(b) What are the last $(r+1) r$ -subsets?

Rakvi .
Rakvi .
Numerade Educator
02:21

Problem 35

The complement $\bar{A}$ of an $r$ -subset $A$ of $\{1,2, \ldots, n\}$ is the $(n-r)$ -subset of $\{1,2, \ldots, n\}$, consisting of all those elements that do not belong to $A$. Let $M=\left(\begin{array}{l}n \\ r\end{array}\right)$, the number of $r$ -subsets and, at the same time, the number of $(n-r)$ subsets of $\{1,2, \ldots, n\} .$ Prove that, if
$$
A_{1}, A_{2}, A_{3}, \ldots, A_{M}
$$
are the $r$ -subsets in lexicographic order, then
$$
\overline{A_{M}}, \ldots, \overline{A_{3}}, \overline{A_{2}}, \overline{A_{1}}
$$
are the $(n-r)$ -subsets in lexicographic order.

Nick Johnson
Nick Johnson
Numerade Educator
01:21

Problem 36

Let $X$ be a set of $n$ elements. How many different relations on $X$ are there? How many of these relations are reflexive? Symmetric? Antisymmetric? Reflexive and symmetric? Reflexive and anti-symmetric?

Aman Gupta
Aman Gupta
Numerade Educator
03:54

Problem 37

Let $R^{\prime}$ and $R^{\prime \prime}$ be two partial orders on a set $X$. Define a new relation $R$ on $X$ by $x R y$ if and only if both $x R^{\prime} y$ and $x R^{\prime \prime} y$ hold. Prove that $R$ is also a partial order on $X .\left(R\right.$ is called the intersection of $R^{\prime}$ and $R^{\prime \prime}$.)

Willis James
Willis James
Numerade Educator
08:42

Problem 38

Let $\left(X_{1}, \leq_{1}\right)$ and $\left(X_{2}, \leq_{2}\right)$ be partially ordered sets. Define a relation $T$ on the set
$$
X_{1} \times X_{2}=\left\{\left(x_{1}, x_{2}\right): x_{1} \text { in } X_{1}, x_{2} \text { in } X_{2}\right\}
$$
by $\left(x_{1}, x_{2}\right) T\left(x_{1}^{\prime}, x_{2}^{\prime}\right)$ if and only if $x_{1} \leq_{1} x_{1}^{\prime}$ and $x_{2} \leq_{2} x_{2}^{\prime}$.
Prove that $\left(X_{1} \times X_{2}, T\right)$ is a partially ordered set. $\left(X_{1} \times X_{2}, T\right)$ is called the direct product of $\left(X_{1}, \leq_{1}\right)$ and $\left(X_{2}, \leq_{2}\right)$ and is also denoted by $\left(X_{1}, \leq_{1}\right) \times\left(X_{2}, \leq_{2}\right)$. More generally, prove that the direct product $\left(X_{1}, \leq_{1}\right) \times\left(X_{2}, \leq_{2}\right) \times \cdots \times\left(X_{m}, \leq_{m}\right)$
of partially ordered sets is also a partially ordered set.

Prathan Jarupoonphol
Prathan Jarupoonphol
Numerade Educator
08:42

Problem 39

Let $(J, \leq)$ be the partially ordered set with $J=\{0,1\}$ and with $0<1$. By identifying the subsets of a set $X$ of $n$ elements with the $n$ -tuples of 0s and 1s, prove that the partially ordered set $(X, \subseteq)$ can be identified with the $n$ -fold direct product $(J, \leq) \times(J, \leq) \times \cdots \times(J, \leq)(n$ factors $)$.

Prathan Jarupoonphol
Prathan Jarupoonphol
Numerade Educator
00:53

Problem 40

Generalize Exercise 39 to the multiset of all combinations of the multiset $X=$ $\left\{n_{1} \cdot a_{1}, n_{2} \cdot a_{2}, \ldots, n_{m} \cdot a_{m}\right\} .$ (Part of this exercise is to determine the "natural" partial order of these multisets. )

Nandini Singh
Nandini Singh
Numerade Educator
14:19

Problem 41

Show that a partial order on a finite set is uniquely determined by its cover relation.

Bobby Barnes
Bobby Barnes
University of North Texas
03:21

Problem 42

Describe the cover relation for the partial order $\subseteq$ on the collection $\mathcal{P}(X)$ of all subsets of a set $X$.

Prathan Jarupoonphol
Prathan Jarupoonphol
Numerade Educator
06:47

Problem 43

Let $X=\{a, b, c, d, e, f\}$ and let the relation $R$ on $X$ be defined by $a R b, b R c$, $c R d, a R e, e R f, f R d$. Verify that $R$ is the cover relation of a partially ordered set, and determine all the linear extensions of this partial order.

Anthony Ramos
Anthony Ramos
Numerade Educator
03:58

Problem 44

Let $A_{1}, A_{2}, \ldots, A_{s}$ be a partition of a set $X .$ Define a relation $R$ on $X$ by $x R y$ if and only if $x$ and $y$ belong to the same part of the partition. Prove that $R$ is an equivalence relation.

Mengchun Cai
Mengchun Cai
Numerade Educator
02:44

Problem 45

Define a relation $R$ on the set $Z$ of all integers by $a R b$ if and only if $a=\pm b$. Is $R$ an equivalence relation on $Z ?$ If so, what are the equivalence classes?

Ibrahima Barry
Ibrahima Barry
Numerade Educator
02:39

Problem 46

Let $m$ be a positive integer and define a relation $R$ on the set $X$ of all nonnegative integers by a $R b$ if and only if $a$ and $b$ have the same remainder when divided by $m$. Prove that $R$ is an equivalence relation on $X$. How many different equivalence classes does this equivalence relation have?

Chris Trentman
Chris Trentman
Numerade Educator
03:49

Problem 47

Let $\mathrm{II}_{n}$ denote the set of all partitions of the set $\{1,2, \ldots, n\}$ into nonempty sets. Given two partitions $\pi$ and $\sigma$ in $\Pi_{n}$, define $\pi \leq \sigma$, provided that each part of $\pi$ is contained in a part of $\sigma .$ Thus, the partition $\pi$ can be obtained by partitioning the parts of $\sigma$. This relation is usually expressed by saying that $\pi$ is a refinement of $\sigma$.
(a) Prove that the relation of refinement is a partial order on $\Pi_{n}$.
(b) By Theorem $4.5 .3$, we know that there is a one-to-one correspondence between $\Pi_{n}$ and the set $\Lambda_{n}$ of all equivalence relations on $\{1,2, \ldots, n\} .$ What is the partial order on $\Lambda_{n}$ that corresponds to this partial order on $\Pi I_{n} ?$
(c) Construct the diagram of $\left(\Pi_{n}, \leq\right)$ for $n=1,2,3$, and $4 .$

James Kiss
James Kiss
Numerade Educator
01:37

Problem 48

Consider the partial order $\leq$ on the set $X$ of positive integers given by "is a divisor of." Let $a$ and $b$ be two integers. Let $c$ be the largest integer such that $c \leq a$ and $c \leq b$, and let $d$ be the smallest integer such that $a \leq d$ and $b \leq d .$ What are $c$ and $d$ ?

James Chok
James Chok
Numerade Educator
02:59

Problem 49

Prove that the intersection $R \cap S$ of two equivalence relations $R$ and $S$ on a set $X$ is also an equivalence relation on $X$. Is the union of two equivalence relations on $X$ always an equivalence relation?

Nick Johnson
Nick Johnson
Numerade Educator
01:16

Problem 50

Consider the partially ordered set $(X, \subseteq)$ of subsets of the set $X=\{a, b, c\}$ of three elements. How many linear extensions are there?

Heather Zimmers
Heather Zimmers
Numerade Educator
01:24

Problem 51

Let $n$ be a positive integer, and let $X_{n}$ be the set of $n !$ permutations of $\{1,2, \ldots, n\}$ Let $\pi$ and $\sigma$ be two permutations in $X_{n}$, and define $\pi \leq \sigma$ provided that the set of inversions of $\pi$ is a subset of the set of inversions of $\sigma$. Verify that this defines a partial order on $X_{n}$, called the inversion poset. Describe the cover relation for this partial order and then draw the diagram for the inversion poset $\left(H_{4}, \leq\right) .$

Vishnu P
Vishnu P
Numerade Educator
01:19

Problem 52

Verify that a binary $n$ -tuple $a_{n-1} \cdots a_{1} a_{0}$ is in place $k$ in the Gray code order list where $k$ is determined as follows: For $i=0,1, \ldots, n-1$, let
$$
b_{i}=\left\{\begin{array}{ll}
0 & \text { if } a_{n-1}+\cdots+a_{i} \text { is even, and } \\
1 & \text { if } a_{n-1}+\cdots+a_{i} \text { is odd. }
\end{array}\right.
$$
Then
$$
k=b_{n-1} \times 2^{n-1}+\cdots+b_{1} \times 2+b_{0} \times 2^{0}
$$
Thus, $a_{n-1} \ldots a_{1} a_{0}$ is in the same place in the Gray code order list of binary $n$ -tuples as $b_{n-1} \ldots b_{1} b_{0}$ is in the lexicographic order list of binary $n$ -tuples.

Bobby Barnes
Bobby Barnes
University of North Texas
08:25

Problem 53

Continuing with Exercise 52, show that $a_{n-1} \cdots a_{1} a_{0}$ can be recovered from $b_{n-1} \cdots b_{1} b_{0}$ by $a_{n-1}=b_{n-1}$, and for $i=0,1, \ldots, n-1$,
$$
a_{i}=\left\{\begin{array}{ll}
0 & \text { if } b_{i}+b_{i+1} \text { is even, and } \\
1 & \text { if } b_{i}+b_{i+1} \text { is odd }
\end{array}\right.
$$.

Gaurav Kalra
Gaurav Kalra
Numerade Educator
01:07

Problem 54

Let $(X, \leq)$ be a finite partially ordered set. By Theorem $4.5 .2$ we know that $(X, \leq)$ has a linear extension. Let $a$ and $b$ be incomparable elements of $X$. Modify the proof of Theorem $4.5 .2$ to obtain a linear extension of $(X, \leq)$ such that $a<b$. (Hint: First find a partial order $\leq^{\prime}$ on $X$ such that whenever $x \leq y$, then $x \leq^{\prime} y$ and, in addition, $a \leq^{\prime} b$.)

Carson Merrill
Carson Merrill
Numerade Educator
02:58

Problem 55

Use Exercise 54 to prove that a finite partially ordered set is the intersection of all its linear extensions (see Exercise 37 ).

Harshita Goel
Harshita Goel
Numerade Educator
03:43

Problem 56

The dimension of a finite partially ordered set $(X, \leq)$ is the smallest number of its linear extensions whose intersection is $(X, \leq) .$ By Exercise 55 , every partially ordered set has a dimension. Those that have dimension 1 are the linear orders. Let $n$ be a positive integer and let $i_{1}, i_{2}, \ldots, i_{n}$ be a permutation $\sigma$ of $\{1,2, \ldots, n\}$ that is different from $1,2, \ldots, n .$ Let $X=\left\{\left(1, i_{1}\right),\left(2, i_{2}\right), \ldots,\left(n, i_{n}\right)\right\} .$ Now define a relation $R$ on $X$ by $\left(k, i_{k}\right) R\left(l, i_{l}\right)$ if and only if $k \leq l$ (ordinary integer inequality) and $i_{k} \leq i_{l}$ (again ordinary inequality); that is, $\left(i_{k}, i_{l}\right)$ is not an inversion of
\sigma. Thus, for instance, if $n=3$ and $\sigma=2,3,1$, then $X=\{(1,2),(2,3),(3,1)\}$, and $(1,2) R(2,3)$, but $(1,2) \quad R(3,1)$. Prove that $R$ is a partial order on $X$ and that the dimension of the partially ordered set $(X, R)$ is 2, provided that $i_{1}, i_{2}, \ldots, i_{n}$ is not the identity permutation $1,2, \ldots, n .$

Clarissa Noh
Clarissa Noh
Numerade Educator
03:30

Problem 57

Consider the set of all permutations $i_{1} i_{2} \ldots, i_{n}$ of $1,2, \ldots, n$ such that $i_{k} \neq k$ for $k=1,2, \ldots, n .$ (Such permutations are called derangements and are discussed in Chapter 6.) Describe an algorithm for generating a random derangement (modify the algorithm given in Section $4.1$ for generating a random permutation).

WZ
Wen Zheng
Numerade Educator
14:26

Problem 58

Consider the complete graph $K_{n}$ defined in Chapter 2, in which each edge is colored either red or blue. Define a relation on the $n$ points of $K_{n}$ by saying that one point is related to another point provided that the edge joining them is colored red. Determine when this relation is an equivalence relation, and, when it is, determine the equivalence classes.

Chris Trentman
Chris Trentman
Numerade Educator
01:39

Problem 59

Let $n \geq 2$ be an integer. Prove that the total number of inversions of all $n !$ permutations of $1,2, \ldots, n$ equals
$$
\frac{1}{2} n !\left(\begin{array}{l}
n \\
2
\end{array}\right)=n ! \frac{n(n-1)}{4}
$$
(Hint: Pair up the permutations so that the number of inversions in each pair is $n(n-1) / 2 .)$

Lindsay El
Lindsay El
Numerade Educator