My Son's Yr7 Maths Question

Trebor76

Well-known Member
Joined
Jul 23, 2007
Messages
5,335
Office Version
  1. 365
Platform
  1. Windows
Hi there,

My 12 year old came home with the following maths question which has got us all stuck:

"Alpha has forgotten the PIN on a credit card. There are four digits altogether. Here are the various PINs Aplha tries:

6204
6108
8208
8198

Each time two of the numbers are correct, and two are wrong. Can you work out the four digits of the PIN, in their correct order?"

I think it's either 6298 or 8104 as these combinations haven't errored out before, but I'm not really sure and I can't narrow it down any further than two which seems odd :confused:

Any guidance (and its reasoning) would be greatly appreciated.

Regards,

Robert
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
I don't know if this is the fastest way to create the proof, but I just started with the first try and made the assumption that each of 6 possible cases of correct digits is true. Five of the six resulted in logical impossibilities, so that leaves the sixth proven. From there it was two short steps to infer the remaining two digits, given the information proven in the first try.

Tries:            a 6204
                  b 6108
                  c 8208
                  d 8198                        
                                            
Possible cases:     6 2 x x   correct                
(from first try)    6 x 0 x   correct                
                    6 x x 4   correct                
                    x 2 0 x   correct                
                    x 2 x 4   correct                
                    x x 0 4   correct                
                                            
Test each possible case:                                            
Hypothesis:     a    6 2 x x  correct                
                a    x x 0 4  incorrect                
Consequence:    c    8 x x 8  correct    *    
                d    8 1 x x  incorrect  *    
Result:                hypothesis disproved                            
                                            
Hypothesis:     a    6 x 0 x  correct                
Consequence:    a    x 2 x 4  incorrect                
                c    x 1 x 8  incorrect   *    
                d    x 1 x 8  correct     *    
Result:         hypothesis disproved (conflicting cases)                            
                                            
Hypothesis:          6 x x 4  correct                    
Consequence:    b    x x 0 x  incorrect                
Result:         hypothesis disproved (3 digits cannot be wrong)                            
                                            
Hypothesis:          x 2 0 x  correct                
Consequence:    c    8 x x 8  incorrect   *             
                d    8 x x 8  correct     *          
Result:                hypothesis disproved (conflicting cases)                            
                                            
Hypothesis:     a    x 2 x 4  correct                
                a    6 x 0 x  incorrect                
                b    6 x 0 x  correct                
Result:         hypothesis disproved (conflicting cases)                            
                                            
First Proof          x x 0 4  correct        (proven - all other cases disproved)        
                     6 2 x x  incorrect                
                                            
From this it follows that 1 is the second digit, since in the second try:                                            
                b   6    incorrect (known)                    
                    1    correct   (inferred)                    
                    0    correct   (known)                    
                    8    incorrect (known)                    
                                            
Second Proof        x 1 0 4 correct                        
                                            
From this it follows that 8 is the first digit since in the third try:                                            
                b   8    correct   (inferred)                    
                    2    incorrect (known)                    
                    0    correct   (known)                    
                    8    incorrect (known)                    
                                            
Third Proof         8 1 0 4 is correct                        
 
Last edited:
WOW - that's fair more scientific than my strategy :cool:

I appreciate the effort xenou. It's a pity you're not in Sydney as I'd tee up tutoring lessons!!

Thanks again,

Robert
 
It reminds me of the game Master Mind - do they sell that in Australia? One person sets up four colored pegs behind a shield, and the other has something like 10 or 12 tries to correctly guess the sequence (I think after each attempt you are told for each guessed peg if your color is correct and/or if the color and position is correct. Amazing that this is a game for kids - it's a fun puzzle to work out.
 
It reminds me of the game Master Mind - do they sell that in Australia?

Yes, we have it!! I showed your reply to my wife and she said it too reminded her of Mastermind but unlike the game we could not exclude the wrong combinations to end up with the right one, as you've done.
 
Hi, Xenou... I'm not sure your proof for 62XX is right. 8 x x 8 doesn't need to be correct in C if the 2 is already assumed to be correct.

I think C becomes x2x8 correct, which means D is xx98 correct

I think the OP's original assessment is correct and both 6298 and 8104 are valid solutions.
 
Ah rat. That's true, I made a mistake there. If we had two pins then the puzzle is cooked as that is also a logically impossible case.

I think I found another way to disprove 62 as the first two digits:

Hypothesis:     a    6 2 x x  correct                
                a    x x 0 4  incorrect                
Consequence:    b    6 x x 8  correct
                b    x 1 0 x  incorrect *
                d    x x 9 8  correct   *  
                d    8 1 x x  incorrect
Result:         hypothesis disproved  (3rd digit cannot be both 0 and 9) 
 
Thanks guys.

What I find annoying with these types of questions is that in reality you can only have one PIN which because I always arrived at the two alternatives (and after hours of trying) I thought my answer must have been wrong.

I suppose that as there are four digits and "each time two of the numbers are correct, and two are wrong" there must be two answers i.e. 4 x 2 /4

Anyway, I really appreciate the efforts.

Kind regards,

Robert
 
Surely this is a trick question - he tried his pin four times, but surely the machine would eat the card after the third attempt anyway? :)
 
There are only 16 possible combinations:


Excel Workbook
ABCD
16204
26208
36294
46298
56104
66108
76194
86198
98204
108208
118294
128298
138104
148108
158194
168198
Sheet1


Should take no more than two minutes to see that your original suggestion was correct. 6298 or 8104 are the only viable options.
 

Forum statistics

Threads
1,222,621
Messages
6,167,087
Members
452,094
Latest member
Roberto Saveru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top