Kingdom Rush... with math!!!

For the King!

Kingdom Rush... with math!!!

by Manijure » Tue Jan 03, 2017 9:28 pm

Since I've posted everything about Kingdom Rush I wanted to in the forums, I have decided to bring some arithmetic and probability to you guys. Pretty sure most of you guys here are math nerds (but I could always be wrong).

Anyways, I have received new stat information about the Golden Longbow's Crimson Sentence percentage chance. I updated the wiki with this information a while back, but if you haven't seen it yet, here it is:

There's a 3/6/9% chance for each Golden Longbow attack to instakill an enemy. However, if the enemy is in short range, than the percentage is halved (1.5/3/4.5%). Also, don't forget that in short-range, the Golden Longbow's attack speed doubles.

For this problem, let's assume that Crimson Sentence is fully upgraded. Calculate the probability that at least one of two short-range attacks will instakill the targeted enemy, and based on the value, determine if it is better for a Golden Longbow to shoot long-range for Crimson Sentence than shooting short-range.

As you can tell, I am obsessed with numbers. :P
"Carpe diem. Seize the day, boys. Make your lives extraordinary."
User avatar
User
 
Posts: 907
Joined: Fri Jun 19, 2015 3:27 pm
Location: Somewhere

Re: Kingdom Rush... with math!!!

by RaZoR LeAf » Tue Jan 03, 2017 9:36 pm

Manijure wrote:Pretty sure most of you guys here are math nerds (but I could always be wrong).

:P


Not me, I hate maths.

But I appreciate the details added to the wiki.
Image
Yes it's me
User avatar
Moderator
 
Posts: 2732
Joined: Thu Jun 13, 2013 10:05 pm
Location: Wales, UK

Re: Kingdom Rush... with math!!!

by nova_n » Wed Jan 04, 2017 12:27 am

Its equal at far/close. lets say, afar, he does 10 attacks. At close, 20. Either way, 3 shots are instakills
I AM THE VIC VIPER
User avatar
User
 
Posts: 196
Joined: Mon Jul 25, 2016 5:45 pm
Location: Elmore and Mgtown

Re: Kingdom Rush... with math!!!

by Manijure » Wed Jan 04, 2017 1:30 am

nova_n wrote:Its equal at far/close. lets say, afar, he does 10 attacks. At close, 20. Either way, 3 shots are instakills


I'm looking for precise probability calculations, as in exact percentages. For starters, what is the probability that out of two short-range shots, none of them instakill?
"Carpe diem. Seize the day, boys. Make your lives extraordinary."
User avatar
User
 
Posts: 907
Joined: Fri Jun 19, 2015 3:27 pm
Location: Somewhere

Re: Kingdom Rush... with math!!!

by Big Bad Bug » Wed Jan 04, 2017 2:29 am

Manijure wrote:For this problem, let's assume that Crimson Sentence is fully upgraded. Calculate the probability that at least one of two short-range attacks will instakill the targeted enemy, and based on the value, determine if it is better for a Golden Longbow to shoot long-range for Crimson Sentence than shooting short-range.


At least once? Well then:

[+] SPOILER
The first shot has a chance of 4.5% to instantly kill. The second shot also has a 4.5% chance. Therefore, 4.5% + 4.5% = 9%. Nova_n is right, assuming that at close range, the fire rate is double that of the long range fire rate.


Manijure wrote:What is the probability that out of two short-range shots, none of them instakill?


[+] SPOILER
If there's a 4.5% chance to activate, the missing portion is 95.5%. If it shoots twice, then it's the chance of not activating within the situation that the first shot didn't instakill, either. Therefore, 95.5% x 95.5% = 91.2025%.
BBB
User avatar
Moderator
 
Posts: 7815
Joined: Sun Jan 12, 2014 5:22 pm
Location: Your worst nightmares

Re: Kingdom Rush... with math!!!

by Manijure » Wed Jan 04, 2017 2:57 am

