Solutions to other tests:
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  

Mathematics for the Digital Age
and
Programming in Python


>>> Second Edition

Test 8

1.
(a) T   (b) T   (c) F   (d) F
2.
3·4·2 = 24
3.
35 = 243
4.
10·26·10·26·10·26 = 17,576,000
5.
4·2 = 8
(4 ways to place 2 and 2 ways to place 6.)
6.
6·4 = 24
(6 ways to choose the power of 2 and 4 ways to choose the power of 3 in a divisor.)
7.
30·29·28 = 24360
8.
7! = 5040
9.
4·3 = 12
10.
5·4! = 120
(5 ways to choose a vowel and 4! ways to arrange the letters.)
11.
6! / (3!·2) = 60
(6! ways to arrange the letters divided by the number of ways to rearrange A's and N's.)
12.
32! / (8!·(4!)8) = 59,287,247,761,257,140,625
(32! ways to arrange all teams in order divided by 8! ways to rearrange the 8 groups and by 4! ways to arrange the four teams withing each group of 4.)
13.
8-choose-3 = 8-choose-5 = 56
14.
10-choose-4 = 210
(Choose any 4 digits, then arrange them in the ascending order.)
15.
64-choose-3 · 61-choose-3 = 1,499,487,360
16.
4 + 4 + 4 +2 = 14
(The workshop can start on Monday, Tuesday, Wednesday, or Thursday in any of the first three weeks or on Monday or Tuesday of the fourth week.)
17.
9000 - 9·9·8·7 = 4464
18.
5·20 + 20·5 + 20 + 5 + 1 = 226
(The number of VC + the number of CV + the number of CY + the number of YV + YY, where C stands for any consonant, excluding Y, and V stands for any vowel, excluding Y.)
19.
13·(12·11 / 2)·4·4·4 = 54912
(13 ways to choose a rank for three of a kind; (12·11 / 2) ways to choose ranks for 2 single cards; 4 ways to choose three cards of a given rank, 4 ways to choose one card of a given rank)
20.
(13·12 / 2)·11·6·6·4 = 123552
(4-choose-2 = 6)

21.
98 + 97 + 96 + ... + 2 + 1 = 4851
(98 examples of a + b = 99, etc., one example of a + b = 2)
22.
(m(m+1) / 2) · (n(n+1) / 2)
(On an n by 1 grid, there are n rectangles of length 1, (n-1) rectangles of length 2, etc., for the total of n(n+1) / 2.  On an m by n grid, we need to combine all possible projections to the vertical and horizontal directions.)
23.
4·3·2 + 4·3·2·1 = 48
(Two configurations are possible:
   
There are 4·3·2 ways to assign colors in the first configuration and 4·3·2·1 ways to assign colors in the second configuration.)
24.
2n + 1 leaves.
(Each node, except the top one, is someone's child, so the total number of nodes is 3n + 1 and the total number of leaves is (3n + 1) - n )
25.
99·99 - 66·66 = 5445
(Among 1, 2, ..., 99, 66 numbers are not divisible by 3.)
26.
def printSplits(items): n = len(items) for x in range(2**n): person1 = [] person2 = [] for k in range(n): if x & (1 << k): person1.append(items[k]) else: person2.append(items[k]) print(person1, person2)



Copyright © 2010 by Skylight Publishing