Created
January 28, 2018 21:08
-
-
Save jianminchen/4ae49fc199d27981091a4f31fad623bf to your computer and use it in GitHub Desktop.
Guess 4 digit number discussion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Please try to ask minimum number of questions to identify a four-digit number. | |
For example, guess 1111, | |
let 1111 -> 1 number is correct , 1 number at correct position | |
2111 -> 2q number is correct , 0 number at correct position | |
Analysis of the problem: | |
4 digits, 4 position | |
10^4 * 4 * 3 * 2 * 1 | |
minimum questions I should ask 24 choices | |
0 - 9 10 -> one digit - 4 distinct | |
taking 10, give digits 4 digit , 10 times - 9 times | |
2 digits | |
3 digits | |
4 digits | |
identify -> | |
10 times -> at time | |
four digits - at most -> 0, 1, 2, , | |
1, 2, -> add new digit <- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment