A full binary tree has $1$ root at level $0$, $2$ nodes at level $1$, and doubles at every next level. How many nodes are there in total from level $0$ to level $5$?
Xem đáp án và lời giải
Đáp án: $63$
Tổng số nút là $1 + 2 + 4 + \cdots + 2^{5} = 2^{6} - 1 = 63$.
Bonus question. A frog wants to travel exactly 17 squares forward. Each jump moves either 1 square or 5 squares. How many different sequences of jumps are possible?
Xem đáp án và lời giải
Đáp án: $60$
Gọi W(k) là số cách đi đúng k ô, W(0)=1. Xét bước cuối: W(k)=W(k−1)+W(k−5), với W(k)=0 khi k âm. Tính lần lượt đến k=17 được 60.
Bonus question. A frog wants to travel exactly 11 squares forward. Each jump moves either 1 square or 3 squares. How many different sequences of jumps are possible?
Xem đáp án và lời giải
Đáp án: $41$
Gọi W(k) là số cách đi đúng k ô, W(0)=1. Xét bước cuối: W(k)=W(k−1)+W(k−3), với W(k)=0 khi k âm. Tính lần lượt đến k=11 được 41.
A box contains socks of $4$ different colors, with at least $10$ socks of each color. What is the minimum number of socks you must draw blindly to guarantee at least $2$ socks of the same color?
Xem đáp án và lời giải
Đáp án: $5$
By the Pigeonhole Principle, worst case draws $1$ of each of the $4$ colors before the next sock guarantees a match: $4(1) + 1 = 5$.
A box contains socks of $3$ different colors, with at least $10$ socks of each color. What is the minimum number of socks you must draw blindly to guarantee at least $2$ socks of the same color?
Xem đáp án và lời giải
Đáp án: $4$
By the Pigeonhole Principle, worst case draws $1$ of each of the $3$ colors before the next sock guarantees a match: $3(1) + 1 = 4$.
A box contains socks of $4$ different colors, with at least $10$ socks of each color. What is the minimum number of socks you must draw blindly to guarantee at least $2$ socks of the same color?
Xem đáp án và lời giải
Đáp án: $5$
By the Pigeonhole Principle, worst case draws $1$ of each of the $4$ colors before the next sock guarantees a match: $4(1) + 1 = 5$.
Trong hộp mẫu #2 có bi gồm $6$ màu khác nhau (mỗi màu có rất nhiều viên). Cần bốc ít nhất bao nhiêu viên bi (không nhìn) để chắc chắn có $3$ viên cùng màu?
Xem đáp án và lời giải
Đáp án: $13$
Theo nguyên lý Dirichlet: $6 \times (3-1) + 1 = 13$ viên.
Trong hộp mẫu #4 có bi gồm $4$ màu khác nhau (mỗi màu có rất nhiều viên). Cần bốc ít nhất bao nhiêu viên bi (không nhìn) để chắc chắn có $3$ viên cùng màu?
Xem đáp án và lời giải
Đáp án: $9$
Theo nguyên lý Dirichlet: $4 \times (3-1) + 1 = 9$ viên.
Trong hộp mẫu #6 có bi gồm $6$ màu khác nhau (mỗi màu có rất nhiều viên). Cần bốc ít nhất bao nhiêu viên bi (không nhìn) để chắc chắn có $3$ viên cùng màu?
Xem đáp án và lời giải
Đáp án: $13$
Theo nguyên lý Dirichlet: $6 \times (3-1) + 1 = 13$ viên.
Trong hộp mẫu #8 có bi gồm $4$ màu khác nhau (mỗi màu có rất nhiều viên). Cần bốc ít nhất bao nhiêu viên bi (không nhìn) để chắc chắn có $3$ viên cùng màu?
Xem đáp án và lời giải
Đáp án: $9$
Theo nguyên lý Dirichlet: $4 \times (3-1) + 1 = 9$ viên.
Trong hộp mẫu #10 có bi gồm $5$ màu khác nhau (mỗi màu có rất nhiều viên). Cần bốc ít nhất bao nhiêu viên bi (không nhìn) để chắc chắn có $3$ viên cùng màu?
Xem đáp án và lời giải
Đáp án: $11$
Theo nguyên lý Dirichlet: $5 \times (3-1) + 1 = 11$ viên.