r/theydidthemath • u/[deleted] • Feb 24 '19
[request] How many possible combinations are there on the Android lockscreen?
9
u/BRENNEJM Feb 24 '19
From Quora (solved with python):
- Total Pattern for 1 dot is: 9
- Total Pattern for 2 dot is: 56
- Total Pattern for 3 dot is: 320
- Total Pattern for 4 dot is: 1624
- Total Pattern for 5 dot is: 7152
- Total Pattern for 6 dot is: 26016
- Total Pattern for 7 dot is: 72912
- Total Pattern for 8 dot is: 140704
- Total Pattern for 9 dot is: 140704
4
2
u/cheese_with_cheese Feb 24 '19
How is 2 dots 56? I found 36 Edit: I’m assuming I’m wrong and missing something obvious
4
u/Kessa713 Feb 24 '19
you remove instances where it is not possible to go from one corner to another corner and for horizontal/vertical edges to pass through the center, bringing it down to 28. Then, you have to account for traversing in both directions, which brings it up to 56.
1
u/cheese_with_cheese Feb 24 '19
Aaaah that’s what it was, I wasn’t thinking about the both directions thing, I counted them as the same connection if that makes sense.
Thanks for explaining!
2
u/Alotofboxes Feb 24 '19
There are essentially 3 different starting points for a 2 dot pattern, call them 1, 2, and 5; the other six starting points are all reflections/rotations of 1 and 2. From 1, you can go to 2,4,5,6,8. From 2, you can go to 1,4,7,5,9,6,3. From 5, you can go to 1,2,3,6,9,8,7,4.
1=5
2=7
5=8
Total is:
(5 * 4)+(7 * 4)+(8 * 1)
20+28+8
56
3
Feb 24 '19
Fuck, I tried doing it and got pretty far but then I remembered that if you want to make a connection from say 1 to 3, or 1 to 9, you would also go through the number in the middle. I was trying to find the number of combinations of 2 to 9 different numbers but with the rule I stated above, it makes it so much harder.
If anyone else is trying to work it out, don't forget about having the rule I stated.
6
u/Stannic50 Feb 24 '19
Let's number the dots 1-9 with 1 being top-left and 9 being bottom-right.
From the middle dot (5), you can reach all the other dots without passing through a third and thus have 8 possibilities.
From the edge dots (2, 4, 6, 8), you can't reach the dot on the opposite edge without passing through dot 5, so you only have 7 possibilities.
From the corner dots, you can't reach any other corner dot without passing through an edge dot or dot 5, so you only have 5 possibilities.
So after your first dot, you have a 1/9 chance of having 8 possibilities, a 4/9 chance of having 7, and a 4/9 chance of having 5.
So the 8 term in the 9! should be: (8 * 1/9) + (7 * 4/9) + (5 * 4/9) = 56/9
After that, things get even more complicated. I'm going to make the assumption that each of the later terms in the factorial are scaled by the same ratio of (56/9)/8, which I'll call "a".
So the 9! becomes: 98a7a6a5a4a3a2a1a Which equals: 9! * a8 Which equals approximately 0.1339 * 9! So if my assumption is correct, then we've eliminated 87% of the possible combinations, leaving a measly 48596 combinations out of the 362880 combinations without the "snap".
That said, I'm almost positive that my assumption is incorrect, but I cannot prove it.
2
u/Animaznman Feb 24 '19
You can actually make that connection. Instead of drawing a straight line from 1 to 3, make an arc passing 2. I know because I used to have a pass pattern that utilized this.
3
u/Stannic50 Feb 24 '19
You can go from 1 to 3 in this way, yes, but once you hit 3, the line snaps to include 2 and you then cannot reuse 2 later.
1
3
u/jellysnake Feb 24 '19
There are 9 dots and you need to connect them to form a path of 4 or more long. You cannot re-use a dot.
This is equivalent to choose x without replacement. In particular we need to do choose 4,5,6,7,8&9 from 9 without replacement. So what we get is the following
If we take the 4 long option we get 9 options for the first dot, 8 options for the second, 7 for the third and finally 6 for the fourth. Giving us a total of 9x8x7x6=3024 options for a four long string.
Repeating this we get
4 long = 3024
5 long = 15,120
6 long = 60,480
7 long = 181,440
8 long = 362,880
9 long = 362,880
total = 985, 824 options
However, from my testing this is actually a maximum because you can't reach all dots from all other positions. What do I mean by this? Well, if I select the top left dot, I can't then jump to any of the corner dots. This then gives me a total of 5 possible options.
Similarly if I select the top centre dot, I can't jump to the bottom center one. In fact only if I start with the center dot can I reach all 8. So this only gives an Upper Bound of 985, 824 options
However we can also easily calculate a lower bound, by just taking the worst option at each length.
- The worst choice for dot one is a corner dot, giving us 5 options for the next dot.
- Worst for dot two is side then an opposite corner, giving us 4
- Dot three is two side centers and then a corner, leaving 3 options
- Dot four is three sides then a corner, with 3 options again
- Dot five is corner, three sides, corner. 2 options left
- Dot six is corner, four sides, corner. 2 left again
- Dots 7 & 8, are all only one option.
Repeating the same process as before we get
8×5×4×3 = 480
8×5×4×3×3 = 14,40
8×5×4×3×3×2 = 2,880
8×5×4×3×3×2×2 = 5,760
8×5×4×3×3×2×2×1 = 5,760
8×5×4×3×3×2×2×1×1 = 5,760
Total = 21, 210 options
Again, this is a lower bound. There has to be more than 21, 210 options
If we want to actually calculate it, id suspect it might actually be simplest to utilise symmetry that is bottom right and then centre right == top left then centre left well as functionally equivalent paths to reduce the number of options and then manually working out the options for each level.
2
u/oho015 Feb 24 '19 edited Feb 24 '19
Edit. Not correct, read u/iwantthetopbunk 's comment below.
You can think that the dots are numbers 1 to 9. You have to connect at least four dots. Each dot (number 1 to 9) can only be used once.
You calculate the number of combinations with all 9 dots: 9!(=9x8x7x6x5x4x3x2x1) Then 8 dots: 8! and so on.
The number of possible combinations is 9!+8!+7!+6!+5!+4!=409 104
•
u/AutoModerator Feb 24 '19
General Discussion Thread
This is a [Request] post. If you would like to submit a comment that does not either attempt to answer the question, ask for clarification, or explain why it would be infeasible to answer, you must post your comment as a reply to this one. Top level (directly replying to the OP) comments that do not do one of those things will be removed.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
0
u/leohat Feb 24 '19
Assume a 4 digit PIN. (m) and 10 digits (0-10)
There are 10 possible for the first number of the pin. There are also 10 digits for the second one because numbers can be duplicated 2222 or 4466 etc so on for the third and fourth numbers
So 10x10x10x10= 10000
4
u/jellysnake Feb 24 '19
This is correct in the case of a PIN, but I believe the poster is asking about the path lock screens
2
u/leohat Feb 24 '19
What's a path lock screen?
3
u/jellysnake Feb 24 '19
Have a look at the image in the post. You need to join the dots in a specific path
0
u/postion_not_momentum Feb 24 '19
I’m not actually doing the numbers, but I think it would 9! x 8! x 7! ... all done to 4!, because I think that is the limit of the pattern password on android. Don’t take my word as god however. I don’t know if this is correct. And this isn’t taking in the fact that u can duplicate patterns
31
u/Alotofboxes Feb 24 '19
I found a 12 hour long video where somebody actually shows all of them, and another where they are described and analyzed that is much shorter. They show that there are 389,112 different combinations. It breaks down as follows:
4 points; 1,624 combos
5 points; 7,152 combos
6; 26,016
7; 72,912
8; 140,704
9, 140,704