Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say I have a string set such as "AAAABBBBAAAABAAAA" and I want to have some quantitative measure of most likely subset length. In the above example (4 sets of length 4, one set of length 1), it is "humanly" evident the next set will be 4 in length, but just making an average yields length of 3.4.

What would be best method to get "the answer closer to 4" ?

share|cite|improve this question
up vote 3 down vote accepted

It's not evident to me that the next group will have length 4. What if the next elements are "BAAAA" again? It happened once, so why not again?

If you want the "most likely" length, then choose the mode, which is exactly what you said: the most likely length seen so far, in this case 4.

share|cite|improve this answer

Why do you have to show this in a single number? Why not just plot a histogram of the lengths? Then you can see that the mode is 4 and you will be able to see any other commonly occurring string lengths as well. Certainly as Mark suggests the mode will give you 4 and will always be an integer.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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