# a complex set combination problem

• April 3rd 2011, 01:19 PM
boxermc
a complex set combination problem
gotta question for you guys that i can't seem to get a grapple on...

there is a 19 digit code that consists of 1's and 0's and starts with the number 1, (its first digit is 1)
how many combinations of this 19 digit code carry three or more repeating digits, or, 5 or more 0's or 1's than its counterpart? (5 or more 1's than 0's or 5 or more 0's than 1's), a +5 or more count on the other digit

examples of positive cases
1...000......
1.......111......
11011011011.....

i've been working on this problem all day any help is appreciated!
thanks
• April 3rd 2011, 03:51 PM
Soroban
Hello, boxermc!

Here's part of it . . . hope it helps.

Quote:

There is a 19 digit code that consists of 1's and 0's and starts with 1.
How many 19-digit codes have five more 0's than 1's or five more 1's than 0's?

If there are five more 0's than 1's, there must be seven 1's and twelve 0's.

One of the 1's is placed in the first slot.
The other 18 digits can be placed in $\dfrac{18!}{6!\,12!} \:=\: 18,564$ ways.

If there are five more 1's than 0's, there must be twelve 1's and seven 0's.

One of the 1's is placed in the first slot.
The other 18 digits can be placed in $\dfrac{18!}{11!\,.7!} \:=\:31,824$ ways.

Therefore, there are: . $18,\!564 + 31,\!824 \:=\: 50,\!388$ ways.

• April 3rd 2011, 11:23 PM
boxermc
thanks!
thanks alot! we are definitely on the right track. we have the 5+ number of cases. now we need the triple repeating number of cases that do not have 5 or more 1's than 0's or 0's than 1's
• April 3rd 2011, 11:42 PM
boxermc
to build on soroban's work... now to get all the cases where there are 5 or more 1's or zeroes it would make sense to make a sum of the form where you increase the 5+ term one by one and decrease the other denominator term one by one to solve.

I got 249527 for 5 or more 0's than 1's and 261155 for 5 or more 1's than 0's

these both add to a total number of 510682 cases
• April 4th 2011, 02:02 AM
boxermc
need to find when both 5+ and triples occur
i think i approximated the total number of 3 in a row cases...

if you make a table with number of entries on the left and number of positive cases on the right, you get a pattern of 1 3 8 19 42, this is just 2 times the preceeding number plus (n-3). when projecting to the 19th term you get 196596 positive cases

now all we need to do is find the number of cases that have 3 1's or 0's in a row and
a 5+ margin on the other digit, or, the overlapping circle case of the two criteria
• April 4th 2011, 01:53 PM
boxermc
OK

I'm going to restate this question to tackle the important part:

In a 19 digit code that containing only 1's and 0's that starts with a 1, how many cases satisfy both of the following:
~contain a (111) or a (000) in the code, (three repeating digits)
and
~contain 5 or more 1's than 0's or 5 or more 0's than 1's

If it is easier, the second criteria can also be
~contain 4 or less 1's than 0's or 4 or less 0's than 1's

both will lead me to solve my problem