PDA

View Full Version : Anbody like statistics?

Stevie Rave On
01-18-2000, 02:16 PM
Seeing the responses you've gotten so far, I'd have to say 100% of the people don't :)

AWB
01-18-2000, 02:30 PM
191,760,000 combinations.

Did you want me to show my work? :D

------------------
I looked in the mirror today/My eyes just didn't seem so bright
I've lost a few more hairs/I think I'm going bald - Rush

ignatiusjreilly
01-18-2000, 02:36 PM
I like stats!

But this ain't stats. These are permutations, which is mathematics.

Seems a little obscure, too. What are you trying to do, hack NSA? :)

Well, the answer to your question is that- wait- [knock at the door...]

- Why are you guys wearing sunglasses indoors?
- HUH? No, I just saw this question and wanted to an-
- Um, where are we going? Can I get my coat? It's cold - oh. um, okay

I gotta go now.

wamphyri
01-18-2000, 03:06 PM
I'm actually just trying to deal with the age old problem of selecting a unique ID number to assign to clients. I'm trying to yield the most possible numbers with a simple algorithm. Besides, cracking NSA is easy.

wamphyri
01-18-2000, 03:08 PM
Oh, and sorry, AWB, the 18 digit number alone yields well over one trillion numbers.

AWB
01-18-2000, 03:33 PM
wamphyri: Oh, and sorry, AWB, the 18 digit number alone yields well over one trillion numbers.

Maybe then I misunderstood your algorithm.

You said the first number is:
<code>101 11 10001 1001 101 1</code>
The second is:
<code>104 14 10004 1004 104 4</code>
Continuing: <code>
107 17 10007 1007 107 7
110 20 10010 1010 110 0 (reached 9)
113 23 10013 1013 113 3
116 26 10016 1016 116 6
119 29 10019 1019 119 9
122 32 10022 1022 122 0 (reached 9 again)</code>

From what you said, you never start a group with a number ending with a 2.

You'll get 30,000 unique sequences by the time the third area (10000-99999) reaches the end the first time. By this time, all the lesser areas have run past their first sequences and are now on the repeating sequence (by threes) 0-9, 10-97, 100-997, etc.

The second time through the third areas count, it runs through the numbers 10000-99997 by threes. This is another 30,000.

All of the lesser fields repeat themselves much quicker. But their periods (the count of numbers before they begin again) are integral multiples of 30,000. That is, the first area repeats every 300, 2nd every 30, 4th every 3000, 5th every 300, and 6th every 4. Therefore, the 30,001th number (XXX XX 10000 XXXX XXX X) will be repeated after the 60,000th one (XXX XX 99997 XXXX XXX X). So you only have 60,000 numbers to play with inserting the dashes.

On to the dashes. To determine how many places the dashes could go, I used the combinations formula: nCr = n!/(n-r)!r!

17C2 = 136
17C3 = 680
17C4 = 2380

Adding these, I get 3196 different patters for the dashes.

Finally, 3,196 * 60,000 = 191,760,000.

------------------
I looked in the mirror today/My eyes just didn't seem so bright
I've lost a few more hairs/I think I'm going bald - Rush

RickG
01-18-2000, 03:47 PM
OK, let me take a crack at this. If I understand correctly:

Area 1 repeats after 900 iterations of the algorithm.
Area 2 after 90.
Area 3 after 90000.
Area 4 after 9000.
Area 5 after 900.
Area 6 after 10.

The lowest common multiple of these numbers is 90000, so after that many iterations of the algorithm, the entire sequence must repeat.

Now, there are three possible dash patterns:

2 dashes yield 17*16=272 distinct patterns.
3 dashes yield 17*16*15=4080 patterns.
4 dashes yield 17*16*15*14=57120 patterns.

So the total should be

90000*(272+4080+57120)= 5,532,480,000

or about five and a half billion.

Somebody correct me if I screwed that up.

Rick

RickG
01-18-2000, 03:55 PM
AWB posted while I was composing. Now rereading, I realize I screwed up big time. I thought you were doing the three interlocked sequences 101, 104, ..., then 100, 103, ..., *then* 102, 105, etc, rather than only using two of the three. I made the mistake of reading what made sense to me, rather than what you wrote. Plus I screwed up on the combinations of dashes.

I agree completely with AWB. That is the correct answer.

Alphagene
01-18-2000, 04:12 PM
That's so weird. I got 4.

------------------
We gladly devour those who would subdue us.

wamphyri
01-19-2000, 12:38 AM
This is three steps to choosing an 18 digit ID number.

Question:
---------
How many possible combinations does this give?
I.E: How many unique numbers does this yield?

First:
------
18 digit number
choosen in ranges: xxx xx xxxxx xxxx xxx x
1 2 3 4 5 6
area 1 ranges from 100-999
area 2 ranges from 10-99
area 3 ranges from 10000-99999
area 4 ranges from 1000-9999
area 5 ranges from 100-999
area 6 ranges from 0-9

area 1 starts with 101, increments by three, yielding the sequence: 101,104,107...
when 999 is reached, the counting starts over at 100, yielding: 100,103,106...
when 999 is reached again, the counting starts over at 100, yielding: 100,103,106...
...

area 2 starts with 11, increments by three, yielding the sequence: 11,14,17...
when 99 is reached, the counting starts over at 10, yielding: 10,13,16...
when 99 is reached again, the counting starts over at 10, yielding: 10,13,16...
...

area 3 starts with 10001, increments by three, yielding the sequence: 10001,10004,10007...
when 99999 is reached, the counting starts over at 10, yielding: 10000,10003,10006...
when 99999 is reached again, the counting starts over at 10000, yielding: 10000,10003,10006...
...

area 4 starts with 1001, increments by three, yielding the sequence: 1001,1004,1007...
when 9999 is reached, the counting starts over at 1000, yielding: 1000,1003,1006...
when 9999 is reached again, the counting starts over at 1000, yielding: 1000,1003,1006...
...

area 5 starts with 101, increments by three, yielding the sequence: 101,104,107...
when 999 is reached, the counting starts over at 100, yielding: 100,103,106...
when 999 is reached again, the counting starts over at 100, yielding: 100,103,106...
...

area 6 starts with 1, increments by three, yielding the sequence: 1,4,7...
when 9 is reached, the counting starts over at 0, yielding: 0,3,6...
when 9 is reached again, the counting starts over at 0, yielding: 0,3,6...
...

The first 18 digit number is: 101 11 10001 1001 101 1 or 101111000110011011
The second 18 digit number is: 104 14 10004 1004 104 4 or 104141000410041044
...

Second:
-------
randomly choose the number 2,3 or 4, with equal probability, this designates the
number of dashes to add to the 18 digit number

Third:
------
randomly choose where the dashes will go from 1-17, no duplicates, with equal probability
no numbers within one of other numbers, so you can't have:1834--174
can't have a dash at the beginning or end

Conclusion:
-----------
So, our first number could have 3 dashes at 2,6,14 yielding: 10-1111-00011001-1011
our second number could have 2 dashes at 2,5 yielding: 10-414-10004100410044