[proposition] town:scum winrate calculator

This forum is for discussion related to the game.
User avatar
Smithereens
Smithereens
Mafia Scum
User avatar
User avatar
Smithereens
Mafia Scum
Mafia Scum
Posts: 1028
Joined: May 12, 2014
Location: Melbourne

[proposition] town:scum winrate calculator

Post Post #0 (isolation #0) » Tue Jun 14, 2016 5:48 am

Post by Smithereens »

I recently broke my graphics calculator. The result was an epiphany of how difficult it actually is to do probability without the assistance of technology. For a start, I need to know how much re-balancing a 7v2 game requires to make a town win as viable as a scum win. The long way to find this is to solve this equation: 7/9x5/7x3/5+7/9x5/7x2/5x2/3+7/9x2/7x4/5x2/3+2/9x6/7x4/5x2/3 = 0.70159. So Scum are expected to win 70% of the time in a 7v2 match assuming ideal play (random lynches every day). However, I don't really have the mathematical ingenuity to solve expected win rates for much bigger games, let alone games with roles in them. The addition of a doctor for example means that instead of 2 possible outcomes (mislynch + NK or lynch + NK) there is instead double that (mislynch + NK or mislynch + no NK or lynch + NK or lynch + no NK) for as long as the doctor is alive. The cop, assuming perfect play increases the chance of lynch to (m+1)/n, and reduces the chance of mislynch to (n-m-1)/n where m is the number of scum and n is the number of living players. As you can see, the addition of a single variable exponentially increases the complexity of the calculation.

