kyu_6.color_choice package¶
Submodules¶
kyu_6.color_choice.checkchoose module¶
-
kyu_6.color_choice.checkchoose.
checkchoose
(m: int, n: int) → int[source]¶ Knowing m (number of posters to design), knowing n (total number of available colors), search x (number of colors for each poster so that each poster has a unique combination of colors and the number of combinations is exactly the same as the number of posters). :param m: :param n: :return:
kyu_6.color_choice.test_checkchoose module¶
-
class
kyu_6.color_choice.test_checkchoose.
CheckchooseTestCase
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Testing checkchoose function
-
test_checkchoose
()[source]¶ In mathematics the number of x combinations you can take from a set of n elements is called the binomial coefficient of n and x, or more often n choose x. The formula to compute m = n choose x is: m = n! / (x! * (n - x)!) where ! is the factorial operator.
You are a renowned poster designer and painter. You are asked to provide 6 posters all having the same design each in 2 colors. Posters must all have a different color combination and you have the choice of 4 colors: red, blue, yellow, green. How many colors can you choose for each poster?
-