Code puzzle thread +_+

Ok, here's one... :)

I solved it before posting. Has a single solution.

1722374645861.png
 
This one took a while:

Spoiler for answer :
With both 3 out of 1237 and 2 out of 3694:
=> 3 has to be correct, so 3 is not –3-.
==> 1 out of 694 is correct and 2 out of 127 are correct.
===> With 2169, if 4 is correct, then both 6 and 9 are wrong and both 1 and 2 are right, but then, 2 out of 4721 is incorrect, so 4 is wrong.
===> Thus, with 2169, either 2 or 1 is right (and 7 must be right), and either 6 or 9 is right.
==> So, 3 is not –3- and 7 is not ---7, with either 6 or 9 and either 1 or 2.
=> With 8951, 9 and 1 must be correct, so 9 is not -9-- and 1 is not ---1.
==> With 4721, ---1 is wrong, so -7-- is right.
=> With 2169 and 4721, -1-- is wrong and ---9 is right.
==> With 3694, 3--- is right and --9- is wrong.
3719
 
Correct answer, @Arakhor :)
Yes, it took me a while too, due to a step where I had to show that 2 can't be there in any position... I wish we could establish what is the optimal rigorous way to prove (maybe if @Comrade Ceasefire posts).
Can you do the next puzzle?

Spoiler for my solution:

Spoiler :

A.1237 has 3 correct, so there are at least 2 correct in 127. 4721 has 2 correct, therefore they all have to be in 721=>4 is false.
B. In 2169, if 21 were both true, then 69 would both be false, but then in 3694 we would be left with only one possible true (3), so 21 both being true has to be false. From this it follows that in 721 there are exactly two true numbers=>3 has to be true.
C. Since there is only one true in 21, and 4 is false, in 4721 7 has to be true. For the same reason, in 2169 there has to be one true in 69.
D. (here starts a massive step to show that 2 is false and consequently 1 is true)
1722436048197.png


