Problem 44630. Guess the number I'm thinking of (Part 1)
- I randomly choose an integer between one and ten (inclusive). I don't provide any clues about the number.
- Your first opponent tries to guess the number. They guess randomly.
- Your second opponent tries to guess the number. They also guess randomly.
- You try to guess the number. But you guess strategically.
- The winner is the person who guesses my chosen number, or the person who guesses closest to my chosen number. This represents a "win".
- If two contestants are equally close, they may share the win, with such a result being declared a "draw". (It is a loss for the remaining contestant.) A draw is worth half as much as a win.
Solution Stats
Problem Comments
-
6 Comments
I figured out why Tim's solution scored higher than mine. My code gave me half credit for a few oddball cases where there was a tie between two of us but the third person was closer to the correct number. It didn't happen enough for the solution to fail the tests, but it was still sub-optimal.
This is a great problem. I was planning to eventually do one like this, but now I don't have to, as this one is very well implemented.
By the way, more problems like this one would be great, too.
Thanks. There are indeed some more that I have thought of like this....
Solution Comments
Show commentsProblem Recent Solvers50
Suggested Problems
-
Find state names that start with the letter N
1294 Solvers
-
Test if a Number is a Palindrome without using any String Operations
237 Solvers
-
Numbers with prime factors 2, 3 and 5.
575 Solvers
-
Find third Side of a right triangle given hypotenuse and a side. No * - or other functions allowed
245 Solvers
-
7345 Solvers
More from this Author32
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!