Ngân hàng đề / Luyện thi phong cách Bebras

Bebras Practice · Cấp độ 3 / Level 3 (Song ngữ Anh–Việt · Lớp 5–6 · 15 câu)

Điểm: 0/15

Question 1

Dễ · +10 điểm

[Part A · Easy] A warehouse badge uses a 5-bit binary LED strip with weights $16, 8, 4, 2, 1$ from left to right. What badge ID number corresponds to the pattern 10110?

Hình minh họa câu 1
Chọn đáp án

Xem đáp án và lời giải

Đáp án: $22$

Answer / Đáp án: 22

Step-by-step (EN): Sum the weights of bits equal to 1: $16 + 0 + 4 + 2 + 0 = 22$.

Giải chi tiết (VI): Cộng các trọng số ứng với bit 1: $16 + 4 + 2 = 22$.

Computational Thinking / Tư duy Máy tính: 5-bit Binary Decoding (Giải mã nhị phân 5-bit).

Question 2

Dễ · +10 điểm

[Part A · Easy] In a Caesar cipher, every letter in a word is shifted forward by $3$ positions in the English alphabet (A -> D, B -> E, ..., X -> A, Y -> B, Z -> C). An encrypted message reads KRPH. What was the original word before encryption?

Chọn đáp án

Xem đáp án và lời giải

Đáp án: HOME

Answer / Đáp án: HOME

Step-by-step (EN): To decrypt, shift each letter backward by $3$ positions: K -> H, R -> O, P -> M, H -> E $\implies$ HOME.

Giải chi tiết (VI): Để giải mã, ta lùi mỗi chữ cái về trước $3$ vị trí trong bảng chữ cái: K -> H, R -> O, P -> M, H -> E, thu được từ gốc HOME.

Computational Thinking / Tư duy Máy tính: Symmetric Cryptography — Caesar Shift Cipher (Mật mã đối xứng dịch vòng).

Question 3

Dễ · +10 điểm

[Part A · Easy] In this sorting network, four data packets (8, 3, 6, 1) travel downward. Rule: Whenever two packets meet at ends of an orange comparator bridge, they compare values: the smaller number goes to the left lane and the larger number goes to the right lane! What is the final order at exits A, B, C, D?

Hình minh họa câu 3
Chọn đáp án

Xem đáp án và lời giải

Đáp án: 1, 3, 6, 8

Answer / Đáp án: 1, 3, 6, 8

Step-by-step (EN): Trace step by step:

  • Start: [8, 3, 6, 1]
  • Compare (0,1): [3, 8, 6, 1]
  • Compare (1,2): [3, 6, 8, 1]
  • Compare (2,3): [3, 6, 1, 8]
  • Compare (1,2): [3, 1, 6, 8]
  • Compare (0,1): [1, 3, 6, 8].

Giải chi tiết (VI): Truy vết qua $5$ bộ so sánh:

  • Đầu vào: [8, 3, 6, 1]
  • Cặp (1,2): [3, 8, 6, 1]
  • Cặp (2,3): [3, 6, 8, 1]
  • Cặp (3,4): [3, 6, 1, 8]
  • Cặp (2,3): [3, 1, 6, 8]
  • Cặp (1,2): [1, 3, 6, 8].

Computational Thinking / Tư duy Máy tính: Sorting Networks & Parallel Comparators (Mạng sắp xếp phần cứng).

Question 4

Dễ · +10 điểm

[Part A · Easy] A bakery team has plenty of workers to run independent tasks at the same time, but an arrow X -> Y means task Y cannot start until X is completely finished. Each box shows the task name and duration in minutes (m). What is the minimum total time (in minutes) to finish all four tasks?

Hình minh họa câu 4
Chọn đáp án

Xem đáp án và lời giải

Đáp án: $15$

Answer / Đáp án: 15

Step-by-step (EN): Task A finishes at $4\text{m}$. Then B ($6\text{m}$, finishes at $4+6=10\text{m}$) and C ($3\text{m}$, finishes at $4+3=7\text{m}$) run in parallel. Task D must wait for both B and C, so D starts at $\max(10, 7) = 10\text{m}$ and finishes at $10 + 5 = 15\text{m}$.

