Before getting to rivers, let’s figure out where spaces are likely to appear in the (fictional) Fiddlish language, which includes only three- and four-letter words. These words are separated by spaces, but there is no other punctuation. Suppose a line of Fiddlish text is generated such that each next word has a 50 percent chance of being three letters and a 50 percent chance of being four letters.
Suppose a line has many, many, many words. What is the probability that any given character deep into the line is a space?
Let's suppose that we have N≫1 words in a line. Then there would be N−1 spaces, whereas the total length of the line would be L=4F+3T+N−1 characters, where F is the number of four-letter words and T is the number of three-letter words. Since F+T=N, we have L=4F+3(N−F)+N−1=4N+F−1.
Therefore, the expected frequency of spaces in the line, which is equivalent to the probability that any given character deep into the line is a space, is then p=N−1E[L]=N−192N−1→29=22.222…%
No comments:
Post a Comment