Calculates number of possible android screen lock patterns
- Clone the repo
- Open the sln in Visual Studio 2015+
- Build the solution
> ./ScreenLockPatternCalc.exe 3 3
Upper limit of 986409 distinct permutations
A 3 by 3 grid yields 389497 distinct possible permutations
Calculations took 00:00:00.5622309
Options can be found in the App.config file
- maxThreads: Maximum number of parallel threads used when calculating. Upper bound is the total number of nodes in the grid (e.g. for a 3x3 grid, 9)
- printTime: Whether or not to print the amount of time calculations take
- printUpperEstimate: Whether or not to print the estimated upper limit of permutations
The upper limit of possible permutations, i.e. ignoring the snapping if you skip over a node, is , i.e. for each possible length of pattern
, the number of permutations, summed.
This sum is according to this proof equal to , so we have an
run time where
is the total number of nodes.