PDA

View Full Version : Mathhammer again? Maybe something new!



Sajuuk
12-03-2008, 06:58
Greetings!

Have you ever wondered what is the chance that ten guardsmen will kill exactly four termis? Or which weapon is better in mass shooting? Maybe you're too young to know proper statistic equations or you're better in something else than math (or even hate math :P)

In fact counting chances is laborious and time-consuming. That's why I wrote PC program that will do it for you.

IMPORTANT! This is an EXE file. Bear in mind that it can contain everything. You don't know me, I did little posts, nothing really to loose. If you are not aware of this or that you can handle any critical situations on you pc drop it. Don't download it. I did everything I know to make this file safe - but I'm just an engineer, not a programist.

If there is anything I could add, change or improve tell me. I wrote it as a statistical tool that every general should have planing a battle. I don't see how it can be used while battling, it still takes few seconds to put variables.

Or maybe there is plenty of such programs and my own is lame but I don't know it ;)

Hope I'm not breaking any Warseer's law :D

JackHammer v1.0 (http://myfreefilehosting.com/f/314ea7bc1d_0.39MB) Now its banner safe (only those added by google).

If you want to know how does it work I will try to explain. In short its loops in loops of loop of Bernoulli's process.

Enjoy!

Desert thunder
12-03-2008, 09:28
Its pretty good but I was wondering why it didn't include AP?

Xenobane
12-03-2008, 13:50
You might want to warn people about the NSFW banners on your link!

Sajuuk
12-03-2008, 20:56
Hmm... why it doesn't include AP? ;) Because or you have armour save die with value of AS target has or you have no armour save at all.

What about banners, its not my server. Its free broadcast page that everyone can upload anything he wants. I didn't check it, ***** now I see. I apologize. I will change it ASAP. SORRYY! :)

EDIT: now it should be ok.

Xenobane
13-03-2008, 01:40
Impressive program Sajuuk - you're obviously right about the AP. I'll be sure to refer to it with all my mathhammer queries!

Sajuuk
13-03-2008, 06:59
Thank you :) hope it'll be useful. But maybe you have some ideas I should add to it?

Logarithm Udgaur
13-03-2008, 07:25
That is really cool. Thanks for the app.

bdo
13-03-2008, 07:31
thanks for that :)

how about adding the possiblity to reroll the missed shots/attacks? (or unsuccessfull lightning claw or living ammunition to wound rolls).

WLBjork
13-03-2008, 09:38
I'm looking at it and thinking it's not working correctly.

Try this experiment:

1 shot BS3, S3 vs. T4 Save 3+

10 shots BS3, S3 vs. T4, Save 3+

1 shot, chance of causing maximum wounds is 5.5556%

10 shots, chance of causing maximum wounds is 0%.

Indeed, it seems like the calculations for inflicting in excess of 1 wound are inaccurate.



<<Ignore this post... I wasn't thinking straight when I wrote it>>

Bunnahabhain
13-03-2008, 12:06
I'm looking at it and thinking it's not working correctly.

Try this experiment:

1 shot BS3, S3 vs. T4 Save 3+

10 shots BS3, S3 vs. T4, Save 3+

1 shot, chance of causing maximum wounds is 5.5556%

10 shots, chance of causing maximum wounds is 0%.

Indeed, it seems like the calculations for inflicting in excess of 1 wound are inaccurate.

That will be a rounding error then.

Chance of causing 10 MEQ wounds from 10 lasgun shots is 1 in (1/18)^10

(1/18)^10 = 2.8007 x10^-13,
ie roughly 1 in Three thousand billion. That's clearly too big a chance to ignore....

The programme appears to operate to either 5 significant figures, or 4 decimal places, either of which is a perfectly sensible level of accuarcy for 40k.

Sholto
13-03-2008, 13:15
Thanks - assuming the maths is correct this could be a very hand tool indeed.

The option to specify twin-linked weapons or other re-rolls to hit and/or re-rolls to wound would be a nice addition, though :)

Is there some way to show graphically which results are the ones that, when added together, represent 50% or more of the total? For example, take this output:-

