5.5 #18,22,24,25
5.6 #6,22,24
5.5 #18. We're summing over all subsets except the empty set, so 2^10 - 1
= 1023.
#22. Our base case is the n=2 case: |A U B| = |A| + |B| - |A intersect B|.
If we break A into (A int B) and A\B, and B into (A int B) and B\A,
then this is |A U B| = |A\B U (A int B) U B\A| = |A\B| + |A int B| + |B\A|
= |A| + |B| - |A int B|.
More generally, A_1 U A_2 U .. U A_n = (A_1 U A_2 U .. U A_{n-1}) U A_n.
By the n=2 case we know this is
|A_1 U A_2 U .. U A_{n-1}| + |A_n| - |(A_1 U A_2 U .. U A_{n-1}) int A_n|.
What is this last set? It's things in any of the first n-1 A_i's, and
also in A_n. I claim we can rewrite it as
(A_1 int A_n) U (A_2 int A_n) U .. U (A_{n-1} int A_n)
checking the containment in A_n at every step. We can calculate the size
of this by induction (it's only got n-1 terms unioned together):
|A_1 int A_n| + |A_2 int A_n| + ...
- |(A_1 int A_n) int (A_2 int A_n)| - ...
+ |(A_1 int A_n) int (A_2 int A_n) int (A_3 int A_n)| + ...
...
Now we use the rewriting argument in reverse, to say that this is
|A_1 int A_n| + |A_2 int A_n| + ...
- |A_1 int A_2 int A_n| - ...
+ |A_1 int A_2 int A_3 int A_n| + ...
...
Okay, back to our actual answer, which you may remember looked like this:
|A_1 U A_2 U .. U A_{n-1}| + |A_n| - |(A_1 U A_2 U .. U A_{n-1}) int A_n|
By induction, we know how to rewrite this first part: we get an alternating
sum of these intersections, never involving A_n. Then we get the A_n alone
term. Then (by the analysis just finished) the last part expands into an
alternating sum of intersections, all involving A_n. So we get every term
we wanted in the inclusion-exclusion formula for n things, exactly once,
and with the correct sign.
#24. Probability of coin flipped 5 times, such that
|A| + |B| + |C| - |A int B| - |A int C| - |B int C| + |A int B int C|
= (5 choose 3) + 2^3 + 2^3
- (5-2 choose 3-2) - 1 - 2^1
+ 1
= 10 + 8 + 8 - 3 - 1 - 2 + 1 = 21.
5.6 #6. The key observation is that if you're divisible by a square,
then you're divisible by the square of a prime (and of course, vice versa).
|Squarefrees|
= |all|
- |those divisible by 2^2| - |by 3^2| - |by 5^2| - |by 7^2| - |by 11^2| etc.
+ |those divisible by 2^2 & 3^2| + |by 2^2 & 5^2| + etc.
...
= 100 - 100/4 - floor(100/9) - 100/25 - floor(100/49) - zeroes
+ floor(100/36) + 100/100 + zeroes
-/+ zeroes
= 100 - 25 - 11 - 4 - 2 + 2 + 1 = 61
(An example of non-baby number theory: the fraction converges to ln(2).)
#22. Rel. prime to pq = |all| - |mults of p| - |mults of q| + |mults of pq|
= pq - q - p + 1 = (p-1)(q-1).
#24. Break up the n! permutations according to how many elements are held
fixed. If k are fixed, then there are (n choose k) choices for which are
the ones fixed, and D_{n-k} ways that the others may be being permuted (since
they can't be fixing any others). So |all permutations| = sum over k,
of (n choose k) times D_{n-k}.