Giải chi tiết (VI): Việc A xong ở phút thứ $4$. Sau đó B (xong ở phút $4+6=10$) và C (xong ở phút $4+3=7$) chạy song song. Việc D phải đợi cả B và C xong hết nên chỉ bắt đầu từ phút $\max(10, 7) = 10$ và hoàn thành lúc $10 + 5 = 15$ phút.

Computational Thinking / Tư duy Máy tính: Critical Path Method — CPM on DAGs (Đường găng trên đồ thị tác vụ).

Question 5

Dễ · +10 điểm

[Part A · Easy] A print server uses a Queue (First-In, First-Out) to process print jobs: 1. Jobs J1, J2, J3 arrive in that order. 2. The printer finishes 1 job. 3. Jobs J4, J5 arrive in that order. 4. The printer finishes 2 more jobs.

Which job is now at the front of the queue (next to be printed)?

Chọn đáp án

Xem đáp án và lời giải

Đáp án: J4

Answer / Đáp án: J4

Step-by-step (EN): Step 1: [J1, J2, J3]. Step 2 (pop front J1): [J2, J3]. Step 3 (enqueue J4, J5): [J2, J3, J4, J5]. Step 4 (pop J2, then J3): [J4, J5]. Front of queue is J4.

Giải chi tiết (VI): Bước 1: [J1, J2, J3]. Bước 2 (in xong J1): [J2, J3]. Bước 3 (thêm J4, J5 vào cuối): [J2, J3, J4, J5]. Bước 4 (in xong J2 và J3): còn [J4, J5]. Vậy lệnh đứng đầu hàng đợi là J4.

Computational Thinking / Tư duy Máy tính: Queue Data Structure — FIFO (Cấu trúc hàng đợi Vào trước – Ra trước).

Question 6

Trung bình · +20 điểm

[Part B · Medium] Data packets travel along one-way fiber links from server S to server T. Each number shows the transmission delay in milliseconds (ms). What is the minimum total delay (in ms) from S to T?

Hình minh họa câu 6
Chọn đáp án

Xem đáp án và lời giải

Đáp án: $9$

Answer / Đáp án: 9

Step-by-step (EN): Compute shortest distances from S (Dijkstra):

  • d(S) = 0
  • d(B) = 2
  • d(A) = min(5, d(B)+2) = 4 (via S -> B -> A)
  • d(C) = min(d(A)+3, d(B)+5) = min(7, 7) = 7
  • d(D) = d(B)+6 = 8
  • d(T) = min(d(C)+4, d(D)+1) = min(11, 9) = 9 (via S -> B -> D -> T $= 2 + 6 + 1 = 9\text{ ms}$!).

Giải chi tiết (VI): Tính khoảng cách ngắn nhất từ S:

  • S -> B -> A -> C -> T mất $2 + 2 + 3 + 4 = 11\text{ ms}$.
  • S -> B -> C -> T mất $2 + 5 + 4 = 11\text{ ms}$.
  • S -> B -> D -> T mất $2 + 6 + 1 = 9\text{ ms}$!

Vậy độ trễ nhỏ nhất là $9\text{ ms}$.

Computational Thinking / Tư duy Máy tính: Dijkstra's Shortest-Path Algorithm (Thuật toán đường đi ngắn nhất Dijkstra).

Question 7

Trung bình · +20 điểm

[Part B · Medium] To detect transmission errors, a rover sends 7-bit messages using even parity: the total number of 1s in every valid 7-bit message must be an even number. Four messages arrive at Earth:

  • Message P: 1011001
  • Message Q: 1101010
  • Message R: 1110110
  • Message S: 0011011

Which message had a single-bit error during transmission?

Chọn đáp án

Xem đáp án và lời giải

Đáp án: Message R

Answer / Đáp án: Message R

Step-by-step (EN): Count the 1s in each 7-bit string:

  • P (1011001): four 1s (even)
  • Q (1101010): four 1s (even)
  • R (1110110): five 1s (odd — corrupted!)
  • S (0011011): four 1s (even).

Giải chi tiết (VI): Đếm số bit 1 của từng gói tin:

  • P: $4$ bit 1 (chẵn)
  • Q: $4$ bit 1 (chẵn)
  • R (1110110): $5$ bit 1 (lẻ $\to$ bị lỗi!)
  • S: $4$ bit 1 (chẵn).

Computational Thinking / Tư duy Máy tính: Error Detection & Parity Bits (Bit kiểm tra chẵn lẻ trong truyền thông số).

Question 8

Trung bình · +20 điểm

[Part B · Medium] A turtle graphics program runs:

  • Start with step = 4.
  • REPEAT 5 TIMES: draw forward by step $\text{cm}$, turn right $90^\circ$, then update step = step + 3.

What is the total length (in cm) of the spiral drawn after all $5$ iterations finish?

Chọn đáp án

Xem đáp án và lời giải

Đáp án: $50$

Answer / Đáp án: 50

Step-by-step (EN): Across the $5$ iterations, step takes values $4, 7, 10, 13, 16$. Total length drawn $= 4 + 7 + 10 + 13 + 16 = 50\text{ cm}$.

Giải chi tiết (VI): Qua $5$ lần lặp, độ dài đoạn vẽ step lần lượt là $4, 7, 10, 13, 16\text{ cm}$. Tổng độ dài vẽ được là $4 + 7 + 10 + 13 + 16 = 50\text{ cm}$.

Computational Thinking / Tư duy Máy tính: Variable Mutation Inside Loops (Cập nhật biến trạng thái trong vòng lặp).

Question 9

Trung bình · +20 điểm

[Part B · Medium] Three crates of sizes 3 (largest, bottom), 2 (middle), and 1 (smallest, top) are stacked on Rod A. You want to move the entire stack onto Rod C, moving 1 top crate at a time, and never placing a larger crate on top of a smaller crate. What is the minimum number of moves?

Hình minh họa câu 9
Chọn đáp án

Xem đáp án và lời giải

Đáp án: $7$ moves

Answer / Đáp án: $7$ moves ($7$ bước)

Step-by-step (EN): This is the 3-disk Tower of Hanoi! Moving top $2$ crates (1, 2) to Rod B takes $3$ moves; moving crate 3 to Rod C takes $1$ move; moving crates 1, 2 from Rod B onto crate 3 takes $3$ moves. Total $= 3 + 1 + 3 = 2^3 - 1 = 7$ moves.

Giải chi tiết (VI): Đây là bài toán Tháp Hà Nội với $3$ tầng: chuyển $2$ kiện nhỏ (1, 2) sang Cọc B mất $3$ bước; chuyển kiện lớn nhất 3 sang Cọc C mất $1$ bước; chuyển tiếp $2$ kiện (1, 2) từ Cọc B đè lên kiện 3 mất $3$ bước. Tổng tối thiểu: $3 + 1 + 3 = 7$ bước.

Computational Thinking / Tư duy Máy tính: Recursion — Tower of Hanoi (Tư duy đệ quy).

Question 10

Trung bình · +20 điểm

[Part B · Medium] A drone courier carries a backpack that holds at most $10\text{ kg}$. Four parcels are waiting:

ParcelWeightReward
P1$6\text{ kg}$$13$ coins
P2$5\text{ kg}$$11$ coins
P3$4\text{ kg}$$9$ coins
P4$3\text{ kg}$$7$ coins

Each parcel can be taken at most once. What is the maximum total reward the drone can earn in a single trip?

Chọn đáp án

Xem đáp án và lời giải

Đáp án: $22$ coins

Answer / Đáp án: $22$ coins

Step-by-step (EN): Check valid subsets with total weight $\leqslant 10\text{ kg}$:

  • {P1, P3}: $6 + 4 = 10\text{ kg} \implies 13 + 9 = 22$ coins!
  • {P1, P4}: $6 + 3 = 9\text{ kg} \implies 13 + 7 = 20$ coins.
  • {P2, P3}: $5 + 4 = 9\text{ kg} \implies 11 + 9 = 20$ coins.
  • {P2, P4}: $5 + 3 = 8\text{ kg} \implies 11 + 7 = 18$ coins.

