# Hard statistical question: Erik beating Rama on OH



## AvGalen (Jun 19, 2009)

Not entirely Puzzle Theory, but this is the best place for this question:

Given these results, is it possible to calculate the chances of Erik beating Rama?

I would like to know:
1) What are the chances of Eriks best single being better than Ramas best single during an average of 5
2) What are the chances of Eriks (corrected) average being better than Rama's (corrected) average during an average of 5

Bonus question: What about Mats beating them both on single


----------



## trying-to-speedcube... (Jun 19, 2009)

I have no idea. Nuff said.

I think I can get a pretty vague estimation, by taking the average of all the ranks. The number that's lower has a bigger chance. That probably will be Rama, as I am too lazy to compute it all. I think that from the ratio between those averages you should be able to give a (really) rough estimation of Erik's chances beating Rama. But seriously, there are so many other factors involved, like experience, practise, etc., so even with a more professional approach than mine, an estimation won't say anything.


----------



## Swoncen (Jun 19, 2009)

It's hard to tell with the given data because it is spread over the years and improvement plays a big role. If you have e.g. 100 solves of each of them from a recent date you can calculate the distributions and then calculate the overlaping area to the left which is the probability of Erik beating Rama. I know the explanation is not good without a picture so I make one:







The cyan area should be the probabilty of Erik's chance to beat Rama..

EDIT: "The cyan area should be the probabilty of Erik beating Rama.."


----------



## trying-to-speedcube... (Jun 19, 2009)

But then the purple area should be the probability of Rama beating Erik. The rest is a tie? Then even my computation is more accurate


----------



## Swoncen (Jun 19, 2009)

Sorry for beeing stupid. You have to integrate over the time (x-Axis) and in the integral multiply the distributions. In my first assumption I only had ONE case. You need all cases from the most left of erik's distributions to the most right of ramas distribution.. therefore you use the integral.. thats it!

@trying: What is your computation? Taking the average and then give an estimation? Based on what? If you have the averages, you have two numbers and one is better.. then you'll have 100% for one and 0% for the other. At least you have to include the deviations.


----------



## trying-to-speedcube... (Jun 19, 2009)

As I said, I have no experience in this, I am not good in chance computations.


> *you should be able to give a (really) rough estimation of Erik's chances beating Rama.*


Well, say Rama gets a 20 average and Erik gets a 40, you might say that Erik has a 40/(40+20)*100 = 66.7% chance of losing to Rama?

Again, I have no idea. I'm just randomly trying stuff.


----------



## Swoncen (Jun 19, 2009)

Int_-inf_+inf(D1(x)*D2(x)*dx)

D1 and D2 are the distributions. Now it should be clear for all of us.


----------



## Swoncen (Jun 19, 2009)

trying-to-speedcube... said:


> As I said, I have no experience in this, I am not good in chance computations.
> 
> 
> > *you should be able to give a (really) rough estimation of Erik's chances beating Rama.*
> ...



nonononono. You don't include the deviation and your calculation is wrong! Let's say one has an average of 10 seconds and never had a time over 11 seconds. The other one has an average of 20 and never had a time below 19. In your computation the second one would have a chance of 20/30 * 100 = 66,7% of beating the better one? Think about it *g*. I don't blame you, but don't say your's is more accurate


----------



## AvGalen (Jun 19, 2009)

You don't have to count in their development.


----------



## Swoncen (Jun 19, 2009)

Then just take the times and integrate as in my previous post.. it should work. You just have to compute the distribution first.


----------



## Swoncen (Jun 19, 2009)

Ok, since we don't have such distributions but each result is a point-probabilty (I don't know the english word - it is: "Punktwahrscheinlichkeit" in german) which is 1/n for each result, we have to do that computation for discrete values: An example:

Distribution x: 1.1, 1.2, 1.3, 1.4
Distribution y: 1.34, 1.35, 1.36, 1.5

The chance of x beeing worse then y is (y is better then x)

(x=1.1 and y < 1.1) + (x=1.2 and y < 1.2) + (x=1.3 and y < 1.3) + (x=1.4 and y < 1.4)

which is:

1/4 * 0 + 1/4 * 0 + 1/4 * 0 + 1/4 * 3/4 = 0.1875 = 18.75%


----------



## TomZ (Jun 19, 2009)

Rama
Average: 19.865 - SD: 1.281

Erik
Average: 20.813 - SD: 0.785

Using a recursing computer program to simulate each of them getting three times in the range of 15-23 (step 1) I found that:

The cases where Rama wins have a combined probability of 0.853. The cases where Erik wins have a combined probability of 0.142.

Accounting for the 0.5% of cases my search did not cover, Erik has a 14.2% chance to win his next mean-of-3 match against Rama. I think this probability would be the same for an average-of-5, as you do not need to account for their best and worst times.

Mats:
His chances are pretty slim. Looking only at his most recent competition, we find:
Average: 27.462 - SD: 3.078

Using a similar technique (this time in the range 10-35) we find that Mats has a 1.2% chance of beating Erik and a 0.7% chance of beating Rama. The chance of beating them both at the same time is less than 1%%.


----------



## trying-to-speedcube... (Jun 19, 2009)

Swoncen said:


> trying-to-speedcube... said:
> 
> 
> > As I said, I have no experience in this, I am not good in chance computations.
> ...


It's more accurate than a 90% chance that noone wins ^^

Also, I was talking about the average rank, not the average time.


> The cases where Rama wins have a combined probability of 0.853. The cases where Erik wins have a combined probability of 0.142.


Hehe... And the last 0.005 are for Mats


----------



## Swoncen (Jun 19, 2009)

trying-to-speedcube... said:


> It's more accurate than a 90% chance that noone wins ^^



What are you talking about? Who said 90% chance that no one wins?



trying-to-speedcube... said:


> Also, I *wasn't *talking about the average rank, *not* the average time.



:confused:


----------



## TomZ (Jun 19, 2009)

trying-to-speedcube... said:


> > The cases where Rama wins have a combined probability of 0.853. The cases where Erik wins have a combined probability of 0.142.
> 
> 
> Hehe... And the last 0.005 are for Mats



 No, the last 0.005 are for the cases where Rama or Erik either break the world record or screw up horribly. My computer didn't have the time to calculate that! (And of course the nearly infinitesimal chance of a draw)


----------



## Tortin (Jun 19, 2009)

I'm probably missing somthing big here, but couldn't you get the % from the number of competitions they competed in together?

For example, if you take the stats from 5 compitions, because each has two rounds, that would make ten rounds. If Erik beat Rama once out of those ten rounds, that would make his chances of winning 10%.


----------



## qqwref (Jun 19, 2009)

Roughly, if you write down the last m of Erik's OH solves and the last n of Rama's OH solves, and k is the number of ways you can pick one of Erik's OH solves and one of Rama's slower OH solves, the chance of Erik beating Rama in a single solve is k/(n*m). Of course this is only an approximation to the real-life probability (which you could never calculate), and you'd have better results if you had more data, but it's better than assuming a normal distribution (since it might very well not be). I don't feel like writing up code to do this, but that's how you'd do it. You'd want to choose n and m so that Erik and Rama didn't improve (much) in the interval.

Tortin: That doesn't work because it's a really really small sample size. You don't get an accurate result at all.


----------



## Swoncen (Jun 19, 2009)

qqwref said:


> Roughly, if you write down the last m of Erik's OH solves and the last n of Rama's OH solves, and k is the number of ways you can pick one of Erik's OH solves and one of Rama's slower OH solves, the chance of Erik beating Rama in a single solve is k/(n*m).



This is only at one position of the distributions. In my example

n=4
m=4

k=0 for x=1.3

would be 0

You have to do that for each value (approximation of the integral since we have point distributions)

k=0 for x=1.2 would be 0
k=0 for x=1.1 would be 0
k=3 for x=1.4 would be 3/16

0+0+0+3/16 would be the right answer. In this case we only have a higher value then 0 for one value, but thats not allways like this..


----------



## qqwref (Jun 19, 2009)

Swoncen said:


> qqwref said:
> 
> 
> > Roughly, if you write down the last m of Erik's OH solves and the last n of Rama's OH solves, and k is the number of ways you can pick one of Erik's OH solves and one of Rama's slower OH solves, the chance of Erik beating Rama in a single solve is k/(n*m).
> ...



