Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Dungyichao authored Mar 20, 2018
1 parent 0b8144a commit f76c11b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It is proven that any number could be solved within seven turns. <br />
We have a code set containing 5040 combination of 4 digit number without duplicate. We first randomly use a guess and receive the response of A and B. Based on the value of A and B, we remove the element from the code set which is not going to be the correct answer. We then pick up an element from the code set for the next play and receive A and B value. The method of how we pick up the element for the next play will be elaborate more later. We will keep guessing until we get A=4 and B=0 (it means we get 4 digit with correct position and value).<br />
### Which element need to be removed from the code set<br />
In the original code set, there is 0123, 0124, 0125, 0126....... and so on(totally 5040 elements in the beginning). If our first guess is 0521 and receive A=2, B=1. 0123 might be the answer because it will give us the same A and B value, so we keep it in the code set. However 0124 will not be the answer definitely because it will give us A=2, B=0 based on our guess 0521. We will clean the code set based on this rule.<br />
<p align="center"><img src="/image/remove.JPG"></p>
<p align="center"><img src="/image/remove1.JPG"></p>

### Which element need to be picked from the code set for the next play<br />
We give a graph explanation below. Please also refer to the paper ```Efficient solutions for Mastermind using genetic algorithms``` page 8. The main idea is to minimize the code set after we pick an element from the code set. To reduce the checking time for the entire code set, we therefore randomly choose some elements (We implemented 100 as the max number of elements) as S to represent for the entire code set.<br />
Expand Down

0 comments on commit f76c11b

Please sign in to comment.