firstnero.blogg.se

Random letter generator writing shakespeare
Random letter generator writing shakespeare








We know that, at least, but we can also show that it is an increasing function of if we have letters, the phrase could appear in the first letters with probability.

random letter generator writing shakespeare

Define as the probability a random string of letters contains a sub-string of letters spelling out our desired phrase. Let be positive integer and consider a fixed phrase of letters in some order we care about. That is, we will show that as where is the aforementioned probability. We will prove that if we have some fixed string of letters (we’ll call this a phrase), and a random string of letters, then the probability the letter string contains the fixed sub-string of letters converges to 100% as is allowed to grow to infinity. But does it work for some sequence of arbitrary length? Can it? Hamlet is about 130,000 words, does it make sense to talk about this? The larger is, the more ways we can have the word `fun’ appear somewhere in our string, which is pretty fun itself. Intuitively we might see why this is true. Now if we had a monkey typing for an infinite amount of type, we are essentially letting Does it now follow that ? In other words, if we let get bigger and bigger, so the probability we see the word `fun’ appear somewhere in the n-string get better and better? So even though the increase in probability is minuscule, there is still an increase. Then we have possible ways to spell `fun’ out of possible ways. In the second case, where X comes last, we also have 26 ways to spell `fun’. Then there is only one choice for the next letter, one choice for the third letter, and one choice for the last letter (`f’, `u’, `n’, respectively). How many total ways can we do this? Well, for `Xfun’, the first letter is irrelevant, so there are 26 possible choices there. We could spell it as `Xfun’, or `funX’, where X is just some random letter. However, if, then we can spell “fun” in several ways. But there is only one way to spell “fun”, so the probability for ends up being. Since there are 26 letters in the alphabet, we have 26 choices for the first letter, 26 for the second letter, and 26 for the third letter to give total choices. To see this, let’s think about how many different strings of length we could make. So, this let’s us conclude that for, we have. In other words, if you give your toddler a bunch of scrabble tiles, and ask her to spell out some random words for grandma, there is a non-zero probability your toddler is about to embarrass you. But when, then is meaningful, since there is a non-zero probability this could happen. There is at least one way a random sequence of 10 letters could spell out “fun” somewhere in the middle. We can see pretty clearly that if, then, since there aren’t enough letters to actually spell our word “fun”.

random letter generator writing shakespeare

For example, take, and let our phrase be the word “fun”, then is the probability that 10 random letters spells out the word “fun” somewhere inside. Let be the probability that the letters have substring of consecutive letters that spell out some phrase we care about. We can reframe the infinite-monkey theorem as follows: Consider a random string of letters, where is a positive integer. Sorry casual reader, this post is more gobbledy-gook, but I think it’s intuitive gobbledy-gook. “Okay, blah-blah-blah, the theorem is true, I’m getting a Starbucks.” I can relate, much of my undergrad felt that way. You can read wikipedia about this theorem and almost surely you’ll find a bunch of gobbledy-gook and precise computations that are meaningless to the casual reader. Human’s aren’t really good at imagining things that are infinite, so while the saying appeals to some sense of intuition that we have about rare events eventually happening given a long enough time frame, it’s hard to imagine how randomly typing on a keyboard would eventually produce a coherent work of art. Take an immortal monkey, and have it bang on a typewriter from now until the end of time, then eventually the monkey would produce the complete works of Shakespeare.










Random letter generator writing shakespeare