Counting With Repetitions

Counting With Repetitions
The genetic code of an organism stored in DNA molecules consist of 4 nucleotides:
Adenine, Cytosine, Guanine and Thymine.
• It is possible to sequence short strings of molecules.
• One way to sequence the nucleotides of a longer string of
DNA is to split the string into shorter sequences.
• A C-enzyme will split a DNA-sequence at each “C”. This
means that each fragment will end at a C except possibly
the last fragment.
• Similarly for A-enzymes, G-enzymes and T-enzymes.
• If the original nucleotide is split on each of C, A, G and
T then it can be sequenced as it is most likely a unique
sequence that can be constructed by each of the four sets
of fragments.
1
Example. Given a 20-nucleotide string split at the Cs, one might
have the fragments:
AC, AC, AAATC, C, C, C, TATA, TGGC
Q. How many different 20-nucleotide strings could have given
rise to the above set of fragments? In other words, how many
different arrangements are there of these fragments?
A.
2
Theorem. Given n objects, with r1 of type 1, r2 of type 2, . . . ,
rm of type m where
r1 + r2 + . . . + rm = n
then the number of arrangements of the n objects, denoted by
P (n; r1 , r2 , . . . , rm ) is:
n n − r n − r − r n − r − r − · · · − r m
1
1
2
1
2
=
···
r1
r2
r3
rm
Q. What does this formula simplify to?
A.
3
Proof.
P (n; r1 , r2 , . . . , rm ) =
n!
r1 !r2 ! . . . rm !
• Convert the problem into something we can already solve.
• Suppose all objects are distinct. How many permutations
are there?
• Consider the ith type. It is repeated ri times.
• Add the subscripts 1, 2, . . . , ri to make them unique.
Example. Let our set of objects be the letters {b, a, a, a, n, n}.
We can make the as and ns unique as follows: a1 , a2 , a3 ,
n1 , n2 .
Q. Number of permutations of {b, a1 , a2 , a3 , n1 , n2 }?
A.
We can think of this as the number of ways to arrange
{b, a, a, a, n, n} × .
Q. How do we say this mathematically?
A.
6! =
×??
4
Q. Suppose we have b, a, a, n, n, a. What are the different
ways to arrange the as?
A.
Q. How many ways to arrange the ns for each arrangement
of as?
A.
Resulting in:
• Generally, for the ith type, we have
the objects. Therefore:
ways to arrange
n! =
n! =
• Rearranging gives:
P (n; r1 , r2 , . . . , rm ) =
5
Selections With Repetitions
Example. While shopping at the St. Lawrence market, you
decide to buy half a dozen bagels. There are three flavours to
choose from.
Q. How many different ways can you select your 6 bagels?
A. Rephrase as an arrangement problem.
Sesame
xx
Poppy Seed
xxx
Plain
x
Q. How is this an arrangement problem?
A.
Q. How can we also think of this as a selection problem?
A.
Let n be the number of choices, r the number of items selected.
Then 8 = r + (n − 1) and we are choosing r = 6. This results
in:
6
Theorem. Given r objects and n types of objects to choose from,
the number of selections with repetitions is:
r + (n − 1 )
r
Proof. Simply generalize the arguments above.
Example. How many ways are there to select a committee of 15
politicians from a room full of
• indistinguishable Democrats,
• indistinguishable Republicans and
• indistinguishable Independents
if every party must have at least two members on the committee?
Solution.
7
Pascal’s Triangle
Blaise Pascal [1623-1662] was a French mathematician, physicist, inventor, writer and philosopher.
• As a teenager, he invented the
mechanical calculator.
• He collaborated with Pierre de
Fermat in Probability Theory
influencing modern economics
and social sciences.
• Invented Pascal’s Triangle in his
“Treatise on the Arithmetic Triangle”.
Pascal’s Triangle can be constructed several ways. One way is:
• The edges are “1”s.
• The interior numbers are the sum of the two numbers above.
8



 
  
   
    








Fill in the entire triangle.
Q. What do you notice about each number? How is it related to
pizza and toppings?
A.
Q. How is Pascal’s Triangle related to binomial expansion? I.e.,
how is it related to the coefficients of the polynomials found by
expanding (a + b)n ?
A. Let’s write out:
(a + b)1
(a + b)2
(a + b)3
(a + b)4
etc.
=
=
=
=
9
Fun Pascal Triangle Facts*
1
1
1
1
3
1
1
2
4
1
1
3
6
4
1
1
5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
1 9 36 84 126 126 84 36 9 1
Q. What do each line sum to?
A.
Q. Read each line as a number. If a number has two digits carry
the tens digit to the left and add. What do these numbers represent?
A.
*http://www.mathsisfun.com/pascals-triangle.html
10
More Cool Pascal Triangle Facts
1
1
1
1
3
1
1
2
4
1
1
3
6
4
1
1
5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
1 9 36 84 126 126 84 36 9 1
Q. Colour all the odd numbers. What does this remind you of?
A. A well known repeating pattern, the Sierpinkski Triangle.
11
1
1
1
1
2
3
1
1
3
6
4
1
1
4
1
1
5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
1 9 36 84 126 126 84 36 9 1
Q. What series of numbers do you get by adding up the numbers
of the same colour which are on a stretched diagonal?
A.
Q. What numbers do you get if go down the diagonals?
A.
ones
1
counting numbers
1
1
triangular numbers
1 3 3 1 tetrahedral numbers
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
1 9 36 84 126 126 84 36 9 1
1
2
1
12
Q. What are the triangular numbers?
A. They are the numbers you get by counting the number dots
required to make successive triangles**.
Guess what the Tetrahedron numbers are.
**http://www.mathsisfun.com/algebra/triangular-numbers.html
13