How many patterns? You probably have seen #patterns# in android devices witch working like passwords.

My question is how many patterns can we draw in a 3*3 net and then how many in a m*n?
assumptions:
-a pattern can be just a dot
-the direction is important and makes diffrent patterns
-you can't connect any two dots directly!
 A: Let us mark all the points as shown.  C - Corner, M - Middle, T- Center.  
Each C can reach 2 M OR 1 T, Each M can reach 2 M, 2 C OR 1 T, T can reach 4 C OR 4 M. 

Step 1: 1 step password is allowed, so there are 9 ways.
Step 2: Out of the 9 ways of step 1, there are 4 Cs, 4 Ms and 1 T.  Each of the 4 Cs can reach 2 Ms or 1 T, each of the 4 Ms can reach 2 Ms, 2 Cs or 1 T, 1 T can reach 4 Cs or 4 Ms.  So there are $12+20+8=40$ ways to complete step 2.

Step 3: Collect all the Cs and Ms together.  Now the choice of Ms for Ms will be reduced by 1, since we can't go back to from where we came.
So $18+32+16=66$ ways to complete step 3.

Same way 
$\underline{\text{Step 4}:} 62 $ways$\hspace{50 pt}$
$\underline{\text{Step 5}:} 62 $ways$\hspace{50 pt}$
$\underline{\text{Step 6}:} 62 $ways$\hspace{50 pt}$
$\underline{\text{Step 7}:} 62 $ways$\hspace{50 pt}$
$\underline{\text{Step 8}:} 62 $ways$\hspace{50 pt}$
$\underline{\text{Step 9}:} 62 $ways$\hspace{50 pt}$
So TOTAL number of combinations=No of ways of step 1+No of ways of step (1*2)+No of ways of step (1*2*3) +...+ No of ways of step (1*2*3*...*9)
NOTE: I was not aware about what is mentioned in the previous answer and comments that we can reach any point from any point.
A: If you have an $m \times n$ grid of dots and each stroke can go from any dot to any other dot, the number of patterns of $k$ strokes is $mn (mn-1)^k$.
