Robert Batzinger
Dec 2 17
One hundred ticket numbered \( 1,2,3,...,100 \) are sold to 100 people. There are 4 prizes, including a grand prize of a trip to Australia. How many are there to award the prizes?
Select 2 out of 4 \[ r = 2, n = 4 \]
\[ \begin{array}{l} Given\ X = \{a,b,c,d\}:\\ \quad Y = \{\forall x:\\ \qquad\qquad x \in {\cal P}(X):\\ \qquad\qquad\qquad|x| = 2 \}\\ \end{array} \]
Permutations: All recombinations without repetition \[ ab, ac, ad, ba, bc, bd, ca, cb, cd, da, db, dc \] \[ \left({n!\over (n-r)!}\right) \]
Combinations: All unique combinations without repetition \[ ab, ac, ad, bc, bd, cd \] \[ \left({n!\over r!\ (n-r)!}\right) \]
\[ \]
Select 2 out of 4 \[ r = 2, n = 4 \]
\[ \begin{array}{l} Given\ X = \{a,b,c,d\}:\\ \quad Y = \{\forall x:\\ \qquad\qquad x \in {\cal P}(X):\\ \qquad\qquad\qquad|x| = 2 \}\\ \end{array} \]
Permutations: All recombinations with repetition \[ aa, ab, ac, ad, ba, bb, bc, bd, ca, cb, cc, cd, da, db, dc, dd \] \[ \left({n^r}\right)= 4^2 = 16 \]
Combinations: All unique combinations with repetition \[ aa, ab, ac, ad, bb, bc, bd, cc, cd, dd \] \[ \left({(n+r-1)!\over r!\ (n-1)!}\right) = {(4 + 2 -1)!\over 2! (4-1)!} = {5!\over 2! (3)!} = 5\cdot 2 = 10 \]
\( n \) objects can be permuted \( n^r \) when repetition is allowed
How ways can 3 binary digits be combined?
\[ \begin{array}{rl} Permutations: & 000, 001, 010, 011, 100, 101, 110, 111 \\ Calculations:& 2^3 = 2\cdot2\cdot2 = 8 \\ \end{array} \]
\[ Z = \forall X \subset Y: |Y| = n, |X| = r, repetition = TRUE \] \[ \left({n + r -1 \atop r}\right) \]
How many combinations of 2 pencils can be drawn from a box of 2 colors?
\[ \begin{array}{rl} & \\ Bar\ and\ star\ model: & *|*, **|, |** \\ Color Scripting: & R_1G_1, G_2, R_2 \\ Calculation & \left({2 + 2 - 1 \atop2}\right) = \left({3\atop2}\right) = \left({3!\over 2!}\right) = \left({3\cdot2!\over 2!}\right) = 3\\ \end{array} \]
\[ \begin{array}{cccl} Pencils & Colors & Combinations & Calculation\\ \hline 1 & 2 & *|, |* & \left({2\atop1}\right) = 2\\ 3 & 1 & *** & \left({3\atop3}\right) = 1\\ 3 & 2 & *|**, **|*, ***|, |***, & \left({4\atop3}\right) = 4\\ 2 & 3 & *|*|, |*|*, *||*, **||, |**|, ||** & \left({4\atop2}\right) = 6\\ 3 & 3 & *|*|*, *|**|, *||**, **|*|, |*|**, & \left({5\atop3}\right) = 10\\ & & **||*, |**|*, ***||, |***|, ||*** & \\ 4 & 2 & **|**, *|***, ***|*, ****|, |**** & \left({5\atop4}\right) = 5\\ 4 & 2 & **|**, *|***, ***|*, ****|, |**** & \left({5\atop4}\right) = 5\\ \hline \end{array} \]
No repetitions
Permutations \[ \left({n! \over (n - r)!}\right) \]
Combinations \[ \left({n! \over r!\ (n - r)!}\right) \]
Repetition allowed
Permutations \[ \left(n^r\right) \]
Combinations: \[ \left({(n+r-1)! \over r!\ (n - 1)!}\right) \]
Given \( n \) items of \( k \) unique types of items, \[ n = \sum_{i=1}^{k}\ n_i \] the number of permutations equals \[ \left({n!\over n_1!\ n_2!\ n_3!\ n_4! \cdots n_k}\right) \]
toot
has 2 t
's and 2 o
's: \( \hbox{toot, toto, ttoo,otot, oott, otto} \)
\[ \left({4! \over 2!\ 2!}\right) = 2\cdot 3 = 6 \]
bee
has 2 e
's and 1 b
: \( \hbox{bee, ebe, eeb} \)
\[ \left({3! \over 2!}\right) = 3 \]
teethe
has 3 e
's, 2 t
's and 1 h
. \[ \left({6!\over 3!\ 2! 1!}\right) = {6\cdot 5\cdot 2} = 60 \]
beekeeper
has 5 e
's and the letters bkpr
have 1 each.\[ \left({9!\over 4!\ 1!\ 1!\ 1!\ 1!}\right) = 9\cdot8\cdot7\cdot6\cdot5 = 15,120 \]
bookkeeper
has 3 e
's, 2 k
's, 2 o
's, 1 b
and 1 r
\[ \left({10!\over 3!\ 2!\ 2!\ 1!\ 1!}\right) = 10\cdot9\cdot8\cdot7\cdot6\cdot5 = 151,200 \]
Number of ways that \( n \) discrete items into \( k \) boxes of specific sizes \( n_1\dots n_k \) \[ \left({n!\over n_1!\ n_2!\cdots n_k!}\right) \]
\[ \left({10!\over 2!\ 2!\ 2!\ 1!}\right) = 10\cdot9\cdot8\cdot7\cdot6\cdot5\cdot3 = 453,600 \]
\[ \left({10!\over5!\ 5!}\right) = 9\cdot4\cdot7 = 252 \]
\[ \begin{array}{rcl} \left({n \atop 0}\right) &=& \left({n\atop n}\right) = 1\\ \\ \left({n \atop k}\right) &=& \left({n\atop n-k}\right)\\ \\ \left({n \atop k}\right) &=& \left({n - 1\atop k - 1}\right) + \left({n - 1 \atop k}\right)\\ \\ \large 2^n &=& \left({n \atop 0}\right) + \left({n \atop 1}\right) + \left({n \atop 2}\right) + \dots + \left({n \atop n}\right) \end{array} \]
Sequence is an ordered list of numbers
What would you expect to the be next term?
Closed formula: a formula in which the value of any particular term \( a_n \) as a function of \( n \).
Recursive relationship: a formula in which the terms of any particular term \( a_n \) is a function of previous values of \( a_1 \) to \( a_{n-1} \)
Find the value for \( n=10 \)
Closed formulas:
Recursive formulas:
\[ \begin{array}{l} P_0 = 10000 \\ P_1 = P_0 + 1.05\ P_0\\ P_2 = P_1 + 1.05\ P_1 = P_0 + 1.05^2P_0\\ P_3 = P_2 + 1.05\ P_2 = P_0 + 1.05^3P_0\\ P_4 = P_3 + 1.05\ P_3 = P_0 + 1.05^4P_0\\ P_5 = P_4 + 1.05\ P_4 = P_0 + 1.05^5P_0\\ \qquad\qquad \vdots\\ P_{n} = P_{(n-1)} + 1.05\ P_{(n-1)} = P_0 + 1.05^n P_0\\ \\ P_{30} = P_{29} + 1.05\ P_{29} = P_0 + (1.05)^{30} P_0 = 53,219.42 \\ \end{array} \]
A pair of male/female rabbits are left on a island. The pair does not breed until they are 2 months old. After 2 months old, each pair produces another pair each month. Find the recurrence relation assuming no deaths. -Fibonacci 1202
Month | Mating pairs | Young pairs | Total pairs |
---|---|---|---|
1 | 0 | 1 | 1 |
2 | 0 | 1 | 1 |
3 | 1 | 1 | 2 |
4 | 1 | 2 | 3 |
5 | 2 | 3 | 5 |
6 | 3 | 5 | 8 |
7 | 5 | 8 | 13 |
8 | 8 | 13 | 21 |
\[ Pairs_n = Pairs_{n-1} + Pairs_{n-2} \]
\[ series: 1, 4, 9, 16, 25, 36, ... \] \[ differ_1: 3, 5, 7, 9, 11, ... \] \[ differ_2: 2, 2, 2, 2, ... \]
\[ series: 4, 9, 16, 25, 36, 49, 64, 81, ... \] \[ differ_1: 5, 7, 9, 11, 13, 15, 17, ... \] \[ differ_2: 2, 2, 2, 2, 2, 2, ... \]
\[ series: 1, 16, 81, 256, 625, 1296, ... \] \[ differ_1: 15, 65, 175, 450, 671, 1105, ... \] \[ differ_2: 50, 110, 194, 302, 434, ... \] \[ differ_3: 60, 84, 108, 132, ... \] \[ differ_4: 24, 24, 24, ... \]
\[ series: 16, 82, 258, 628, 1300, 2406, ... \] \[ differ_1: 66, 176, 370, 672, 1106, ... \] \[ differ_2: 110, 194, 302, 434, 590, ... \] \[ differ_3: 84, 108, 132, 156, ... \] \[ differ_4: 24, 24, 24, ... \]
Count | 1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|---|
Number in level | 1 | 3 | 6 | 10 | 15 | 21 |
Number in stack | 1 | 4 | 10 | 20 | 35 | 56 |
Differ1 | 3 | 6 | 10 | 15 | 21 | - |
Differ2 | 2 | 3 | 4 | 5 | 6 | - |
Differ3 | 1 | 1 | 1 | - | - | - |
\[ Balls = a x^3 + b x^2 + c x + d \]
\[ \begin{array}{rcl} 0 &=& d\\ 1 &=& a + b + c \\ 4 &=& 8a + 4b + 2c\\ 10 &=& 27a + 9b + 3c\\ \end{array} \]
\[ \begin{array}{ccccc} 1a & 1b & 1c &=& 1\\ 8a & 4b & 2c &=& 4\\ 27a & 9b & 3c &=& 10\\ \hline 1 & 1 &1&=& 1\\ 0 & 1 &3/2&=& 1\\ 0 & 0 & 1&=& 1/3\\ \hline 1 & 0 & 0 & = & 1/6\\ 0 & 1 & 0 & = & 1/2\\ 0 & 0 & 1 & = & 1/3\\ \end{array} \]
\[ y = {x^3\over 6} + {x^2\over 2} + {x\over 3} \]
\[ y_{15} = 680 \]
Calculate the number of cans in stack 10 levels high
How many elements in \( n \in \{1,2,3,...,500}: \)
\( n \) is a multiple of one or more of 5, 6, or 7?
Series: 3,6,12,24,48,96,192
Differences: 3,6,12,24,48,96,
\[ \begin{array}{rcl} a_0 &=& 3 \\ a_n &=& 2\times a_{n-1}\\ \end{array} \]
\[ \begin{array}{rcl} a_1 &=& 2a_0\\ a_2 &=& 2a_1 = 4a_0\\ a_3 &=& 2a_2 = 8a_0\\ \end{array} \]
\[ a_n = 3\times 2^n \]
the terms differ by a constant
Recursive definition: \( a_0 = a \) \[ a_n = a_{n−1} + d \]
Closed formula: \( a_n = a + d n \)
There is a constant ratio between successive terms
Recursive definition: \( a_0 = a \) \[ a_n = r a_{n−1} \]
Closed formula: \( a_n = a \times r^n \)
\[ \sum_{i=1}^n a_i = 1+2+3+4+...+n = \frac{n(n+1)}{2} \]
\[ \sum_{i=1}^n a_i = \left\{\ \begin{array}{l} \frac{a r^{n+1} - a}{r - 1} if r \neq 1 \\ a (n+1) if r = 1\\ \end{array}\right. \]
\[ \sum_{i=1}^n a_i = \frac{n(n+1)}{2} \]
\[ \sum_{i=1}^n a_i^2 = \frac{n(n+1)(2n+1)}{6} \]
\[ \sum_{i=1}^n a_i^3 = \frac{n^2(n+1)^2}{4} \]
\[ \sum_{k=0}^\infty x^k = \frac{1}{1-x} if |x| < 1 \]
\[ \sum_{k=1}^\infty kx^k = \frac{1}{(1-x)^2} if |x| < 1 \]
Weather | Rain next day | Sunny next day |
---|---|---|
Rain today | 0.60 | 0.40 |
Sunny today | 0.50 | 0.50 |
If it is sunny today, what is the 10 day prediction?
day | rain | sunny | rain | sunny | |
---|---|---|---|---|---|
1 | 0.0000000 | 1.0000000 | 1.0000000 | 0.0000000 | |
2 | 0.5000000 | 0.5000000 | 0.6000000 | 0.4000000 | |
3 | 0.5500000 | 0.4500000 | 0.5600000 | 0.4400000 | |
4 | 0.5550000 | 0.4450000 | 0.5560000 | 0.4440000 | |
5 | 0.5555000 | 0.4445000 | 0.5556000 | 0.4444000 | |
6 | 0.5555500 | 0.4444500 | 0.5555600 | 0.4444400 | |
7 | 0.5555550 | 0.4444450 | 0.5555560 | 0.4444440 | |
8 | 0.5555555 | 0.4444445 | 0.5555556 | 0.4444444 | |
9 | 0.5555556 | 0.4444445 | 0.5555556 | 0.4444444 | |
10 | 0.5555556 | 0.4444444 | 0.5555556 | 0.4444444 |
\[ \begin{array}{|l|cc|} \hline & Rain & Sunshine \\ \hline R_n &.6R_n& .4R_n\\ S_n &.5S_n& .5S_n \\ \hline \end{array} \]
\[ \begin{array}{rcl} R_{n+1} &=& 0.6R_n + .5S_n = R_n\\ S_{n+1} &=& 0.4R_n + .5S_n = S_n\\ 1 &=& R + S\\ \end{array} \]
Solution: \[ R = 5/9; S= 4/9 \]
Current Year | Fresh | Sopho | Junior | Senior | Grad |
---|---|---|---|---|---|
Freshmen | 0.10 | 0.90 | 0.00 | 0.00 | 0.00 |
Sophomore | 0.00 | 0.10 | 0.90 | 0.00 | 0.00 |
Junior | 0.00 | 0.00 | 0.10 | 0.90 | 0.00 |
Senior | 0.00 | 0.00 | 0.00 | 0.10 | 0.90 |
Grad | 0.00 | 0.00 | 0.00 | 0.00 | 1.00 |
Year | Fresh | Sopho | Junior | Senior | Grad |
---|---|---|---|---|---|
1 | 1.0000 | 0.0000 | 0.0000 | 0.0000 | 0.0000 |
2 | 0.1000 | 0.9000 | 0.0000 | 0.0000 | 0.0000 |
3 | 0.0100 | 0.1800 | 0.8100 | 0.0000 | 0.0000 |
4 | 0.0010 | 0.0270 | 0.2440 | 0.7290 | 0.0000 |
5 | 0.0001 | 0.0036 | 0.0486 | 0.2916 | 0.6562 |
6 | 0.0000 | 0.0005 | 0.0081 | 0.0729 | 0.9185 |
7 | 0.0000 | 0.0000 | 0.0012 | 0.0146 | 0.9842 |
8 | 0.0000 | 0.0000 | 0.0002 | 0.0025 | 0.9973 |
9 | 0.0000 | 0.0000 | 0.0000 | 0.0004 | 0.9996 |
10 | 0.0000 | 0.0000 | 0.0000 | 0.0001 | 0.9999 |
Level | 1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|---|
Good (1) | 0 | 1 | 0 | 0 | 0 | 0 |
Moderate (2) | 0 | 23 | 12 | 0 | 0 | 0 |
High (3) | 0 | 8 | 17 | 9 | 0 | 1 |
Very high 4) | 0 | 4 | 4 | 7 | 0 | 0 |
Hazardous (5) | 0 | 0 | 1 | 0 | 0 | 0 |
Extreme (6) | 0 | 0 | 0 | 0 | 1 | 1 |
Level | 1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|---|
Good (1) | 0.000 | 1.000 | 0.000 | 0.000 | 0.000 | 0.000 |
Moderate (2) | 0.000 | 0.657 | 0.343 | 0.000 | 0.000 | 0.000 |
High (3) | 0.000 | 0.229 | 0.486 | 0.257 | 0.000 | 0.028 |
Very high 4) | 0.000 | 0.267 | 0.267 | 0.466 | 0.000 | 0.000 |
Hazardous (5) | 0.000 | 0.000 | 1.000 | 0.000 | 0.000 | 0.000 |
Extreme (6) | 0.000 | 0.000 | 0.000 | 0.000 | 0.500 | 0.500 |
Equalibrium Polution
12=>{3=>1.00},
22=>{2=>0.652,3=>0.348},
23=>{2=>0.231,3=>0.461,4=>0.308},
32=>{2=>0.625,3=>0.375},
33=>{2=>0.235,3=>0.471,4=>0.235,6=>0.059},
34=>{2=>0.2,3=>0.3,4=>0.4,6=>0.1},
36=>{5=>1.0},
42=>{2=>0.75,3=>0.25},
43=>{2=>0.25,3=>0.5,4=>0.25},
44=>{2=>0.4,3=>0.2,4=>0.4},
46=>{5=>1.0},
53=>{3=>1.00},
55=>{3=>1.00},
65=>{3=>0.5,5=>0.5}}}
class Stoichastic
attr_accessor :connect, :last, :current
def initialize(list,start1,start2)
@connect =list
@last=start1
@current = start2
end
def rotate(val)
@last = @current
@current = val
end
end
def next
choices = @connect[10*@last+@current]
r = rand()
rsum = 0
k = choices.keys
while rsum < r do
kk = k.shift
rsum = rsum + choices[kk]
if rsum >= r
return rotate(kk)
end
end
end
s = Stoichastic.new({
12=>{3=>1.00}, 22=>{2=>0.652,3=>0.348},
23=>{2=>0.231,3=>0.461,4=>0.308},
32=>{2=>0.625,3=>0.375}, 6=>0.059},
33=>{2=>0.235,3=>0.471,4=>0.235,
34=>{2=>0.2,3=>0.3,4=>0.4,6=>0.1},
36=>{5=>1.0}, 42=>{2=>0.75,3=>0.25},
43=>{2=>0.25,3=>0.5,4=>0.25},
44=>{2=>0.4,3=>0.2,4=>0.4},
46=>{5=>1.0}, 65=>{3=>0.5,5=>0.5}
55=>{3=>1.00}, 53=>{3=>1.00}, },1,2)
(1..400).each {|i|
puts "#{s.next}"
}
\[ \tiny\begin{array}{lcccccc} State & 1st & 2nd & 3rd & 4th & Grd & With & Retir \\ \hline 1st & 0.1 & 0.7 & 0.0 & 0.0 & 0.0 & 0.2&0.0 \\ 2nd & 0.1 & 0.8 & 0.0 & 0.0 & 0.1 &0.0 & 0.0 \\ 3rd & 0.0 & 0.0 & 0.1 & 0.8 & 0.0 & 0.1 &0.0 \\ 4th & 0.0 & 0.0 & 0.0 & 0.1 & 0.8 & 0.1 &0.0 \\ Grad & 0.0& 0.0 & 0.0 & 0.0 & 1.0 & 0.0& 0.0 \\ With & 0.001&0.0& 0.0 & 0.0 & 0.0 &0.009& 0.99\\ Retire & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 &1.0\\ \hline \end{array} \]
Yr | 1st | 2nd | 3rd | 4th | Grad | With | Retire |
---|---|---|---|---|---|---|---|
1 | 1000 | 0 | 0 | 0 | 0 | 0 | 0 |
2 | 100 | 700 | 0 | 0 | 0 | 200 | 0 |
3 | 10 | 140 | 560 | 0 | 0 | 92 | 198 |
4 | 1 | 21 | 168 | 448 | 0 | 73 | 289 |
5 | 0 | 3 | 34 | 179 | 358 | 65 | 361 |
6 | 0 | 0 | 6 | 45 | 502 | 22 | 425 |
7 | 0 | 0 | 1 | 9 | 538 | 5 | 447 |
8 | 0 | 0 | 0 | 2 | 545 | 1 | 452 |
9 | 0 | 0 | 0 | 0 | 547 | 0 | 453 |
State | 0 Next | 1 Next |
---|---|---|
0 | 0.5 | 0.5 |
1 | 0.5 | 0.5 |
\[ \begin{array}{ll} Pattern & Probability\\ 1 & 0.5 \\ 11 & 0.25 \\ 111 & 0.125 \\ 1111 & 0.0625 \\ 11111 & 0.03125 \\ 111111 & 0.015625 \\ \end{array} \]
ID | RANDOM STRING | Run length tallies | Ave Run Len |
---|---|---|---|
1 | 110000001101111001000101100001 | 1-4,2-3,3-1,4-2,6-1 | 2.31 +/- 1.54 |
2 | 001010101000101100011001000001 | 1-11,2-4,3-2,5-1 | 1.67 +/- 1.08 |
3 | 011110000011001111000000011010 | 1-4,2-3,4-2,7-1 | 2.73 +/- 2.00 |
4 | 110101101001011011111100001011 | 1-10,2-5,4-1,6-1 | 1.76 +/- 1.35 |
5 | 001111111001111001110000001001 | 1-2,2-4,6-1,7-1 | 3.00 +/- 2.05 |
6 | 011100000101000110000010001100 | 1-5,2-3,3-3,5-2 | 2.31 +/- 1.43 |