If there is a trick to running large calculations, I'd love to know it. I'm no mathematician :(

However, this does drive me to make a suggestion, and one where I'm actually prepared to pay money to see it happen. There are a lot of people who are really good at coding on this site, and while I know nothing about coding, I want to know if it's feasible to build a calculator that is specifically tailored towards calculating expected win rates for town:mafia:others given certain variables, including number of players, number of scum, the presence of certain roles and certain other key mechanics.

Imo it would really be a major asset to the mafia community. Mods would be able to fine tweak balancing of large themed games instead of relying on opinions. Also, we'd be able to scientifically research our games and drawn valid conclusions. Except I wouldn't have a clue as to how feasible it is. I assume currently there are a couple mathematicians running around here who know how to do large calculations in a finite amount of time, however it's clearly not possible for them to run statistical analysis of every game that pops up for a review.

Is this idea possible? Also, if you're a maths person and you have tips to share on mafia calculations, please share them!
User avatar
Smithereens
Smithereens
Mafia Scum
User avatar
User avatar
Smithereens
Mafia Scum
Mafia Scum
Posts: 1028
Joined: May 12, 2014
Location: Melbourne

Post Post #22 (isolation #1) » Tue Jun 14, 2016 1:26 pm

Post by Smithereens »

User avatar
Smithereens
Smithereens
Mafia Scum
User avatar
User avatar
Smithereens
Mafia Scum
Mafia Scum
Posts: 1028
Joined: May 12, 2014
Location: Melbourne

Post Post #28 (isolation #2) » Tue Jun 14, 2016 1:40 pm

Post by Smithereens »

wow did you sit down and calculate all these EV's?? jesus

Also, what formulas did you use for various role utility? The mathematical significance of some of these roles appears hard to ascertain.
User avatar
Smithereens
Smithereens
Mafia Scum
User avatar
User avatar
Smithereens
Mafia Scum
Mafia Scum
Posts: 1028
Joined: May 12, 2014
Location: Melbourne

Post Post #33 (isolation #3) » Tue Jun 14, 2016 8:20 pm

Post by Smithereens »

He's only 16, be nice :)

I didn't know much about discrete random variables when I was 16 either.
User avatar
Smithereens
Smithereens
Mafia Scum
User avatar
User avatar
Smithereens
Mafia Scum
Mafia Scum
Posts: 1028
Joined: May 12, 2014
Location: Melbourne

Post Post #35 (isolation #4) » Wed Jun 15, 2016 1:31 am

Post by Smithereens »

In post 34, Randomnamechange wrote:To make this work considering players you would need a RNG scumminess scale, assign players a value on that, and make players with higher scumminess more likely to be lynched. Run the program multiple times and you should get a decent indicator of win rate. Gets more complicated if you add in roles (for instance if a doctor randomly protects one of the three least scummy players and mafia shoots one of them) but then it still doesn't account for people's personal reads. Could potentially randomly generate player's reads by assigning a random value within a certain position of their value on the scumminess scale?
To make it more complicated people's positions could change, randomly or based on factors like not being on scum wagons. Then you have roles like alignment cops which makes it even more complicated based on randomly deciding when they choose to reveal.
why would I want to assign arbitrary numbers to players and then claim that this makes a predictable outcome? I'm not sure what you're suggesting here.
User avatar
Smithereens
Smithereens
Mafia Scum
User avatar
User avatar
Smithereens
Mafia Scum
Mafia Scum
Posts: 1028
Joined: May 12, 2014
Location: Melbourne

Post Post #37 (isolation #5) » Wed Jun 15, 2016 1:56 am

Post by Smithereens »

In post 36, Ircher wrote:It took a while, I get it now.
It's a rare thing to see people concede points in arguments imo. Your presence is welcome in this discussion.
User avatar
Smithereens
Smithereens
Mafia Scum
User avatar
User avatar
Smithereens
Mafia Scum
Mafia Scum
Posts: 1028
Joined: May 12, 2014
Location: Melbourne

Post Post #39 (isolation #6) » Wed Jun 15, 2016 4:13 am

Post by Smithereens »

In post 38, Randomnamechange wrote:
In post 35, Smithereens wrote:
In post 34, Randomnamechange wrote:To make this work considering players you would need a RNG scumminess scale, assign players a value on that, and make players with higher scumminess more likely to be lynched. Run the program multiple times and you should get a decent indicator of win rate. Gets more complicated if you add in roles (for instance if a doctor randomly protects one of the three least scummy players and mafia shoots one of them) but then it still doesn't account for people's personal reads. Could potentially randomly generate player's reads by assigning a random value within a certain position of their value on the scumminess scale?
To make it more complicated people's positions could change, randomly or based on factors like not being on scum wagons. Then you have roles like alignment cops which makes it even more complicated based on randomly deciding when they choose to reveal.
why would I want to assign arbitrary numbers to players and then claim that this makes a predictable outcome? I'm not sure what you're suggesting here.
There is an effectively random playerlist. It basically allows for PR actions to be made predictable rather than random (doc protects townie players, cop investigates scummy players, scum shoot townie players) and also the way this interacts with lynches.
Generally we cancel out this by assuming scum is also playing perfectly. This means the best town can do is to lynch correctly in proportion to the number of scum there are, ie completely at random.PR actions are random when both sides play ideally, given that mafia will attract the doc as often as their proportion would suggest. I still don't know what you mean by saying we should assign values to players. What is the justification for this action?
User avatar
Smithereens
Smithereens
Mafia Scum
User avatar
User avatar
Smithereens
Mafia Scum
Mafia Scum
Posts: 1028
Joined: May 12, 2014
Location: Melbourne

Post Post #46 (isolation #7) » Wed Jun 15, 2016 2:33 pm

Post by Smithereens »

Muffinman the answer to everything is randomness.

The chances of the vig being run up Dp1 is 1/n where n is the living player pool. So there is a 1/n chance that any player will be lynched on any given day, no matter what their role is. Unless of course we're talking double voters or innocent children. In the absence of those kinda roles, all calculations assume that the lynch will hit a random player every day.

For roles with night utility, we average out their statistical effects across each day that they are alive. If a cop strikes mafia, let's assume that the cop will always out himself to lynch said mafia. In this case, the probability of lynching scum has increased from #scum/n to 1. However there's also the chance that the cop will never hit mafia due to early death. With this in mind, the formula for probability increase is (m+1)/n where m is the number of mafia. This formula claims that each day, the chance of lynching scum is 1 person higher due to the fact that 1 person is investigated each night. It also equates to a game with no cop where there is an extra mafia player and town lynch randomly.

So long as we can assume randomness, we can always derive formulas to describe the effects of different roles on the chance of town lynching correctly.
User avatar
Smithereens
Smithereens
Mafia Scum
User avatar
User avatar
Smithereens
Mafia Scum
Mafia Scum
Posts: 1028
Joined: May 12, 2014
Location: Melbourne

Post Post #49 (isolation #8) » Wed Jun 15, 2016 3:17 pm

Post by Smithereens »

This is where definitions are needed lol.
>We define the ideal play of a cop as outing themselves to kill a scum, but not to save a townie.
>We define the ideal play of a tracker to out themselves only if they trace another player to the NK.
In relation to the fact that multiple claims are outed each day, that's alright. We simply need to define the mean rate of role outings for the type of game we're talking about. In mountainous, let's say we get 3 on Day 1. Assuming X power roles and N living players, the chance of a NK against a PR on night 1 is (#PR+3/n)/(n-m).

Yes you're completely correct in thinking that it can't be as simple as this. However most aspects of mafia gameplay can be reduced to probability formulas regardless.
User avatar
Smithereens
Smithereens
Mafia Scum
User avatar
User avatar
Smithereens
Mafia Scum
Mafia Scum
Posts: 1028
Joined: May 12, 2014
Location: Melbourne

Post Post #55 (isolation #9) » Wed Jun 15, 2016 4:49 pm

Post by Smithereens »

Oh yes for sure muffin. Nothing ever goes according to plan. However, when balancing a game, we make the assumption that both town and mafia are playing at equal levels in order to determine if one side is objectively more advantaged than the other. It doesn't really matter if complexity is added in after, so long as we know that the playing field is even. Thus we can determine optimal play and draw formulas etc even if everyone is retarded.

These outcomes and equations don't describe actual games. They describe games that depict how town and scum would play if they were playing perfectly. You can't really study the balance of a game if you add in all those confounders. But even still, many of the complexities associated with roles can still be studied and reduced to mere numbers.

Take this example: In a game of professional baseball, officials will methodically ensure that the bats used by each team meet certain standards so that the game is fair. That's basically what we're doing here.
User avatar
Smithereens
Smithereens
Mafia Scum
User avatar
User avatar
Smithereens
Mafia Scum
Mafia Scum
Posts: 1028
Joined: May 12, 2014
Location: Melbourne

Post Post #57 (isolation #10) » Wed Jun 15, 2016 7:23 pm

Post by Smithereens »

+1
User avatar
Smithereens
Smithereens
Mafia Scum
User avatar
User avatar
Smithereens
Mafia Scum
Mafia Scum
Posts: 1028
Joined: May 12, 2014
Location: Melbourne

Post Post #60 (isolation #11) » Thu Jun 16, 2016 1:10 am

Post by Smithereens »

In post 58, zMuffinMan wrote:
In post 55, Smithereens wrote:how town and scum would play if they were playing perfectly
i would be surprised if this has ever happened in the history of mafia

but that still misses the point

we're not talking about playing optimally here, necessarily. for example, it's optimal for a cop not to claim if they can push their lynch without making it obvious they're a cop, but it's silly to assume that the player who rolls cop both thinks this and is able to pull it off. you're suggesting we assume a cop will claim if they have a guilty, which also isn't the case in a lot of games. little things like this might seem silly, but they determine the difference between scum team shooting at random and cop getting a different result and scum team killing cop so no more results

*shrug*
To address this situation specifically, ideally a cop does not need to out to push a lynch on a scum, that's perfect play by town. Perfect play by mafia would be that they identify that the push is caused by information not normally accessible to town, ergo investigative role. So a cop would out themselves even if they don't out themselves if both sides play perfectly.

We assume they play perfectly due to long term probability. Mistakes made by one side are cancelled out by mistakes made by the other side. I'm not sure what the original point was anyway.
User avatar
Smithereens
Smithereens
Mafia Scum
User avatar
User avatar
Smithereens
Mafia Scum
Mafia Scum
Posts: 1028
Joined: May 12, 2014
Location: Melbourne

Post Post #65 (isolation #12) » Thu Jun 16, 2016 3:32 pm

Post by Smithereens »

"the differences in opinion on how you "should" play a role make it borderline impossible to reasonably predict actions."
We can objectively determine the best possible outcome with long term probability.

A cop has outed himself and there is a doc in the game. Should the doc doc the cop?
Scenario 1 (the existence of the doc is unknown): Obviously yes.
Scenario 2 (the existence of the doc is known): in this wifom the maf suspect that the doc is going to protect the cop, so they should target another player. The doc knows this, so he docs a different player instead of the cop. The mafia consider this possibility, so they want to NK the cop instead etc etc.
In this situation there are two Nk outcomes:
1) The NK is against the cop (50%)
2) The NK is not against the cop (50%)
The doc knows that mafia are equally likely to choose either option. With a player pool of say, 8 townies, one of which is the cop and another the doc, there is a 50% chance that the cop will be the NK target and a 7.1% chance that any given other player will be NK target. in a game where the doc chooses to protect another player, the NK is expected to be prevented 7.1% of the time. Protecting the cop should prevent the NK 50% of the time. Therefore the doc knows that his best bet is to protect the cop. Knowing this, the mafia's best bet is to shoot someone else. So the probability of a NK against a random other player becomes 14.3% in a game of 8. So long as this percentage remains lower than 50%, the doctor's optimal course of action is to always protect the cop. Likewise the mafia should always shoot someone else, and that's how we define optimal play in an infinite regression.
User avatar
Smithereens
Smithereens
Mafia Scum
User avatar
User avatar
Smithereens
Mafia Scum
Mafia Scum
Posts: 1028
Joined: May 12, 2014
Location: Melbourne

