How many sequences of $0$s and $1$s of length $19$ are there that begin with a $0$, end with a $0$, contain no two consecutive $0$s, and contain no three consecutive $1$s?
Xem đáp án và lời giải
Đáp án: $65$
Let $a_n$ be the number of valid sequences of length $n$ that begin with $0$, end with $0$, contain no two consecutive $0$s, and contain no three consecutive $1$s.
Any valid sequence begins with $0$ and must end either with $010$ or $0110$:
If it ends in $010$, deleting the final $10$ leaves a valid sequence of length $n - 2$ ending in $0$.
If it ends in $0110$, deleting the final $110$ leaves a valid sequence of length $n - 3$ ending in $0$.
Thus, $a_n$ satisfies the recurrence relation:
\[
a_n = a_{n-2} + a_{n-3} \quad \text{for } n \geqslant 5.
\]
The initial values for small $n$ (beginning with $0$ and ending with $0$):
$n = 1$: sequence $0$ has length $1$, but requires length $\geqslant 2$.
Jason rolls three fair standard six-sided dice. Then he looks at the rolls and chooses a subset of the dice (possibly empty, possibly all three dice) to reroll. After rerolling, he wins if and only if the sum of the numbers face up on the three dice is exactly $7$. Jason always plays to optimize his chances of winning. What is the probability that he chooses to reroll exactly two of the dice?
Xem đáp án và lời giải
Đáp án: $\dfrac{7}{36}$
Let the initial sorted roll be $1 \leqslant a \leqslant b \leqslant c \leqslant 6$. Compare the win probabilities of each reroll choice:
Rerolling $0$ dice wins with probability $1$ if $a + b + c = 7$, and $0$ otherwise.
Rerolling $1$ die (keeping two dice summing to $s$) wins with probability $\dfrac{1}{6} = \dfrac{36}{216}$ if $1 \leqslant 7 - s \leqslant 6$ (i.e., $s \leqslant 6$), and $0$ otherwise.
Rerolling $2$ dice (keeping one die of value $k$) requires the two rerolled dice to sum to $7 - k$. For $k = 1, 2, 3, 4, 5, 6$, the win probabilities are $\dfrac{5}{36}, \dfrac{4}{36}, \dfrac{3}{36}, \dfrac{2}{36}, \dfrac{1}{36}, 0$, respectively.
Rerolling all $3$ dice wins with probability $\dfrac{\mathrm{C}_6^2}{216} = \dfrac{15}{216} = \dfrac{2.5}{36}$.
Notice that $\dfrac{1}{6} > \dfrac{5}{36}$ and $\dfrac{3}{36} > \dfrac{2.5}{36} > \dfrac{2}{36}$. Thus Jason rerolls exactly $2$ dice if and only if $a + b + c \ne 7$, no two dice have sum $\leqslant 6$ (so $a + b \geqslant 7$), and at least one die is at most $3$ (so $a \leqslant 3$).
Note that $a \leqslant 3$ and $a + b \geqslant 7$ already imply $a + b + c \geqslant 7 + c > 7$. Counting triples $(a, b, c)$ with $1 \leqslant a \leqslant 3$, $a + b \geqslant 7$, and $b \leqslant c \leqslant 6$ along with their permutations:
Let $D(n)$ denote the number of ways of writing the positive integer $n$ as a product
\[
n = f_1 \cdot f_2 \cdots f_k,
\]
where $k \geqslant 1$, the $f_i$ are integers strictly greater than $1$, and the order in which the factors are listed matters (that is, two representations that differ only in the order of the factors are counted as distinct). For example, the number $6$ can be written as $6$, $2 \cdot 3$, and $3 \cdot 2$, so $D(6) = 3$. What is $D(96)$?
Xem đáp án và lời giải
Đáp án: $112$
Since $96 = 2^5 \cdot 3$, consider first any ordered factorization of $2^5 = 32$ into $m$ factors greater than $1$ ($1 \leqslant m \leqslant 5$).
Distributing the $5$ identical prime factors of $2$ into $m$ nonempty ordered factors corresponds to a composition of $5$ into $m$ positive parts, of which there are $\mathrm{C}_4^{m-1}$.
To turn an $m$-factor product of $32$ into an ordered factorization of $96$, we place the single factor $3$ either:
by multiplying one of the $m$ existing factors by $3$ ($m$ ways), or
by inserting $3$ as a new standalone factor in one of the $m + 1$ gaps before, between, or after the $m$ factors ($m + 1$ ways).
Every ordered factorization of $96$ arises uniquely in this way (removing $3$ from whichever factor contains it recovers the underlying factorization of $32$). Thus
\[
D(96) = \sum_{m=1}^{5} \mathrm{C}_4^{m-1} (2m + 1) = 1 \cdot 3 + 4 \cdot 5 + 6 \cdot 7 + 4 \cdot 9 + 1 \cdot 11 = 112.
\]
Frieda the frog begins a sequence of hops on a $3 \times 3$ grid of squares, moving one square on each hop and choosing at random the direction of each hop—up, down, left, or right. She does not hop diagonally. When the direction of a hop would take Frieda off the grid, she `wraps around'' and jumps to the opposite edge. For example if Frieda begins in the center square and makes two hops `up”, the first hop would place her in the top row middle square, and the second hop would cause Frieda to jump to the opposite edge, landing in the bottom row middle square. Suppose Frieda starts from the center square, makes at most four hops at random, and stops hopping if she lands on a corner square. What is the probability that she reaches a corner square on one of the four hops?
Xem đáp án và lời giải
Đáp án: $\dfrac{25}{32}$
Group the $9$ squares into three states: the center $C$, the $4$ edge-middle squares $E$, and the $4$ corner squares $K$ (absorbing).
From $C$, every direction leads to $E$ with probability $1$.
From any square in $E$ (say top-middle), $1$ direction leads to $C$ (probability $\dfrac{1}{4}$), $1$ wraps around to another square in $E$ (probability $\dfrac{1}{4}$), and $2$ lead to corners in $K$ (probability $\dfrac{1}{2}$).
Tracking the probability distribution $(p_C, p_E, p_K)$ step by step from $(1, 0, 0)$:
After $1$ hop: $(0, 1, 0)$.
After $2$ hops: $\left(\dfrac{1}{4}, \dfrac{1}{4}, \dfrac{1}{2}\right)$.
How many ways are there to place $3$ indistinguishable red chips, $3$ indistinguishable blue chips, and $3$ indistinguishable green chips in the squares of a $3 \times 3$ grid so that no two chips of the same color are directly adjacent to each other, either vertically or horizontally?
Xem đáp án và lời giải
Đáp án: $36$
By symmetry, there are $3$ choices for the color of the center square; assume it is red and multiply the count by $3$ at the end.
Because no two red chips may be adjacent, none of the $4$ edge-middle squares can be red, so the other $2$ red chips must lie on $2$ of the $4$ corners ($\mathrm{C}_4^2 = 6$ ways).
Case 1: The $2$ red corners are opposite ($2$ choices, e.g., top-left and bottom-right). The remaining $6$ squares split into two disjoint $3$-square L-paths (upper-right and lower-left). Each L-path cannot have adjacent same-colored chips, so it must be colored either $B$-$G$-$B$ or $G$-$B$-$G$. To use $3$ blue and $3$ green chips in total, one L-path must be $B$-$G$-$B$ and the other $G$-$B$-$G$ ($2$ ways). This gives $2 \cdot 2 = 4$ arrangements.
Case 2: The $2$ red corners are on the same side ($4$ choices, e.g., top-left and top-right). The edge-middle square between them is isolated from the remaining $5$ squares, which form a single $5$-square U-path. To avoid adjacent chips of the same color along the $5$-square path, its colors must strictly alternate: either $B$-$G$-$B$-$G$-$B$ or $G$-$B$-$G$-$B$-$G$ ($2$ ways), which uniquely forces the color of the isolated square. This gives $4 \cdot 2 = 8$ arrangements.
Accounting for the $3$ choices for the center square, the total number of valid placements is $3(4 + 8) = 36$.
A square with side length $8$ is colored white except for $4$ black isosceles right triangular regions with legs of length $2$ in each corner of the square and a black diamond with side length $2\sqrt{2}$ in the center of the square, as shown in the diagram. A circular coin with diameter $1$ is dropped onto the square and lands in a random location where the coin is completely contained within the square. The probability that the coin will cover part of the black region of the square can be written as $\dfrac{1}{196}(a + b\sqrt{2} + \pi)$ where $a$ and $b$ are positive integers. What is $a + b$?
Xem đáp án và lời giải
Đáp án: $68$
Place the $8 \times 8$ square as $[0, 8]^2$. For the coin of radius $r = \dfrac{1}{2}$ to lie completely inside $[0, 8]^2$, its center $(x, y)$ must be chosen uniformly from the $7 \times 7$ square $[0.5, 7.5]^2$ of area $49$.
The coin covers part of the black region if and only if $(x, y)$ lies within distance $\dfrac{1}{2}$ of either the $4$ corner triangles or the central diamond (note that the minimum distance between a corner triangle and the central diamond is $2\sqrt{2} > 1$, so these neighborhoods are disjoint).
Corner triangles: For the bottom-left triangle ($x, y \geqslant 0, x + y \leqslant 2$), the points in $[0.5, 7.5]^2$ within distance $\dfrac{1}{2}$ satisfy $x \geqslant \dfrac{1}{2}$, $y \geqslant \dfrac{1}{2}$, and $x + y \leqslant 2 + \dfrac{\sqrt{2}}{2}$ (the rounded neighborhoods at $(2, 0)$ and $(0, 2)$ lie below $y = \dfrac{1}{2}$ and left of $x = \dfrac{1}{2}$, respectively, except at single tangent points). This forms a right triangle with leg length $1 + \dfrac{\sqrt{2}}{2}$ and area $\dfrac{1}{2}\left(1 + \dfrac{\sqrt{2}}{2}\right)^2 = \dfrac{3}{4} + \dfrac{\sqrt{2}}{2}$. All $4$ corners together have area $4\left(\dfrac{3}{4} + \dfrac{\sqrt{2}}{2}\right) = 3 + 2\sqrt{2}$.
Central diamond: The neighborhood within distance $\dfrac{1}{2}$ of the square of side $2\sqrt{2}$ consists of the square itself (area $(2\sqrt{2})^2 = 8$), four $0.5 \times 2\sqrt{2}$ rectangles along its sides (area $4 \cdot \dfrac{1}{2} \cdot 2\sqrt{2} = 4\sqrt{2}$), and four quarter-disks of radius $\dfrac{1}{2}$ at its corners (area $\pi \left(\dfrac{1}{2}\right)^2 = \dfrac{\pi}{4}$), giving area $8 + 4\sqrt{2} + \dfrac{\pi}{4}$.
Combining both parts gives total area $11 + 6\sqrt{2} + \dfrac{\pi}{4}$, so the probability is
\[
\dfrac{11 + 6\sqrt{2} + \dfrac{\pi}{4}}{49} = \dfrac{1}{196}(44 + 24\sqrt{2} + \pi),
\]
and $a + b = 44 + 24 = 68$.
Arjun and Beth play a game in which they take turns removing one brick or two adjacent bricks from one “wall” among a set of several walls of bricks, with gaps possibly creating new walls. The walls are one brick tall. For example, a set of walls of sizes $4$ and $2$ can be changed into any of the following by one move: $(3, 2)$, $(2, 1, 2)$, $(4)$, $(4, 1)$, $(2, 2)$, or $(1, 1, 2)$.
Arjun plays first, and the player who removes the last brick wins. For which starting configuration is there a strategy that guarantees a win for Beth?
Xem đáp án và lời giải
Đáp án: $(6, 2, 1)$
Using Sprague–Grundy values $g(n)$ for a single wall of size $n$ (where $g(n) = \operatorname{mex}$ of the nim-sums of resulting walls, and $\oplus$ denotes bitwise XOR):
The second player (Beth) has a winning strategy if and only if the nim-sum of the walls is $0$. Computing the nim-sum for each option using $g(6) = 3, g(1) = 1, g(2) = 2, g(3) = 3$:
Giữ nguyên toàn bộ luật lên toa tàu $100$ ghế ở bài trước (người thứ $1$ làm mất vé ngồi ngẫu nhiên, các người tiếp theo ưu tiên ngồi đúng ghế của mình nếu còn trống). Lần này, xác suất để hành khách áp chót (người thứ $99$) được ngồi đúng ghế số $99$ của chính mình bằng bao nhiêu?
Xem đáp án và lời giải
Đáp án: $2/3$
Lối mòn dễ mắc: Quen đà bài trước nên nhiều bạn đoán bừa $\dfrac{1}{2}$ luôn cho cả người thứ $99$!
Đổi câu hỏi (Chìa khóa): Áp dụng đúng chìa khóa đối xứng cho ba chiếc ghế đặc biệt: $\{\text{Ghế } 1,\ \text{Ghế } 99,\ \text{Ghế } 100\}$ trong suốt giai đoạn từ người thứ $1$ đến người thứ $98$!
Lời giải gọn đẹp:
Với tất cả $98$ hành khách đầu tiên, không ai mang vé số $1$ (đã ngồi bừa), số $99$ hay số $100$ cả! Do đó, trong mọi lần chọn ngẫu nhiên trước khi người thứ $99$ bước lên, ba chiếc ghế $\{1,\ 99,\ 100\}$ hoàn toàn đối xứng, bình đẳng $100\%$ với nhau!
Người thứ $99$ chỉ bị mất ghế khi và chỉ khi trong ba ghế $\{1, 99, 100\}$, Ghế $99$ là chiếc bị chọn ĐẦU TIÊN!
+ Vì nếu Ghế $1$ được chọn đầu tiên $\to$ trật tự khôi phục ngay, Ghế $99$ còn nguyên.
+ Nếu Ghế $100$ được chọn đầu tiên $\to$ lúc người thứ $99$ bước lên vẫn còn $2$ ghế trống là $\{1, 99\}$, nên người thứ $99$ đường hoàng ngồi vào Ghế $99$!
Trong $3$ ghế bình đẳng, xác suất Ghế $99$ KHÔNG phải ghế bị chọn đầu tiên đúng bằng $\dfrac{2}{3}$!
[Part A · Easy] A complete binary tree has height $h = 4$ (Level $0$ has $1$ root node, Level $1$ has $2$ nodes, Level $2$ has $4$ nodes, Level $3$ has $8$ nodes, and Level $4$ has $16$ leaf nodes). How many nodes in total are in this tree?
Một cây nhị phân đầy đủ có chiều cao $h = 4$ (Tầng $0$ có $1$ nút gốc, Tầng $1$ có $2$ nút, Tầng $2$ có $4$ nút, Tầng $3$ có $8$ nút và Tầng $4$ có $16$ nút lá). Cây có tổng cộng bao nhiêu nút? (Chỉ điền số)