This post makes no sense... in your example n=4 and m=4, and then k=3 because there are 3 ways to choose one number from x and then one smaller number from y, so the probability is 3/16.

k/(n*m) is the chance that if you randomly pick one of Erik's solves from the set you chose, and randomly pick one of Rama's solves from the set you chose, Erik's solve will be better. So this is a pretty good approximation for the actual probability, and since we don't know the real distribution it's probably more accurate in the long run than just taking the mean and SD and assuming they're both normal. (And if you do the mean and SD bit, how do you factor in DNFs? Does it make the mean infinite?)


By the way, if the distribution for one solve has mean m and standard deviation s, the distribution of the mean of 3 solves is approximately normally distributed (even if the distribution for one solve isn't) with mean m and standard deviation s/sqrt(3). I'm not sure about the distribution of a trimmed avg5 but it's probably similar.


----------



## Swoncen (Jun 19, 2009)

qqwref said:


> This post makes no sense... in your example n=4 and m=4, and then k=3 because there are 3 ways to choose one number from x and then one smaller number from y, so the probability is 3/16.



Ah sorry, your post was not clear to me.. I think I know what you mean. Your "k" is allready the sum of my k's and my 1/16 is just your 1/(m*n). Just another way to write..

k=Sum_i=1-4_(j(i))

j(1)=0 for x=1.1
j(2)=0 for x=1.2
j(3)=0 for x=1.3
j(4)=3 for x=1.4

Did you mean that? Then we had the same result..


----------



## Swoncen (Jun 19, 2009)

With that equation Erik has a chance of ~30,7% to win a single duell against Rama. This is due to the small amount of Eriks Results an the top 100 compared to Rama. Consider 99 Results of Rama and 1 of Erik.. if Erik's result is the 70th-best he would have a chance of 30%.


----------



## AvGalen (Jun 20, 2009)

Lots of people seem to be just guessing and this question is just way to hard for that.

TomZ: You are making a big assumption with the SD and you changed the question for Mats by taking different data. I guess your calculation does give an approximation though.

Swoncen:


> Int_-inf_+inf(D1(x)*D2(x)*dx). D1 and D2 are the distributions. Now it should be clear for all of us.


Yes, completely clear  I also don't understand how you could do "point-probabilty " for all these values

Michael:


> last m of Erik's OH solves and the last n of Rama's OH solves


What does that mean?

What about this "paradox"?
Mats has never beaten Erik so it is clear that based on this data Mats vs Erik will be 100% victory for Erik
Rama is "much" better than Erik so he will win "most" matches
So you would assume that if Mats always gets beaten by Erik, and if Erik isn't as good as Rama then Mats will always get beaten by Rama as well.
...but Mats actually has a (small) chance against Rama


----------



## Swoncen (Jun 20, 2009)

AvGalen said:


> Swoncen:
> 
> 
> > Int_-inf_+inf(D1(x)*D2(x)*dx). D1 and D2 are the distributions. Now it should be clear for all of us.
> ...



Actually this equation is the general case and the calculation with the point-probability is a special case. So you don't understand *why* we have point probabilities? Because we have single values (The results) where there are some areas in the distribution which are 0 and other ones (most of them) are 1/n where n is the number of results from one person. What we can do is: feed the distribution with more data and calculate the probabilities for ranges (e.g.: how many results are between 15.6 and 15.8) - but then we loose some precision. Therefore we have to handle each result as one point probability and use the *sum* instead of the *integral* because we don't have a real curve but single samples.

I hope it's clear now?



AvGalen said:


> Swoncen:
> 
> 
> > What about this "paradox"?
> ...


----------



## Swoncen (Jun 20, 2009)

So look at this case:

The red one is the best but his SD is very high. The green one is better then the blue one and the blue one has a better chance to win agains the red one then win agains the green one.








In our case it's a bit like this due to the short list of results. Let's look at this:

96: Rama
97: Erik
98: Mats
99: Rama
100: Rama
_101: Erik
102: Erik
103: Rama_

without the results from 101-103 Mats would have 0% chance in beating Erik but if we look at the data behind, we see that it's not true.

Easy example: Throw a dice twice. Let's say you had a 5 and a 1. Now you can say the prob. for 1 and 5 is 50% and for the others it's 0%. But you have to throw it much more often.

These results are "Elementarereignisse" http://de.wikipedia.org/wiki/Elementarereignis 

Also take a look at this: http://de.wikipedia.org/wiki/Wahrsc..._Fall_diskreter_Wahrscheinlichkeitsr.C3.A4ume

(couldn't find the dutch or english version)

Once again I'm sorry for the bad drawings. lol


----------



## trying-to-speedcube... (Jun 20, 2009)

Swoncen said:


> trying-to-speedcube... said:
> 
> 
> > It's more accurate than a 90% chance that noone wins ^^
> ...


First one: you did, with your graph.
Second one: sorry, fixed 

I will stop posting in this thread. I feel like a noob.


----------



## Swoncen (Jun 20, 2009)

In my graph was no information that no one wins.. these are two distributions..


----------



## qqwref (Jun 21, 2009)

AvGalen said:


> Michael:
> 
> 
> > last m of Erik's OH solves and the last n of Rama's OH solves
> ...



Suppose you don't think Erik has improved for the last 60 OH solves he did in competition... then you can effectively take those 60 solves to be 60 random OH solves from right now. The more solves you have from a given person, the more accurately you can determine how likely they are of beating something or getting sub-X second average, because you can get a better sense of how their times are distributed. So it's your benefit to look further back and take more times, but of course you don't want to go too far back, because for instance Erik got a 30 second OH average in 2007 and clearly he's not going to be getting a 30 second average now unless something terrible happens.

Anyway you'd take the last few of Erik's solves and the last few of Rama's solves, but the number you take of each person doesn't have to be the same. That gives you a large set of times from each person and then you can start comparing them.


EDIT: I ran the thing with Rama's solves since UK Open 2007 and Erik's solves since Dutch Open 2008. There are 101 of Rama's solves and 69 of Erik's and I get that Erik got a strictly better solve than Rama 1451/6969 of the time (~20.8%). If we just use Erik's solves since Belgian Open 2009 (his recent streak of sub25 averages) Erik gets a strictly better solve 550/2020 of the time (~27.2%). The probability that Erik can beat Rama in an avg5 contest is lower, though, because Rama averages lower than Erik does and we can expect avg5 times to be more consistent than single times.


----------



## AvGalen (Jun 22, 2009)

Swoncen and Michael: You are changing the question. I specificaly said "Given these results....". You shouldn't change that by adding data from other solves or by adding date-information or "improvement" factors.

Swoncen: I understand WHY point-probability should be used, but I want to know HOW you would calculate that for this data.

And the "Mats can't beat Erik, but can beat Rama although Rama is better than Erik"-paradox can be simply explained like this:
[exaggeration]
Erik is a pretty good solver and he is consistent
Rama is an even better solver, but sometimes he sucks
Mats is a solver who sucks, but he doesn't suck as hard as Rama's suckiest solves
So normally the order would be Mats < Erik < Rama, but when everyone performs at his worst the order would be Rama < Mats < Erik.
As you can see Erik is always better than Mats, but Rama can be the best or the worst


----------



## Swoncen (Jun 22, 2009)

AvGalen said:


> Swoncen and Michael: You are changing the question. I specificaly said "Given these results....". You shouldn't change that by adding data from other solves or by adding date-information or "improvement" factors.
> 
> Swoncen: I understand WHY point-probability should be used, but I want to know HOW you would calculate that for this data.
> 
> ...



You just take the number of results from a person (= n) and each result has a probability of 1/n. If there are 2 exact same results you would handle this result as 2/n but since we do that for each result we have twice 1/n which is also 2/n.

And for the data: I just said you cannot really tell who's better with a few results. Take the extreme: you have 3 results: 1. Rama, 2. Rama, 3. Erik.. Erik is much worse then Rama in this case and would have a 0% chance of beating Rama but we know there is alot of data behind that. But if you want to take only this data, just go ahead and use the point-probabilities. 

But then you cannot expect results that can predict the chances of anyone beating another person in real life.

Now I really want to know what are my chances to beat you *g*. Would you be so kind to send me some of your recent 3x3x3 times? You have alot I know  (maybe 100?).


----------



## AvGalen (Jun 22, 2009)

Swoncen: I still don't understand how to calculate it. Maybe you can give an example with a very small set of data like this:

1. Rama: 17.00
2. Rama: 18.00
3. Erik: 19.00
4. Rama: 20.00
5. Erik: 21.00
6. Rama: 22.00

Now what would the chance be that Erik beats Rama based on just this data?
I would guess that it should be calculate like this:
Erik does 19.00: Chances of him beating Rama are 2 out of 4 (Rama's 20.00 and 22.00)
Erik does 21.00: Chances of him beating Rama are 1 out of 4 (Rama's 22.00)
So with this data I would say that Erik has a (2/4 + 1/4)/2 = 3/8 chance of beating Rama

Calculating this for Mats would be easy:
Mats vs Erik: 0/24 = 0% chance that Mats wins
Mats vs Rama: 1/75 = 1,3% chance that Mats wins

But I don't see any way this can be done with a formula. Just a loop that analyses each of Eriks solves and determines the chances of winning/draw/losing for that solve
So for this data that would be something like this:
22: (75 - 21) / 75 = n1
24: (74 - 22) / 74 = n2
36: (75 - 33) / 75 = n3
37: (75 - 33) / 75 = n4
38: (74 - 33) / 74 = n5
etc
98: (75-74)/75 = n24
Chances of Erik winning on a single solve: (n1 + n2 + n3 + n4 + n5 + etc + n24) / 24

For a corrected average of 5 this become much harder because then it is not just a matter of winning losing, but the actual times would matter. I guess that would mean that instead of doing 24 point analysis you would need to do point analysis for all 24^5 * 75^5 possible averages

Is there a program that can perform these calculations automatically (based on table-input) or is there a smarter way to do this?


I have dumped the Excel file with all 2295 results on 
http://rapidshare.com/files/247177443/fifty_fifty.xlsx.html


----------



## qqwref (Jun 22, 2009)

AvGalen said:


> Swoncen and Michael: You are changing the question. I specificaly said "Given these results....". You shouldn't change that by adding data from other solves or by adding date-information or "improvement" factors.



You may have asked for us only to look at statistics given the top hundred single results, but I don't think that's a useful way of looking at things, which is why I didn't use it. The reason is that neither cuber is guaranteed to get in the top hundred on any given solve, so if you just look at those results you can only answer the question "if both cubers get 22.18 or better on a given solve, what's the probability Erik wins?" This is a valid question, but it can't be extended to looking at the probability Erik wins an avg5 contest unless you can guarantee that each of the ten solves will be 22.18 or better. (We don't have access to the probability distribution outside of that range, so you can't include it in your calculations if you hope to be accurate.) As I said you would get more accurate results (closer to the real-life probability of Erik beating Rama) if you took the past few competitions' worth of OH solves for both cubers and compared them.


As for the average of 5, suppose you chose n of Erik's times and m of Rama's. Instead of considering (n^5) * (m^5) possibilities (because that's a lot), what you would really have to do is consider the n^5 possibilities (not even that; you can divide by 120 because the order of the times is irrelevant) and for each one decide how many of the m^5 averages of 5 of Rama's would be worse than that. The sum of all of those, divided by (n^5 * m^5), is the probability Erik beats Rama. But remember that you have to choose a set of times from ALL the times each cuber gets, not just the ones under 22 seconds, because otherwise you will not have a distribution that looks like the distribution these cubers will get in real life, and then you will not have an accurate result.


----------



## AvGalen (Jun 24, 2009)

Michael: I asked about these 100 results because I wanted to know how you would calculate this. Not because I really want to know what chances Erik has against Rama.

And for your second part I think you are wrong. Just calculating if Erik beats Rama on 1 or more solves isn't relevant for an average. You can beat someone on average even if you are only faster on 2 solves and are slower on 3 solves. So you really need to calculate all n^5*m^5 possibilities (we could debate about reducing that by 5!)


----------



## JasonTriesToCube (Jul 6, 2009)

Mats will beat them 99/100 times.

Oh wait, was it the other way around?


----------

