Question 541
A binomial random variable $X \sim B(80, 0.3)$ models the number of successes in $80$ independent trials. What is the expected value $E(X)$?
Xem đáp án và lời giải
Đáp án: $24$
$E(X) = np = 80 \times 0.3 = 24$.
Luyện tập / Chủ đề Combinatorics · Tổ hợp
Bài tập quy tắc đếm, hoán vị, chỉnh hợp, tổ hợp, nguyên lý Dirichlet, bất biến và xác suất thống kê.
Đăng nhập để lưu tiến độ và tích lũy điểm trên bảng xếp hạng.
A binomial random variable $X \sim B(80, 0.3)$ models the number of successes in $80$ independent trials. What is the expected value $E(X)$?
Đáp án: $24$
$E(X) = np = 80 \times 0.3 = 24$.
A binomial random variable $X \sim B(50, 0.4)$ models the number of successes in $50$ independent trials. What is the expected value $E(X)$?
Đáp án: $20$
$E(X) = np = 50 \times 0.4 = 20$.
[Part A · Easy] A Bloom filter uses an $8$-bit array B[0..7] initialized to 00000000 and two hash functions $h_1(x) = x \bmod 8$ and $h_2(x) = (3x + 1) \bmod 8$. Inserting key $x$ sets both B[h1(x)] = 1 and B[h2(x)] = 1. After inserting x = 2 and x = 7, how many bits in B[0..7] are equal to 1?
Bộ lọc Bloom filter dùng mảng $8$ bit B[0..7] khởi tạo toàn 0 cùng hai hàm băm $h_1(x) = x \bmod 8$ và $h_2(x) = (3x + 1) \bmod 8$. Khi thêm khóa $x$, cả hai bit B[h1(x)] và B[h2(x)] được bật lên 1. Sau khi thêm x = 2 và x = 7, có tất cả bao nhiêu bit trong mảng mang giá trị 1? (Chỉ điền số)
Đáp án: $3$
Answer / Đáp án: 3
Step-by-step (EN): - For $x = 2$: $h_1(2) = 2$, $h_2(2) = (6+1) \bmod 8 = 7 \to$ sets bits {2, 7}.
1!), $h_2(7) = (21+1) \bmod 8 = 6 \to$ sets bits {6, 7}.Distinct set bits: {2, 6, 7}, so $3$ bits equal 1.
Giải chi tiết (VI): - Với $x = 2$: $h_1(2) = 2$, $h_2(2) = 7 \to$ bật các ô {2, 7}.
7 đã bật!), $h_2(7) = 22 \bmod 8 = 6 \to$ bật {6, 7}.Hợp lại có các vị trí {2, 6, 7}, tức đúng $3$ bit bằng 1.
Computational Thinking / Tư duy Máy tính: Probabilistic Data Structures — Bloom Filters (Cấu trúc dữ liệu xác suất Bloom Filter).
An image row is compressed with Run-Length Encoding as 3W 5B 2W (meaning 3 White, 5 Black, 2 White). How many pixels are in this row?
Đáp án: $10$
Tổng số ô ảnh bằng $3 + 5 + 2 = 10$.
In a database, $15$ files have only Tag A, $9$ have only Tag B, and $6$ have both. How many files match the search query Tag A OR Tag B?
Đáp án: $30$
Phép OR lấy hợp của hai tập: $15 + 6 + 9 = 30$.
A fair pointer is spun once on the circular wheel shown (sector angles are in degrees). What is the probability that the pointer lands on Win?
Đáp án: $\dfrac{5}{12}$
Win rồi chia cho $360^\circ$!A fair pointer is spun once on the circular wheel shown (sector angles are in degrees). What is the probability that the pointer lands on A?
Đáp án: $\dfrac{1}{2}$
A là $120^\circ + 60^\circ = 180^\circ$!A fair pointer is spun once on the circular wheel shown (sector angles are in degrees). What is the probability that the pointer lands on Gold?
Đáp án: $\dfrac{1}{3}$
Gold là $45^\circ + 75^\circ = 120^\circ$!A fair pointer is spun once on the circular wheel shown (sector angles are in degrees). What is the probability that the pointer lands on 10?
Đáp án: $\dfrac{5}{12}$
10 là $60^\circ + 90^\circ = 150^\circ$!A fair pointer is spun once on the circular wheel shown (sector angles are in degrees). What is the probability that the pointer lands on Red?
Đáp án: $\dfrac{1}{2}$
Red là $80^\circ + 100^\circ = 180^\circ$!In a club, $14$ students take only Math, $6$ take only CS, $7$ take both, and $4$ take neither. How many students are in the club?
Đáp án: $31$
In road map #4-1, each edge shows the travel time in minutes between towns. What is the shortest time to travel from $A$ to $D$?
Đáp án: $7$
In tree #4-1, 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 $4$?
Đáp án: $31$
In experiment #4-1, two fair $4$-sided dice numbered $1$ to $4$ are rolled. How many outcomes give two DIFFERENT numbers?
Đáp án: $12$
In a club, $12$ students take only Math, $7$ take only CS, $6$ take both, and $3$ take neither. How many students are in the club?
Đáp án: $28$