Kills Chances
0 0.000001786 %
1 0.000049127 %
2 0.000644787 %
3 0.005373229 %
4 0.031903548 %
5 0.143565966 %
6 0.508462797 %
7 1.452750850 %
8 3.404884800 %
9 6.620609330 %
10 10.758490200 %
11 14.670668400 %
12 16.810140900 %
13 16.163597000 %
14 12.988604700 %
15 8.659069820 %
16 4.735428810 %
17 2.089159770 %
18 0.725402697 %
19 0.190895447 %
20 0.035792896 %
21 0.004261059 %
22 0.000242106 %

You are more than 50% likely to get results 11, 12, 13 and 14, meaning you are more likely to get one of those results than any of the others. Might be useful information to show.

Lastly (and since I don't know the maths I cannot comment), but does your programme operate in the way shown here? - http://advancedtautactica.com/viewtopic.php?t=6482

Sholto

Xenobane
13-03-2008, 15:46
Thank you :) hope it'll be useful. But maybe you have some ideas I should add to it?

I'd love to be able to program in different sorts of attack at once. For instance, what's the expected kills from a combined volley of 1 krak missile, 1 krak grenade and 16 lasgun shots. I know I can put them all in separately but I'm lazy ;)

Good work anyhow.

Sajuuk
13-03-2008, 21:07
Ok. Let me explain how does it work (but I'm not native english speaker). There is proven equation that states something like this (its called Bernoulli's trial):

p^r * (1-p)^(n-r) * nCr

Where:
p - probability of success in one trial
n - number of trials
nCr - binomial coefficient of n of r (ask wikipedia what's this)
r - number of successes

This is a probability to get r successes with p chance each in n trials... crappy not understandable sentence, isn't it?

But we all know 40k mechanic ;) so I'll us it.

This is a probability to get r hits with p chance (2+ 3+ 4+ 5+ 6+) in n-dices roll. Try it with something simple.

Rolling, let say 10 dices, we can have from 0 up to 10 hits. This is a first loop my app does. Then for each hit it counts chances for each wound. Example:

0 hits - no further rolls (or one roll to get no wounds)
1 hits - two rolls for one wound or none
2 hits - three rolls to get two wounds, one wound and none...
...
10 hits - eleven rolls to get... etc etc ;)

Then adding it while that chances are independent.

After that for each wound roll we have armour save roll which app counts. For a human being it takes hours to count single 10 dice roll.

If its still unclear tell me or maybe try that link from Sholto - maybe there its better explained.

WLBjork... one attack/shot its exactly the same what statistical shot, for your example you have 4+ to hit, 5+ to wound and 3+ armour save. In chances it is 0.5 to hit, 0.33 to wound and (1-0.66) 0.33 to armour save failed. It its 0.0556 When it comes for ten shoots it is a chance that exactly 10 lasgun shoots will kill exactly ten MEQs Have you ever heard about something like this? Like Bunnahabhain said its far lower chance that being kill by a meteor. Try counting it for clear adding chances (in fact multipling them) and count Bernoulli's trial for that. And tell us how long it will take you.

Hmmm... I was thinking about adding re-roll previously. Many attacks use it: preferred enemy, litany of hate, living ammunition, lighting claws... But that's quite hard because re-roll is a dependant trial.

That exposing biggest 50% shouldn't be difficult. Give me some days ;) I'm very busy lastly at work.

Hmm... The problem with whole squad is not in code writing but in math. I will try to do it third. But impossible is nothing!

Ok! What else?

FurryMiguell
13-03-2008, 21:19
wow, uh... that's heavy on my head! to many numbers at 9:30pm:p

I'll read it tomorrow, im sure I'll understand;) (im not a native english speaker eighter though, so i might not:p)

Cheers:D

EDIT: I wrote something wrong...

WLBjork
13-03-2008, 22:32
WLBjork... one attack/shot its exactly the same what statistical shot, for your example you have 4+ to hit, 5+ to wound and 3+ armour save. In chances it is 0.5 to hit, 0.33 to wound and (1-0.66) 0.33 to armour save failed. It its 0.0556 When it comes for ten shoots it is a chance that exactly 10 lasgun shoots will kill exactly ten MEQs Have you ever heard about something like this? Like Bunnahabhain said its far lower chance that being kill by a meteor. Try counting it for clear adding chances (in fact multipling them) and count Bernoulli's trial for that. And tell us how long it will take you.

Duh! Realised I'd got it wrong once I got to work.

Just pay no attention to my above post!

catbarf
13-03-2008, 23:34
Sajuuk. He Whose Hand Shapes What Is.

/nerdy reference

Anyway, great program, very useful.