Total Posts:2Showing Posts:12
Mafia Math & Probabilities
Posts: 3,527
Add as Friend Challenge to a Debate Send a Message 
9/18/2015 9:42:32 PM Posted: 1 year ago I was recently approached for my opinion on the balancing of mafia games. But before roles are discussed, what are the win probabilities of a mafia game based on player faction count? This study  http://arxiv.org...  asserts that the number of mafia required for a balanced roleless game is proportional to the square root of the total number of players.
Since the math is often too difficult, I wrote a program that will provide some solid numbers, as well as the shift in probability if a cop was thrown in the mix. Probabilities are given as 0 <= p <= 1, where p is the chance of town winning, rounded to the thousandth decimal place. As 10 million trials were done per scenario, p is confidently within a 0.1% range of the true theoretical value. ==== Full Vanilla game: Total # of players / town / mafia  p; Full random lynch every DP. Town death every NP. Source code (Java; pls no comment on bad coding practice): http://pastebin.com... 7/5/2  .229 11/9/2  .352 11/8/3  .165 15/13/2  .430 15/12/3  .245 15/11/4  .122 Vanilla + 1 Cop game: Total # of players / town / mafia  p; Save mechanic as Vanilla, with exceptions: 1 cop, Cop makes 1 investigation per night, Investigating mafia prompts cop to out the following DP and guarantees a mafia lynch, Upon lack of guilties, cop outs DP sqrt(playerCount1), Inno'd players are confirmed, Cop and confirmed townies cannot be lynched, Preconfirmed town survival rate approximated, If cop is about to be lynched, he outs, if mafia is about to be lynched, he claims cop, forcing the cop to out, Upon outing, cop dies, Confirmed townies receive priority death. (Note that play is not 100% optimal.) Source code (Java): http://pastebin.com... 9/7/2  .460 11/9/2  .567 11/8/3  .271 15/13/2  .631 15/12/3  .370 15/11/4  .176 Findings:  Surprisingly, given a constant of 2 mafia members, it will take 19 or more town to make the game balanced (town having > .5 chance of winning); given the same constant of 2 and a cop, it takes only 7 town.  Increasing the scum count is several times more potent as increasing the number of town (as expected), but DECREASES the utility of the cop.  Adding just 1 cop dramatically increases the chance of town winning at low player counts by between 0.12 ~ 0.22.  Increasing the number of town by one from an odd number of total players to even will DECREASE the probability of town winning by between 0.08 ~ 0.15. ==== More simulations will be coming soon, potentially including the use of doctors, godfathers, and roleblockers, and the factor of read accuracy. If there is anything particular you'd like to request post here. If you find an error in the program please inform me. 0x5f3759df 
Posts: 12,701
Add as Friend Challenge to a Debate Send a Message 
9/18/2015 10:41:58 PM Posted: 1 year ago I've read that study before. The only problem is it assumes random lynchings  which isn't how mafia is actually played.
