What are the odds of cracking a cellphone pattern-lock?

In case someone don't know what a pattern lock is, they are like this:

I am curious on the probability of randomly cracking one of these 'passwords', given that the length of the grid is 3x3 and that we know the pattern length (e.g number of lines).

Also, you may or not noticed but the pattern can go in both + and x directions.

Note: we can have multiple lines that go to a single dot, but we can never draw a line above another line (I think some apps allow this, but for this question lets assume we will not).

-
Can patterns be of any length (i.e., 1 or more dots)? – sacohe Dec 6 '12 at 3:26
stackoverflow.com/questions/2120655/… – user51427 Dec 6 '12 at 3:26
@sacohe the minimum is connecting 2 dots, the maximum however, was left blank because the answers I want to be like a function that you put one number here and then everything is done using that number sorry my englishç – ajax333221 Dec 6 '12 at 3:30
Perhaps a duplicate of Combination of smartphones' pattern password. – Bill Dubuque Dec 6 '12 at 4:12
@BillDubuque I agree, after knowing the total combinations should not be hard to calculate the odds of cracking one of those – ajax333221 Dec 6 '12 at 4:15