Patterns on a 3x3 matrix of numbers

Possible duplicate:
Android lock password combinations

Dear Sir, I came across a question that asked me to find all the unique patterns that can be obtained using a 3x3 matrix with numbers from 1 to 9. which is similar to the Android lock screen. Can you help me find him? I thought we can use floyd warshall to do this and increment the counter whenever the value changes in the next matrix?

+5
source share
1 answer

Android 1 9. 4-9, , , , ( , 2.3 , , 2.2 3- ). :

Moves = 4, combinations = 1624
Moves = 5, combinations = 7152
Moves = 6, combinations = 26016
Moves = 7, combinations = 72912
Moves = 8, combinations = 140704
Moves = 9, combinations = 140704

Total possibilities: 1624 + 7152 + 26016 + 72912 + 140704 + 140704 = 389112

, Google, .

+12

All Articles