Solutions to other tests:
Mathematics for the Digital Age
and
Programming in Python
>>> Second Edition
Test 12
- 1.
- (a) T (b) F (c) T
(d) F (e) T (f) T
- 2.
- (a) F (b) T (c) T
- 3.
- (a) F (b) T (c) T (d) F
- 4.
- B
- 5.
- A
- 6.
- D
- 7.
- D
- 8.
- (a) T (b) T (c) F (d) T
- 9.
- (a) T (b) T (c) T
- 10.
- (a) T (b) T (c) T
(d) F (e) T
|
- 11.
- (a) F (b) T (c) T (d) T
- 12.
- C
- 13.
- (b)
- 14.
- (a) T (b) T (c) F (d) T
- 15.
- C
- 16.
- B
- 17.
- A
- 18.
- A
- 19.
- D
- 20.
- (a), (c)
|
- 21.
- def stretchPolynomial(p, k):
t = 1
i = len(p) - 1
while i >= 0:
p[i] *= t
t *= k
i -= 1
Or:
def stretchPolynomial(p, k):
n = len(p) - 1
for i in range(n):
p[i] *= k**(n-i)
- 22.
- def divideByX(p):
return (p[:-1], p[-1])
- 23.
- 24.
- (a)
(b)
- 25.
- def derivative(p):
n = len(p) - 1
i = 0
while n > 0:
p[i] *= n
n -= 1
i += 1
return p[:-1]
- 26.
- The sum of the numbers in a column is equal to the
number in the next row diagonally to the right.
This is true for the first row: 1 = 1.
If this is true for the n-th row, it must be true
for the (n+1)-th row, too, because in the triangle
each number is equal to the sum of the two numbers in the previous
row: the one above and the one diagonally to the left:
|