Maximum reward is $22$ coins.

Giải chi tiết (VI): Kiểm tra các tổ hợp có tổng khối lượng $\leqslant 10\text{ kg}$:

  • {P1, P3}: $6 + 4 = 10\text{ kg} \implies 13 + 9 = 22$ xu!
  • {P1, P4}: $6 + 3 = 9\text{ kg} \implies 20$ xu.
  • {P2, P3}: $5 + 4 = 9\text{ kg} \implies 20$ xu.
  • {P3, P4}: $7\text{ kg} \implies 16$ xu.

Vậy giá trị lớn nhất là $22$ xu.

Computational Thinking / Tư duy Máy tính: 0/1 Knapsack Optimization (Bài toán cái túi 0/1 — Quy hoạch động / Tối ưu tổ hợp).

Question 11

Khó · +30 điểm

[Part C · Hard] A museum places Wi-Fi routers at junctions (1 to 6). A router placed at a junction covers that junction itself AND all junctions directly connected to it by a single corridor. What is the minimum number of routers needed to cover all $6$ junctions?

Hình minh họa câu 11
Chọn đáp án

Xem đáp án và lời giải

Đáp án: $2$

Answer / Đáp án: 2

Step-by-step (EN): Check maximum coverage of $1$ router: 2 covers {1, 2, 3, 5} ($4$ junctions) and 5 covers {2, 4, 5, 6} ($4$ junctions); 1, 3, 4, 6 each cover only $3$ junctions. Thus $1$ router cannot cover all $6$. Placing routers at 1 and 6 covers {1, 2, 4} \cup {3, 5, 6} = {1, 2, 3, 4, 5, 6} (or at 2 and 5), so $2$ routers are sufficient.

Giải chi tiết (VI): Kiểm tra phạm vi phủ của $1$ bộ phát: đặt tại 2 phủ {1, 2, 3, 5} ($4$ điểm); đặt tại 5 phủ {2, 4, 5, 6} ($4$ điểm); các điểm còn lại chỉ phủ $3$ điểm. Do đó $1$ bộ không đủ. Đặt $2$ bộ (chẳng hạn tại 1 và 6, hoặc tại 2 và 5) sẽ phủ kín toàn bộ {1, 2, 3, 4, 5, 6}.

Computational Thinking / Tư duy Máy tính: Dominating Set on Graphs (Tập thống trị nhỏ nhất trên đồ thị).

Question 12

Khó · +30 điểm

[Part C · Hard] A chat app compresses a $100$-character message consisting of $45$ As, $25$ Bs, $18$ Cs, and $12$ Ds using a prefix-free binary code:

  • A $\to$ $1$-bit code (0)
  • B $\to$ $2$-bit code (10)
  • C $\to$ $3$-bit code (110)
  • D $\to$ $3$-bit code (111)

How many bits in total are used to transmit this $100$-character message?

Chọn đáp án

Xem đáp án và lời giải

Đáp án: $185$

Answer / Đáp án: 185

Step-by-step (EN): Total bits $= 45 \times 1 + 25 \times 2 + 18 \times 3 + 12 \times 3 = 45 + 50 + 54 + 36 = 185$ bits (saving $15$ bits compared to a fixed $2$-bit code of $200$ bits!).

Giải chi tiết (VI): Tổng số bit cần dùng là: $$45 \times 1 + 25 \times 2 + 18 \times 3 + 12 \times 3 = 45 + 50 + 54 + 36 = 185\text{ (bit)}$$ (tiết kiệm được $15$ bit so với mã cố định $2$-bit tốn $200$ bit).

Computational Thinking / Tư duy Máy tính: Huffman Variable-Length Compression (Nén dữ liệu tối ưu Huffman).

Question 13

Khó · +30 điểm

[Part C · Hard] This 2-state automaton starts in the double-circle accepting state Even and reads a binary string from left to right. Which property describes all binary strings that make the automaton finish in state Even?

Hình minh họa câu 13
Chọn đáp án

Xem đáp án và lời giải

Đáp án: Strings containing an even number of 1s

Answer / Đáp án: Strings containing an even number of 1s (Chuỗi có chẵn chữ số 1)