Big Bad Bug wrote:
Manijure wrote:For this problem, let's assume that Crimson Sentence is fully upgraded. Calculate the probability that at least one of two short-range attacks will instakill the targeted enemy, and based on the value, determine if it is better for a Golden Longbow to shoot long-range for Crimson Sentence than shooting short-range.


At least once? Well then:

[+] SPOILER
The first shot has a chance of 4.5% to instantly kill. The second shot also has a 4.5% chance. Therefore, 4.5% + 4.5% = 9%. Nova_n is right, assuming that at close range, the fire rate is double that of the long range fire rate.


Manijure wrote:What is the probability that out of two short-range shots, none of them instakill?


[+] SPOILER
If there's a 4.5% chance to activate, the missing portion is 95.5%. If it shoots twice, then it's the chance of not activating within the situation that the first shot didn't instakill, either. Therefore, 95.5% x 95.5% = 91.2025%.


[+] SPOILER
You can't add 4.5 and 4.5 together to account for the two short-range shots. Each shot is independent of one another. What you need to do is subtract 1 by the probability that none of the shots instakill, which you already calculated. This is the case because there are only three possible scenarios: none of them instakill, one of them instakills, or both of them instakill.
"Carpe diem. Seize the day, boys. Make your lives extraordinary."
User avatar
User
 
Posts: 907
Joined: Fri Jun 19, 2015 3:27 pm
Location: Somewhere

Re: Kingdom Rush... with math!!!

by Big Bad Bug » Wed Jan 04, 2017 3:22 am

Manijure wrote:
Big Bad Bug wrote:
Manijure wrote:For this problem, let's assume that Crimson Sentence is fully upgraded. Calculate the probability that at least one of two short-range attacks will instakill the targeted enemy, and based on the value, determine if it is better for a Golden Longbow to shoot long-range for Crimson Sentence than shooting short-range.


At least once? Well then:

[+] SPOILER
The first shot has a chance of 4.5% to instantly kill. The second shot also has a 4.5% chance. Therefore, 4.5% + 4.5% = 9%. Nova_n is right, assuming that at close range, the fire rate is double that of the long range fire rate.


Manijure wrote:What is the probability that out of two short-range shots, none of them instakill?


[+] SPOILER
If there's a 4.5% chance to activate, the missing portion is 95.5%. If it shoots twice, then it's the chance of not activating within the situation that the first shot didn't instakill, either. Therefore, 95.5% x 95.5% = 91.2025%.


[+] SPOILER
You can't add 4.5 and 4.5 together to account for the two short-range shots. Each shot is independent of one another. What you need to do is subtract 1 by the probability that none of the shots instakill, which you already calculated. This is the case because there are only three possible scenarios: none of them instakill, one of them instakills, or both of them instakill.


[+] SPOILER
I suppose I got overexcited to answer. :P Let me try again:

There should be 4 possible scenarios. None, both, and the 2 scenarios that account for either one of the 2 shots instakilling, whether the first or second. For at least once, this includes 3 of those: Both, the first shot, and the second shot instakilling. The overall chance is the sum of these 3 chances.
BBB
User avatar
Moderator
 
Posts: 7815
Joined: Sun Jan 12, 2014 5:22 pm
Location: Your worst nightmares

Re: Kingdom Rush... with math!!!

by Zonoro13 » Wed Jan 04, 2017 3:33 am

Big Bad Bug wrote:
[+] SPOILER
I suppose I got overexcited to answer. :P Let me try again:

There should be 4 possible scenarios. None, both, and the 2 scenarios that account for either one of the 2 shots instakilling, whether the first or second. For at least once, this includes 3 of those: Both, the first shot, and the second shot instakilling. The overall chance is the sum of these 3 chances.

[+] SPOILER
yup. Note that you don't have to calculate each of those separately, although you can; you can just take all cases (100%) and subtract the cases where there are no instakills. The last bit is easily calculated.


RaZoR LeAf wrote:
Manijure wrote:Pretty sure most of you guys here are math nerds (but I could always be wrong).

:P


Not me, I hate maths.

But I appreciate the details added to the wiki.

And I'm totally illiterate, haha, I hate reading and writing. How coincidental that we both unabashedly hate things integral to the foundation of knowledge and society :p
In the beginning there was nothing, which exploded.
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
-Terry Pratchett

Is this the latest dank meme? -Pencil
User avatar
User
 
Posts: 5167
Joined: Mon Sep 16, 2013 11:43 pm
Location: memes

Re: Kingdom Rush... with math!!!

by tmn loveblue » Wed Jan 04, 2017 4:14 am

From the following calculations, I conclude that the GL is more effective at range than shooting point-blank.

[+] SPOILER
Let's look at the scenario where the GL get to shoot twice at a single enemy that is insta-kill-able:

The chance that the first arrow kill is 4.5%

The chance that neither arrows instakill is 95.5%x95.5% = 91.2%

The chance that the first arrow don't kill but the second one does is 4.5%x95.5%=4.2975%

Obviously, between one long range shot and two short range ones, the long range arrow has marginally more instakill chance, by 0.2% exactly. We look at this issue from a different view point:

The GL immediately fire an arrow when the enemy is in sight, whether close or far away. If the target is far away, he will fire again after a time period of X. If the target is nearby, the delay between shots will be X/2. See below:

Far target: Shot 1......X......Shot 2......X......Shot 3......X......Shot 4

Near target: Shot 1...X/2...Shot 2...X/2...Shot 3...X/2...Shot 4...X/2...Shot 5...X/2...Shot 6...X/2...Shot 7

So the GL will shoot more arrows at a near target than a far target. Within a period of time of nX (n is a positive integer), if the far target would receive m arrows, a near target would receive 2m-1 arrows. Using the calculations similar to the ones above, we can see that the possibility of instakilling at long range gets increasingly greater than the possibility of instakilling at short range. For example, if firing is sustained for a time period of 3X, the chance at long range is 31.43% while at short range it is 27.55%.

Speaking in terms of damage done without both skills, long range sniping is still better than short range arrow rain, due to the damage halving at short range, and that short range firing cannot get twice the number of arrows into the target compare to firing at long range.

Therefore, long range sniping with the GL is the best tactic.
Last edited by tmn loveblue on Wed Jan 04, 2017 3:05 pm, edited 2 times in total.
User avatar
User
 
Posts: 2396
Joined: Fri Feb 21, 2014 10:41 pm

Re: Kingdom Rush... with math!!!

by Manijure » Wed Jan 04, 2017 4:16 am

tmn loveblue wrote:
[+] SPOILER
Let's look at the scenario where the GL get to shoot twice at a single enemy that is insta-kill-able:

The chance that the first arrow kill is 4.5%

The chance that neither arrows instakill is 95.5%x95.5% = 91.2%

The chance that the first arrow don't kill but the second one does is 4.5%x95.5%=4.2975%

Obviously, between one long range shot and two short range ones, both taking the same amount of time to execute, the long range arrow has marginally more instakill chance, by 0.2% exactly. However two short-range arrows deal twice as much damage. So short-range is generally better.


[+] SPOILER
Actually in short-range, the Golden Longbow's damage is halved to account for the attack speed boost. But you got the question right! :)
"Carpe diem. Seize the day, boys. Make your lives extraordinary."
User avatar
User
 
Posts: 907
Joined: Fri Jun 19, 2015 3:27 pm
Location: Somewhere

Re: Kingdom Rush... with math!!!

by tmn loveblue » Wed Jan 04, 2017 4:31 am

Updated my post, with a lot more content, Manijure ;)
User avatar
User
 
Posts: 2396
Joined: Fri Feb 21, 2014 10:41 pm

Re: Kingdom Rush... with math!!!

by Ninja » Wed Jan 04, 2017 5:47 am

So, why are you all using spoilers again?
:hero:
User avatar
User
 
Posts: 4935
Joined: Wed Jul 22, 2015 7:57 pm

Re: Kingdom Rush... with math!!!

by tmn loveblue » Wed Jan 04, 2017 12:09 pm

