towniness-based EV calculation

This forum is for discussion related to the game.
User avatar
schadd_
schadd_
he/it
pandora's pukebox
User avatar
User avatar
schadd_
he/it
pandora's pukebox
pandora's pukebox
Posts: 7889
Joined: December 28, 2016
Pronoun: he/it
Location: mountain bathroom

towniness-based EV calculation

Post Post #0 (ISO) » Thu Mar 14, 2024 7:40 am

Post by schadd_ »

generally, EV (expected town winrate) for a given setup is calculated by iterating through random decisions for each day and night phase until a win condition happens. this is useful and simple, but it ignores a central aspect of the gameplay which is that some people are scummy and some people are towny. specifically, in a mountainous game, mafia are able to pick out which players are unlikely to ever be executed and shoot those players, and probably they have a fairly accurate judgement of that quality as soon as day 1; "northsidegal has been killed in the night, day 2 dawns".

something i heard radiantcowbells talk about (and maybe there is a thread where he hashed this out that i don't remember) is approaching EV by laying out an ordered sequence of the players in terms of towniness, randomly placing the mafia within that sequence, and then evaluating how the game would play out under those circumstances, where the least towny player gets executed each day. imagining a nightless game with three mafia and six town, mafia wins as long as one of them is at least the second towniest (game ends @ final 3), OR if two of them are the third and fourth towniest (game ends @ final 5); OR if three of them are in the top 6 towniest (game ends at final 7).
Spoiler: ev calculation

Image

for an example with nightkills, consider a similar-EV setup of 2 mafia versus 11 town. in addition to the scummiest player getting executed each day, the towniest town player gets executed every night. thus, mafia now wins if they have one player in the towniest 6 (!) (endgame in final 3 after the top four players are shot and the bottom four players are executed) or the 7th and 8th places (in final 5 after 3 are shot and 3 are executed).
Spoiler:
Image

suddenly this setup looks kind of brutal for town. now, obviously there's various ways you could argue that this model is less descriptive, the primary one being that it assumes perfectly effective nightkilling (which is hard to do all four nights). but it spells out the way that nightkills are meaningfully harmful to town's EV.

to do:
  • ev calculation for dragoneater's setup
  • make a thingy in R that spells out different setups' sensitivity to good reads (i.e., how do things change if wolves are distributed lower in the towniness pile)
free darius mccollum
todays featured user: Balki B

User avatar
DragonEater70
DragonEater70
He/Him
Jack of All Trades
User avatar
User avatar
DragonEater70
He/Him
Jack of All Trades
Jack of All Trades
Posts: 7770
Joined: February 4, 2023
Pronoun: He/Him
Location: UTC+2

Post Post #1 (ISO) » Thu Mar 14, 2024 7:47 am

Post by DragonEater70 »

Hi I heard my name mentioned. The setup in question is the one I ran in Open 904?
User avatar
schadd_
schadd_
he/it
pandora's pukebox
User avatar
User avatar
schadd_
he/it
pandora's pukebox
pandora's pukebox
Posts: 7889
Joined: December 28, 2016
Pronoun: he/it
Location: mountain bathroom

Post Post #2 (ISO) » Thu Mar 14, 2024 7:49 am

Post by schadd_ »

dat one
free darius mccollum
todays featured user: Balki B

User avatar
DragonEater70
DragonEater70
He/Him
Jack of All Trades
User avatar
User avatar
DragonEater70
He/Him
Jack of All Trades
Jack of All Trades
Posts: 7770
Joined: February 4, 2023
Pronoun: He/Him
Location: UTC+2

Post Post #3 (ISO) » Thu Mar 14, 2024 8:06 am

Post by DragonEater70 »

Yeah I'm interested in seeing the calc.
User avatar
biancospino
biancospino
he/she
compulsive complex Inventor
User avatar
User avatar
biancospino
he/she
compulsive complex Inventor
compulsive complex Inventor
Posts: 2255
Joined: October 18, 2022
Pronoun: he/she
Location: UTC+1

Post Post #4 (ISO) » Thu Mar 14, 2024 11:41 am

Post by biancospino »

Do note that,
for Vanilla Nightless games only
, the EV is actually identical calculated this way and by using random lims (it's not the same for non-Nightlesses since nk'ing at the top instead of randomly affects the likelyhood that the bottom is scum).
(In fact, it is easy to see that, if p(m,x) is the chance of mafia winning when there are m mafiosi in x players, then p(m,x)=2m/x. In fact, note that one has p(0,x)=0, p(m,2m)=1 and
p(m,x)=p(last is scum)p(m-1,x-1)+p(last is town)p(m,x-1)=(m/x)p(m-1,x-1)+(1-x/m)p(m,x-1)
when 0<x<m/2; and by double induction those uniquely specify p (for all 0<=m and 2x<=m), and are satisfied by p(m,x)=2m/x. Your example has indeed p(3,9)=6/9=2/3.)
User avatar
biancospino
biancospino
he/she
compulsive complex Inventor
User avatar
User avatar
biancospino
he/she
compulsive complex Inventor
compulsive complex Inventor
Posts: 2255
Joined: October 18, 2022
Pronoun: he/she
Location: UTC+1

Post Post #5 (ISO) » Thu Mar 14, 2024 12:05 pm

Post by biancospino »

For Vanilla games with nightkills, then the mafia, if there are m mafiosi and x players, assuming that x is odd, wins iff there are (x+1)/2-m mislims; this always happens unless the whole scumteam is in the bottom ((x+1)/2-m)+m-1=(x-1)/2 players.
So, the chance of mafia to win would be
p(m,x)=1-p(all m scum in the bottom (x-1)/2)
=1-(((x-1)/2)Cm)/(xCm)
where aCb is the binomial a!/(b!(a-b)!). For a 2:9 mountaneous, for instance, one has
p(2,11)=1-(5C2)/(11C2)=9/11 ~ 81.818...%

(Assuming I'm not making some crude mistake, which tbh it's not even particularly unlikely)
Last edited by biancospino on Thu Mar 14, 2024 12:12 pm, edited 1 time in total.
User avatar
biancospino
biancospino
he/she
compulsive complex Inventor
User avatar
User avatar
biancospino
he/she
compulsive complex Inventor
compulsive complex Inventor
Posts: 2255
Joined: October 18, 2022
Pronoun: he/she
Location: UTC+1

Post Post #6 (ISO) » Thu Mar 14, 2024 12:12 pm

Post by biancospino »

Also, note that 2:N will never have an ev of 1/2 with this approach. In fact that isn't surprising; the mafia ev of 1:N would be (N+2)/(2N+2) (the chance that the mafia is not in the bottom half, which is of course ~1/2 for N very large); and the ev of 2:N is going to be better than that still.

In fact, the mafia ev of 2:N approaches 3/4 (from above) when N grows to infinity
Last edited by biancospino on Fri Mar 15, 2024 2:23 pm, edited 1 time in total.
User avatar
Dannflor
Dannflor
he/him
Survivor
User avatar
User avatar
Dannflor
he/him
Survivor
Survivor
Posts: 18210
Joined: May 25, 2012
Pronoun: he/him

Post Post #7 (ISO) » Fri Mar 15, 2024 7:28 am

Post by Dannflor »

ego
User avatar
JacksonVirgo
JacksonVirgo
they/him
Survivor
User avatar
User avatar
JacksonVirgo
they/him
Survivor
Survivor
Posts: 13224
Joined: October 29, 2019
Pronoun: they/him
Location: ɐılɐɹʇsn∀
Contact:

Post Post #8 (ISO) » Tue Mar 19, 2024 6:08 am

Post by JacksonVirgo »

Also ego
"Am I a ghost like you, caught between the seams of two intertwining melodies?"


wiki // GTKAS
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10721
Joined: April 28, 2011
Pronoun: he/they

Post Post #9 (ISO) » Tue Mar 19, 2024 3:21 pm

Post by Psyche »

have been trying to automate ev calculation lately and finding it kind of challenging — at least when trying to implement something that's reasonably flexible about base assumptions

this seems a cool way to sidestep a lot of questions though. by externalizing towniness/scumminess you maybe don't need to account for each player's belief states about other players to the same level of detail
User avatar
the worst
the worst
Snuggly Duckling
User avatar
User avatar
the worst
Snuggly Duckling
Snuggly Duckling
Posts: 36602
Joined: November 7, 2015
Location: pond

Post Post #10 (ISO) » Tue Mar 19, 2024 3:25 pm

Post by the worst »

ego
who's scum? i haven't read up yet but like, it's me
--
intermittent v/la until late march
User avatar
Gamma Emerald
Gamma Emerald
Any
Survivor
User avatar
User avatar
Gamma Emerald
Any
Survivor
Survivor
Posts: 69101
Joined: August 9, 2016
Pronoun: Any
Location: Hell on Earth (aka Texas)

Post Post #11 (ISO) » Tue Mar 19, 2024 8:37 pm

Post by Gamma Emerald »

While functional in theory, in practice the idea of “the scummiest player gets voted out” is not a universal truth.
<Embrace The Void>


“A flipped coin doesn't always land heads or tails. Sometimes it may never land at all...”
Post Reply

Return to “Mafia Discussion”