Probability and Statistics 201-SN1-RE • CEGEP, Montreal
Corrected exercises: counting (201-SN1-RE)
Here are ten corrected counting exercises from 201-SN1-RE, Probability and Statistics, the probability and statistics course of the CEGEP Science program (Sciences de la nature), preceded by a list of direct calculations.
What the set covers, the traps it targets
They cover the multiplication principle and the addition principle, factorial notation, permutations, including permutations of identical objects, arrangements and combinations, set operations and the Venn diagram, the inclusion-exclusion principle, Pascal's triangle, the binomial theorem and probability computed by counting.
By the end of the series, you can choose between permutation, arrangement and combination (exercises 2 and 3), count “at least one” through the complement (exercises 1 and 3), count overlapping sets (exercises 4 and 10), read a binomial coefficient (exercise 5), prove Pascal's identity and the binomial theorem by a counting argument and algebraically (exercise 6), and compare two fictitious lotteries (exercise 7). The situations come from the natural sciences: bottle codes of a field campaign, the autosampler of a chromatograph, a culture microplate, larvae that indicate water quality, a chain of spins, DNA sequences and the screening of additives.
The pitfalls treated in detail: the double count of “at least one zero” (exercise 1), the forgotten block and “before” read as “right before” (exercise 2), dividing by 4! by mistake (exercise 3), a sum of counts that exceeds the number of stations without the data being wrong (exercise 4), the sign of a binomial coefficient (exercise 5) and unnamed teams counted six times (exercise 8).
The thread of the series: counting starts by writing the sentence that says when two outcomes are the same (does order matter, can an object come back, can two objects be told apart?), then checking that each outcome is counted once and only once. The formula comes after that sentence, never before. Work through each exercise completely before opening the solution.
•MULTIPLICATION PRINCIPLE: a construction in steps offering n1,n2,…,np choices gives n1×n2×⋯×np outcomes, provided the NUMBER of choices at each step does not depend on the earlier choices.
•ADDITION PRINCIPLE: if two families are DISJOINT, ∣A∪B∣=∣A∣+∣B∣. Otherwise, inclusion-exclusion: ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣ and, for three sets, ∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣A∩C∣−∣B∩C∣+∣A∩B∩C∣.
•FACTORIAL AND PERMUTATIONS: n! arrangements of n distinct objects, 0!=1. With identical objects in groups of n1,…,nr: n1!⋯nr!n!.
•ARRANGEMENTS AND COMBINATIONS: k distinct objects out of n, ordered: P(n,k)=(n−k)!n!; unordered: (kn)=k!(n−k)!n!. Link: P(n,k)=k!(kn). With repetition and order: nk.
•CHOOSING THE FORMULA: first write when two outcomes are the same. Does order matter? Can an object come back? Can two objects be told apart? “At least one” is counted through the complement.
•PASCAL AND THE BINOMIAL THEOREM: (kn)=(k−1n−1)+(kn−1), (kn)=(n−kn), and (a+b)n=∑k=0n(kn)an−kbk, so ∑k=0n(kn)=2n.
•PROBABILITY BY COUNTING: P(A)=number of possible casesnumber of favourable cases, only if all the possible cases are EQUALLY LIKELY.
Calculations: factorials, arrangements and combinations
Exercise 0.1: Counting with factorials: twelve direct calculations
12 answers to check
For each line, compute the exact value requested. Course notation: n!=n×(n−1)×⋯×2×1 with 0!=1; P(n,k)=(n−k)!n!, the number of arrangements (ordered selections, or k-permutations), also written A(n,k) or nPk depending on the textbook; C(n,k)=(kn)=k!(n−k)!n!, the number of combinations.
A single move carries the whole list: SIMPLIFY a quotient of factorials before multiplying. (n−k)!n! keeps only the k largest factors of n!, and (kn) further divides that product by k!.
a) 7!
b) 7!10!
c) P(8,3)
d) (410)
e) (1012)
f) Simplify (n−1)!(n+1)!, then give its value for n=9.
g) The number of sequences of 5 bases taken from A, C, G and T, where a base may repeat.
h) The number of ways to arrange 8 objects in a row, where 3 are identical to one another, 2 others are identical to each other, and the last 3 are distinct.
i) (26)×(14)
j) The coefficient of x3 in the expansion of (1+x)7.
k) The integer n≥2 such that (2n)=45.
l) ∣A∪B∣, given that ∣A∣=25, ∣B∣=18 and ∣A∩B∣=7.
Show the solution
Answers
a)7!=5040
b)10×9×8=720
c)8×7×6=336
d)(410)=210
e)(1012)=(212)=66
f)(n+1)n; for n=9: 90
g)45=1024
h)3!2!8!=3360
i)15×4=60
j)(37)=35
k)n=10
l)25+18−7=36
The move that carries the whole list: write the quotient of factorials as a SHORT product before computing anything. Nobody needs to know 10! to compute 7!10!.
a)
7!=7×6×5×4×3×2×1=5040.
b)
10!=10×9×8×7!, so 7!10!=10×9×8=720.
Pitfall: computing 10!=3,628,800 and 7!=5040 separately, then dividing. The result is the same, but with two large numbers to copy without error.
c)
P(8,3)=5!8!=8×7×6=336.
Reading: three ORDERED places, 8 choices for the first, 7 for the second, 6 for the third.
d)
(410)=4×3×2×110×9×8×7=245040=210.
The 5040 arrangements of 4 objects out of 10 fall into bundles of 4!=24 that contain the same objects: each bundle is a single combination.
e)
By symmetry, (1012)=(212)=212×11=66.
Keeping 10 objects out of 12 is exactly deciding which 2 to leave out: the two choices match up one to one.
f)
(n+1)!=(n+1)×n×(n−1)!, so (n−1)!(n+1)!=(n+1)n.
For n=9: 10×9=90.
g)
Five places, four choices at each, and the choice at one place does not reduce the next ones: 45=1024.
Pitfall: writing P(4,5). There is no arrangement of 5 distinct objects out of 4; here the bases may repeat, so this is a sequence with repetition.
h)
If the 8 objects were all distinct, there would be 8!=40,320 arrangements.
Swapping the 3 identical objects among themselves does not change the arrangement (3!=6 ways), and neither does swapping the other 2 (2!=2 ways): each visible arrangement has been counted 6×2=12 times.
3!2!8!=1240,320=3360.
i)
(26)=15 and (14)=4: two choices made one after the other multiply, 15×4=60.
j)
The x3 term of (1+x)7 is (37)14x3, so the coefficient is (37)=67×6×5=35.
k)
(2n)=2n(n−1)=45 gives n(n−1)=90=10×9, so n=10.
The equation n2−n−90=0 also has the root n=−9, rejected: n is a number of objects.
The 7 common elements belong to both sets: the sum 25+18 counts them twice, so we remove them once.
Points are earned before the solution; after it, you can keep practising.
For you:
Tick the exercises you have done or want to review: a free account, no password, keeps your ticks and your right answers from one visit to the next, tells you which chapter to tackle next and lets you ask for the exercise you are missing. Create your space, an email is enough.
Part A: the basics (/50)
Exercise 1: Multiplication and addition principles: the bottle codes of a field campaign
6 answers to check
A limnology team samples water across a network of eight stations, named A to H. Each bottle gets a code made of the letter of its station followed by three digits from 0 to 9, for example C407 (figure). Two codes are different as soon as they differ in a single character, in the same place.
a) Compute the number of possible codes. Justify with the multiplication principle.
b) The laboratory software rejects a code in which two digits are equal, such as C440. Compute the number of accepted codes.
c) Without the constraint of b), compute the number of codes that contain at least one digit 0.
d) An intern finds 2400 codes in c), by the calculation 8×3×100: he chooses the station, then the place of the 0, then the other two digits. Show that this calculation counts the code C400 twice and the code C000 three times. For ONE station, recover the result of c) by inclusion-exclusion on the events Z1, Z2, Z3: “the digit in place i is a 0”.
e) The laboratory adds 100 blank codes, from BL00 to BL99. Compute the total number of different labels, including the codes of a), and justify that the addition principle applies even though the letter B also names a station.
f) Next year's campaign plans 25,000 bottles on the same eight stations. Determine the smallest number of digits to put after the letter so that every bottle has a different code.
Show the solution
Answers
a)8×10×10×10=8000 codes
b)8×10×9×8=5760 codes
c)8×(1000−729)=2168 codes
d)C400 counted 2 times, C000 3 times; 300−30+1=271 codes per station
e)8000+100=8100 labels: the two families are disjoint
f)4 digits: 8×104=80,000≥25,000, whereas 8×103=8000 is not enough
a)
A code is built in four steps: the letter (8 choices), then the first digit (10 choices), the second (10), the third (10).
The number of choices at a step does not depend on the earlier choices: the multiplication principle applies.
8×10×10×10=8000 codes.
b)
The digits must be distinct: 10 choices for the first, 9 for the second (anything but the first), 8 for the third.
8×10×9×8=5760 accepted codes.
The NUMBER of choices at each step stays fixed, even though the LIST of choices depends on the earlier steps: that is all the multiplication principle requires.
c)
“At least one 0” combines three cases (one, two or three zeros): go through the complement, “no 0”.
Codes with no 0 at all: 8×9×9×9=8×729=5832.
Codes with at least one 0: 8000−5832=2168.
d)
The calculation 8×3×100 produces C400 twice: by choosing the 0 in the second place and then “0” for the third, and by choosing the 0 in the third place and then “0” for the second. It produces C000 three times, once per chosen place.
For one station, each event Zi contains 10×10=100 codes, each intersection Zi∩Zj contains 10, and Z1∩Z2∩Z3 a single one.
∣Z1∪Z2∪Z3∣=3×100−3×10+1=271.
Check: 8×271=2168, the result of c). The diagram in the solution shows the eight regions: 3×81+3×9+1=271 and 729 codes with no 0.
Pitfall:300 is not wrong by accident, it weights each code by its number of zeros, 243×1+27×2+1×3=300. Counting means counting each code ONCE.
e)
A station code has a digit in second position, a blank code has the letter L: no label is in both families, not even BL07 and B407.
The two families are disjoint, so the addition principle applies: 8000+100=8100 labels.
The addition principle does not require the families to “look little alike”, it requires them to have NO element in common; that is what had to be checked.
f)
With k digits, there are 8×10k codes. At least 25,000 are needed: 10k≥3125.
k=3 gives 8000 codes, not enough; k=4 gives 80,000 codes. The smallest number of digits is 4.
One more digit multiplies the capacity by 10, which leaves room for the following years.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 2: Permutations and arrangements: the injection order on a chromatograph
8 answers to check
A gas chromatograph is fitted with an autosampler that injects the vials one after the other, in the order of positions 1 to 9. To measure pesticide residues in farm soils, nine distinct vials are loaded: a blank B (pure solvent), two standards E1 and E2 of different concentrations, and six soil extracts S1 to S6. An injection order is a way of placing the nine vials in the nine positions (figure).
a) Compute the number of possible injection orders, with no constraint. Write it with factorial notation.
b) The protocol puts the blank in position 1, to check that the column is clean. Compute the number of possible orders.
c) With the blank in position 1, we also want the two standards injected one right after the other, in either order. Compute the number of possible orders.
d) With the blank in position 1, deduce from b) and c) the number of orders in which the two standards are NOT next to each other.
e) With the blank in position 1, we only want E1 injected before E2, adjacent or not. Show with a symmetry argument that half of the orders of b) qualify.
f) On a day of breakdown, only 4 positions of the autosampler work. Four of the 6 soil extracts are placed there. Compute the number of ways to fill the 4 positions, then the number of ways to choose the 4 extracts if the order did not matter. Explain the ratio between the two numbers.
Show the solution
Answers
a)9!=362,880 orders
b)8!=40,320 orders
c)2×7!=10,080 orders
d)40,320−10,080=30,240 orders
e)28!=20,160 orders
f)P(6,4)=360; (46)=15; ratio 24=4!
a)
The nine vials are distinct and all placed: this is a permutation of 9 objects.
9 choices for position 1, 8 for position 2, and so on: 9!=362,880 orders.
b)
Position 1 is fixed. The other 8 vials remain to be arranged in positions 2 to 9: 8!=40,320 orders.
c)
Glue E1 and E2 into a single block. After the blank, 7 objects remain to be arranged: the block and the 6 extracts, giving 7!=5040 arrangements.
Inside the block, two orders: E1E2 or E2E1. Total: 2×7!=10,080 orders.
The solution figure shows one of these orders: the block occupies positions 4 and 5.
Pitfall: forgetting the factor 2 of the block, or arranging 8 objects instead of 7. The block REPLACES two vials, it is not added to them.
d)
The orders of b) split into two disjoint families: standards adjacent or not. Through the complement:
40,320−10,080=30,240 orders in which the standards are not adjacent.
Counting the non-adjacent positions directly is possible but longer; the complement avoids forgetting a case.
e)
Swapping the labels E1 and E2 turns an order where E1 comes before E2 into an order where E2 comes before E1, and vice versa.
This swap pairs the orders two by two, without missing any or counting any twice: the two families therefore have the same number of elements.
28!=20,160 orders in which E1 comes before E2.
Pitfall: answering 10,080 as in c). “Before” does not mean “right before”.
f)
The positions are numbered: filling positions 1 to 4 with 4 distinct extracts is an arrangement, P(6,4)=6×5×4×3=360.
If the order did not matter, we would only choose a group of 4 extracts: (46)=15.
Ratio: 15360=24=4!. Each group of 4 extracts can be arranged in 4! ways in the 4 positions: P(6,4)=4!×(46).
This is the link between arrangements and combinations: first decide WHICH objects, then in WHAT ORDER.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 3: Combinations: choosing wells on a 24-well microplate
8 answers to check
A microbiologist grows bacterial strains isolated from a forest soil on a 24-well plate, with rows A to D and columns 1 to 6 (figure). Each well receives at most one deposit. For each question, start by saying whether the order of the chosen wells matters.
a) She chooses 4 wells that will receive a sterile medium, used as controls. The 4 control deposits are identical. Compute the number of possible choices.
b) For another experiment, on an empty plate, she places 4 different strains, labelled s1 to s4, in 4 wells. Compute the number of possible placements, then the ratio between this number and that of a). Explain this ratio.
c) Compute the number of choices of 4 control wells that all lie in the same row.
d) To limit cross-contamination, she wants 4 control wells in 4 different rows AND 4 different columns. Compute the number of possible choices.
e) Compute the number of choices of 4 control wells of which at least one lies in row A.
f) The edge wells (rows A and D, columns 1 and 6) evaporate faster. Compute the number of wells that are not on the edge, then the number of choices of 4 control wells taken from them.
Show the solution
Answers
a)(424)=10,626 choices
b)P(24,4)=255,024 placements; ratio 24=4!
c)4×(46)=60 choices
d)6×5×4×3=360 choices
e)10,626−3060=7566 choices
f)2×4=8 wells; (48)=70 choices
a)
The 4 controls are identical: only the SET of chosen wells matters, not the order in which they are chosen. This is a combination.
The strains are different: putting s1 in A1 and s2 in B3 is not the same as the reverse. This is an arrangement.
P(24,4)=24×23×22×21=255,024 placements.
Ratio: 10,626255,024=24=4!. Each choice of 4 wells from a) takes the 4 strains in 4! ways.
The thread of the series: the same plate, the same wells, but two outcomes are “the same” only in a). The sentence that says so comes before the formula.
c)
Two steps: choose the row (4 ways), then 4 wells among the 6 of that row, (46)=15 ways.
4×15=60 choices. Two different rows give different choices, and no choice lies in two rows at once: nothing is counted twice.
d)
There are exactly 4 rows: 4 wells in 4 different rows means ONE well per row.
Such a choice is therefore described by the column of the well in A, that of B, that of C, that of D, all different: 6×5×4×3=P(6,4)=360 choices.
The solution figure shows one of them: A2, B5, C1, D4.
Pitfall: dividing by 4! “because order does not matter”. But the wells were never ordered: the row is a label that already tells the 4 wells apart, and each set of 4 wells is produced only once.
e)
“At least one”: go through the complement, “no well in row A”, that is 4 wells taken from the 18 of rows B, C and D.
(418)=2418×17×16×15=3060, so 10,626−3060=7566 choices.
Pitfall: first choosing “the” well in row A (6 ways), then 3 others among 23. This calculation counts twice a choice with two wells in row A: there is no “designated” well.
f)
Off the edge: rows B and C, columns 2 to 5, that is 2×4=8 wells.
(48)=248×7×6×5=70 choices.
This plan protects the controls, at the cost of far fewer choices: 70 against 10,626.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 4: Set operations: the inventory of pollution-sensitive larvae in a network of streams
5 answers to check
The larvae of mayflies (Ephemeroptera), stoneflies (Plecoptera) and caddisflies (Trichoptera) tolerate pollution poorly: their presence in a stream is a sign of good water quality. An inventory covers 80 sampling stations. Let E, P and T be the sets of stations where each of the three groups was found (figure). Results, fictitious: ∣E∣=52, ∣P∣=31, ∣T∣=45, ∣E∩P∣=24, ∣E∩T∣=33, ∣P∩T∣=19 and ∣E∩P∩T∣=15.
a) Using set operations, write the set of stations where mayflies were found but no stoneflies, then compute its number of elements.
b) Compute, with the inclusion-exclusion formula, the number of stations where at least one of the three groups was found.
c) Deduce the number of stations where none of the three groups was found. Write this set in two ways, using one of De Morgan's laws.
d) Fill in the seven regions of the diagram inside the circles, starting from the center. Compute the number of stations where exactly one of the three groups was found.
e) A station is drawn at random, each station being equally likely to be drawn. Compute the probability that exactly two of the three groups were found there.
f) A technician adds 52+31+45=128 and concludes that the data are wrong, since 128 exceeds 80. Show that his total counts each station as many times as the number of groups it hosts, and recover 128 from the diagram.
Show the solution
Answers
a)E∩P; 52−24=28 stations
b)52+31+45−24−33−19+15=67 stations
c)80−67=13 stations: E∪P∪T=E∩P∩T
d)10+3+8=21 stations
e)809+18+4=8031=0.3875
f)21×1+31×2+15×3=128: each station is counted once per group found
a)
“Mayflies” translates to E, “no stoneflies” to the complement P, and “but” to an intersection: E∩P.
The stations of E split into those in P and those not in P: ∣E∩P∣=∣E∣−∣E∩P∣=52−24=28.
b)
∣E∪P∪T∣=∣E∣+∣P∣+∣T∣−∣E∩P∣−∣E∩T∣−∣P∩T∣+∣E∩P∩T∣
=52+31+45−24−33−19+15=67 stations.
Why the +15: a station in the center is counted 3 times in the first sum, then removed 3 times with the intersections. It must be added back once so that it counts exactly once.
c)
80−67=13 stations with none of the three groups.
“No group” is the complement of “at least one group”: E∪P∪T. By De Morgan's law, it is also “neither E, nor P, nor T”: E∩P∩T.
These stations lie outside the three circles, in the rectangle of the 80 stations.
d)
Start from the center, ∣E∩P∩T∣=15, then remove the center from each pairwise intersection:
Then each group alone: E alone 52−9−18−15=10; P alone 31−9−4−15=3; T alone 45−18−4−15=8.
Exactly one group: 10+3+8=21 stations.
Check: 10+3+8+9+18+4+15=67, the result of b).
e)
Exactly two groups: 9+18+4=31 stations. The 80 stations are equally likely, so P=8031=0.3875.
Pitfall: taking 24+33+19=76 stations. These three intersections all contain the 15 stations of the center, which have THREE groups.
f)
In the sum ∣E∣+∣P∣+∣T∣, a station is counted once for each set that contains it.
The 21 stations with one group count 1 time, the 31 with two groups 2 times, the 15 with three groups 3 times, the 13 with no group 0 times:
21×1+31×2+15×3=21+62+45=128.
The total 128 is therefore not a number of stations, and it has no reason to be less than 80: the data are consistent.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 5: Pascal's triangle and the binomial theorem: expanding and reading a coefficient
9 answers to check
The figure gives rows 0 to 6 of Pascal's triangle: row n contains (0n),(1n),…,(nn). Row 7 is to be completed. Recall the binomial theorem, for every integer n≥1: (a+b)n=∑k=0n(kn)an−kbk.
a) Complete row 7 using the relation (kn)=(k−1n−1)+(kn−1), then give (37).
b) Expand (a+b)4 by reading row 4, and give the coefficient of a2b2.
c) Compute the coefficient of x3 in the expansion of (2x−1)5.
d) Compute the coefficient of x2 in the expansion of (2x−1)5.
e) Compute the term independent of x in the expansion of (x2+x3)6, for x=0.
f) Apply the binomial theorem with a=b=1, then with a=1 and b=−1, to compute the sum, then the alternating sum (07)−(17)+⋯−(77), of the numbers in row 7. Check on the completed row.
g) In a simple model, a seabird colony grows by 2% per year: its size is multiplied by (1.02)10 in ten years. Estimate (1.02)10=(1+0.02)10 with the first three terms of the binomial expansion, then compare with the value given by the calculator.
Show the solution
Answers
a)Row 7: 1,7,21,35,35,21,7,1; (37)=35
b)a4+4a3b+6a2b2+4ab3+b4; coefficient 6
c)(25)×23×(−1)2=80
d)(35)×22×(−1)3=−40
e)k=4: (46)×34=1215
f)27=128 and 07=0
g)1+0.2+0.018=1.218; calculator 1.219 (difference less than 0.001)
a)
Each inner number of row 7 is the sum of the two numbers just above it in row 6, and each row starts and ends with 1:
The first three terms give 1+0.2+0.018=1.218. The calculator gives (1.02)10≈1.21899, that is 1.219 to the nearest thousandth.
The difference comes mostly from the fourth term, (310)0.023=120×0.000008≈0.00096: the following terms quickly become negligible because 0.02 is small.
Pitfall: the “simple” growth 1+10×0.02=1.2 forgets the compounding, the (210) term: the population grows by nearly 22%, not 20%.
Points are earned before the solution; after it, you can keep practising.
For you:
Part B: problems and reasoning (/50)
Exercise 6: Proving by counting: spin configurations, Pascal's identity and the binomial theorem
4 answers to check
In a simple model of a magnetic material, a chain of n atoms each carries a spin pointing up or down. A configuration is the list of the orientations of the n spins, from the first to the last: the figure shows one for n=6. Let k be the number of spins pointing up and M=k−(n−k)=2k−n the magnetization of the chain, in units of the moment of one spin.
a) Compute the number of configurations of a chain of 6 spins, then the number of those with exactly 2 spins up.
b) Show that, for a chain of n spins, the number of configurations with exactly k spins up is (kn), then that it equals the number of configurations with exactly k spins down. Deduce that (kn)=(n−kn).
c) For 1≤k≤n−1, prove Pascal's identity (kn)=(k−1n−1)+(kn−1) by sorting the configurations with k spins up according to the orientation of the LAST spin.
d) Prove the same identity algebraically, starting from (kn)=k!(n−k)!n!.
e) Prove the binomial theorem (x+y)n=∑k=0n(kn)xkyn−k by expanding the product of the n factors (x+y), then deduce that ∑k=0n(kn)=2n. Interpret this equality in terms of configurations.
f) For a chain of 10 spins with no external magnetic field, assume that the 210 configurations are equally likely (independent spins, each up or down with the same probability). Compute the probability that the magnetization is zero, then the probability that M≥6.
Show the solution
Answers
a)26=64 configurations; (26)=15 with 2 spins up
b)A configuration with k spins up = a choice of k positions out of n; the complementary choice gives (kn)=(n−kn)
e)A term of the expansion = a choice of x or y in each factor; (1+1)n=2n configurations
f)1024252≈0.2461; 102456≈0.0547
a)
Each spin has 2 orientations, independently of the others: 26=64 configurations.
A configuration with 2 spins up is determined by the POSITIONS of these 2 spins, chosen out of 6, without order: (26)=15. Its magnetization is M=2×2−6=−2.
Pitfall:P(6,2)=30. Choosing “position 1 then position 4” or “position 4 then position 1” gives the same configuration.
b)
A configuration with k spins up is completely determined by the set of positions of its up spins, and that set can be any k-element subset of {1,…,n}. There are therefore (kn) such configurations.
Having exactly k spins up means having exactly n−k spins down: the two families are the SAME family, described by its up spins or by its down spins.
Counting this family by the positions of the down spins gives (n−kn). The same set counted in two ways gives the same number: (kn)=(n−kn).
This is a proof by double counting: no calculation, only a one-to-one correspondence.
c)
Let 1≤k≤n−1. The configurations with k spins up split into two families, according to the last spin.
Last spin up: the first n−1 spins carry exactly k−1 spins up, giving (k−1n−1) configurations.
Last spin down: the first n−1 spins carry exactly k spins up, giving (kn−1) configurations.
The two families are disjoint (the last spin has only one orientation) and together they contain all the configurations: the addition principle applies.
(kn)=(k−1n−1)+(kn−1).
The condition 1≤k≤n−1 guarantees that k−1≥0 and k≤n−1: both numbers on the right make sense.
d)
Put the two fractions over the common denominator k!(n−k)!, using k!=k(k−1)! and (n−k)!=(n−k)(n−1−k)!:
The two proofs complement each other: the calculation proves, the counting explains why the identity is true.
e)
(x+y)n=(x+y)(x+y)⋯(x+y), with n factors. Expanding means choosing in EACH factor either x or y, then multiplying the choices: this gives 2n products, one per sequence of choices.
Match “x” with a spin up and “y” with a spin down: each product corresponds to a configuration.
A product equals xkyn−k exactly when k factors supplied x: by b), there are (kn) of them. Grouping equal products:
(x+y)n=∑k=0n(kn)xkyn−k.
With x=y=1: ∑k=0n(kn)=(1+1)n=2n.
Interpretation: all the configurations are counted in two ways, spin by spin (2n), or by sorting them according to their number k of spins up (the sum of the (kn)).
f)
M=0 means 2k−10=0, that is k=5: P(M=0)=210(510)=1024252≈0.2461.
M≥6 means 2k−10≥6, that is k≥8: (810)+(910)+(1010)=45+10+1=56 configurations, and P(M≥6)=102456≈0.0547.
The diagram in the solution shows why: the configurations pile up around M=0. In this model, a strong magnetization is rare because it corresponds to few configurations, not because one particular configuration would be less likely than another.
Pitfall: saying “M=0 has a one-in-11 chance” because M takes 11 values. The 11 values of M are not equally likely; the 1024 configurations are.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 7: Comparing two fictitious lotteries: probability by counting
11 answers to check
To fund a sampling campaign in the Arctic, a student association is hesitating between two lotteries, invented for the exercise (figure). Tickets cost the same price, and in each lottery the draw is random, all possible outcomes being equally likely.
Boreal lottery: the player marks 6 distinct numbers from 1 to 40, and the draw selects 6 numbers. Jackpot for the 6 right numbers; small prize for exactly 4 or 5 right numbers.
Tundra lottery: the player writes 4 distinct numbers from 1 to 30, in an order, and the draw produces 4 numbers one after the other. Jackpot for the 4 right numbers in the order of the draw; small prize for the 4 right numbers in another order.
a) Compute the number of different tickets of the Boreal lottery, then of the Tundra lottery. Each time, justify the choice between combination and arrangement.
b) Compute the probability of the jackpot in each lottery, as a fraction or in scientific notation with three significant figures, then the ratio of the larger to the smaller.
c) Show that in the Boreal lottery, the number of tickets with exactly k right numbers is (k6)(6−k34). Compute it for k=4 and for k=5.
d) Compute the probability of winning a prize, jackpot or small, in each lottery, as a fraction or with three significant figures.
e) Check that ∑k=06(k6)(6−k34)=(640), and explain what this equality expresses.
f) Write a recommendation for the association: which lottery gives the better chance of the jackpot, which one makes players win a prize more often? Say what information is missing to compare the average winnings of a ticket.
Show the solution
Answers
a)Boreal (640)=3,838,380; Tundra P(30,4)=657,720
b)3,838,3801≈2.61×10−7; 657,7201≈1.52×10−6; ratio ≈5.84
e)Sum =3,838,380: each ticket has a number of right numbers, and only one
f)Tundra for the jackpot (about 5.8 times more likely); Boreal for any prize (about 62 times more likely); the prize amounts are missing
a)
Boreal: the player marks a SET of 6 numbers, and a ticket does not depend on the order in which they are marked. This is a combination: (640)=6!40×39×38×37×36×35=3,838,380 tickets.
Tundra: the order is part of the ticket, 17-4-29-12 and 4-17-29-12 are two different tickets. This is an arrangement: P(30,4)=30×29×28×27=657,720 tickets.
b)
Only one ticket wins the jackpot, and all outcomes are equally likely:
pB=3,838,3801≈2.61×10−7 and pT=657,7201≈1.52×10−6.
Ratio: pBpT=657,7203,838,380≈5.84. The Tundra jackpot is about 5.8 times more likely.
Pitfall: believing Tundra is harder “because order matters”. Order does multiply the number of tickets by 4!, but there are fewer numbers to choose from, and fewer numbers to find.
c)
A ticket with exactly k right numbers is built in two steps: choose its k right numbers among the 6 drawn, (k6) ways, then its 6−k other numbers among the 34 not drawn, (6−k34) ways.
Boreal: 8415+204+1=8620 winning tickets, so P=3,838,3808620≈2.25×10−3.
Tundra: a ticket wins if it holds the 4 right numbers, in the order of the draw (1 ticket) or in another order (4!−1=23 tickets), that is 24 tickets: P=657,72024=27,4051≈3.65×10−5.
Check: 27,4051=(430)1. Winning a prize at Tundra only means finding the right SET of 4 numbers: the order only decides which prize.
e)
The terms are (634)=1,344,904 (k=0), 6×(534)=1,669,536 (k=1), 15×(434)=695,640 (k=2), 20×(334)=119,680 (k=3), then 8415, 204 and 1.
Their sum is 3,838,380=(640).
This equality expresses that the families “exactly k right numbers”, for k from 0 to 6, are disjoint and together contain each ticket once: it is the addition principle, and an excellent check of all the calculations of c).
f)
Recommendation: to give players the best chance of the JACKPOT, Tundra; to make them win a prize most often, Boreal, since 3.65×10−52.25×10−3≈62.
In both cases, the probability stays very small: about one winning ticket in 445 at Boreal, one in 27,405 at Tundra.
The AMOUNT of each prize is missing: the average winnings of a ticket are computed by weighting each amount by its probability, the expected value, a tool of the chapter on random variables.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 8: Five claims to correct
5 answers to check
Each of the following five claims is FALSE. Say why in one or two sentences, then give the correct number requested.
a) “To form a field team of 3 students out of 10, with no assigned roles, there are 10×9×8=720 possible teams.” Give the correct number of teams.
b) “In a forest inventory, 34 plots host sugar maple and 27 host yellow birch; so 61 plots host at least one of the two species.” Given that 12 plots host both, give the correct number.
c) “With the five bases A, A, C, C, G, we can write 5!=120 different sequences of length 5.” Give the correct number of sequences.
d) “Since 15>10, there are more ways to choose 15 species out of 20 for an inventory than to choose 10 out of 20.” Give the number of ways to choose 15 species out of 20.
e) “To split 12 students into 3 field teams of 4, the teams having neither a name nor an assigned sector, there are (412)(48)(44)=34,650 splits.” Give the correct number of splits.
Show the solution
Answers
a)(310)=120 teams
b)34+27−12=49 plots
c)2!2!5!=30 sequences
d)(1520)=(520)=15,504, far fewer than (1020)=184,756
e)3!34,650=5775 splits
a)
The calculation 10×9×8 counts ORDERED triples: the team {Léa, Noah, Zoe} appears 3!=6 times in it, once per order of choice. A team with no roles is a set.
Correct number: 3!720=(310)=120 teams.
The calculation 720 would be right for a team with three distinct roles: leader, note-taker, photographer.
b)
The sum ∣A∣+∣B∣ is right only if the two sets are disjoint. Here, the 12 plots that host both species are counted twice.
∣A∪B∣=34+27−12=49 plots.
c)
5! counts the arrangements of five DISTINCT objects. Swapping the two A's, or the two C's, does not change the sequence: each sequence is counted 2!×2!=4 times.
2!2!5!=4120=30 sequences.
Check by positions: place the two A's among 5 places, (25)=10, then the two C's among the 3 remaining places, (23)=3, and the G goes in the last one: 10×3=30.
d)
Choosing the 15 species kept is choosing the 5 left out: (1520)=(520)=15,504.
Yet (1020)=184,756. Along a row of Pascal's triangle, the numbers increase up to the middle and then decrease: (kn) is largest for k=2n when n is even.
Pitfall: reading (kn) as an increasing function of k. The symmetry (kn)=(n−kn) rules that out.
The same split, for example {1,2,3,4}, {5,6,7,8}, {9,10,11,12}, is produced 3!=6 times, once per way of numbering the three teams. With no name and no sector, these six numberings are the same split.
3!34,650=5775 splits.
Nuance: as soon as the teams head to three DIFFERENT sectors, the number 34,650 becomes right again. Everything depends on the sentence that says when two splits are “the same”.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 9: Problem: DNA sequences, codons and GC content
10 answers to check
DNA is a sequence of bases chosen from four: adenine (A), cytosine (C), guanine (G) and thymine (T). When a gene is translated, the bases are read in consecutive groups of three, the codons, and each codon stands for one of the 20 amino acids or for a stop signal. The figure shows a 12-base fragment, ATGCAGCTAGCA, read as 4 codons; it contains 4 A, 3 C, 3 G and 2 T.
a) Compute the number of different codons.
b) Show that a code made of groups of 2 bases would not be enough to stand for the 20 amino acids and the stop signal, then determine the smallest group length that is enough.
c) Compute the number of codons made of three different bases, then the number of codons that contain at least two identical bases.
d) Compute the number of 12-base fragments that have the same composition as the one in the figure: 4 A, 3 C, 3 G and 2 T.
e) Among these fragments, compute the number of those that start with the codon ATG. Deduce, as a fraction, the probability that a random rearrangement of the 12 bases of the figure starts with ATG, and check it with a product of probabilities.
f) A student answers 12! in d), “since we are permuting 12 bases”. Compute how many times each fragment is counted in 12!.
g) The GC content of a fragment is the proportion of its bases that are G or C. Compute the number of 12-base fragments, of any composition, whose GC content is exactly 50%. Then compute the probability of this content for a fragment in which each base is drawn at random from the four, independently of the others.
A codon is an ordered sequence of 3 bases, and a base may repeat (AAA is a codon): 4×4×4=43=64 codons.
b)
At least 20+1=21 different words are needed. With groups of 2 bases, there are only 42=16 words: 16<21, the code is not enough.
With groups of 3 bases, 43=64≥21. The smallest length that is enough is therefore 3.
This counting argument was put forward before the genetic code was cracked: it predicted codons of at least three bases, which experiments confirmed. It also shows that the code has room to spare: 64 words for 21 meanings, and several codons stand for the same amino acid.
c)
Three different bases, in an order: P(4,3)=4×3×2=24 codons.
At least two identical bases is the complement: 64−24=40 codons.
Pitfall: counting “at least two identical” directly by choosing the repeated base and then its place; codons such as AAA are then counted several times.
d)
If the 12 bases were all distinguishable, there would be 12! arrangements. Swapping two A's does not change the fragment, nor does swapping two C's, two G's or two T's:
4!3!3!2!12!=1728479,001,600=277,200 fragments.
Another reading, by positions: (412)(38)(35)(22)=495×56×10×1=277,200; choose the places of the A's, then of the C's among the remaining places, and so on.
e)
The first three bases are fixed, A, T and G. That leaves 9 bases to arrange: 3 A, 3 C, 2 G and 1 T.
3!3!2!1!9!=72362,880=5040 fragments.
All rearrangements being equally likely: P=277,2005040=551≈0.0182.
Step-by-step check: the first base is an A with probability 124, then the second a T with 112, then the third a G with 103: 124×112×103=132024=551.
f)
In 12!, a given fragment is produced once for each way of permuting its A's among themselves (4!), its C's (3!), its G's (3!) and its T's (2!).
It is therefore counted 4!×3!×3!×2!=24×6×6×2=1728 times, and 172812!=277,200.
The thread of the series: before the formula, the sentence that says when two arrangements are the same fragment.
g)
A GC content of 50% over 12 bases means exactly 6 bases that are G or C. Choose their 6 places, (612)=924 ways; each receives G or C (2 choices), and each of the other 6 places receives A or T (2 choices).
924×26×26=924×4096=3,784,704 fragments.
There are 412=16,777,216 fragments in all, equally likely in this model: P=16,777,2163,784,704=4096924≈0.2256.
This model of independent, equally likely bases is a reference, not a description of living things: real genomes have GC contents that vary widely from one species to another. It is precisely by comparing a genome with this reference that an unusual composition is spotted.
Pitfall: answering (612) only. That number chooses the places of the G or C bases, but not WHICH base goes there.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 10: Problem: a screening plan for additives on microplates, from counting to a decision
13 answers to check
An environmental chemistry laboratory is looking for a mixture of additives that speeds up the degradation of a textile dye in wastewater. It has eight additives (figure): three iron salts F1, F2, F3, a peroxide H, a reducing agent R and three complexing agents K1, K2, K3.
Each mixture tested contains exactly three different additives; the order of addition is not studied. Each mixture is tested in triplicate, one well per trial, on 24-well plates. This month's budget allows 6 plates.
a) Compute the number of mixtures of three additives, then the number of wells needed to test them all. Is the budget enough?
b) The peroxide H and the reducing agent R must never be in the same well: they react with each other before acting on the dye. Compute the number of mixtures that contain both H and R, then the number of mixtures that respect this rule.
c) The chemist also requires a mixture to contain at least one iron salt, the catalyst of the degradation. Compute the number of mixtures with no iron salt.
d) Compute the number of mixtures that contain both H and R and no iron salt. Deduce, by inclusion-exclusion, the number of mixtures that respect both rules, and represent the situation with a Venn diagram.
e) Compute the number of wells needed for this plan and the number of wells left free on the 6 plates. Conclude: is the plan feasible within the budget?
f) A colleague suggests a full factorial design instead: all possible mixtures, from zero to eight additives, each in a single replicate. Show that this design has 28 mixtures, without listing them, and compute the number of plates it would require.
Show the solution
Answers
a)(38)=56 mixtures, 168 wells >144: no
b)(16)=6 with H and R; 56−6=50 allowed
c)(35)=10 with no iron salt
d)3; 56−(10+6−3)=43 mixtures
e)3×43=129 wells, 144−129=15 free: yes
f)28=256 mixtures, 11 plates
a)
A mixture is a SET of 3 additives out of 8, with no order and no repetition: (38)=68×7×6=56 mixtures.
In triplicate: 3×56=168 wells. The budget gives 6×24=144 wells, and 168>144: the budget is not enough.
b)
A mixture that contains H and R is completed by a third additive taken from the other 6: (16)=6 mixtures.
Mixtures that respect the rule: 56−6=50, that is 150 wells, still more than 144.
c)
With no iron salt, the 3 additives are taken from the other 5, H, R, K1, K2, K3: (35)=10 mixtures.
d)
Let N be the set of mixtures with no iron salt and HR the set of mixtures that contain H and R. A mixture of N∩HR contains H, R and a third additive that is not an iron salt, so K1, K2 or K3: ∣N∩HR∣=3.
Allowed mixtures: 56−13=43. The diagram in the solution shows the regions: 7, 3 and 3 forbidden, 43 allowed.
Direct check: the mixtures with at least one iron salt number 56−10=46; among them, those containing H and R are H, R and an iron salt, that is 3. That leaves 46−3=43.
Pitfall: removing 10+6=16 mixtures and finding 40. The three mixtures H, R, K are forbidden for TWO reasons, but they are removed only once.
Conclusion: the plan that respects both rules is feasible within the budget of 6 plates. The 15 free wells can hold controls, for example the dye alone, which strengthens the interpretation of the results.
The decision comes from counting: without the two chemical rules, the plan would have exceeded the budget by 24 wells.
f)
To form a mixture of the full design, decide for EACH additive whether it is present or absent: 2 choices, 8 times. Multiplication principle: 28=256 mixtures, the empty mixture included.
Another reading: ∑k=08(k8)=28, sorting the mixtures by their number k of additives, like the spin configurations of exercise 6.
Plates: 24256≈10.7, so 11 plates, nearly twice the budget.
This design also tests mixtures that chemistry rules out (H and R together); the restricted plan of d) is both cheaper and better targeted.
Points are earned before the solution; after it, you can keep practising.
Something missing from this set?A type of exercise your teacher gives, a problem you are stuck on, a mistake you spotted: tell me, I read every request.
Sending goes through your free space: that is how I can answer you and tell you when the exercise is added. An email is enough, no password. Create your space.
Rather not create an account? Write to me directly.
This chapter comes back in
The chapters that build on it, later in the year or in the years that follow.
Looking for a probability and statistics tutor in Montreal?
Get in touch for a first session. In counting, almost every error comes from a single question asked badly, the one that says when two outcomes are the same: that is where we start, before any formula.