Step-by-step (EN): Reading 0 stays in the same state, while every 1 toggles between Even and Odd. Starting at Even, the machine ends back at Even if and only if it toggles an even number of times, meaning the string has an even number of 1s.

Giải chi tiết (VI): Mỗi bit 0 giữ nguyên trạng thái hiện tại, còn mỗi bit 1 làm đổi trạng thái giữa Even và Odd. Xuất phát từ Even, máy kết thúc tại Even khi và chỉ khi số lần đổi trạng thái là số chẵn — tức chuỗi có số chẵn chữ số 1.

Computational Thinking / Tư duy Máy tính: Deterministic Finite Automata — DFA Invariants (Bất biến máy hữu hạn trạng thái).

Question 14

Khó · +30 điểm

[Part C · Hard] A staircase has $7$ steps. A robo-frog starts on the ground (step $0$) and can jump either $1$ step or $2$ steps upward at a time. In how many different ways can the robo-frog reach step $7$?

Chọn đáp án

Xem đáp án và lời giải

Đáp án: $21$

Answer / Đáp án: 21

Step-by-step (EN): Let $W(n)$ be the number of ways to reach step $n$. Since the last jump is from $n-1$ or $n-2$, $W(n) = W(n-1) + W(n-2)$ with $W(1) = 1$, $W(2) = 2$: $W(3)=3,\; W(4)=5,\; W(5)=8,\; W(6)=13,\; W(7) = 13 + 8 = 21$.

Giải chi tiết (VI): Gọi $W(n)$ là số cách lên bậc $n$. Bước nhảy cuối cùng chỉ có thể xuất phát từ bậc $n-1$ (nhảy $1$ bậc) hoặc bậc $n-2$ (nhảy $2$ bậc), nên $W(n) = W(n-1) + W(n-2)$. Tính tuần tự: $W(1)=1,\; W(2)=2,\; W(3)=3,\; W(4)=5,\; W(5)=8,\; W(6)=13,\; W(7) = 13 + 8 = 21$ cách.

Computational Thinking / Tư duy Máy tính: Dynamic Programming & Fibonacci Recurrence (Quy hoạch động truy hồi).

Question 15

Khó · +30 điểm

[Part C · Hard] Four school clubs (Robotics, Chess, Drama, Music) each hold a weekly meeting. Two clubs cannot share the same time slot if any student belongs to both:

  • An is in Robotics and Chess.
  • Binh is in Chess and Drama.
  • Chi is in Robotics and Drama.
  • Dung is in Music and Chess.

What is the minimum number of time slots required so no student has a schedule conflict?

Chọn đáp án

Xem đáp án và lời giải

Đáp án: $3$ slots

Answer / Đáp án: $3$ slots ($3$ ca)

Step-by-step (EN): Robotics, Chess, and Drama are mutually conflicting (a triangle $K_3$), so they require at least $3$ different slots (say Slot 1: Robotics, Slot 2: Chess, Slot 3: Drama). Music only conflicts with Chess (Slot 2), so Music can share Slot 1 with Robotics! Minimum $= 3$ slots.

Giải chi tiết (VI): Ba CLB Robotics, Chess và Drama đôi một có chung thành viên (tạo thành tam giác xung đột), nên bắt buộc cần ít nhất $3$ ca khác nhau (ví dụ Ca 1: Robotics, Ca 2: Chess, Ca 3: Drama). CLB Music chỉ xung đột với Chess nên có thể xếp chung Ca 1 với Robotics. Vậy cần ít nhất $3$ ca.

Computational Thinking / Tư duy Máy tính: Graph Coloring & Conflict Scheduling (Tô màu đồ thị lập lịch).

Cài đặt ứng dụng O₂ Education

Thêm O₂ Education vào Màn hình chính trên iPhone / iPad để học nhanh như ứng dụng gốc:

  1. Nhấn biểu tượng Chia sẻ trên thanh công cụ Safari.
  2. Cuộn xuống và chọn Thêm vào MH chính (Add to Home Screen).
  3. Nhấn Thêm ở góc trên bên phải để hoàn tất.