I guess to give people a choice of whose complex calculations they want to look at. It makes the topic neat.
User avatar
User
 
Posts: 2396
Joined: Fri Feb 21, 2014 10:41 pm

Re: Kingdom Rush... with math!!!

by RaZoR LeAf » Wed Jan 04, 2017 1:56 pm

tmn loveblue wrote:I guess to give people a choice of whose complex calculations they want to look at. It makes the topic neat.


Not really. The main reason you're reading or replying to the thread is for the subject under discussion. Having to open all the spoiler posts just to read it is pointless and annoying.

[+] SPOILER
Nothing


[+] SPOILER
Nothing here either


[+] SPOILER
Spoilerception doesn't work. Wise.


Can you see yourself posting in any other thread like this? It would make things neat if you were grouping multiple things on one page, but not your standard replies.
Image
Yes it's me
User avatar
Moderator
 
Posts: 2732
Joined: Thu Jun 13, 2013 10:05 pm
Location: Wales, UK

Re: Kingdom Rush... with math!!!

by Big Bad Bug » Wed Jan 04, 2017 2:26 pm

Ninja wrote:So, why are you all using spoilers again?


I wanted to leave an answer that people can check for themselves if they want without spoiling the answer in case they want to try.
BBB
User avatar
Moderator
 
Posts: 7815
Joined: Sun Jan 12, 2014 5:22 pm
Location: Your worst nightmares

Re: Kingdom Rush... with math!!!

by tmn loveblue » Wed Jan 04, 2017 2:59 pm

;) I was thinking about MasterKnightDH and all his calculations on frame rate, DPS and such. Not everyone want to see that, many just skim through.

I would add a conclusion outside of the Spoiler though.
User avatar
User
 
Posts: 2396
Joined: Fri Feb 21, 2014 10:41 pm

Re: Kingdom Rush... with math!!!

by nova_n » Wed Jan 04, 2017 8:00 pm

tmn, why is it 2m-1? does it not fire 1 arrow at close range? If it didnt, then that changes alot
I AM THE VIC VIPER
User avatar
User
 
Posts: 196
Joined: Mon Jul 25, 2016 5:45 pm
Location: Elmore and Mgtown

Re: Kingdom Rush... with math!!!

by tmn loveblue » Thu Jan 05, 2017 1:32 am

nova_n wrote:tmn, why is it 2m-1? does it not fire 1 arrow at close range? If it didnt, then that changes alot

Well, you can look at the rows where I did the calculations. Here are they:

[+] SPOILER
X: the delay between shots at long range => X/2 is the delay between shots at short range

Far target: Shot 1......X......Shot 2......X......Shot 3......X......Shot 4

Near target: Shot 1...X/2...Shot 2...X/2...Shot 3...X/2...Shot 4...X/2...Shot 5...X/2...Shot 6...X/2...Shot 7

At close range, while it is true that the GL fires twice as fast, but within a time frame of nX, with n being any positive integer, a near target would never receive twice the number of arrows that a far target would receive within that time frame. For a near target to receive double the number of arrows, the time frame must be (2n+1)X/2, with n being any natural number. That is because the GL takes an additional amount of time of X/2 to let that last arrow flies.
User avatar
User
 
Posts: 2396
Joined: Fri Feb 21, 2014 10:41 pm

Re: Kingdom Rush... with math!!!

by nova_n » Thu Jan 05, 2017 2:27 am

Wait.. Why does it actually take a while for the last arrow to fire?
I AM THE VIC VIPER
User avatar
User
 
Posts: 196
Joined: Mon Jul 25, 2016 5:45 pm
Location: Elmore and Mgtown

Re: Kingdom Rush... with math!!!

by tmn loveblue » Fri Jan 06, 2017 3:16 pm

nova_n wrote:Wait.. Why does it actually take a while for the last arrow to fire?

Because of the delay between shots :?
User avatar
User
 
Posts: 2396
Joined: Fri Feb 21, 2014 10:41 pm


Who is online
Users browsing this forum: Bing [Bot] and 127 guests