I'm sure most people are familiar with word grid games like Boggle and the newer digital versions Scramble with Friends and Ruzzle.

enter image description here

For anyone not familiar, the idea is to find words by using adjacent tiles. You start from any cell and try to spell a word by dragging up, down, left, right, or diagonal. The board doesn't wrap, and you can't reuse letters you've already selected.

I'm trying to figure out the likelihood of a word appearing on a board given the likelihood of knowing how often individual letters appear. For example, if I know that the letter A appears 9.8% of the time, what is the probability of seeing the word AA?

I know this is fairly simple, but it's been too long since college stats class. (I do have two hokey models, but I'd like to hear from the experts.) I could run a simulation of a million boards and come up with an empirical answer--in fact, someone has--but I'd rather understand why that is. In order to make things simpler, I'd like to ignore two rules that add to the complexity:

  • We can ignore the constraints of how many times a letter can appear on a board. e.g., don't worry about whether there will be enough E's to make the word ELECTEE.
  • We can ignore the fact that letters have to be adjacent. This means we don't have to figure out the likelihood that a letter is a neighbor of another letter that we need for the word

So with that being said, and with the following probabilities

  • A: 0.098
  • E: 0.146
  • R: 0.079
  • S: 0.102
  • T: 0.098
  • C: 0.021

What is the likelihood of a random board containing the word SEE? What about SET? TEAR? What about the rarer CREATES?

  • $\begingroup$ Is the board 4 X 4? Don't we have to know the probabilities of the other letters as well? $\endgroup$ – Geoffrey Critzer Jun 6 '14 at 0:09

I have the probability that a 16 letter board contains at least one S and at least two E's given the frequency probabilities above is: .565135

nn = 16; nn! Coefficient[ Series[(Exp[.102 x] - 1) (Exp[.146 x] - 1 - .146 x) Exp[.752 x], {x, 0, nn}], x^nn]

I ran this code in Mathematica which I believe simulates 1000000 boards and returns the number of "good" boards.

Length[Select[ RandomChoice[{.102, .146, .752} -> {s, e, o}, {1000000, 16}], MemberQ[#, s] && Count[#, e] > 1 &]]

The agreement is very good.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.