[OLD] The Numbers Thread

This forum is for discussion of individual Open Setups, including theoretical balance.
User avatar
Xylthixlm
Xylthixlm
!xmafia win
User avatar
User avatar
Xylthixlm
!xmafia win
!xmafia win
Posts: 5414
Joined: July 12, 2006

Post Post #25 (ISO) » Fri Mar 06, 2009 7:36 pm

Post by Xylthixlm »

Trumpet of Doom wrote:Now that I've got this finished (because I'm playing it), I'll post it here.

Rebels in the Palace (setup described here for those that don't know it)

Rebels win: 66%
Guards+king win: 26%
Happily ever after (i.e. only remaining players are king and one rebel): 9%

Full possibility chart posted here. My calculations assumed that when the rebels were even with the guards and king, they couldn't lynch the king that day, but they could still lynch guards even after they found the king.
When the rebels are even with the guards and king, the guards and king have met their win condition of equaling or outnumbering the rebels, and therefore win.
#mafia@irc.globalgamers.net

"Xyl was completely berserk" -dramonic
"Xyl's ruthless policy lynching won the game." -Vi
User avatar
Empking
Empking
Empking's Alt's Alt
User avatar
User avatar
Empking
Empking's Alt's Alt
Empking's Alt's Alt
Posts: 16758
Joined: May 4, 2008

Post Post #26 (ISO) » Fri Mar 06, 2009 11:31 pm

Post by Empking »

You are the King! To win you must lynch enough rebels that you and your loyal guards outnumber them. You lose if you are lynched.
Plus, if you guys want to make a point, skip the walls, because everyone else in the game does as well. - Magister Ludi
User avatar
Xylthixlm
Xylthixlm
!xmafia win
User avatar
User avatar
Xylthixlm
!xmafia win
!xmafia win
Posts: 5414
Joined: July 12, 2006

Post Post #27 (ISO) » Sat Mar 07, 2009 1:07 am

Post by Xylthixlm »

Empking wrote:
You are the King! To win you must lynch enough rebels that you and your loyal guards outnumber them. You lose if you are lynched.
That role PM is wrong. The original post with the setup specifically says "the king and guards win when they
equal or outnumber
the rebels".
#mafia@irc.globalgamers.net

"Xyl was completely berserk" -dramonic
"Xyl's ruthless policy lynching won the game." -Vi
User avatar
Trumpet of Doom
Trumpet of Doom
Mafia Scum
User avatar
User avatar
Trumpet of Doom
Mafia Scum
Mafia Scum
Posts: 1029
Joined: December 22, 2008
Location: Baker! Hell yeah!

Post Post #28 (ISO) » Sat Mar 07, 2009 4:57 am

Post by Trumpet of Doom »

In that case, our mod misread the setup.
Discretion is the better part of valor.
If I helped lynch you, you deserved it.

Retired from playing for the foreseeable future.
User avatar
Xylthixlm
Xylthixlm
!xmafia win
User avatar
User avatar
Xylthixlm
!xmafia win
!xmafia win
Posts: 5414
Joined: July 12, 2006

Post Post #29 (ISO) » Sat Mar 07, 2009 1:33 pm

Post by Xylthixlm »

Trumpet of Doom wrote:In that case, our mod misread the setup.
You should probably calculate the EVs for the correct setup.

Which you are doing the really hard way, BTW.

Hint: There are exactly 1980 different ways to order 8 rebels, 3 guards, and 1 king. Count the number of orderings which lead to the guards & king winning, then divide by 1980.
#mafia@irc.globalgamers.net

"Xyl was completely berserk" -dramonic
"Xyl's ruthless policy lynching won the game." -Vi
User avatar
Trumpet of Doom
Trumpet of Doom
Mafia Scum
User avatar
User avatar
Trumpet of Doom
Mafia Scum
Mafia Scum
Posts: 1029
Joined: December 22, 2008
Location: Baker! Hell yeah!

Post Post #30 (ISO) » Sat Mar 07, 2009 4:48 pm

Post by Trumpet of Doom »

Got it.

Rebels win: 60.4%
Guards win: 39.6%

That sound good?
Discretion is the better part of valor.
If I helped lynch you, you deserved it.

Retired from playing for the foreseeable future.
User avatar
Xylthixlm
Xylthixlm
!xmafia win
User avatar
User avatar
Xylthixlm
!xmafia win
!xmafia win
Posts: 5414
Joined: July 12, 2006

Post Post #31 (ISO) » Sat Mar 07, 2009 5:07 pm

Post by Xylthixlm »

Trumpet of Doom wrote:Got it.

Rebels win: 60.4%
Guards win: 39.6%

That sound good?
That's what I got. :)

TTTT******** 8!/(4!*3!)=280
(TTTG)TT****** 4*6!/(3!*2!)=240
(TTTG)(TG)TT**** 4*2*4!/2!=96
(TTTG)(TG)(TG)TT** 4*2*2*2=32
(TTTG)GGTTTT** 4*2=8
(TTGG)TTTT**** 6*4!/2!=72
(TTGG)(TTTG)TT** 6*4*2=48
(TGGG)TTTTTT** 4*2=8

12!/(8!*3!)=1980 total possibilities
Total scum win = 784/1980 = 39.6%
#mafia@irc.globalgamers.net

"Xyl was completely berserk" -dramonic
"Xyl's ruthless policy lynching won the game." -Vi
User avatar
mith
mith
Godfather
User avatar
User avatar
mith
Godfather
Godfather
Posts: 9267
Joined: March 27, 2002
Location: McKinney, TX
Contact:

Post Post #32 (ISO) » Mon Mar 09, 2009 7:06 am

Post by mith »

Ok, my spreadsheet currently has 8 Vanilla variants; but before I put it online, go take The Balance Quiz
User avatar
mith
mith
Godfather
User avatar
User avatar
mith
Godfather
Godfather
Posts: 9267
Joined: March 27, 2002
Location: McKinney, TX
Contact:

Post Post #33 (ISO) » Wed Mar 11, 2009 8:23 am

Post by mith »

Answers are up, I'll get my spreadsheet up soon. I want to put together a few graphs to demonstrate some trends.
User avatar
mith
mith
Godfather
User avatar
User avatar
mith
Godfather
Godfather
Posts: 9267
Joined: March 27, 2002
Location: McKinney, TX
Contact:

Post Post #34 (ISO) » Thu Mar 12, 2009 11:27 am

Post by mith »

Ok, haven't gotten around to doing any graphs, but I put the spreadsheet up. Link in the first post.

I'd like to play with California next. I'll probably make some simplifying assumptions to start with (Cop will always claim if first-choice for lynching, Townie claim will always be lynched). With those assumptions, Scum will always claim Cop if first-choice for lynching, and then we need to figure out whether the Cop should counter, whether the Scum should ever counter the Cop, and whether the Town should ever lynch a Cop claim.
User avatar
GIEFF
GIEFF
Internet Superstar
User avatar
User avatar
GIEFF
Internet Superstar
Internet Superstar
Posts: 1610
Joined: October 15, 2008

Post Post #35 (ISO) » Thu Mar 12, 2009 12:36 pm

Post by GIEFF »

Can you just program your simulator to determine the optimal percentage for the town to lynch a cop claim, the optimal percentage for scum to counter a cop claim, and an optimal percentage for cop to counter a scum-copclaim? They are all inter-related, but it seems as though it should be solvable.
User avatar
mith
mith
Godfather
User avatar
User avatar
mith
Godfather
Godfather
Posts: 9267
Joined: March 27, 2002
Location: McKinney, TX
Contact:

Post Post #36 (ISO) » Thu Mar 12, 2009 12:49 pm

Post by mith »

If I were using a simulator, probably. I'd rather find an exact solution, though.
User avatar
mith
mith
Godfather
User avatar
User avatar
mith
Godfather
Godfather
Posts: 9267
Joined: March 27, 2002
Location: McKinney, TX
Contact:

Post Post #37 (ISO) » Thu Mar 12, 2009 1:08 pm

Post by mith »

(There's also the rather interesting problem of what the scum should do if a townie is lynched D1 and they don't hit the Cop N1; it's probably optimal for one of them to claim an investigation, but you've got to deal with the question of which claim you are more likely to believe (first or second), and how often scum should claim to have gotten guilty/innocent.)
User avatar
GIEFF
GIEFF
Internet Superstar
User avatar
User avatar
GIEFF
Internet Superstar
Internet Superstar
Posts: 1610
Joined: October 15, 2008

Post Post #38 (ISO) » Thu Mar 12, 2009 1:16 pm

Post by GIEFF »

Simulating something 100,000 times is exact enough for me. Kudos on trying to do it the right way, though. I'll see if I can throw some code together and if it matches what you come up with.

Cop claims if lynch-target: 100%
Town lynches town-claim: 100%
Scum claims cop if lynch-target: 100%
Town lynches un-CC'd cop claim: 0%
Town lynches first of 2 cop claims: A%
Town lynches second of 2 cop claims: B%
Town lynches neither of 2 cop claims: 1 - A% - B%
Cop counters scum-cop-claim: C%
Scum counters cop-claim: D%

So I think it's just 4 variables. Anything I'm missing?
User avatar
mith
mith
Godfather
User avatar
User avatar
mith
Godfather
Godfather
Posts: 9267
Joined: March 27, 2002
Location: McKinney, TX
Contact:

Post Post #39 (ISO) » Thu Mar 12, 2009 1:29 pm

Post by mith »

Ok, assuming the cop always counters a scum fake claim (pretty sure this is correct play), and assuming the town always lynches a claimed cop if there are two such claims (see below), I get that the scum should *always* counterclaim the cop. Obviously the town should always lynch the first "cop" to claim (since it's twice as likely to be scum first), and so the EV in the 3/7 where we have a cop claim D1 is 19/105. Not very good for the town.

If those numbers are correct, the town's optimal strategy can't be to lynch a cop: they're probability of winning if they lynch one of the other five players is clearly at least 1/5 (if they hit the other scum D1, they have two lynches to find the fake cop). So I'll need to calculate that probability, and then rerun the numbers on scum countering. It's a bit more tricky, because there's the investigations to consider (what the scum claims, as well as what the town can deduce from the two claims; they might be able to eliminate certain pairings or confirm players).
User avatar
mith
mith
Godfather
User avatar
User avatar
mith
Godfather
Godfather
Posts: 9267
Joined: March 27, 2002
Location: McKinney, TX
Contact:

Post Post #40 (ISO) » Thu Mar 12, 2009 1:32 pm

Post by mith »

Oops, I see my problem. I'm multiplying by the wrong thing. EV *given a cop claim* is 19/45 (with a 3/7 chance of a cop claim - 19/105 is the contribution of that branch to the overall EV).

Still possible the town's strategy should be to not lynch a cop claim, though.
User avatar
shaft.ed
shaft.ed
dem.agogue
User avatar
User avatar
shaft.ed
dem.agogue
dem.agogue
Posts: 4998
Joined: August 15, 2007
Location: St. Louis

Post Post #41 (ISO) » Thu Mar 12, 2009 1:38 pm

Post by shaft.ed »

GIEFF wrote:Simulating something 100,000 times is exact enough for me. Kudos on trying to do it the right way, though. I'll see if I can throw some code together and if it matches what you come up with.

Cop claims if lynch-target: 100%
Town lynches town-claim: 100%
Scum claims cop if lynch-target: 100%
Town lynches un-CC'd cop claim: 0%
Town lynches first of 2 cop claims: A%
Town lynches second of 2 cop claims: B%
Town lynches neither of 2 cop claims: 1 - A% - B%
Cop counters scum-cop-claim: C%
Scum counters cop-claim: D%

So I think it's just 4 variables. Anything I'm missing?
Is this all assuming D1 with no investigations?
User avatar
GIEFF
GIEFF
Internet Superstar
User avatar
User avatar
GIEFF
Internet Superstar
Internet Superstar
Posts: 1610
Joined: October 15, 2008

Post Post #42 (ISO) » Thu Mar 12, 2009 1:38 pm

Post by GIEFF »

But if scum claims cop 100% of the time, then a townie claim is essentially a clear. I don't think there is an exact solution until you come to a decision on the game-theory-optimal percentages for scum claims and counterclaims.

Yes shafted, that's still D1, but I think I should make "town lynches town-claim" a variable rather than just 100%.

It makes superficial sense for the optimal scum-claiming-cop percentage to be equal to the "town lynches townie-claim" percentage, but I'm not sure that's really correct. It is surely optimal at 100% and at 0%, but is it optimal in between?

Update:


Cop claims if lynch-target: 100%
Town lynches town-claim: A%
Scum claims cop if lynch-target: A% (I believe this is correct)
Town lynches un-CC'd cop claim: 0%
Town lynches first of 2 cop claims: B%
Town lynches second of 2 cop claims: C%
Town lynches neither of 2 cop claims: 1 - B% - C%
Cop counters scum-cop-claim: D%
Scum counters cop-claim: E%



Should town ever lynch an un-CC'd cop claim?
User avatar
Xylthixlm
Xylthixlm
!xmafia win
User avatar
User avatar
Xylthixlm
!xmafia win
!xmafia win
Posts: 5414
Joined: July 12, 2006

Post Post #43 (ISO) » Thu Mar 12, 2009 1:42 pm

Post by Xylthixlm »

I'm trying to find a closed-form formula for the town's chances of winning a vanilla game.

Let w(t,p) be the town's chances of winning a vanilla game with t townies in p players, assuming random lynches and no nolynch.

Consider m(j,h) = h * 2^(j + h) * w(j + h, 2 * h)
Then
m(j,h) = h * 2^(j + h) when j = h;
m(j,h) = 0 when j = 0;
m(j,h) = m(j - 1, h) + m(j, h - 1) otherwise.

That's as far as I've gotten right now. It looks like there should be a closed formula for w() based on the recurrence relation of m(), but I'm not sure how to find it.

m(j,0) =? 2^j * j * (j + 1)
m(j,h) =? sum(i = 0 to j, 2^i * i * (i + 1) * (j + h - i)! / [(j - i)! * h!])

(EDIT: Trying to verify my math here.)
Last edited by Xylthixlm on Thu Mar 12, 2009 7:02 pm, edited 3 times in total.
#mafia@irc.globalgamers.net

"Xyl was completely berserk" -dramonic
"Xyl's ruthless policy lynching won the game." -Vi
User avatar
mith
mith
Godfather
User avatar
User avatar
mith
Godfather
Godfather
Posts: 9267
Joined: March 27, 2002
Location: McKinney, TX
Contact:

Post Post #44 (ISO) » Thu Mar 12, 2009 1:46 pm

Post by mith »

Eesh, messy. Here's the problem, for those confused by my ramblings:

There are two cop claims D1. The town lynches someone else, who comes up townie. We go to night with 2 claimed cops, 1 other scum, and 3 townies. One option for the scum is to kill the real cop, which reduces the whole thing to a 1:4 vanilla game, basically (town has two chances to hit the other cop, they win 7/15 of these).

The second option is to kill someone else. D2, there are now 56 cases to wade through:

Which cop has to claim his investigation first? (2)
Who did the real cop investigate? (4)
Who did the fake cop claim to investigate, and what did he claim to get? (7 - he'll obviously claim innocent on the dead player if he goes with that claim, but could claim either on anyone else)

If the scum claims first, he has (essentially) five options - rat out buddy, protect buddy, frame townie (2 options for which), buddy up to townie (same), claim dead player. But if the real cop claims first, the scum has either five or seven options... and the probabilities for how he should claim could potentially be different for each different situation he finds himself in.

Then the town has to sort out what they've learned (in some cases, they can reduce it to a 50-50)... and they can still take into account how much more likely it was for the scum to have claimed first D1.

What a mess. :)
User avatar
mith
mith
Godfather
User avatar
User avatar
mith
Godfather
Godfather
Posts: 9267
Joined: March 27, 2002
Location: McKinney, TX
Contact:

Post Post #45 (ISO) » Fri Mar 27, 2009 5:41 am

Post by mith »

We're discussing multi-group vanilla setups in the certification thread, thought I'd move some of that over here.

I think I've shown that at 1-1-2, the town's best play is for one of the townies to offer himself up as a sacrifice. This reduces it to 1-1-1, which has an EV for the town of either 1/3 or 1/4, depending on how draws are counted.

Now the question is: What is the best play in 1-1-3?

The sacrifice plan now puts us in 1-1-2 the next night, giving us 7/27 (assuming my interpretation of the draw rules).

Lynching at random is a slight improvement: 2/5 chance of hitting scum (taking us to 1-2, 1/3 EV), 3/5 chance of hitting town (7/27, as above). Overall: 13/45

No Lynching is better still. There's a 1/16 chance of a cross-kill (town win); otherwise, either one scum gets hit (1-2, 1/3 EV) or one/two townies get hit, putting us in either 1-1-1 or 1-1-2 which have the same 1/3 EV as shown above. Overall: 3/8
User avatar
mith
mith
Godfather
User avatar
User avatar
mith
Godfather
Godfather
Posts: 9267
Joined: March 27, 2002
Location: McKinney, TX
Contact:

Post Post #46 (ISO) » Fri Mar 27, 2009 5:53 am

Post by mith »

1-1-4... Lynching scum only gets us to 1-3 (NL down to 1-2, EV 1/3), so that's no good.

NL gives 1/25 cross-kill, one scum hit puts us at 1-3 (NL down to 1-2, EV 1/3), two townies hit put us at 1-1-2 (EV 1/3), but one townie double killed takes us to 1-1-3 (3/8); 4/25 of the latter happening. Overall we have... 1/25+4/15+3/50 = 55/150 = 11/30 = 36.666%.

3/8 = 37.5%, so the best play is actually to sacrifice a townie again and reduce to 1-1-3 going to night.

1-1-5 lynching: 2/7 chance of hitting scum, with a EV of 7/15 if we do; 5/7 chance of a 1-1-4 night, with the EV of 11/30. Overall: 2/15+11/42 = 83/210 = 39.5%. Better, but:

NL gives 1/36 cross-kill (EV 1), 10/36 one scum dead (1-4, EV 7/15), anything else is 1-1-4 or 1-1-3 (3/8). Overall: 1/36+7/54+25/96 = 361/864 = 41.8%.
User avatar
Tenchi
Tenchi
Mafia Scum
User avatar
User avatar
Tenchi
Mafia Scum
Mafia Scum
Posts: 1438
Joined: November 19, 2008
Location: California, USA

Post Post #47 (ISO) » Thu Apr 09, 2009 7:27 pm

Post by Tenchi »

Question: I have trouble with the numbers here, but I'm trying to review my statistics here. Which is better, finding some closed formula do determine the exact solution for EVs or simulating?

I kinda gave up on coming up with a formula, given that I can't keep up with Xyl's post 43, and it's vanilla. And I'm boggled with how the spreadsheet formulas were derived. Would simulating a setup be acceptable?
Yes. That same Tenchi. :D

Reicheru and Tenchi begin to bond more, sending love letters to each other.
User avatar
mith
mith
Godfather
User avatar
User avatar
mith
Godfather
Godfather
Posts: 9267
Joined: March 27, 2002
Location: McKinney, TX
Contact:

Post Post #48 (ISO) » Fri Apr 10, 2009 3:16 am

Post by mith »

Simulation is fine... the main issue is that it's difficult to know which strategy is optimal in certain situations, and in order to run a simulation you either need to decide beforehand how it will treat those situations (so you are just guessing what is optimal, and may not be finding the true EV... and in some cases, a non-obvious strategy may drastically shift the balance of the game), or you need to brute force it and try all the different possible strategies (at which point, might as well find an exact solution, IMO).
User avatar
GIEFF
GIEFF
Internet Superstar
User avatar
User avatar
GIEFF
Internet Superstar
Internet Superstar
Posts: 1610
Joined: October 15, 2008

Post Post #49 (ISO) » Fri Apr 10, 2009 5:28 am

Post by GIEFF »

You don't need brute force - you can code an evolutionary sim, where you give each strategy a probability of occuring. Let those probabilities "mutate" over time, changing randomly in either direction, and eventually an equilibrium will be reached.
Post Reply

Return to “Open Setup Discussion”