What are the odds of guessing a 4 digit number if told how many you have correct? I pick a 4 digit number and you have to guess it exactly right in the right order. If I tell you how many digits you have right, but NOT which one... how many guesses on average should it take? 
For example: my number is 4382. And you guess 5309. You have 1 digit right. But you don't know which one.
What about if I tell you a specific digit is correct?
 A: For any 4 digit sequence, assuming that 0000 is a valid sequence for the number guessing game that you have devised, it will take a maximum of 34 appropriate guesses to correctly choose the number that you picked, and the number of guesses should be adjusted accordingly.
Methodology:
Guessing the unique number sequences; 0000, 1111, 2222, ... 9999 (10 initial guesses)
This should give you the number of each digit that occurs in the sequence and maximum guesses could only occur for a standardized guessing for a sequence containing a 9.
Then, when you have the numbers available for the sequence (4 total), they can only be arranged in 4! different orders; 0123, 0132, 0213, 0231, 0321, 0312, ... 3210
10 + 4! = 10 + 4*3*2*1 = 34.
Now, the probability of guessing any individual number is 1:10, and the odds of guessing the right number is still 1:10,000 simply based on probability. However, "guessing" in the right manner narrows down the individual probability to 1:34.
A: Unless I've misunderstood how the game works, you can do much better than existing answers suggest.
First, trying 1111 through 9999 you can deduce how many of each digit there are (you don't need to check 0s specifically). Now after this I claim you can finish in at most five more goes.
I'll start with the hardest case that all four digits are different, say 1234 in some order. Now using a digit known not to appear you can pin down the position of the 1 in two attempts by trying 1100 and 1010. This leaves say x1xx where the three xs are 234 in some order. Now try 2123. If this matches in three places, the correct answer is either 2143 or 4123. If it matches in two, the correct answer is 2134 or 3124. If it only matches one, the correct answer is 3142 or 4132. So in each case you can get the right answer in at most two more guesses.
If there are three different digits, say they are 1233 in some order, first pin down the location of the 1 in two guesses, as before. Now there are only three possibilities for the other digits, so you can finish in three more guesses.
If there are two pairs, say 1122, you can work out the first digit by guessing 1000, and then there are only three possibilities left. Finally, if there are three or four of one digit, there are at most three options so you can easily do it.
This gets the right combination with at most $14$ guesses in the worst case.
