Probability algorithm: Finding probable correct item in a list (e.g John, John, Jon)

Posted by Andrew White on Stack Overflow See other posts from Stack Overflow or by Andrew White
Published on 2010-05-06T12:59:57Z Indexed on 2010/05/06 13:08 UTC
Read the original article Hit count: 681

Filed under:
|
|
|

Hi,
Take for example the list (L):
John, John, John, John, Jon

We are to presume one item is to be correct (e.g. John in this case), and give a probability it is correct. First (and good!) attempt: MostFrequentItem(L).Count / L.Count (e.g. 4/5 or 80% likelihood)

But consider the cases:
John, John, Jon, Jonny
John, John, Jon, Jon

I want to consider the likelihood of the correct item being John to be higher in the first list! I know I have to count the SecondMostFrequent Item and compare them.

Any ideas? This is really busting my brain!
Thx, Andrew

© Stack Overflow or respective owner

Related posts about algorithm

Related posts about list