⚡ Build the skills to land top-paying quant jobs. Offer ends in 25d 09h 51m 29s25 days 9 hours 51 minutes 29 seconds.
A machine prints a string made of words, each chosen independently and uniformly at random from the vocabulary {cup, cake, foot, ball}, and joins them without spaces. Adjacent words that form a compound word are merged into a single word: "foot" followed by "ball" becomes the single word "football", and "cup" followed by "cake" becomes the single word "cupcake". No other pair forms a compound.
What is the expected number of words in the final string?
Related Problems