|
Post by stamos65 on Jun 8, 2018 1:03:47 GMT -5
Let's have some fun.How many ways can you fit weapons on the four slots on a patton such that no adjacent slot has the same weapon?Adjacent slot means for example the two side weapons on the patton or the top right and bottom right weapon slots.
|
|
|
Post by stamos65 on Jun 8, 2018 1:06:33 GMT -5
You can also post your War Robots math questions here
|
|
|
Post by windcaster on Jun 8, 2018 1:46:16 GMT -5
Ok, someone go for his legs, I got the top.
|
|
Deleted
Deleted Member
Posts: 0
Karma:
|
Post by Deleted on Jun 8, 2018 2:27:50 GMT -5
Lots, using Terry Pratchett's counting for trolls.
|
|
|
Post by Pulse Hadron on Jun 8, 2018 2:42:37 GMT -5
Figure out the number of light weapons which I’ll label N. Then I think it’s N*(N-1)^3
This is a first guess, I’ll ponder it some more later. Btw, are you asking or do you already know?
edit: oh wait, need clarification what you mean by adjacent? Are you only talking about adjacency between the weapons on either side but not the adjacency of the 2 weapons on top? Are the top and bottom weapons the same on both sides?....
|
|
|
Post by eco on Jun 8, 2018 5:56:07 GMT -5
it is M where M is the proper number of non adjacent linear escalations. I did not consider hyperextrapolation solutions since they would be located on the z-axis. anyhow you could easily formulate the solution of these as M+L. All statements are made with the following assumtions (to get a reproducable result) 20 degree celsius, 0m above sea level. 40% humidity, 50% full moon cycle, lastly but not least I assume the bot stands still.
|
|
|
Post by stamos65 on Jun 8, 2018 9:41:59 GMT -5
Figure out the number of light weapons which I’ll label N. Then I think it’s N*(N-1)^3 This is a first guess, I’ll ponder it some more later. Btw, are you asking or do you already know? edit: oh wait, need clarification what you mean by adjacent? Are you only talking about adjacency between the weapons on either side but not the adjacency of the 2 weapons on top? Are the top and bottom weapons the same on both sides?.... Think of it as a square where the four corners are where the light weapons are supposed to go Edit:yeah it was for fun,I already know the answer.
|
|
|
Post by Pulse Hadron on Jun 8, 2018 21:00:42 GMT -5
Ah, ok. n*(n-1)^3 works for a segment, the first slot you have n choices and for every subsequent slot there’s (n-1) choices.
But now considering a ring where the last slot of the square is adjacent to the first, some of those (n-1) choices of the last slot are the same as the first slot and they need to be subtracted. To find that amount I drew out a tree for 4 types and reasoned about the counts (because my permutation knowledge is rusty). So given types ABCD (n=4), slot 1 has A which branches to B C and D in slot 2, which branch to slot 3 as B->ACD, C->ABD, D->ABC, and those branch into slot 4 resulting in 27 paths down the tree. But 6 of those paths end in A.
Looking at the tree I could see that A only appears in slot 4 once for every node in slot 3 that is not A. That is, the number of terminal A equals the number of non-A in slot 3. To get the number of non-A in slot 3 note that every node in slot 2 is necessarily not A and there are (n-1) of them. Each of those (n-1) nodes in slot 2 has (n-1) branches to slot 3, but one of those branches goes to A. So there are (n-2) branches from slot 2 that go to non-A in slot 3. Therefore, the number of terminal A to subtract is the number of nodes in slot 2 (n-1) times the number of branches that don’t go to A (n-2).
The counts of that tree are for one type in slot 1. Multiply by n to get the count for all types in slot 1 and yields the expression...
n * ( (n-1)^3 - (n-1)*(n-2) )
(n-1)^3 gives the total paths from a single starting type, subtract (n-1)*(n-2) to remove terminals with the same starting type, and multiply by n for every starting type.
Trying to simplify I foiled that to n * (n^3 - 4*n^2 + 6*n - 3) which isn’t much nicer. Betting there’s a cleaner way to write this.
Anyways, there are 12 light weapons and plugging that in gives 14652 possibilities.
While looking up the number of light weapons I noticed a complication, a 13th light slot item that is not a weapon and can’t be mounted on the top 2 slots, the god damned Écu shield. I will ponder this later. I’m also curious for a general expression of non-adjacency on any ring size.
|
|
|
Post by Pulse Hadron on Jun 8, 2018 21:32:30 GMT -5
Factoring in Ecu was pretty easy. It can only by mounted in 1 slot since it has to be bottom left or bottom right which are adjacent. Considering mounted on bottom left there are n choices for top left (n is still 12) and (n-1) choices for both top right and bottom right. That’s 1452 possibilities with Ecu on the bottom left, multiply by 2 for it also mounted bottom right for a total of 2904 possibilities with Ecu. Add that to the possibilities without Ecu, 14652, for a grand total of 17556 possibilities of mounting light items on a Patton with no adjacency repetition.
|
|
|
Post by Browncoats4ever on Jun 8, 2018 23:46:51 GMT -5
You lost me at math.
|
|
|
Post by zombiewolf907 on Jun 8, 2018 23:53:54 GMT -5
Three - wait - that is how many licks it takes to get to the center of a Tootsie Pop! (Showing my age)
|
|
|
Post by Browncoats4ever on Jun 9, 2018 0:27:04 GMT -5
37?!
|
|
|
Post by HarvesterOsorrow on Jun 9, 2018 9:33:41 GMT -5
Is adjacency really a word? Huh, learn something new every day
Next thread is grammar and English within War Robots
Good times LOL
|
|
|
Post by Pulse Hadron on Jun 9, 2018 21:27:24 GMT -5
I already know the answer. So am I right?
|
|
|
Post by stamos65 on Jun 11, 2018 9:06:55 GMT -5
I already know the answer. So am I right? Actually,my answer was 12210.How? Here's the formula(X is the number of weapons) {(X-1)*((X-2)^3)}-{(X-1)*(X-2)-(X-3)})[C1]-{(1*X*(X-1)^2)*2}[C2] Where C stands for case.The case 1 bit is to calculate the number of builds without the ecu,that's why it's X-1.The case 2 bit was to calculate the builds with the ecu.I multiplied it by 2 cuz,you know,the builds with ecu on the left can be reflected to the right.
|
|
|
Post by Pulse Hadron on Jun 11, 2018 22:09:21 GMT -5
{(X-1)*((X-2)^3)}-{(X-1)*(X-2)-(X-3)})[C1]-{(1*X*(X-1)^2)*2}[C2] Not being sure where all of your expression comes from (there’s an extra closing parentheses before C1) and not reproducing your result value from it I noticed there’s only 13^4 = 28561 total permutations so wrote a bit of code to brute force test each one. dim arr(3), i0, i1, i2, i3, count As integer
for i0 = 0 to 12 arr(0) = i0 for i1 = 0 to 12 arr(1) = i1 for i2 = 0 to 12 arr(2) = i2 for i3 = 0 to 12 arr(3) = i3
if hasNoAdjacencyRing(arr) then count = count + 1
next next next next
resultField.Text = Str(count)
Function hasNoAdjacencyRing(arr() As integer) As Boolean //a value of 0 in the array is considered an Ecu //index 0=bottomleft 1=topleft 2=topright 3=bottomright dim i As integer
for i = 0 to 2 //Test adjacency on ring if arr(i) = arr(i+1) then return False next if arr(0) = arr(3) then return False
if arr(1) = 0 or arr(2) = 0 then return False //filter Ecu on top
return True //no adjacency on ring and no misplaced Ecu
End Function
The result is 17556. I’ll list them out later
|
|