Danganronpa V3: Killing Harmony

Danganronpa V3: Killing Harmony

73 ratings
monomonoslots
By magnus_orion
An analysis of the slot machine minigame.
3
   
Award
Favorite
Favorited
Unfavorite
Analysis
Within the game, there is a slot machine minigame.The game actually turns out to be an excellent source of casino coins, provided you have enough to hedge against the statistical fluctuations. I believe 100 casino coins (10 monocoins) should be enough.
This guide will go about showing why the slot machine is a good investment, provided you keep putting 7 coins in. Essentially what it boils down to is that the slot machine has a fairly high positive expected value of return. All you really need to know is that the expectation value for the slots is positive, the rest is more an academic excercise for the curious. There are at least 2 achievements related to winning at the slots, so this knowledge makes getting them easier.

By carefully watching the slots, I was able to write out the exact contents of the rollers.

S: scatter
7: 7
R: red
B: blue
G: green
Y: yellow
P: pink
W: wild
There are 3 different roller sets for the 3 different machines. The machine in the center (closest to the player) is used here.
roller1: SGWBRWGPYBW7PYRWBGRPWY
roller2: WRYPGWBSPRWG7WRYBWPGBY
roller3: BWPYRGWP7YWBSYRGWBPWGR
roller4: RYPSBWRGPWB7YWRGWBYPGW
roller5: BRWYBWGRPYWB7GRPWYSGPW

The potential payouts are
All 7: 1000
1 of each color: 200
all the same color: 20
at least one 7, all 7 and wild: 800
at least one color, all matching color and wild: 16

basically, a wild can fill in for a match of all the same, but the result is 80% of the return if you actually got them all the same.

In addition, if you get all wilds, you get a random payout that does not include wilds.
I don't currently know, but I have assumed all such payout options equally likely in this circumstance.

If 3 scatter show up on the screen, you get 5 bonus spins where all scatter count as wilds.

All these results are cumulative, meaning you can score multiple winnings in the different directions.

For simplicity, I assume we always put 7 coins in, that all roller positions are equally likely (no slipping), and that the wilds pick a prize payout at random (so 7 options: 5: 20, 1: 200, 1: 1000). If someone has more imformation regarding these situations, please let me know so I can take them into account.

I ran a computer program in javascript which I will reproduce below

