Self rep VS pickups

General forum for chat and banter.
ecvej
Developer / Administrator
Posts: 704
Joined: Sun Sep 28, 2008 11:43 pm

Re: Self rep VS pickups

Post by ecvej »

Good post, getting closer to the answer :)
Britnoth
Posts: 22
Joined: Fri Feb 04, 2011 12:55 am

Re: Self rep VS pickups

Post by Britnoth »

The problem is giving away points for any reason, not just someone on your own side.

The fact that they get a carrier days before they would otherwise and are now using it to bomb Krilgore is just icing on the cake.

I am waiting for my own free 10k points, where is it?

anyway.
Now lets get repaired ASAP (Self reps are faster then Pu's)
Smart arse answer: self repping is faster, as it needs less database access?

Or, it depends on ship type, level, damage, sector location and probably several other things. ie:
On something we dont know: the chance of each pickup. So we cant give an answer.

Correct answer: we dont know, only admin do.
Arch
Posts: 41
Joined: Sun Feb 13, 2011 4:58 am

Re: Self rep VS pickups

Post by Arch »

So Butterfly's comparison of HMR vs PUs is in and of itself is fairly complicated. One of the big unknowns is the % chance for a HMR as that weighs heavily into the equation for which is faster. I have a very small dataset as its only my moves this round but my HMR % is about 4.5%. (7 out of 153 PUs).

Another wrinkle is the addition of +/- HP PUs and how they factor into the equation. Again from my limited data, I have a net -375 HP from pickups this round. This may be a bit inaccurate though as I have 5 +0 HP (I'm assuming these were gotten at full HP), so I averaged those out to +125 HP pickups. That's assuming +50, +100, +150, and +200 all have the same probability to be picked from and taking the average of those). I didn't bake these into my conclusion though since its too small and too inaccurate with the limited data. It may be something to consider though.

Assuming you are not above 50% HP, the probability needed for a HMR to be quicker than selfreps is:
  • L1 - 14.29%
  • L2 - 7.14%
  • L3 - 5%
  • L4 - 3.7%
  • L5 - 2.94%
  • C - 4%
With those percentages in mind against the admittedly very small dataset I have to work with, I'd garner a guess that fishing for a HMR is only faster when you are L4/L5 and below 50% HP. This is consistent with my initial hypothesis (that was in my head :P) that there's a breakpoint around L3 where HMR would become faster than selfrepping which is definitely king at the lower levels.

It's been awhile since I did any probability work so my assumptions could totally be off base here. I based it off of the # of selfreps at that level it would take to surpass the value of a HMR. The data is available to us though, you can see All Moves and the only real unknown there is the +0 HP pickups at full health. If we get enough data to determine what the probability of getting each pick up is, I'm pretty sure we'd be pretty close to providing a definitive answer to the initially posed question.

That is until ecvej goes into the code/config files and changes the probability percentages. ;)
ecvej
Developer / Administrator
Posts: 704
Joined: Sun Sep 28, 2008 11:43 pm

Re: Self rep VS pickups

Post by ecvej »

Please can you post the workings you have used to work out those percentages for L1 - C. I just checked one of them working back from your percentages and I didn't get to what I thought I would. Are the percentages per move or per tick?

I'm glad people are touching on the other HP pickups now as that will indeed be a factor. Also the fact that you have factored in that a HMR is worth more for higher levels is good. Just to throw further complications in, other factors would be whether you in effect get 6+ moves with pickups by choosing not to take triples / randoms which gives you bonus chances of getting the HMR.
Arch
Posts: 41
Joined: Sun Feb 13, 2011 4:58 am

Re: Self rep VS pickups

Post by Arch »

I took the value of a HMR for each level and divided by the self rep value at that level and rounded up to the nearest integer. Then for each of those I took the inverse (1 divided by said number) to get the percentage.

Level 3 for example:

3000 / 150 = 20
1/20 = .05 (5%)

The logic is per selfrep so assuming you make 20 self reps, you would have 20 PUs to try and get a HMR for net-zero gain. More than 20 moves (sub 5% probability) and self repping is more worthwhile, less than 20 moves (above 5%) and it would be better at L3 to fish for a HMR.

That was before I realized I could check all my moves to get a rough idea of what the probability was like, but it worked out once I was able to determine my HMR % I could match it up against the guidelines I had initially come up with. Initially I had went in probability-blind and wanted to gauge what the thresholds would be.

I don't have my laptop so I can't check but under the assumption that not-taken PUs (Free, Triples, Randoms) are still added to All Moves, it would just be a matter of adjusting the probability (upwards) to account for the reduction in overall opportunities. 7/153 would then turn into 7/146 or something like that since the untaken Randoms/Frees don't count against the overall tries.

