game companion!
BYTE the robot is thinking of a secret number between 1 and some maximum. Your job? Guess it!
After each guess, BYTE will tell you: 📈 Too Low!, 📉 Too High!, or 🎉 You got it!
The challenge: can you find the number using as few guesses as possible? Play the game first — then try to discover the best strategy yourself!
There is a genius method that can find ANY number in just a handful of guesses —
every single time! Computers use this trick millions of times a day. 🖥️
Enter the 6-digit code from your teacher to unlock the secret!
— type it below to unlock the strategy!
Here is the magic rule: always guess the number in the exact middle of your remaining range. Every single guess cuts your remaining possibilities in half! This is called Binary Search — one of the most important ideas in computer science!
Think about it: if you have 100 numbers, after 1 guess you have at most 50 left. After 2 guesses? At most 25. After 3? At most 12 or 13. After 7 guesses, you've narrowed it down to just 1 number!
You're chopping the search space in HALF with each guess. This is like folding a piece of paper — fold it 7 times and it's tiny!
• For N = 10: ⌈log₂(10)⌉ = 4 guesses max
• For N = 100: ⌈log₂(100)⌉ = 7 guesses max
• For N = 1000: ⌈log₂(1000)⌉ = 10 guesses max
• For N = 1,000,000: ⌈log₂(1,000,000)⌉ = only 20 guesses! 🤯
Start a new game above and use the strategy: always guess the middle of your remaining range! Can you find the number in the minimum number of guesses?