Call a permutation $a_1, a_2, \ldots, a_n$ of the integers $1, 2, \ldots, n$ quasi-increasing if $a_k \leqslant a_{k+1} + 2$ for each $1 \leqslant k \leqslant n - 1$. For example, $53421$ and $14253$ are quasi-increasing permutations of the integers $1, 2, 3, 4, 5$, but $45123$ is not. Find the number of quasi-increasing permutations of the integers $1, 2, \ldots, 7$.
Xem đáp án và lời giải
Đáp án: $486$
Let $S_n$ be the number of quasi-increasing permutations of $1, 2, \ldots, n$. It is easy to check that $S_1 = 1$, $S_2 = 2$, and $S_3 = 6$. For $n \geqslant 3$, $S_n = 3S_{n-1}$ is proved as follows. First note that if $a_1, a_2, \ldots, a_{n-1}$ is a quasi-increasing permutation of $1, 2, \ldots, n - 1$, then one can construct a quasi-increasing permutation of $1, 2, \ldots, n$ by placing the $n$ immediately in front of $n - 1$, immediately in front of $n - 2$, or after $a_{n-1}$. If $n$ is placed in any other position, then it will be followed by an integer $k$ with $1 \leqslant k \leqslant n - 3$ so $n \leqslant k + 2$ will not be true. Thus every quasi-increasing permutation of $1, 2, \ldots, n - 1$ leads to $3$ quasi-increasing permutations of $1, 2, \ldots, n$. Conversely, suppose that we have a quasi-increasing permutation $a_1, a_2, \ldots, a_n$ of $1, 2, \ldots, n$. If $a_n = n$ or $a_1 = n$, then removing $a_n$ results in a quasi-increasing permutation of $1, 2, \ldots, n - 1$. If $n = a_k$, $k \ne 1, n$, then $a_{k+1} = n - 1$ or $a_{k+1} = n - 2$. In either case \[ a_{k-1} < n \leqslant a_{k+1} + 2, \] so removing $n$ again results in a quasi-increasing permutation of $1, 2, \ldots, n - 1$. Furthermore, as the previous paragraph showed, for each quasi-increasing permutation $\pi$ of $1, 2, \ldots, n - 1$, there are exactly $3$ quasi-increasing permutations of $1, 2, \ldots, n$ that result in $\pi$ when $n$ is removed. This completes the proof that $S_n = 3S_{n-1}$ for $n \geqslant 3$. Hence $S_n = 3^{n-2} S_2 = 2 \cdot 3^{n-2}$ for $n \geqslant 3$. In particular, $S_7 = 2 \cdot 3^5 = 486$.
For a permutation $p = (a_1, a_2, \dots, a_9)$ of the digits $1, 2, \dots, 9$, let $s(p)$ denote the sum of the three 3-digit numbers $a_1 a_2 a_3$, $a_4 a_5 a_6$, and $a_7 a_8 a_9$. Let $m$ be the minimum value of $s(p)$ subject to the condition that the units digit of $s(p)$ is $0$. Let $n$ denote the number of permutations $p$ with $s(p) = m$. Find $|m - n|$.
Xem đáp án và lời giải
Đáp án: $162$
For any permutation $p$, \[ s(p) = 100(a_1 + a_4 + a_7) + 10(a_2 + a_5 + a_8) + (a_3 + a_6 + a_9). \] Because the units digit of $m$ is $0$, it follows that $a_3 + a_6 + a_9 = 10$ or $20$. If $a_3 + a_6 + a_9 = 10$, then $a_1 + a_4 + a_7 + a_2 + a_5 + a_8 = 45 - 10 = 35$, and \[ s(p) = 90(a_1 + a_4 + a_7) + 360 \geqslant 90(1 + 2 + 3) + 360 = 900. \] If $a_3 + a_6 + a_9 = 20$, then $s(p) = 90(a_1 + a_4 + a_7) + 270 \geqslant 90 \cdot 6 + 270 = 810$, with equality if and only if $\{a_1, a_4, a_7\} = \{1, 2, 3\}$. The set $\{a_3, a_6, a_9\}$ must equal $\{4, 7, 9\}$, $\{5, 6, 9\}$, or $\{5, 7, 8\}$. For each $\{a_i, a_{i+3}, a_{i+6}\}$, there are $3!$ ways to permute these numbers. Hence there are $n = 3 \cdot 3! \cdot 3! \cdot 3! = 648$ permutations $p$ with $s(p) = m = 810$ and $|m - n| = |810 - 648| = 162$.
A special deck of cards contains $49$ cards, each labeled with a number from $1$ to $7$ and colored with one of seven colors. Each number-color combination appears on exactly one card. Sharon will select a set of eight cards from the deck at random. Given that she gets at least one card of each color and at least one card with each number, the probability that Sharon can discard one of her cards and still have at least one card of each color and at least one card with each number is $\dfrac{p}{q}$, where $p$ and $q$ are relatively prime positive integers. Find $p + q$.
Xem đáp án và lời giải
Đáp án: $13$
In a set of eight cards that includes every color and every number, there will be exactly one repeated number and exactly one repeated color. If Sharon selects a set that includes the card with that number and color, Sharon can discard it. If the set does not include that card, Sharon cannot discard any card. In the former case, there are $7!$ ways to choose one card of each number and color, and then $42$ ways to choose the “extra” card. The total is $7! \cdot 42$. In the latter case, there are $7$ ways to choose which number is repeated, and $C_7^2 = 21$ ways to choose which two cards of that number are used. There are then $5$ ways to choose which color is repeated, and $C_6^2 = 15$ ways to choose which cards of that color are used. There now remain four unused colors and four unused numbers, and there are $4! = 24$ ways to choose from those. The total is $7 \cdot 21 \cdot 5 \cdot 15 \cdot 24$. The probability that a given set is of the first type is therefore \[ \dfrac{7! \cdot 42}{7! \cdot 42 + 7 \cdot 21 \cdot 5 \cdot 15 \cdot 24} = \dfrac{4}{9}. \] The requested sum is $4 + 9 = 13$.
A real number $a$ is chosen randomly and uniformly from the interval $[-20, 18]$. The probability that the roots of the polynomial \[ x^4 + 2ax^3 + (2a - 2)x^2 + (-4a + 3)x - 2 \] are all real can be written in the form $\dfrac{m}{n}$, where $m$ and $n$ are relatively prime positive integers. Find $m + n$.
Xem đáp án và lời giải
Đáp án: $037$
Let $P(x) = x^4 + 2ax^3 + (2a - 2)x^2 + (-4a + 3)x - 2$. Grouping the terms containing $a$: \[ P(x) = (x^4 - 2x^2 + 3x - 2) + 2a(x^3 + x^2 - 2x). \] Factoring both parts: $x^3 + x^2 - 2x = x(x^2 + x - 2) = x(x - 1)(x + 2)$. For $x^4 - 2x^2 + 3x - 2$, testing $x = 1$: $1 - 2 + 3 - 2 = 0$. Testing $x = -2$: $16 - 8 - 6 - 2 = 0$. Thus $(x - 1)(x + 2) = x^2 + x - 2$ divides $x^4 - 2x^2 + 3x - 2$: \[ x^4 - 2x^2 + 3x - 2 = (x^2 + x - 2)(x^2 - x + 1). \] Therefore, factoring out $(x - 1)(x + 2)$: \[ P(x) = (x - 1)(x + 2) [x^2 - x + 1 + 2ax] = (x - 1)(x + 2) [x^2 + (2a - 1)x + 1]. \] Two roots are already real: $x = 1$ and $x = -2$. For all four roots of $P(x)$ to be real, the quadratic $Q(x) = x^2 + (2a - 1)x + 1$ must have real roots. The discriminant of $Q(x)$ must be non-negative: \[ \Delta = (2a - 1)^2 - 4 \geqslant 0 \iff (2a - 1)^2 \geqslant 4 \iff |2a - 1| \geqslant 2. \] This gives: \[ 2a - 1 \geqslant 2 \implies a \geqslant \dfrac{3}{2}, \text{ or } 2a - 1 \leqslant -2 \implies a \leqslant -\dfrac{1}{2}. \] The roots are real when $a \in \left[-20, -\dfrac{1}{2}\right] \cup \left[\dfrac{3}{2}, 18\right]$. The total length of the interval $[-20, 18]$ is $18 - (-20) = 38$. The length of the favorable set of values of $a$ is \[ \left(-\dfrac{1}{2} - (-20)\right) + \left(18 - \dfrac{3}{2}\right) = \dfrac{39}{2} + \dfrac{33}{2} = \dfrac{72}{2} = 36. \] Therefore, the probability is \[ \dfrac{36}{38} = \dfrac{18}{19}. \] Here $m = 18$ and $n = 19$, which are relatively prime. Thus $m + n = 18 + 19 = 37$.
Find the number of functions $f(x)$ from $\{1, 2, 3, 4, 5\}$ to $\{1, 2, 3, 4, 5\}$ that satisfy $f(f(x)) = f(f(f(x)))$ for all $x$ in $\{1, 2, 3, 4, 5\}$.
Xem đáp án và lời giải
Đáp án: $756$
Let $S = \{1, 2, 3, 4, 5\}$. The condition $f(f(x)) = f(f(f(x)))$ for all $x \in S$ means that every element in the image of $f \circ f$ is a fixed point of $f$. That is, if $y \in Im(f \circ f)$, then $f(y) = y$. This implies that each component of the functional directed graph of $f$ consists of trees rooted at fixed points, where every path from any element reaches a fixed point in at most $2$ steps. Let $i$ be the number of fixed points of $f$ ($1 \leqslant i \leqslant 5$). Let $j$ be the number of elements that are not fixed points but map directly to a fixed point ($0 \leqslant j \leqslant 5 - i$). The remaining $5 - i - j$ elements must map to one of the $j$ elements. There are $C_5^i$ ways to choose the $i$ fixed points. There are $C_{5-i}^j$ ways to choose the $j$ secondary elements. Each of the $j$ elements has $i$ choices of fixed points: $i^j$ ways. Each of the $5 - i - j$ elements has $j$ choices of secondary elements: $j^{5-i-j}$ ways (with $0^0 = 1$ when $5 - i - j = 0$). Summing over all valid pairs $(i, j)$: $i = 1$: $j = 0 \implies 0$ ways; $j = 1 \implies C_5^1 C_4^1 (1)^1 (1)^3 = 20$; $j = 2 \implies C_5^1 C_4^2 (1)^2 (2)^2 = 120$; $j = 3 \implies C_5^1 C_4^3 (1)^3 (3)^1 = 60$; $j = 4 \implies C_5^1 C_4^4 (1)^4 (4)^0 = 5$. Subtotal for $i = 1$: $205$. $i = 2$: $j = 0 \implies C_5^2 C_3^0 (2)^0 (0)^3 = 0$; $j = 1 \implies C_5^2 C_3^1 (2)^1 (1)^2 = 60$; $j = 2 \implies C_5^2 C_3^2 (2)^2 (2)^1 = 240$; $j = 3 \implies C_5^2 C_3^3 (2)^3 (3)^0 = 80$. Subtotal for $i = 2$: $380$. $i = 3$: $j = 0 \implies 0$; $j = 1 \implies C_5^3 C_2^1 (3)^1 (1)^1 = 60$; $j = 2 \implies C_5^3 C_2^2 (3)^2 (2)^0 = 90$. Subtotal for $i = 3$: $150$. $i = 4$: $j = 0 \implies 0$; $j = 1 \implies C_5^4 C_1^1 (4)^1 (1)^0 = 20$. Subtotal for $i = 4$: $20$. $i = 5$: $j = 0 \implies C_5^5 = 1$. Subtotal for $i = 5$: $1$. Total number of such functions is \[ 205 + 380 + 150 + 20 + 1 = 756. \]
Bài toán «$100$ đồng đội và $100$ chiếc hộp» của Gál & Miltersen ($2003$): trong phòng kín có $100$ chiếc hộp đánh số ngoài vỏ từ $1$ đến $100$, bên trong mỗi hộp chứa ngẫu nhiên một mảnh giấy ghi một số từ $1$ đến $100$ (mỗi số xuất hiện đúng $1$ lần). Lần lượt từng người mang số áo từ $1$ đến $100$ đi vào phòng một mình, được mở tối đa $50$ chiếc hộp rồi phải đóng hộp giữ nguyên hiện trạng và bước ra (không được trao đổi thông tin sau khi bắt đầu). Cả đội chỉ thắng nếu tất cả $100$ người đều mở trúng mảnh giấy ghi số áo của mình! Nếu mở đại ngẫu nhiên, xác suất thắng là $(1/2)^{100} \approx 0{,}00000000000000000000000000008\%$. Chiến thuật kỳ diệu nào nâng xác suất thắng của cả đội lên tới hơn $31\%$?
Xem đáp án và lời giải
Đáp án: Người mang áo số k mở Hộp số k đầu tiên; nếu thấy số m ≠ k thì bước tiếp theo mở Hộp số m, cứ lần theo dây chuyền cho tới khi gặp số k!
Lối mòn dễ mắc: Mọi cách chọn trước tập $50$ hộp cố định đều làm các sự kiện giữa từng người hoặc độc lập $(1/2)^{100}$, hoặc triệt tiêu nhau về $0\%$!
Đổi câu hỏi (Chìa khóa): Nhìn cách xếp giấy trong hộp như một hoán vị gồm các chu trình khép kín (Cycles)! Khi lần theo con trỏ «số trong hộp trước dẫn tới vỏ hộp sau», số mệnh của cả $100$ người được gom chung vào độ dài của chu trình dài nhất!
Lời giải gọn đẹp:
Người số $k$ bắt đầu từ Hộp $k$ chính là bước vào chu trình có chứa $k$; và con số cuối cùng trỏ ngược về Hộp $k$ trong chu trình đó chính là mảnh giấy mang số $k$!
Do đó, người số $k$ tìm thấy số của mình trong $\leqslant 50$ lần mở khi và chỉ khi chu trình chứa $k$ có độ dài $\leqslant 50$.
Cả $100$ người cùng thành công khi và chỉ khi hoán vị của $100$ lá phiếu không chứa chu trình nào dài từ $51$ trở lên! Xác suất tồn tại chu trình độ dài $L > 50$ chỉ là $\dfrac{1}{L}$, nên xác suất thắng bằng:
Để tự tay tính nhẩm chính xác chiến thuật «đi theo chu trình» ở quy mô nhỏ: xét $4$ người đồng đội (số $1, 2, 3, 4$) và $4$ chiếc hộp chứa ngẫu nhiên các mảnh giấy $\{1, 2, 3, 4\}$, mỗi người được mở tối đa $2$ chiếc hộp theo đúng chiến thuật chu trình. Trong tất cả $4! = 24$ cách xếp giấy khác nhau vào $4$ hộp, có đúng bao nhiêu cách xếp mà cả $4$ người đều thắng?
Xem đáp án và lời giải
Đáp án:$10$ cách xếp.xác suất thắng $10/24$ = $5/12$ ≈ $41{,}7\%$, cao gấp gần $7$ lần mức $1/16$!
Lối mòn dễ mắc: Mở ngẫu nhiên độc lập thì xác suất thắng của $4$ người chỉ là $(2/4)^4 = \dfrac{1}{16} = 6{,}25\%$.
Đổi câu hỏi (Chìa khóa): Cả $4$ người cùng thắng khi mọi chu trình đều có độ dài $\leqslant 2$ — vậy ta chỉ cần đếm phần bù: các hoán vị có chu trình dài $3$ hoặc dài $4$!
Lời giải gọn đẹp:
Số hoán vị có $1$ chu trình dài $4$ (ví dụ $1 \to 2 \to 3 \to 4 \to 1$): cố định vị trí của $1$, hoán vị vòng quanh $3$ số còn lại có $(4 - 1)! = 6$ cách (tỷ lệ $\dfrac{6}{24} = \dfrac{1}{4}$).
Số hoán vị có $1$ chu trình dài $3$ và $1$ điểm cố định: chọn $1$ số đứng yên có $4$ cách, nhân $(3 - 1)! = 2$ cách xoay vòng $3$ số kia $\implies 4 \times 2 = 8$ cách (tỷ lệ $\dfrac{8}{24} = \dfrac{1}{3}$).
Vậy số cách xếp giấy mà cả $4$ người cùng thắng là: $$24 - (6 + 8) = 10\text{ (cách)}$$ (đúng bằng công thức $1 - \dfrac{1}{3} - \dfrac{1}{4} = \dfrac{5}{12} = \dfrac{10}{24}$!).
Một kỹ sư kiểm thử độ bền của mẫu kính điện thoại mới tại tòa nhà $55$ tầng bằng đúng $2$ chiếc điện thoại giống hệt nhau. Nếu thả từ tầng $k$ mà máy không vỡ thì có thể nhặt lên dùng lại; nếu vỡ thì mất máy đó. Với chiến lược tối ưu cho trường hợp xấu nhất, kỹ sư cần thực hiện tối thiểu bao nhiêu lần thả để xác định chính xác tầng cao nhất mà máy không vỡ?
Xem đáp án và lời giải
Đáp án: $10$
Gọi $x$ là số lần thả tối đa ở trường hợp xấu nhất. Ở lần thả đầu tiên của máy thứ nhất, ta chỉ nên thả từ tầng $x$ (vì nếu vỡ ngay, máy thứ hai còn $x - 1$ lần để dò tuần tự từ tầng $1$ đến $x - 1$).
Nếu không vỡ, lần tiếp theo ta nhảy thêm $x - 1$ tầng (lên tầng $x + (x-1)$), rồi $x - 2$ tầng, v.v.
Tổng số tầng tối đa kiểm tra được với $x$ lần thả là:
$$x + (x-1) + (x-2) + \dots + 1 = \dfrac{x(x+1)}{2} \geqslant 55.$$
Với $x = 10$, ta có $\dfrac{10 \times 11}{2} = 55$ vừa khít! Vậy cần tối thiểu $10$ lần thả.
There are $n$ mathematicians seated around a circular table with $n$ seats numbered $1, 2, 3, \dots, n$ in clockwise order. After a break they again sit around the table. The mathematicians note that there is a positive integer $a$ such that (1) for each $k$, the mathematician who was seated in seat $k$ before the break is seated in seat $ka$ after the break (where seat $i + n$ is seat $i$); and (2) for every pair of mathematicians, the number of mathematicians sitting between them after the break, counting in both the clockwise and the counterclockwise directions, is different from either of the numbers of mathematicians sitting between them before the break. Find the number of possible values of $n$ with $1 < n < 1000$.
Xem đáp án và lời giải
Đáp án: $332$
If $\gcd(a, n) = d > 1$, then the mathematician seated in seat $n/d$ before the break will be seated in seat $an/d = n(a/d)$, which is seat $n$, after the break. This is impossible because a mathematician seated in seat $n$ before the break will also be seated in seat $n$ after the break, violating condition (1). On the other hand, if $\gcd(a, n) = 1$, then $\{a, 2a, \dots, na\}$ is a complete set of residue classes modulo $n$, and hence condition (1) is satisfied. Condition (2) holds if and only if for all $i$ and $j$ with $1 \leqslant i < j \leqslant n$, $ai - aj \not\equiv i - j \pmod{n}$ and $ai - aj \not\equiv j - i \pmod{n}$, that is, $(a-1)(i-j) \not\equiv 0 \pmod{n}$ and $(a+1)(i-j) \not\equiv 0 \pmod{n}$. Thus both $a - 1$ and $a + 1$ are relatively prime to $n$. Combining the above, a pair $(n, a)$ of positive integers satisfies the conditions of the problem if and only if \[ \gcd(a(a-1)(a+1), n) = 1. \] Call such a pair a good pair. Note that $6$ divides $a(a-1)(a+1)$ for every positive integer $a$. Hence if $\gcd(n, 6) \ne 1$, then $(n, a)$ is not a good pair. On the other hand, if $\gcd(n, 6) = 1$, then $(n, 3)$ is a good pair. Therefore all integers $n$ with $1 < n < 1000$ and $\gcd(n, 6) = 1$ satisfy the conditions of the problem. These are exactly the integers of form either $6k + 1$ or $6k - 1$ with $1 \leqslant k \leqslant 166$, and there are $166 + 166 = 332$ such integers.
For a positive integer $p$, define the positive integer $n$ to be $p$-safe if $n$ differs in absolute value by more than $2$ from all multiples of $p$. For example, the set of $10$-safe numbers is $\{3, 4, 5, 6, 7, 13, 14, 15, 16, 17, 23, \dots\}$. Find the number of positive integers less than or equal to $10{,}000$ which are simultaneously $7$-safe, $11$-safe, and $13$-safe.
Xem đáp án và lời giải
Đáp án: $958$
Because $lcm(7, 11, 13) = 1001$, the Chinese Remainder Theorem implies that there is a one-to-one correspondence between the integers from $0$ to $1000$ and the ordered triples $\{(a,b,c) : 0 \leqslant a \leqslant 6, 0 \leqslant b \leqslant 10, 0 \leqslant c \leqslant 12\}$, where the number $n$ corresponds to the triple $(a,b,c)$ if the remainders when $n$ is divided by $7$, $11$, and $13$ are $a$, $b$, and $c$, respectively. The number $n$ is $7$-safe if $3 \leqslant a \leqslant 4$, $11$-safe if $3 \leqslant b \leqslant 8$, and $13$-safe if $3 \leqslant c \leqslant 10$. Thus there are $(4-2) \cdot (8-2) \cdot (10-2) = 96$ positive integers less than $1001$ that are $7$-safe, $11$-safe, and $13$-safe. The same can be said for the integers in the range from $1001$ to $2001$, those from $2002$ to $3002$, those from $3003$ to $4003$, and so forth. It follows that there are $10 \cdot 96 = 960$ numbers between $0$ and $10{,}009$ that are simultaneously $7$-safe, $11$-safe, and $13$-safe. The numbers $10{,}006$ and $10{,}007$ are the only integers between $10{,}000$ and $10{,}009$ that are $7$-safe, $11$-safe, and $13$-safe, so the required number is $960 - 2 = 958$.
Ten adults enter a room, remove their shoes, and toss their shoes into a pile. Later, a child randomly pairs each left shoe with a right shoe without regard to which shoes belong together. The probability that for every positive integer $k < 5$, no collection of $k$ pairs made by the child contains the shoes from exactly $k$ of the adults is $\dfrac{m}{n}$, where $m$ and $n$ are relatively prime positive integers. Find $m + n$.
Xem đáp án và lời giải
Đáp án: $28$
Let $R_j$ and $L_j$ represent the right and left shoes, respectively, from the $j$th adult. Call a set $S$ of $k > 0$ pairs made by the child good if $S$ contains the shoes from exactly $k$ adults. The condition to be satisfied is that no good set contains fewer than $5$ pairs. Note that if a set of $k$ pairs is good, then the complementary set of $10 - k$ pairs is also good. Therefore the required condition can be met in only one of two ways: The set of all $10$ pairs is the only good set. In this case $L_1$ can be paired with any of $9$ right shoes ($L_1$ cannot be paired with $R_1$). Relabeling if necessary, it may be assumed that $L_1$ is paired with $R_2$. Then $L_2$ can be paired with any of $8$ right shoes ($L_2$ cannot be paired with $R_1$ or $R_2$). Again by relabeling, it may be assumed that $L_2$ is paired with $R_3$, and $L_3$ can be paired with any of $7$ right shoes. Continuing, it is seen that there are $9!$ pairings for which the set of all $10$ pairs is the only good set. There are $2$ good sets of $5$ pairs each. The set of $10$ left shoes can be partitioned into $2$ sets of $5$ left shoes in $\dfrac{1}{2} \cdot C_{10}^5$ ways. For each such partition of the left shoes, the reasoning of the preceding case can be used to establish that for each of the sets of $5$ left shoes, there are $4!$ possible arrangements of right shoes that result in a good set of $5$ pairs. Thus there are $\dfrac{1}{2} \cdot C_{10}^5 \cdot (4!)^2 = \dfrac{10!}{50} = \dfrac{1}{5} \cdot 9!$ pairings for which there are $2$ good sets of $5$ pairs each. The total number of possible pairings is $10!$, so the required probability is \[ \dfrac{9! + \dfrac{1}{5} \cdot 9!}{10!} = \dfrac{3}{25}. \] The requested sum is $3 + 25 = 28$.
Consider all 1000-element subsets of the set $\{1, 2, 3, \ldots, 2015\}$. From each such subset choose the least element. The arithmetic mean of all of these least elements is $\dfrac{p}{q}$, where $p$ and $q$ are relatively prime positive integers. Find $p + q$.
Xem đáp án và lời giải
Đáp án: $431$
Consider the number of $1000$-element subsets of $\{1, 2, 3, \ldots, 2015\}$ with least element $j$, $1 \leqslant j \leqslant 1016$. Every such subset has $999$ elements greater than $j$, and thus the number of such subsets is $C_{2015-j}^{999}$. Therefore the sum of all least elements of the subsets under consideration is $\sum_{j=1}^{1016} j C_{2015-j}^{999}$. Thus the arithmetic mean in question is equal to \[ \dfrac{\sum_{j=1}^{1016} j C_{2015-j}^{999}}{C_{2015}^{1000}}. \] Note that the number of $1001$-element subsets of $\{0, 1, 2, \ldots, 2015\}$ where $j$ is the second smallest element is $j C_{2015-j}^{999}$ because there are $j$ choices for the least element of the subset and $C_{2015-j}^{999}$ choices for the largest $999$ elements. Thus \[ \sum_{j=1}^{1016} j C_{2015-j}^{999} = C_{2016}^{1001}. \] Hence the required arithmetic mean is \[ \dfrac{\sum_{j=1}^{1016} j C_{2015-j}^{999}}{C_{2015}^{1000}} = \dfrac{C_{2016}^{1001}}{C_{2015}^{1000}} = \dfrac{2016}{1001} = \dfrac{288}{143}. \] The requested sum is $288 + 143 = 431$.
For positive integers $N$ and $k$, define $N$ to be $k$-nice if there exists a positive integer $a$ such that $a^k$ has exactly $N$ positive divisors. Find the number of positive integers less than $1000$ that are neither $7$-nice nor $8$-nice.
Xem đáp án và lời giải
Đáp án: $749$
Consider numbers of the form $p^m$, where $p$ is a prime and $m$ is a nonnegative integer. Then $(p^m)^k$ has $km + 1$ positive divisors. Thus all numbers $N$ that are one more than a nonnegative multiple of $k$ are $k$-nice. Conversely every $k$-nice number $N$ must be one more than a nonnegative multiple of $k$. This is because if an integer $a$ can be written in the form $p_1^{m_1} p_2^{m_2} \cdots p_i^{m_i}$, where $p_1, p_2, \dots, p_i$ are distinct primes and $m_1, m_2, \dots, m_i$ are nonnegative integers, then $a^k$ has $N = (km_1 + 1)(km_2 + 1) \cdots (km_i + 1)$ positive divisors, and by considering each parenthesized factor of $N$ modulo $k$, it is clear that $N \equiv 1 \pmod k$. It follows that there are $\lfloor \dfrac{999 - 1}{k} \rfloor + 1$ positive integers less than $1000$ that are $k$-nice. Thus there are $143$ positive integers less than $1000$ that are $7$-nice, and there are $125$ positive integers less than $1000$ that are $8$-nice. Because $7$ and $8$ are relatively prime, there are $\lfloor \dfrac{998}{56} \rfloor + 1 = 18$ positive integers less than $1000$ that are both $7$-nice and $8$-nice. Thus there are a total of $999 - (143 + 125 - 18) = 749$ positive integers less than $1000$ that are neither $7$-nice nor $8$-nice.
The figure below shows a ring made of six small sections which you are to paint on a wall. You have four paint colors available and will paint each of the six sections a solid color. Find the number of ways you can choose to paint the sections if no two adjacent sections can be painted with the same color.
Xem đáp án và lời giải
Đáp án: $732$
Consider the problem of painting $k$ regions in a row rather than in a ring. Let $A_k$ be the number of ways to paint $k$ regions in a row so that no two adjacent regions receive the same color and the first and last regions are painted different colors. Let $B_k$ be the number of ways to paint the $k$ regions so that no two adjacent regions receive the same color and the first and last regions are painted the same color. Then $A_1 = 0$ and $B_1 = 4$. Note that for $k \geqslant 1$, $A_{k+1} = 2A_k + 3B_k$ and $B_{k+1} = A_k$. Thus $A_1 = 0$, $A_2 = 12$, and for $k > 1$, $A_{k+1} = 2A_k + 3A_{k-1}$, which allow the calculation of $A_3 = 24$, $A_4 = 84$, $A_5 = 240$, and $A_6 = 732$. The requested count is equal to $A_6 = 732$. It is easy to verify that $A_k = 3^k + 3(-1)^k$ satisfies the required recursion.
Call a set $S$ product-free if there do not exist $a, b, c \in S$ (not necessarily distinct) such that $ab = c$. For example, the empty set and the set $\{16, 20\}$ are product-free, whereas the sets $\{4, 16\}$ and $\{2, 8, 16\}$ are not product-free. Find the number of product-free subsets of the set $\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}$.
Xem đáp án và lời giải
Đáp án: $252$
Let $T$ be a product-free subset of $U = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}$. First note that $1 \notin T$ because $1 \cdot 1 = 1$. Assume $T$ is nonempty and let $t$ be the least element of $T$. Note that if $t \geqslant 4$, then the least possible product of any two elements of $T$ is $4^2 = 16 > 10$; hence any subset of $\{4, 5, 6, 7, 8, 9, 10\}$ will be product-free. Counting the empty set, there are $2^7 = 128$ such subsets. Next, suppose that $t = 2$. Then $4 \notin T$, and 7 and 8 can be in $T$ (or not). The remaining elements of $U$ to consider are the multiples of 3 and 5. The possible subsets of $T$ that contain only multiples of 3 are $\emptyset$, $\{3\}$, $\{6\}$, $\{9\}$, and $\{6, 9\}$. Similarly, the possible subsets of $T$ that contain only multiples of 5 are $\emptyset$, $\{5\}$, and $\{10\}$. Thus there are $2 \cdot 2 \cdot 5 \cdot 3 = 60$ product-free subsets of $U$ that contain 2. If $t = 3$, then 1, 2, and 9 cannot be in $T$. Any of the 6 values in $\{4, 5, 6, 7, 8, 10\}$ may or may not be in $T$, providing $2^6 = 64$ product-free subsets with 3 as the least element. Therefore the requested number of subsets is $128 + 60 + 64 = 252$.