Application to calculate chances of winning the lottery

I need to make an application to calculate your chances of winning the lottery i want to use input textfields.

The actual application will ask you:

Highest choosable number
Lowest chooseable number
how many numbers you need to choose

the actual math calculation is:

e.g
Highest no. = 49
Lowst no. = 1
choosing numbers = 6

494847464544 = x
6! (factorial) = 6
54321 = y
x/y = the chances of winning the lottery

please could someone help me or give me an idea on how to go about this, im not very good on the math side of actionscript and caould really use some help :slight_smile: thanks in advance.