11061  Playing War
Moderator: Board moderators

 A great helper
 Posts: 481
 Joined: Sun Jun 19, 2005 1:18 am
 Location: European Union (Slovak Republic)
I think now I understand the problem. I had some wrong idea. But now
I have same kind of problem. My code outputs 172 for 100. for 171 the probability is 0.4986... Most of the outputs matches. I have used:
p(m,n)=p1*p(m,n3)+p2*(m1,n2)+p3*(m2,n1)+p4*(m3,n)
where
p1=6420.0/46656.0;
p2=10017.0/46656.0;
p3=12348.0/46656.0;
p4=17871.0/46656.0;
and p(m,n) is the probability of success if attack has m soldier and defend has n soldier.
I have same kind of problem. My code outputs 172 for 100. for 171 the probability is 0.4986... Most of the outputs matches. I have used:
p(m,n)=p1*p(m,n3)+p2*(m1,n2)+p3*(m2,n1)+p4*(m3,n)
where
p1=6420.0/46656.0;
p2=10017.0/46656.0;
p3=12348.0/46656.0;
p4=17871.0/46656.0;
and p(m,n) is the probability of success if attack has m soldier and defend has n soldier.
From 0 to 0
well... i cant understand this problem clearly. can any one help?
for example, if attacker had 1 army and defender 1 then, probablity of losing:
(1 + 2 + 3 + 4 + 5 + 6)/6^2 = 21/36 > .5
when attacker 2 and defender 1, probab of losing:
(1^2 + ...+ 6^2)/6^3 = 91/216 < .5 hence winning prob > .5
then how can the output be 3?
one more thing, say A = 4 D = 1, what is the probablity for winning for A?
for example, if attacker had 1 army and defender 1 then, probablity of losing:
(1 + 2 + 3 + 4 + 5 + 6)/6^2 = 21/36 > .5
when attacker 2 and defender 1, probab of losing:
(1^2 + ...+ 6^2)/6^3 = 91/216 < .5 hence winning prob > .5
then how can the output be 3?
one more thing, say A = 4 D = 1, what is the probablity for winning for A?
Self judging is the best judging!
You cannot use all your army in attack. Read
You must have ony army in your teritory when attack. I couldn't figure out the problem in my solution though. Can anyone check the previous post?????When attacking, at least one army must remain on the origin territory, so a player with 3 armies can only use 2 of them to attack an adjacent territory. The defense, however, can use all the available number of armies to defend, up to a maximum allowed number of armies.
From 0 to 0
yap i got that!
but well... say A has 100 and D has 100. say 3 from each side in battle field. and say 2 of D is killed and 1 of A. now what will be about the rest of the armies? will the back to their main base? and then new battle begins?
the process will go on in this style?
but well... say A has 100 and D has 100. say 3 from each side in battle field. and say 2 of D is killed and 1 of A. now what will be about the rest of the armies? will the back to their main base? and then new battle begins?
the process will go on in this style?
Self judging is the best judging!
please help some one, i cant understand where is the mistake. it does not give correct output for 5.
Code: Select all
AC
Last edited by shanto86 on Wed Aug 23, 2006 11:06 am, edited 1 time in total.
Self judging is the best judging!
ok i got AC. it was not that much tough, but to me the tougest part was to compute the base cases. to do so i have written another code to compute the base probablities.
now i can answer my own questions:
1. no it is not necessary to send 3 armies always. they are the best possible player so they both plays optimally.
2. in a battle the undied player will go back to its barrack.
Mahbub
now i can answer my own questions:
1. no it is not necessary to send 3 armies always. they are the best possible player so they both plays optimally.
2. in a battle the undied player will go back to its barrack.
Mahbub
Self judging is the best judging!
well.. towhid vi, i think u just had not read the next sentence:
[quote]It should not be a surprise that usually each player uses as many armies in a combat as he can, even though the rules allow him to use less. On the other hand, some players are a little bit neurotic and when they start attacking an enemy territory, they don
[quote]It should not be a surprise that usually each player uses as many armies in a combat as he can, even though the rules allow him to use less. On the other hand, some players are a little bit neurotic and when they start attacking an enemy territory, they don
Self judging is the best judging!