19: Use two colors to dye the six pieces in a circle. If you get them through rotation, you can only calculate one of them. How many kinds of dyeing are there:
A: 10 B: 11 C: 14: D: 15
Answer: c
Explanation: there should be 14 solutions with only black and white colors by default. Then, P (n) indicates that there are n black games.
P (0) = P (6) = 1
P (1) = P (5) = 1
P (2) = P (4) = 3 // adjacent, one separated, one of two
P (3) = 4 // one adjacent to each other, one of bb0b, one of bb00b, And one of b0b0b. A total of four
24: assume that the rand_k function returns a random number (k> = 2) between [1, K] at random, and each certificate has the same probability. Currently, rand_7 is available. By calling rand_7 () and four Arithmetic Operators and adding logical judgment and cyclic control logic as appropriate, the following functions can be implemented:
A: rand_3 B: rand_21 C: rand_23 D: rand_49
Answer: ABCD
Explanation: for direct truncation of rand_x (x <7), as long as the number of Rand is greater than X, the probability of rand_x is equal. For others, use 7 × RAND _ 7 + rand_7. You can use-7 to get rand_49. Then, split it into rand_42 and divide it by 2. Then, rand_21 is used.
19: Use two colors to dye the six pieces in a circle. If you get them through rotation, you can only calculate one of them. How many kinds of dyeing are there: