pes we called LLLW and LWWW actually correspond to four possible unique outcomes: LLLW, LLWL, LWLLL, WLLL; LWWW, WLWW, WWLW, WWWL. The sequence type LLWW is associated with six unique outcomes: LLWW, LWLW, LWWL, WLWL, WWLL, WLLW, while the sequences LLLL and WWWW have only one unique possibility. Most gener- ally, the number of ways of selecting k slots from a sequence of n slots is given by the combinatorial coefficient Ch (see Chapter (9.3) which is also written (*), and where !=1x2x3x X (q is called the factorial of the integer q (by convention, 0!=1). Consistently, we find for LLLW or LWWW the number C1 = 4!/(1!3!) = 4, and for LLWW the number C2 = 4!/(2!2!) = 6. Calling p the probability of winning a single game in the sequence, we can associate is a 61.7% chance of winning one way or another, which looks a reasonable bet. But this number assumes that we play 36 games, regardless of their outcome. The most likely possibility to win is that our number comes once (and only once), which has the probability C36(1/38) (1 - 1/38)35 = 37.2%. In this event, we win 36 tokens, but the price to pay is to lose 35 tokens for the other 35 games. The net result is that, with 61.7% chances and in the most favorable case, we have not gained anything at all! Furthermore, there are 38.3% chances that we lose 36 tokens. The second lesson learnt is the same as the first lesson! Optimal coding and compression Table 9.4 Construction of variable-length block code for the American roulette, considering a succession of n = 4 independent games for which the outcome is lose (L) or win (W). The sequence LLLL (type A) corresponds to four wins, the sequence LLLW (type B) to three losses and one win, and so on. Each sequence type has a probability P1 and a number of ordered possibilities N, yielding a net probability p = Np1. Each ordered possibility is labeled by a block code made of a header and a trailer block. The header is coded with the uniquely decodable word of length HB, which indicates the sequence type. The trailer field has the