(Thanks to Chief for pointing out a critical bug in the comments.)
var slot_one = "SGWBRWGPYBW7PYRWBGRPWY"; var slot_two = "WRYPGWBSPRWG7WRYBWPGBY"; var slot_three = "BWPYRGWP7YWBSYRGWBPWGR"; var slot_four = "RYPSBWRGPWB7YWRGWBYPGW"; var slot_five = "BRWYBWGRPYWB7GRPWYSGPW"; var bonus_score = 0; var score = 0; var bonus_spin = 0; var s_count = 0; var temp_s = 0; var test = ""; var x = 0; function score_s(score_string) { if( /^((R{5})|(Y{5})|(B{5})|(G{5})|(P{5}))$/g.test(score_string) ) //5 possible, any of RRRRR, etc. { score+= 20; bonus_score+= 20; } else if ( /^W{5}$/g.test(score_string) ) //check for all wild { score += 185.714285714; bonus_score += 185.714285714; } else if ( /^(W|S){5}$/g.test(score_string) ) //check for all wild in bonus { bonus_score += 185.714285714; temp_s += (score_string.split("S").length - 1); } else if ( /^(((R|W){5})|((Y|W){5})|((B|W){5})|((G|W){5})|((P|W){5}))$/g.test(score_string) ) //matches any combination of one character and a wild, we've already excluded all wilds and all characters { score += 16; bonus_score += 16; } else if ( /^(((R|W|S){5})|((Y|W|S){5})|((B|W|S){5})|((G|W|S){5})|((P|W|S){5}))$/g.test(score_string) ) //case as before with scatters { bonus_score += 16; temp_s += (score_string.split("S").length - 1); } else if ( /^7{5}$/g.test(score_string) ) //check for all 7 { score += 1000; bonus_score += 1000; } else if ( /^(7|W){5}$/g.test(score_string) ) { score += 800; bonus_score += 800; } else if ( /^(7|W|S){5}$/g.test(score_string) ) { bonus_score += 800; temp_s += (score_string.split("S").length - 1); } else if ( "BGPRY" === score_string.split('').sort().join('') ) { score += 200; bonus_score += 200; } else { temp_s += (score_string.split("S").length - 1); } return; } for( s_one = 0; s_one < slot_one.length; s_one++) { for( s_two = 0; s_two < slot_two.length; s_two++) { for ( s_three = 0; s_three < slot_three.length; s_three++) { for ( s_four = 0; s_four < slot_four.length; s_four++) { for( s_five = 0; s_five < slot_five.length; s_five++) { s_count = 0; temp_s = 0; //each of the horizontal x = 0; score_s( test + slot_one.charAt(((s_one + x)%(slot_one.length))) + slot_two.charAt(((s_two + x)%(slot_two.length))) + slot_three.charAt(((s_three + x)%(slot_three.length))) + slot_four.charAt(((s_four + x)%(slot_four.length))) + slot_five.charAt(((s_five + x)%(slot_five.length))) ); x = 1; score_s( test + slot_one.charAt(((s_one + x)%(slot_one.length))) + slot_two.charAt(((s_two + x)%(slot_two.length))) + slot_three.charAt(((s_three + x)%(slot_three.length))) + slot_four.charAt(((s_four + x)%(slot_four.length))) + slot_five.charAt(((s_five + x)%(slot_five.length))) ); x = 2; score_s( test + slot_one.charAt(((s_one + x)%(slot_one.length))) + slot_two.charAt(((s_two + x)%(slot_two.length))) + slot_three.charAt(((s_three + x)%(slot_three.length))) + slot_four.charAt(((s_four + x)%(slot_four.length))) + slot_five.charAt(((s_five + x)%(slot_five.length))) ); x = 3; score_s( test + slot_one.charAt(((s_one + x)%(slot_one.length))) + slot_two.charAt(((s_two + x)%(slot_two.length))) + slot_three.charAt(((s_three + x)%(slot_three.length))) + slot_four.charAt(((s_four + x)%(slot_four.length))) + slot_five.charAt(((s_five + x)%(slot_five.length))) ); x = 4; score_s( test + slot_one.charAt(((s_one + x)%(slot_one.length))) + slot_two.charAt(((s_two + x)%(slot_two.length))) + slot_three.charAt(((s_three + x)%(slot_three.length))) + slot_four.charAt(((s_four + x)%(slot_four.length))) + slot_five.charAt(((s_five + x)%(slot_five.length))) ); s_count += temp_s; if (s_count >= 3) { bonus_spin += 5; } //diagonals score_s( test + slot_one.charAt(((s_one + 0)%(slot_one.length))) + slot_two.charAt(((s_two + 1)%(slot_two.length))) + slot_three.charAt(((s_three + 2)%(slot_three.length))) + slot_four.charAt(((s_four + 3)%(slot_four.length))) + slot_five.charAt(((s_five + 4)%(slot_five.length))) ); score_s( test + slot_one.charAt(((s_one + 4)%(slot_one.length))) + slot_two.charAt(((s_two + 3)%(slot_two.length))) + slot_three.charAt(((s_three + 2)%(slot_three.length))) + slot_four.charAt(((s_four + 1)%(slot_four.length))) + slot_five.charAt(((s_five + 0)%(slot_five.length))) ); score -= 7; } } } } } document.write("pre-calc: bonus_score: " + bonus_score + "<br/>score : " + score + "<br/> bonus_spin: " + bonus_spin + "<br/>" ); bonus_score = (bonus_spin * bonus_score) / 5153632.0 score = (score + bonus_score) / 5153632.0; document.write("score : " + score); //results //pre-calc: bonus_score: 130254700.00006951 //score : 51492176.00000936 //bonus_spin: 2087500 //score : 20.228914686713942

the first few lines of the output are just for some bug checking, but the final line gives the expectation value. score: 20.23....
this means, assuming the above code and assumptions correct, for infinitely many games where you put in 7 coins each game, the payout is about 20 coins per game! So over several games, your winnings should eventually average out to be 20 per game.

That's not a bad haul. In a real casino, one would either expect slipping, where the slots change intelligently to control the amount paid out, or the expectation value calcuated to be negative, meaning over time you lose money. But this slot machine seems to be a loser for the house!
Far Machine
The slot machine farthest from the player is the best one:

PRYWGSBRWGPYBW7PYRWSGB
PGWSBPRWG7WRYBWPGWYBRY
BWPYRGWSPYWBWRSGBYPWGR
RBYPGWRYPWBWRGSWB7YPWG
GPWBSYWBRGSPYWB7GRPWYR

score : 37.74821835919489

It is missing a 7 from its middle roller, making it impossible to hit the 1000 without a set of wilds, however, it features more wilds then any other machine, it features an expectation value of 37.75, this machine will make you the most money.

right machine
The machine on the right of the room is:

RYWBWGRY7BPW7RBSPGYGWP
PWYSGBWPR7YBWGRPYWB7GR
RPYWBGRPWY7S7BRWGPYBWG
RGPWB7YWRG7BYPWGRYPSBW
RYBW7GYB7RYPGWBSPRWPGW

score : 21.107545302786114

nearly every roller has two "7"s, giving this one more likely to get 7 in a row naturally. However this doesn't beat out the advantage of the wilds on the other machine.
It has an expectation value of about 21.1 per game.
20 Comments
indigoastronaut Apr 26, 2022 @ 12:29pm 
I have no clue on what ur talking abt but ill try my best to understand lmao, also kudos for the effort!! :Gundham_DGR:
mono Apr 18, 2021 @ 4:21pm 
this is big brain stuff that i dont understand but very cool :Chiaki_DGR:
nyxies_betterthanu Jan 26, 2021 @ 4:26pm 
Good job and thanks! I didn't know that was how it worked. The more you know, anygays have a Byakuya :byakuya_DGR:
Sammy Jul 15, 2020 @ 11:34am 
That explains why I was getting way luckier in the furthest one.
Outer Haven Associate Jul 6, 2020 @ 9:21pm 
Great work thanks.
magnus_orion  [author] Jan 11, 2018 @ 7:08pm 
You are absolutely right. I'll update this now.
Chief Jan 11, 2018 @ 1:26pm 
I think I found out why these numbers seem way too high in my experience. In line 92 of your code, the if statement says (s_count <= 3) when it should say (s_count >= 3), so you end up overcounting the number of bonus spins. With the bugfix, the expected earnings for the three machines are 20.2, 38.0, and 21.1 which seem much more reasonable. Interestingly enough, the far machine is the best since it has more scatters allowing for over three times as many bonus spins despite not paying out as much as the other two per spin.
magnus_orion  [author] Jan 5, 2018 @ 6:20pm 
Yes, as shown in regex in the code, the possibilities for bonus rolls are computed separately and treat the bonus symbol the same as a wild.
Moon Jan 5, 2018 @ 10:45am 
Because I'm bad at sifting through walls of text, did you account for the bonus rolls to change into wildcards during bonus rolls, since this could be where the program is going wrong with certain peoples experiences
mistle Jan 4, 2018 @ 7:23pm 
I assume the 'far' machine is the purple-bluish one and the 'right' one with highest payout would be the pinkish right one.