ZSR Forums
July 13, 2024, 05:01:37 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: ZSR Forums are back - read only!
 
   Home   Help Search Members Login Register  
Pages: [1]
  Print  
Author Topic: Racing Calculations  (Read 5390 times)
RingRush
Moderator
Special Guay

Posts: 330



Email
« on: May 12, 2012, 08:08:24 PM »

Disclaimer: this math isn't very challenging, and the conclusion shouldn't blow your mind, but it is something useful. I originally made this for myself (when my internet was down) to figure out whether to use some dk64 tricks (Aztec Early, Baboon Blast skip) in races, and I figured I'd share it since it might help other people.


Consider a simple trick, where you attempt the trick until you get it and it takes approximately a constant time to attempt it (some examples: Ruto throw, Jabu fish-skip, Cucco dive, antigravity jumpslash in Deku tree). Let S be the time saved if you do the trick your first try, t be the time lost every time you fail the trick. Define your consistency as the probability you get this trick - this is individual dependent, can vary with practice, and can be roughly calculated by doing 30 or so attempts and measuring success rate. Call consistency p, and let q = 1 - p.

We want to consider when a trick is useful for a race. If we let S* be a random variable for the amount of time saved from a trick in a race, then what we want is to have E(S*) > 0 - that is, you are expected to save time if you do this trick.

Observe if you get the trick first try (probability p), then S* = S. If it takes two tries (probability pq), S* = S - t; three tries, S* = S - 2t

Those familiar with expected values will see E(S*) = pS + (pqS - tpq) + (pq^2S - 2tpq^2) ... = p[S(1 + q + q^2 + ...) - t(q + 2q^2 + ...)]
Summing these series we get p[S/p - tq/p^2] = S - tq/p      
          
Now using the condition above, E(S*) > 0, we see we want  pS > tq   which means   S/t > q/p = (1-p)/p = 1/p - 1  and so  S/t + 1 > 1/p
This brings us to the condition      p  >  1 / (1 + S/t)            or equivalently, p > t / (t + S)
Define 1 / (1+ S/t)    to be a tricks Risk Ratio, R
Then we see if p > R, then the trick is worth attempting in races. If p < R the trick is not worth attempting (assuming no other factors of the race are known, such as how far behind you are).

An interesting fact that might be useful for calculation (though probably not): R is equal to the amount of time lost when you fail the trick divided by the time saved if you do the trick second try.

Here is the interesting part: if a trick saves the same amount of time regardless of what your route is (think Shadow gate clip), then S is constant. Thus R-values can be calculated for any trick, independent of the person doing them! This means that we can compile a table of R values to use as a reference. A potential racer needs to only know his consistency to know whether or not to attempt a trick. Luckily, most tricks have either a constant or low-variability S (meaning there are only a few possible values of S depending on what other items are needed).




Now, consider tricks where you attempt them once, and if you fail you do things the "normal" way (the obvious example of this is Mirror Shield from outside).
For these tricks you either save S (probability p) or lose t (probability q).

Then E(S*) = pS - qt = pS - t + tp = p(S + t) - t
Attempt if E(S*) > 0, so p(S + t) - t > 0  which means   p(S + t) > t   and   p > t/(S + t)

But this is just the condition p > R ! Thus we can also calculate R-values for tricks that you attempt only once and then move on.

Unfortunately, this formula only seems to work if you attempt the trick 1 time or as many times until you get it. You can derive a formula for attempting a trick n times, but I don't know of any trick off the top of my head where that is useful.




Now consider a setup that take j seconds and improves consistency to p'. We can consider this a new trick, [S+j]*, with savings S - j (since you lose the j seconds the setup takes).

This means E([S+J]*) = S - j - (t + j)q'/p' = (S - tq'/p') - (j + jq'/p')
For a setup to be worthwhile, we need E([S+J]*) > E(S*), which means S - tq'/p' - j - jq'/p' > S - tq/p
This is equivalent to   tq'/p' + j + jq'/p'  < tq/p   and   j(1 + q'/p') < t(q/p - q'/p')
Evaluating some more:   j(pp' + pq') < t(qp' - q'p)      j/t < (qp' - q'p) / (pp' + pq')     j/t < (p' - p) / p       j/t + 1 < p'/p     1/(j/t + 1) > p/p'

Now let L = 1/(j/t +1)   =  t / (j + t)              
Then if p/p' < L, a setup is worth it.
Thus if ratio of old consistency to new consistency is smaller than ratio of old trick (fail) time to new trick (fail) time, it is worth it to use the setup.

L values can again be calculated for any setup, regardless of player. Note that if the setup makes the trick approximately perfectly consistent, the "saves time" condition is p < L. It makes sense that L is an upper bound, since if your consistency is high enough you don't need a setup.

For pause buffering, math works as before, but j is a function of the player... L becomes t / (jn + t)where j becomes the amount of seconds it takes for you to pause buffer one frame, and n is the amount of frames you need to buffer. Those who can on average do pause buffers with less pausing will have lower js. This means L becomes closer to 1, and so these players benefit more from pause buffering even tricks with higher consistencies.



No guarantee this math is right, if anyone wants to check it.
« Last Edit: May 12, 2012, 08:26:13 PM by RingRush » Logged

ded
ING-X
Site Editor
Mega Guay

Posts: 613


fuck you and the horse you rode in on

562243965 marikthechao@hotmail.com ingx24
« Reply #1 on: May 12, 2012, 08:17:32 PM »

what in the immediate fuck
Logged

<complex> byan you're doing that thing again
<complex> the thing where everything you say is fucking retarded


<ethandude> http://en.wikipedia.org/wiki/Homosexual cheak this out luxury it might come in helpful when u wright your resime
Norkix
Special Guay

Posts: 389



« Reply #2 on: May 12, 2012, 10:27:42 PM »

Um... Uh... Er... Eeg... Eh... So... Uh... I think... Um...  No, that's... Er... How... Uh...

DAFUQ?!?!?!?!
Logged

11:17 <Cosmo>: It's hard to tell what ASAP means with todays sequence breaks
Majora MIM
Special Guay

Posts: 248



Email
« Reply #3 on: May 13, 2012, 07:34:13 PM »

I haven't done probs in a while...
You could also try to list events such as "Get mirror shield" or "Escape forest" and count because there are different techniques to get them.
When there are multiple ways to acheive a trick they interfere with each others.

For exemple the sequence of tries (aquaslide, pokey's stab, pokey's stab) hasn't the same value that (aquaslide, pokey's stab, wwt) but here it's all about addition of the values of each trick because they take you to the same intermediate positions (near kokiri guard). But if the different sequences take you to different intermediate positions then the values of each technique changes and the event hasn't the same probability to happen. So you may include remedial techniques to your calculations in order to know what to do when you choose a bingo goal.

I'm sorry, I have trouble in explaining my ideas here.
But anyway your calculations seems good to me and it's an adequate for individual trick try's worth.
Logged

sorry for my soooo bad english.


TLOZ: complete     AOL: complete     ALTTP(GBA): 100%
LA(DX): complete   OOT/MQ/3D: 100%    MM: 100%
OOA/OOS: 100%    FS:100%   TWW:100%
 FSA: 100%     TMC: 100%     TP: 100%
PH: 100%        ST: 100%         SS: Huh
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!