News for hackers. Stuff that matters.
Re:Anime fans stumbled upon a mathematical proof by Cthulhu_ on Friday March 07, 2025 @03:16AM (#43288196)
I'm no mathematician or leetcode expert and probably don't understand "shortest possible test sequence", but it sounds like this is just bruteforcing 0000-9999. You can't guess what would be closer to the correct solution, so at best I'd propose making a list of choices and randomizing the tries in case you get lucky.

It's different if the keypad gives an indication that one number is correct though, then it'll be 40 tries at most.

Re:Anime fans stumbled upon a mathematical proof by fuglede_ on Friday March 07, 2025 @04:51AM (#43288753)
The point is that if you input, say, 00001, then you will have tested both 0000 and 0001.
Re:Anime fans stumbled upon a mathematical proof by CJefferson on Friday March 07, 2025 @04:53AM (#43288768)
If the code is either 0000 or 0001, then entering 00001 will open the door, as you just need the four digits in order.

That shows how you can do a shorter sequence by using overlaps.

Re:Anime fans stumbled upon a mathematical proof by Biganon on Friday March 07, 2025 @11:08AM (#43291316)
Have you read the article we're commenting on? Obviously mathematicians know that n! * k, with k the length of the code, would work. The idea is to superpose the end of a code with the start of the next, so you don't have to test nearly as many combinations.