How many passwords can be formed from this maze? We are all familiar with the $9$-dotted maze lock screen password that we get in all mobiles phones today.Now if minimum of $3$ consecutive dots can be joined to form a password total how many passwords can be formed? 
My attempt:-$${9\choose 3}+{9\choose4}+...+{9\choose8}+{9\choose9}.$$
Now, I suspect this is wrong as when I write $9\choose3$,I choose any 3 dots among the $9$ dots that appear but this can't be as only $3$ consecutive dots can be chosen but here,we are not doing it.
So, what is the correct method to do it?
Definition of password for help:-Look at the figure.The numbers that can be joined are $1-2$,$1-4$ or $1-5$.But ,dots cannot be joined skipping any dot in between.For eg.$1-3,1-6,1-7,1-8$ or $1-9$ cannot be joined.Interestingly it can be noted,dot $5$ can be joined with all other dots(it is the mid-point).Also you can't overwrite over any line-For eg $1-2-1$ is invalid but you can cross over a line at a point.For eg $1-2-6-3-5$ is valid although there is an intersection of two lines.
So,total how many passwords can be formed?
Thanks for any help!! 

 A: Ok my friends I've solved it by a Brute Force algorithm, I'm so happy I managed it. The script I made is in R, so if you want to test it at home you need to install that statistical program.
The main idea of the algorithm is that I just walk through all possibilities that are possible. At every new move (level) I evaluate the coordinates of the neighbors. When I reach maximum depth or the desired length of the password I add 1 to the total of possibilities and move one level up and get the coordinate of the new neighbor.
I made a YouTube video of the script so you can see what it is doing:
https://www.youtube.com/watch?v=6uOWSM3N7u8
So for the password lengths I calculated the following number of possibilities:


*

*= 9

*= 40

*= 160 (just as we determined manually!)

*= 496

*= 1208

*= 2240

*= 2984

*= 2384

*= 784 


Note that the number of possibilities tends to decline with larger lengths of passwords. This is because there are more restrictions as some moves lead to "dead-ends" and thus not reaching max_level.
We can also see that all outcomes are divisible by 4 (except for max_level=1). This was something I noticed when calculating manually in my first post. The possibilities are divisible by 4 for length > 1, because there are 4 corners and 4 sides. This means that there are 4 symmetric paths from a corner, 4 symmetric paths from a side. If length > 1 than from the middle you will be forced into either a corner or side, meaning that again there are 4 symmetrical paths. This symmetry could be used to speed up the algorithm and just calculate one of the 4 paths and afterwards multiply by 4.
Ok so there you go, implementing "knight-jumps" will take some extra effort but will also be doable. Then you can also calculate for the real-life thing where these swipes are allowed.
If you want to check out or use the code, go here: https://github.com/sjorsvanheuveln/Android_Lock_Combinations
A: If a maximum of three dots is used with not allowing to go back, one can try this. I just simplified the problem so that you only speak of Corner (1,3,7,9), Side (2,4,6,8,) Middle (5).
In that case there are only 7 decisions possible:
Corner-Side = 4*2*(5-1)   = 32 (so 4 Corners, from a Corner you can move to only 2 Sides and from Side you can move only in 5 directions to the final dot, but one was already visited because it was the start so subtract 1)
Corner-Middle = 4*1*(8-1) = 28
Middle-Corner = 1*4*(3-1) = 8
Middle-Side = 1*4*(5-1)   = 16
Side-Corner = 4*2*(3-1)   = 16
Side-Middle = 4*1*(8-1)   = 28
Side-Side = 4*2*(5-1)     = 32

This gives a total of 160 possible passwords with 3 dots. Perhaps this is reducible to a formula, but I don't know how yet.
A: I used a similar method but a tree diagram
Corners (C), Side (S) and Middle (M)
4 C - 2 S then x4 options = 32
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp- 1 M then x7 options = 28 totals 60
4 S - 2 C then x2 options = 16
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp- 2 S then x4 options = 32
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp- 1 M then x7 options = 28 totals 76
1 M - 4 C then x2 options = 8
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp- 4 S then x4 options = 14 totals 24
Totals 160. 
Interestingly you have the least possibilities when you start in the centre, and most when you start on the side.
A: I have written Python code (Hopefully the Link Works) to answer this question. I have calculated the answer in two different ways and the answer I got agrees in both cases: $$10256$$ The first way is just a brute force depth first search on all keys, based on the adjacency graph of the keypad. The search only counts paths of length $3$ or more, i.e. depth $2$ or more. The second approach exploits symmetry, performing only the depth first search on one corner, one side (non-corner), and the centre. It then multiplies the corner and side results by $4$. If the code link doesn't work I can post the code here upon request. You may also be interested in these numbers:


*

*Passwords starting from any corner: $1369$

*Passwords starting from any side: $1031$

*Passwords starting from the centre: $656$


I have cross checked my answer against that given by Ansjovis86 and it indeed checks out. Success! To be more explicit, summing up all paths of length $3$ or more from Ansjovis' answer we get:
$$160 + 496 + 1208 + 2240 + 2984 + 2384 + 784 = 10256$$
