0

i'm sitting here with a pin-locked pad, trying to figure out which combination clicks, i have been given the hint that the code can only contain the numbers: "0" "9" "8" and that it's a 4-digit Pin.

Now i'm stressing here to figure out how exactly what code to try, someone told me that there's only a 160 possible combinations with those three numbers in a 4 digit required pattern, my question exactly is: How do i figure out all the 160 possible combinations, or is there a tool online which you can input the required numbers, with a set pattern of 4 digits?

Thanks in advance!

  • 2
    There are $3^4 = 81$ possibilities. Just list them in order: 000, 008, 009, 080, 088, 089, 090, 098, 099, 800, etc. – xxxxxxxxx Dec 26 '20 at 20:06
  • I'm afraid i listed it incorrectly, i meant to ask how to figure out every 4 digit combination with only using the numbers 0, 9 and 8 – Clay Dec 26 '20 at 20:08
  • @RobertShore was right, this was indeed the case, and no, to answer the question the combination 9009 could also been a accepting factor. – Clay Dec 26 '20 at 20:10
  • 3
    I don't understand where $160$ is coming from. @MorganRodgers calculation is correct: there can be only $3^4$ combinations ($3$ choices for $1$st digit $\times$ $3$ choices for the $2$nd digit $\times$ $3$ choices for $3$rd digit $\times$ $3$ choices for the $4$th digit). –  Dec 26 '20 at 20:15
  • Are you able to run a computer program? Fairly easy to write one that will dump the combinations for you. –  Dec 26 '20 at 20:21

1 Answers1

0

If that is what you are after, the following Python program will dump all $3^4=81$ codes for you:

DIGITS=['0','8','9']

for one in DIGITS: for two in DIGITS: for three in DIGITS: for four in DIGITS: print(f"{one}{two}{three}{four}")

I am sure you either have Python already on your computer, or you can obtain it, or at worst you can get this code to run on some online Python interpreter.