Again, my logic could be off base and skew the calculations, but hopefully we have others who can adjust the above logic to get us going in the right direction if it is off.
Butterfly
Posts: 16
Joined: Tue Apr 09, 2013 7:08 am

Re: Self rep VS pickups

Post by Butterfly »

going to do some cleanups, edits in italics

Arch, if you haven't checked already, see if any of the Pickup (0 hitpoints) happen after an Invul in the same turn. Then it could also be a damage pickup, they show up as Pickup (0 hitpoints) in that case. If you can check your HP for that tick, you can see whether it definitely was a damage pickup or not.

Wrt other pickups factoring in, I'll have to go by the old wiki for info on the pickups and their relevance (ignoring Hypergate also) because I don't know their current values:

Hitpoints up (50,100,150,200? - averages to 125) (HP maxed out is ignored, for obvious reasons, you wouldn't be repping if you were full hp)
Hitpoints down (no effect if Invul that turn, 50,100,...450 - averages to 250)
Extra move, Free attack (up to 5 moves)
Invulnerability (negate hitpoints and environment that turn)
Half-max

If we assumed HP+ and HP- have the same chance. Net loss(125), this is adjusted by the chance to get an Invul prior. We don't have to make this assumption if using algebra later on.
Then the # of moves used/turn on pickup is important (the more the better), because of Invul.
Extra move, does this pickup exist? it a PU that gives a move back? so you can raise from 4-5 but not from 5-6?
Invul, only really relevant if it happens before HP-
HMR, the goal.

I haven't done algrebra in a long time so I'm going to struggle with the next parts and probably get them wrong. The formula can be worked out without knowing the chances of any individual entity, and can even subsitute the complicated probability with algebra logic until someone comes along and expands the algebra with the mathematically correct probabilities. The idea is once the chances become known you can slot them into the formula to get the correct value.

A = actual net HP change from PU
U = expected gross amount of HP up
D = expected gross amount of HP down :::: made this a positive number, if making it negative the formula is A=U+(D*(1-I))
I = Chance of Invul PU prior same turn :::: replace this if someone knows the correct probabilities
(M = Moves used per tick) :::: is a factor in determining the correct probability for "chance already picked up an Invul this turn)
(F = probability of free attack) :::: is a factor in determining the correct probability for "chance already picked up an Invul this turn)
(X = probability of extra move) :::: is a factor in determining the correct probability for "chance already picked up an Invul this turn)
Q = number of moves to self-repair from 50% of ship health (the amount of moves it would take to cover a HMR)
T = number of moves to self-repair adjusted by A

quick edit, think I had formula the wrong way around, + instead of -
A = U-(D*(1-I))
:::: this formula can and probably should be expanded with Y, because Y is a major factor of both U and D and a partial factor of I (just to make I even more horribly complicated to work out)
also to complicate things even more, A is a factor of Y... as A changes so does Y. fun stuff.
simplification: we can say Y is irrelevant if the ship has >50% hitpoints or if we stop at a 1 HMR, instead we use A and U to determine how many turns we need to self-repair after HMR
also may have botched my logic up somewhere.
Y = (TRUE) number of self-repairs needed to hit maximum hitpoints ::: by true, it means the number of self-repairs including any net gain/loss from hitpoint PUs
:::: Y could use it's own algebraic formula for working itself out, which is a bit more complicated than I can do right now.

If A < 0
T = Q + ceil A/150 (normal ships)
T = Q + ceil A/250 (capital ships)


so todo list:
calculate I (you'll need to know M,F,X for starters)
calculate Y (you'll need to know A and I think you'll have to apply A recursively to get the true value of Y, there might be another way.. if you can calculate Y as an expression of A and so forth)

now Y again is a factor in the next formula, as is the prob for extra move and free attack. (this is the Y that represents the TRUE number of self-repairs needed now)

F = probability of free attack
X = probability of extra move
(final edit) R = probability of triple move (doesn't consume a move if not used, so same effect as free attack)
H = base probability of HMR
U = true probability of HMR per move on average? (including free attacks and extra moves)
...
can someone work out the formula for this? it's not something like 1/U = 1 - H - F -2X is it? i'm sure it's more complicated than that..

ok.. so if I can't work it out, maybe there's more than one solution?
Y = true number of self reps it's also the value for the number of pickups that will be attempted if we don't include F and X
so lets try with
Z = true number of pickups that will be attempted supplemented by F and X...

Z= Y + FY + RY + 2YX (not sure about this right now)
Z = Q + FQ + RQ + 2QX based on moves to self-repair from 50%
or Z = T + FT + RT +2TX based on moves to self-repair from 50% plus whatever changes from A

yay, that formula seemed much easier to work out. Anyone that can work out the direct formula for U feel free as well.
(edit: +2.X isn't 100% correct, have to add in the probability that moves are already maxed in a turn, as extra move doesn't apply then. it would still behave like a free move/attack)

A may or may not be a significant factor, because unless HP to repair >= ~50% and A < 0, a HMR will still be a full repair

Y = actual number of moves needed to self-repair taking hitpoint PUs into account
Z = true number of pickups that will be attempted supplemented by F and X...
U = true probability of HMR per move on average? (including free attacks and extra moves)
H = base probability of HMR

If 1/Z < H, then pickups are faster than self-repairs.
If 1/Y < U, then pickups are faster than self-repairs. (not sure about Y for now)

1/Z < H might be the easier of the two equations to work with.
With the clean-up, the formula 1/Z < H only works as intended if the ship has received ~50% or greater damage, however it definitely simplies things this way.. as it should take Y out of the equation.

Again, I've pretty much forgotten everything of algebra and probability so could've got somethings wrong somewhere. Also several of the formulae could definitely be expanded with a better memory of probability, I've just used the simplest terms that I could use without getting stuck and becoming unable to finish.
Last edited by Butterfly on Mon Apr 15, 2013 9:48 am, edited 1 time in total.
Zypher
Administrator
Posts: 195
Joined: Tue Nov 23, 2010 9:06 pm

Re: Self rep VS pickups

Post by Zypher »

lol ok can you take away DBs 10k and give it to butterfly...this is way way way way more thoughtout and i really applaud you bfly for doing this even after the post about points was over. wow... very impressed :D
Butterfly
Posts: 16
Joined: Tue Apr 09, 2013 7:08 am

Re: Self rep VS pickups

Post by Butterfly »

There's still a few errors in it here and there, and some of the important calculations I had substituted with simple algebra. Also I based the format on Arch's last answer, it's almost the same thing but with more pickup attempts.
However I think the best result were the ones that avoided them, and with these you only need to know the probabilities of HMR and the other elements to work it out:

recap:
A = actual net HP change from PU
U = expected gross amount of HP up
D = expected gross amount of HP down :::: made this a positive number, if making it negative the formula is A=U+(D*(1-I))
I = Chance of Invul PU prior same turn :::: replace this if someone knows the correct probabilities
M = move difference up/down because of A

A = U-(D*(1-I))

M = ceil A/150 (normal ships)
M = ceil A/250 (capital ships)

recap:
Z = true number of pickup attempts (greater than number of self-repairs needed)
Q = number of self-repair moves that would equate to a HMR
N = number of self-repair moves (needed if hitpoints >50%)
F = free attack probability
R = triple attack probability
X = extra move probability
H = HMR probability

if M is +ve, less self-repairs will be required due to pickups, if M is -ve, more repairs will be required.

If hitpoints < 50%:
Z = Q + FQ + RQ + 2QX +M (if extra move pickup exists else) Z = Q + FQ + RQ +M
If (1/Z) < H (pickups are faster than self-repairs)

I believe that is the most accurate representation,and edit: -doesn't- ignores hitpoint net gain/loss from pickups, and since Q is based on 50%, it should still result in a faster result if pickup is faster than the self-repairs it would take to repair 50%, the remaining hp would be covered by self-repair. That said.. I think it's possible to insert this into the formula. edit: there, done it.
(final edit: blah I made Z, M and A recursive XD, M/A is based on Z and vice versa. shouldn't make much difference though)

If hitpoints > 50%:
N = number of self-repairs needed to repair to full or just below
Z = N + FN + RN + 2NX (if extra move pickup exists else) Z = N + FN + RN
If 1/Z < H (pickups are faster than self-repairs)

A necessary change, because obviously the more % of hitpoints you already have, the less chance that a HMR will be faster. This is reflected by N being a smaller value than Q in this case.
moves adjusted by repair and damage pickups ignored because it is more likely to be a non-factor with >50% resultant HP.
If you know the probability for free attack, triple attack, (extra move) and half max repair, using the above formula, should be able to work out which is faster on average.
Butterfly
Posts: 16
Joined: Tue Apr 09, 2013 7:08 am

Re: Self rep VS pickups

Post by Butterfly »

Examples:
All unknown prob. are arbitrary 5%, except extra move which is 0%
Ignoring A for simplicity for now (because of the recursion that needs fixing up)

Cruiser 2982/12500, repairs needed: 38
pickups attempted = 38 * 1.1 = 41.8
1/42 = 0.024
HMR is twice as fast

Cruiser 8382/12500, repairs needed: 16.5
pickups attempted = 16.5 * 1.1 = 18.15
1/18 = 0.056
Self-repairs are slightly faster than HMR


Immediate conclusion drawn from two examples:
HMR is faster on average with these probabilities if number of self-repairs needed are greater than 19, all other factors are irrelevant, further examples not needed.
However final caveat, this is probability and I know that it isn't this straight forward as my formula. Here we go XD

Probability of no HMR = 0.95
but the probability of no HMR for 14 moves (which is actually 0.95^14) has already dropped to 49%. Therefore the full 19 moves shouldn't be necessary after all, on average. 14 moves is enough with a 5% probability to get over 50/50 chances.




True conclusion:
with a 5% probability of HMR, HMR is faster on average than 13 (because 13*1.1>14) self-repairs, or 3 full turns of self-repair (1950 HP Normal or 3250 HP Capital ships), assuming that it's a full repair, if not then adjustment is required. 11-12 moves for an auto-repair bomber as they'll heal around an extra 225 HP faster.
Now going to look back at the examples in this light, it changes the 2nd result:

When talking about fleet repairs, repair ships can reduce the number of actual moves/turns available for searching for pickups to repair to full health, making HMR somewhat less efficient.


Cruiser 2982/12500, repairs needed: 38
pickups attempted = 38 * 1.1 = 41.8
At least 1 HMR = (1 - 0.95^42) = 88%
12% probability that self-repairs would be faster

Cruiser 8382/12500, repairs needed: 16.5
pickups attempted = 16.5 * 1.1 = 18.15
At least 1 HMR = (1 - 0.95^18) = 60%
40% probability that self-repairs would be faster

The above based on 5% probabilities for HMR, free attack, triple attack (invulnerability and hp+/- ignored)


Finally, if using calculation by 13(14) instead of 19(20) seems highly counter-intuitive, that's because it is.
The general formula for rolling at least one 6 in n rolls is 1 - (5/6)^n.
So the probability of rolling at least one 6 in 6 rolls is actually around 2/3 or 66.6%..
This is why I have problems with probability sometimes XD, you wouldn't think that rolling a 6 on a die 6 times would be a winning bet, and you would still expect one 6 on average for every 6 rolls made in a large numbers scenario.
However I believe what this is saying is, it's more likely to roll at least one 6 in 6 rolls, then it is not to. It is not the same as the expected number of sixes.
Therefore the likelihood to get a HMR in 14 moves at 5% is more likely than it is not to, but the expected number of HMR at 20 moves is 1. Use whichever you feel is more correct.

Can someone can explain the difference better? If I was rolling for a 6 on 6 rolls and it was for money, the gut instinct might be that it's a 50/50 bet, even incl. that I might roll 6 multiple times. I guess that is why it's not a 50/50 bet, and it's actually in favour of the person rolling for sixes, because of the probability for rolling at least one six is greater than the probability for rolling exactly one. Still seems a little counter-intuitive, but not as much when I think of it that way.

I found a google answer that gives the same result, that betting on rolling a 6 in just 4 rolls is a winning proposition for the person rolling for 6. But it doesn't really explain why. It just uses the same calculations for probability.
http://answers.yahoo.com/question/index ... 803AAMxVFs


Final formulae:

recap:
A = actual net HP change from PU
U = expected gross amount of HP up
D = expected gross amount of HP down :::: made this a positive number, if making it negative the formula is A=U+(D*(1-I))
I = Chance of Invul PU prior same turn :::: replace this if someone knows the correct probabilities
M = move difference up/down because of A
G = Chance of Hypergate

A = U-(D*(1-I))

M = ceil A/150 (normal ships)
M = ceil A/250 (capital ships)

If hitpoints < 50%:
Q = number of self-repairs to equal a half-max
Z = Q + FQ + RQ + GQ + 2QX + M (if extra move pickup exists else) Z = Q + FQ + RQ +GQ + M
P = 1 - (1-H)^Z
If P > 0.5 (pickups are faster than self-repairs)
If P > "breakpoint" (e.g. breakpoint of 0.75 or 75% for fleetwide repairs, etc, pickups are faster than self-repairs)

If hitpoints > 50% (or at least if HP >50% after A is applied):
N = number of self-repairs needed to repair to full or just below
Z = N + FN + RN + GN + 2NX (if extra move pickup exists else) Z = N + FN + RN + GN
P = 1 - (1-H)^Z
If P > 0.5 (pickups are faster than self-repairs)
If P > "breakpoint" (e.g. breakpoint of 0.75 or 75% chance for fleetwide repairs, etc, pickups are faster than self-repairs)

Should be correct, other than I don't have the correct formula for M as it's most likely recursive (U/D are a factor of M and vice versa), but M only plays a minor part anyway.
Z is somewhat recursive too (N and Q are constant, but Z is a truer value to use in Z = N + RZ + GZ + 2ZX for example.)

One final caveat, doing PUs with hp <=450 hp can result in immediate termination.
Post Reply