I am doing a c++ project on cows and bulls where the computer has to guess the number. I have a few questions.?
I recently heard of the pigeon hole principle( i am not exactly sure about how to use it)and I am trying to use this to do my programme. Every time my first number is 0123. Based on this I have 14 possibilities.My questions are-
1.I have reduced the sample space considerably by using a tree. But does it help in arriving at the answer?
2.The next number that I use should be only from the sample space or will using some other number give better result?
This is how far I have got. Thanks in advance.

7 Years
Discussion Span
Last Post by geethasree

Your basic problem is if you don't know how to use something, you can't program it. Any algorithm you try to use in a program you need to understand.

Sit down with paper, pencil, and a good description of the principle and work out how it operates. Be sure to test the idea with highest and lowest values, and values that don't work to understand how to error check.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.