2

By the year 2075, spelling has deteriorated such that the dictionary now defines the spelling of the word “RELIEF” to be any combination (with repetition allowed) of the letters F, L, R, I and E subject to these constraints:

  • The number of letters must not exceed 6;
  • The word must contain at least one L;
  • The word must begin with a string of at least one R’s and end with a string of at least one F’s, and there are no other R’s and F’s;

Questions:

  1. How many spellings are possible? (Hint: You can consider the pattern of R/F’s and the letters in between separately, because the choices for them are independent.)
  2. What is the fifth spelling before RELIEF, in dictionary order?
Red Banana
  • 23,956
  • 20
  • 91
  • 192

1 Answers1

0

Handle the starting/ending strings of R and F separately (they count just by their lengths), and concentrate on the center. This in turn is any string of E, I, L of the appropiate length, but you have to subtract the strings that don't contain L (i.e., only E, I). Splice together the various pieces.

Not really hard to do, but requires careful tracking of the various possibilities.

vonbrand
  • 27,812