Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was wondering if there was a general for formula to calculate the combination of the password lock for the current smart phones

enter image description here

The following is the condition

  1. We must use four nodes or more to make a pattern at least.
  2. Once anode is visited, then the node can't be visited anymore.
  3. You can start at any node.
  4. A pattern has to be connected.
  5. Cycle is not allowed.

If using 4 as the minimum string for the password with 9 nodes , the result is 389112.

Is there anyway to estimate the number of combinations for 16 nodes, 25 nodes and so on?

share|cite|improve this question
The number 389112 shows up exactly once at the Online Encyclopedia of Integer Sequences, at where it's $8P_7(n)$, Legendre polynomial of order 7. I doubt it's related, just thought I'd save others the trouble of consulting OEIS. – Gerry Myerson Nov 26 '12 at 4:29
This question is closely related. It's very nearly a duplicate, including the same image and wording, except it doesn't ask about the generalization to larger grids. – joriki Nov 26 '12 at 4:31
Note that the answer $389112$ is obtained if the rules specified in this other duplicate are assumed. If these are the intended rules, the present problem description is incomplete. – joriki Nov 26 '12 at 4:48
@GerryMyerson I am just learning about Legendre Polynomials and I am glad of you mentioning it. I did not know that Legendre Polynomials will be useful for these types of problems. – diimension Nov 26 '12 at 5:50
@dii, did you see where I wrote, "I doubt it's related"? – Gerry Myerson Nov 26 '12 at 6:22

Since each dot can be the starting point for the pattern, the number of possibilities are as follows:

  1. 4 dots combination (since this is the minimum required): 9 dots (starting points) ^ (raise to the power) 4 = 6,561 patterns
  2. 5 dots combination: 9 dots ^ 5 = 59,049 patterns
  3. 6 dots combination: 9 dots ^ 6 = 531,441 patterns
  4. 7 dots combination: 9 dots ^ 7 = 4,782,969 patterns
  5. 8 dots combination: 9 dots ^ 8 = 43,046,721 patterns
  6. 9 dots combination: 9 dots ^ 9 = 387,420,489 patterns

Total possible number of patterns = 435,847,230 patterns

share|cite|improve this answer
That's not right. The dot sequence must be connected. – Tyler Nov 10 '13 at 16:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.