Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Mastermind 4.4.4: The game of Mastermind requires players to select a “code” con

ID: 3606391 • Letter: M

Question

Mastermind 4.4.4: The game of Mastermind requires players to select a “code” consisting of a sequence of four pegs, each of which may be of any of six colors: red, green, blue, yellow, white, and black. a) How may different codes are there? b*) How may different codes are there that have two or more pegs of the same color? Hint: This quantity is the difference between the answer to (a) and another easily computed quantity. c) How many codes are there that have no red peg? d*) How many codes are there that have no red peg but have at least two pegs of the same color

Explanation / Answer

a) 6p4 permutations from 6 colors having 4 pegs ==> 360 permutations.

b) Total - having 1 combination atleast i,e. 360-120=240

c) Codes not having red color = 6^4 - P(6,1) = 1290

d) Codes not having red color and having same color = 1290 – 936 = 354