I have a personal project I'm working on and could use some help with the math. Let's say I had two lists.
FN: 1 million first names (dupes allowed).
LN: 2 million last names (dupes allowed).
And let's say we're looking at two names:
"Murray": Appears in FN 5,000 times and in LN 75,000 times.
"Harrison": Appears in FN 10,000 times and in LN 70,000 times.
I'm given "Murray Harrison" as a full name. How would you approach calculating the odds that the intended name was actually "Harrison Murray"? For the scope of this project, it is acceptable to assume that any last name is just as likely to appear next to any first name.
I think that:
P(Murray Harrison) = P(Murray as First) * P(Harrison as Last) = 5000/80000 * 70000/80000 = 0.055 P(Harrison Murray) = P(Harrison as First) * P(Murray as Last) = 75000/80000 * 10000/80000 = 0.117
Here's where my question might get tricky:
How would you take those two probabilities and determine the odds that the two names should be swapped? For example, say I decide that if there's a 95% chance they should be swapped, I'll swap them.
Would I need additional data to determine this probability? Would I just look at the probabilities of both name orders and if one's > 0.95 I would select that order?
Edit: To be clear, I have a list of full names and I want to programmatically determine which name is the first name, and which is the last. Sometimes the data will be in Last-First order (without a comma) and sometimes it will be in First-Last order. I'm trying to use a bit of stats to determine the most likely order.