Post Post #67 (isolation #13) » Fri Jun 17, 2016 2:10 am

Post by Smithereens »

Optimal play for the cop would to get a guilty lynched and then not die, but optimal play for mafia would be to kill a cop that lynches a mafia. Therefore if both play optimally, cop will lynch a guilty but mafia will NK a cop that does that. Cop's are not the most basic roles. Their results are knowledge, which cannot be quantified or measured. A doctor does not produce 'psychological' effects such as the gaining of knowledge, so a doc is simpler than a cop. The rules we use for cop need to assume that there is only 1 best possible outcome. This is a reasonable assumption to make so working from there is really not a big deal.
User avatar
Smithereens
Smithereens
Mafia Scum
User avatar
User avatar
Smithereens
Mafia Scum
Mafia Scum
Posts: 1028
Joined: May 12, 2014
Location: Melbourne

Post Post #71 (isolation #14) » Sun Jun 19, 2016 3:28 am

Post by Smithereens »

In post 70, mole wrote:For mountainous I'd use a spreadsheet: https://docs.google.com/a/mimhoff.com/s ... sp=sharing

And cop is even more complicated than that though.

A cop could also have a string of innocent results which improves the chance you catch a mafia for a couple of days, until the cop and all the known innocents are dead. But to track that you'd have to track how many innocents the cop knows about, and whether they have since been killed. Even before you decide when your cop will tell everyone this info.
Nice :D

Is there anything you mean for us to see in the spreadsheet? cuz it seems we don't have permissions. Or maybe that's me O.o

Return to “Mafia Discussion”