F. There is one true in 69, and in 8951 there are two true, one of which is established from step D to be 1. Since we already know that three numbers (1,7,3) are true, and there is 1 true in 895 and one true in 69=>9 is true (otherwise there'd be more than 4 true numbers).
G. (finding the order -3719- was easy, I just haven't typed out how it was :D)
 
Last edited:
All I could find were huge images, so here's one I found in text form:

Clue 1: Code 3 5 4 8 : One digit right but in wrong position.
Clue 2: Code 4 6 7 1 : Two digits are correct and one in right place.
Clue 3: Code 3 7 8 1 : Two digits are correct but both wrongly placed.
Clue 4: Code 8 3 9 7 : One digit wrong and others in wrong place.
Clue 5: Code 5 1 2 4 : All digits are wrong.
Clue 6: Code 2 3 9 4 : One digit right but wrongly placed.
Clue 7: Code 5 1 3 6 : One digit is right and is in its place.

What is the 4-digit code?
 
Spoiler :

9 8 7 6

Already forgotten the steps that led me there, but it started with something like :
"5" + "3" : one of 3,7,8 is wrong
+ "4" : so 9 is correct
+ "1" : one of 3,8 is wrong, so 7 is correct
etc...
 
That's the code I reached too.

Spoiler for my working :
5124 are all wrong, so…
=> Two of 671 are right
=> Two of 378 are right
=> Three of 8397 are right
=> Either 3 is wrong, or 896 are all wrong

If 12345 are all wrong:
=> 8 is right, but not ---8
=> 6 and 7 are right (either -6-- or --7- is correct)
=> Both -7-- or --8- are incorrect
=> 8---, --9- and ---7 are all incorrect
=> ---6 is correct

9876
 
Made this one on the fly, so no guarantee it's actually solvable or, on the contrary, way too easy. :)
  1. 2 4 1 9 : 2 digits correct, but one misplaced.
  2. 8 7 4 2 : 2 digits correct, both misplaced.
  3. 3 5 7 6 : 1 digit correct, in the right place.
  4. 1 5 6 4 : 2 digits correct, but one misplaced.
  5. 8 1 2 4 : 3 digits correct, all misplaced.
  6. 4 5 1 8 : This is the correct code.
  7. One of the statements above is a lie.
 
Thoughts on #27: If line 6 is true, then all the other lines except line 4 are also true. Unless I'm missing something, it seems that you literally gave us the answer.
 
I think that there are two solutions.

Spoiler procedure :

starting point: (6) because it is the most specific statement. It is either true or false.
Assume it to be true: check all statements. It turns out only (4) is false, so this is a valid solution.

Assume it to be false: we are left with 5 statements we assume to be true.
- (5) + (1): three out of 8124 and two out of 2419 -> 8 is in the code, 9 is not, two out of 124 are in the code.
- +(2): two out of 8742 -> one out of 24 is in the code, 1 is in the code, 7 is not.
- +(3) + (4): now it gets less transparent. Assume 4 is in the code -> (4) and (5): code is 1xxx -> (3): 3 is not in code due to being in first place and having to be correctly placed, 7 is not in the code as established, 56 are not in code, since both are also present in (4) which would make (4) contain 4 correct digits -> this is not possible -> 2 is in the code, 4 is not. One out of 356 is in the code.
- (3) + (4)-> 3 is not in the code, since if it were (4) could not contain two correct digits. -> one out of 56 is in the code.
- Assume 6 is in the code -> (3) + (4): code is 1xx6 -> (1) can not have a correctly placed digit -> 6 is not in the code
- Assume 5 is in the code -> (3) code is x5xx -> (4) + (5) 8 and 1 are not in the first position -> code is 25xx -> (1) code is 2581
This fulfills (1) to (5) and not (6) and is thus also a correct solution.

Those two should be the only possible solutions.
 
Dangit.
I checked and rechecked... and still messed up. :wallbash:

I'll try and fix it.

Guess I have a lot of room for improvement at puzzle-making...

Now, technicallly, congrats, you've solved the puzzle ! :lol:
 
The above was an answer to Arakhor, but pen-dragon posted in the meantime.

The second solution you came at was indeed the intended solution. :thumbsup:

So it would seem the puzzle still kinda works in spite of my blunder (clue 4 wasn't intended to be false) ?
 
Since @a pen-dragon actually solved the problem (rather than just reading the clues and agreeing!), they should go next. :)
 
We are looking for a five-digit code that fulfills the following conditions:
  1. the solution is unique
  2. the solution is a multiple of 11
  3. one digit may appear more than once
  4. codes starting with 0 are allowed
  5. 65791 has two correct digits, with only one being in the correct position
  6. 47625 has one correct digit in an incorrect position
  7. 78520 has two correct digits, each in the correct position
  8. 89156 has three correct digits, each in an incorrect position
Spoiler If you do not like the uniqueness condition ... :
... demand that each digit does not appear more than once.
 
I have an answer, but it relies on unique digits and is one away from being divisible by 11. :(

Spoiler for an answer (but clearly not the correct one) :
Two from 65791
One from 47625
Two from 78520
Three from 89156
=> 3 is wrong - This assumes that a number missing from any of the clues is not present in the solution

Assuming unique digits, 1890 must be right
=> 2567 are wrong
=> 4 is right
==> -8--- and ----0 are correct
==> ---9- is correct
==> 4---- is wrong
==> --1-- is wrong
18490
 
3 is wrong - This assumes that a number missing from any of the clues is not present in the solution
This assumption is not correct. 3 is allowed to appear in the solution. If you want to exclude it, use the given conditions.

@Arakhor :
Spoiler :

Assuming unique digits, 1890 must be right
I do not think this is true, it is only one possibility.


Edit: moved [USER] BB-Code due to it apparently not working in Spoiler title.
 
Last edited:
Well, I didn't think it was unreasonable to exclude an integer that is not mentioned in any of the clues (and thus only brought in to satisfy the maths at the end), but my mistake, clearly.
 
I am working on it, let's see :)
@a pen-dragon : please clarify if, in the case that there indeed are two of the same number in the correct pin, in the examples you counted that number (despite appearing just once there) as 1 or 2 correct digits.
 
Last edited:
I count in general one appearing correct digit as one correct digit. If one digit appears more than once in the solution the only difference it makes for my counting is that I would also count further appearances of that same digit as correct.

Examples:
correct code | given code | number of correct digits
1123 | 4510 | 1
1123 | 4511 | 2
1245 | 3311 | 1
 
Top Bottom