# Is this a well-known game?

In the last two days, I got a bit obsessed with the following game, partly because I beat others most of the time I play it. The gamers are expected to have a sound logical reasoning coupled with the ability to analyze data.

Here is the rule of the game:

(1) The game is for two players.

(2) Each player holds a 4-digit positive number in his mind. (Numerals 0 to 9 are allowed. For instance you can hold 0176 or5678 or 2384, etc.) The numbers are to be kept secret.

(3) Each then guesses the other's 4-digit number.

(4) Each person gives a mark for the other person's guess. The mark consists of two parts. The first part counts the number of digits the other person rightly guessed. The second part counts the number of digits that were guessed in the right place.

(5) The fist person who comes to the right 4-digit the other person held is the winner.

Here is a sample where the players are Mr.A and Mr.B. Assume A has held 3476 and that B has 7609. Let A begin.

$\begin{vmatrix} \hline Player(A) & Correct digits & Correct places & Player(B) & Correct digits & Correct places \\ guesses & (B- marks) & (B-marks) & guesses & ( A- marks) & ( A- marks)\\ 4521 & 0 & 0 & 5735 & 2 & 0 \\ 8309 & 2 & 2 & 8762 & 2 & 0 \\ ... & ... & ... & ... & ... & ... \\ 7609 & 4 & 4 & 3467 & 4 & 2 \\ \hline \end{vmatrix}$

So A is the winner. There is a lot of mathematical elimination strategy going in there which makes the play a very interesting pastime at least for me. If this is a known game, could you please point me to a reference? Thank you.

-
My table is not showing up, please help. – Tibebu Haile Yilma Feb 6 '11 at 0:11
@Elo: table might not be supported. Can you try using matrix? – Aryabhata Feb 6 '11 at 0:14
Our family played a commercial game called Jotto that used 5 letter words instead of 4 digit numbers but was otherwise the same. I think we were not really sure we had the rules right. – Ross Millikan Feb 6 '11 at 0:42
@Ross and @ Moron, thanks. – Tibebu Haile Yilma Feb 6 '11 at 0:42
I saw a detailed tree solution for Mastermind (which is the same but with only 0-5 allowed) years ago. en.wikipedia.org/wiki/Mastermind_%28board_game%29 says it can be solved in 5 guesses. The same general strategy would seem to be applicable for you. – Ross Millikan Feb 6 '11 at 0:52

Seems like a variant of Mastermind. I believe it is called Cows and Bulls.

-
Thank you very much. I already found that it is Cows and Bulls with little variation in my counting. But that would be barely possible without your help. – Tibebu Haile Yilma Feb 6 '11 at 0:28