I have a fun family app dealing with the odds of winning the lottery. Seems simple, right? I'm having a problem with the following (I'm sure a simple solution is evident but all help appreciated): 12 variables, 6 user chosen and 6 random generated, all integers. Want to perform comparisons to see how many random spins it takes to match 3, 4, 5, and all 6 user chosen to random CPU chosen. Not sure of a quick shortcut...?

UsrChosen1 = RndChosen1 || RndChosen2 ||...

path I started on, but the permutations for getting it right get ugly fast. For instance:
Usr: 49 49 49 49 49 49
Rnd: 03 26 49 22 16 31

gives a full 6 match as all usr 49's match 1 cpu 49.
Any ideas?

Not quite clear if you want to just pick random numbers or get the possibility equation.

If possibility, see if this helps.

MsgBox("The possiblily to win the loterry by drawing 6 numbers from 1 to 49," & vbNewLine & _
               "is 1 in " & CDbl(49 ^ 6).ToString("#,###,###,###,###") & ".")
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.