Explorations in Gambling Utilizing Poker, Computer Sciences and Combinatorics (2021-EU-30MP-768)
Arhan Surapaneni, Student, Stanford OHS
Siddhant Karmali, Student, Stanford OHS
Saloni Patel, Student, Stanford OHS
Mason Chen, Student, Stanford OHS
Our projects include topics ranging from high level analysis of gambling utilizing hypothesis testing tools, probabilistic calculations and monte-carlo simulation (with Java vs. Python programming) to strategic leadership development through quantification of troop strength in the Empire: Four Kingdoms video game. These projects carefully consider decision-making scenarios and the behaviors that drive them, which are fundamental to domains of cognitive psychology and consciousness. The tools and strategies used in these projects can facilitate the creation of user-interfaces that incorporate statistics and psychology for more informative user decision-making – for example, in minimizing players’ risk of compulsive gambling disorder. The projects are about the game of poker and use eigenvector plots, probability and neural network-esque Monte Carlo Simulations to model gambling disorders through a game consisting of AKQJ cards. Offering a subtle analytical approach to gambling, the economic drawbacks are explained through multi-step realistic statistical modeling methods.
Speaker | Transcript |
Siddhant Karmali | Hi everyone, this is Siddhant Karmali, Mason Chen and Arhan Surapaneni and we're working on |
optimizing the AKQJ game for real poker situations. So COVID-19 as effective mental health and can worsen existing mental health problems. | |
The stressors involved in the pandemic, namely fear of disease or losing loved ones, may impact people's decision making ability and can lead them to addictive behaviors. | |
And addiction to gambling is one such behavior that has increased due to an increase in online gambling sites...the site traffic of online gambling sites. | |
This project analyzes how different situations in the game of poker affect how people make irrational decisions. These include situations that may lead to problem gambling. We developed a simplified model of poker that only uses the ace and the face cards, so A, K, Q, and J. | |
That increase the probabilities of certain winning hands called and we called it AKQJ for ace, king, queen, jack. | |
The variables in this model are the card value, the number of players, the number of betting rounds, and whether cards are open or hidden. | |
Open cards or yeah...the objective of this model is to simplify the complicated probability calculations for the winning outcomes in a full game of poker. | |
And we will extend this objective to the idea that since poker in real life has more than one betting round, we can prove or we can show that this model is effective, even in different variations of poker with different betting rounds. | |
So this is how the project...or this is the outline of the project. First we researched emotional betting and compulsive gambling and what are the risk factors for compulsive gambling? How do people like...what do compulsive gamblers think like? | |
Why do they gamble? So we found that people will gamble for thrills, just like addict...people who have addictions to drugs, they use the drug for a high or thrill. So again we... | |
we we infer that gambling or gambling as an addiction must hit the same chords in the brain that are involved in the review...or the that are involved in the reward system. | |
And then we went to...our technology was using hidden and open cards in real cases. So hidden and open cards are...so open cards are the cards that a player keeps face up and the hidden cards are face down, and only the player knows its identity. | |
The and then we made two separate algorithms. There was a comprehensive algorithm and a worst case algorithm. | |
But comprehensive algorithm is more complicated since all the cards are hidden and it's hard to do calculations, and the worst case algorithm had some open cards so players...or our modeled players could infer | |
whether you take the bet or not. And so this was our engineering part. We used JMP to model players play styles. | |
And we also used | |
Java and Python programming, as Arhan will show, to generate...to randomly generate card situations, and we calculated the probabilities and conducted correlation and regression tests in JMP. | |
So hidden...hidden and open cards. Open cards are, as I mentioned, open cards are the play...cards that a player keeps face up so other players can see it. | |
And hidden cards are facedown and only the player knows its identity. The comprehensive algorithm, which | |
...which is what...usually what happens in a real game of poker where players have to try and calculate the probability | |
of them winning against another person or them winning against their opponent, based on their current hand. | |
And in a comprehensive algorithm it's hard to do, since all the cards are hidden and you don't know which which card which player has. And the open cards make AKQJ game easier calculation wise. | |
And the number of hidden cards increases with the number of betting rounds. so the first case we did was with one round and six players, which had six hidden cards. | |
Then we have one betting round and five players, which had seven hidden cards | |
and so on. | |
So earlier, we...or in the model, there were six players given labels A through F. We assign them probability characteristics, which are the percentages of confidence they have to make a bet. | |
A's is 0%, B's is 15%, C's is 30%, D's is 45%, E's is 60% and F is 75%. And F's 75% probability means that | |
unless they are...unless they are 75% sure...at least 75% sure that they will win against that person...their opponent, then they will not take the bet, so it means they're very, very conservative with their betting. | |
a general poker case, which is the comprehensive algorithm, and the worst case algorithm. | |
The general method is calculated or, for example, if we're trying to calculate the probability of A winning the poker match, in | |
terms of the general method, we would have to use the probability of A is the probability of A versus A winning versus B times the probability of A winning versus C, | |
all the way to probability of A winning versus F. This takes a very long to calculate and it's cumbersome in a real poker match, since the betting round time can be 45 seconds to a minute and not many people can do this kind of calculation in a minute. | |
So the worst case...so that's where we developed the worst case method. | |
The worst case...we calculated the worst case outcome by seeing which player can make the best hand with the cards they can see, out of four shared cards which are which are open to all players and one hidden card and one open card per player. | |
We use these two algorithms in three different cases. The first case is with one betting round and six players. We have to determine in which cases each player will fold or stay and how many chips they will win or lose. | |
For example, A stays, even if they lose chips, because that was | |
...that was one of our models, which we...which we knew had a problem gambling, so...that...so according to our condition, they had to stay. | |
B wins against E, but not against anyone else. C does not win in this case. D wins against B and C and ties with A and E. | |
And E doesn't win, and F wins all...against all the other players. Note that because C and E did not win, they...or because B didn't win enough because C did not win at all, and because E did not win at all, they all fold | |
in the next betting round and they lose their...they lose their chips. And so the ones that stay, they're the ones that like...considering this is a one match or one betting round poker match, | |
the ones that are...the one that is most likely to win is F, since they have the highest worst case winning probability. And we can see that, if you go to the previous slide, we can see that player A or player | |
...or for the six players' case, player F's overall was very close to 80% so we can... so the...so there is a correlation between...or there was a strong correlation between | |
the | |
AKQJ worst case method and the general method. And the next case is with one betting round and five players. In this case, the confidence values change. | |
A's is 0%, B's is 12% , C's is 25%, D's is 38%, and F's is 65%. Player E was removed, since they lost the most chips and had to fold in the previous round. | |
In this round with the fewer players, we see that there are more hidden cards. The number of hidden cards increases with the number of betting rounds and players. | |
With the number of hidden cards increasing, the calculation time may take longer, and this may make players more nervous and unwilling to do those calculations, since they could lose money. In this case, player F didn't win, as shown by | |
how their worst case winning probability | |
is less than their confidence percentage, so they are forced to fold. | |
Meaning that...or this could be because conservative players may not do well in the later stage of the game, because they are, you know, too stingy with their money. They do not make the right bets even when the stakes are higher. | |
The next case is with four players and we did this test to confirm whether player F wins or not, and we can...and if it if F does not win, we can say with confidence that | |
more conservative players do not well...do not do well in the later stages of the game. And note that F has to keep decreasing their winning probability. | |
We also tested whether the worst case algorithm matches for five players. In the general method, B has an 11% chance of winning, D has a 46% chance of winning, and F has a 48% of...48% chance of winning. | |
This is very close to the worst case values, and so we get a strong correlation of...we get a strong correlation with an R squared of 0.998. | |
And so, this worst case makes F win 50% of the time in the five player match. | |
And we also tested this for four players, in which... | |
in which we confirm that F will win 50% of the time in the four players case. And then the third case is with three betting rounds at six players. In this case the values are the same. | |
and E's, which we added back is 56%. In the first round F wins, however, as players started folding like how B, C and D fold, | |
F has to change their confidence level. | |
F has to change their confidence level to match the winning probabilities for a round. | |
F's level changes to 60% after the first round and 54% after the second round. | |
This is involved, like these are models. | |
This will be involuntary, | |
indicating that there's nervousness in a conservative play style, which contributes to such players losing in later rounds. | |
Players A and F represent the extreme playing styles, which may be indicative of problem gambling. And this is a quick summary of the betting round calculations. In two betting rounds or in a game with two bending rounds, we will see that F only wins two times out of 20. So | |
the the... | |
player's possible hand doesn't all...like F's possible hand is not good enough to match up against the opponent's possible hand. This happens in both two betting rounds and three betting rounds. | |
And this is this is due to the nervousness, and this is due to the fact that F's probability was way too high, like they could not match their | |
confidence level, so if you want to...like perhaps the optimal strategy for doing well in a poker game is to be not too, like, aggressive with your betting and also not too conservative with your betting. Be like player D, who has... | |
player D had a 38% chance...or 38% probability so they would have to be at least 38% sure that they would make...that they would win against their opponent. So like...I think...or based on this, around that spot is a good place to be for poker. Now, why is this important? | |
We also did...or we also did the three players test to confirm that player F has to fold and player D wins in this round. So we can say that player D has arguably the best strategy in this poker model, in the AKQJ poker model, with more than one betting round and more than...and less than six players. | |
We also did the two betting rounds, to consider...or to show that F doesn't win either. | |
And this is another case which we did to test if the outcome of F losing held throughout the betting rounds. We did this, three betting rounds and four players. | |
And now, why is this important? We've showed previously that players can perform simple calculations, like the worst case, to control their urge to bet even on the losing hand. | |
People with a gambling addiction may be very, very aggressive with their betting and even though they know they're losing their money, they will still bet in the off chance, in the slight hope, that they will...that they will make a big win. | |
People with a gambling addiction may be very, very aggressive with their betting and even though they know they're losing their money, they will still bet in the off chance, in the slight hope, that they will...that they will make a big win. | |
This is an emotional style of betting and it falls right into the trap of gamblers fallacy, which is thinking that either if you're on a lucky or if you're on an unlucky streak, you will get lucky the next time, for example. | |
These new cases of fewer players and more betting rounds in a poker match introduced the ideas of nervousness in players, even the most rational ones. So F, | |
in the one betting round in six player calculation, was a player who had...like you could see that player had experience or he...or that that player was able to wait, he was able to have a good strategy, he or she, excuse me. | |
This is...and so we can apply this to a real poker game, because in humans, the parasympathetic nervous system releases stressful hormones, like adrenaline, into the body, | |
eliciting a fight or flight response. When you're in a high stakes situation like a poker game, | |
then you know that...you know at a superficial level what's at stake, you know that your money and your assets are at stake, so | |
you will bet on that to try and increase it. That's just inherent human nature. More bandwidth during this poker game is given to the amygdala, which is an area of the brain that controls emotion, rather than the rational and involved in executive functioning prefrontal cortex. | |
So the more hidden cards in a round, players may be more nervous about their bets and make worse bets, even if they... | |
even if they're very experienced in poker. | |
And this nervousness may be correlated with the blindly betting nature of compulsive gambling disorder, based on the concepts of risk calculation and gambling for thrill. | |
And our conclusions were that F, or overly conservative players like player F, may not do as well in realistic poker situations. So the ones that do the best are are on the conservative side but are more willing to bet than your regular very, very stingy player. | |
And get our main takeaway is that gambling disorder may be mitigated if players can understand basic statistical calculations and use them in their games. | |
And | |
the future research, which is actually not in the future, it's going to happen or we've done that research already is, we are going to get more reliable data using Python and that's what Arhan's presentation is going to show. Thank you for watching. | |
Arhan Surapaneni | Millions of people visit the capital of casinos, Las Vegas, every year to party, enjoy luxuries, but |
most importantly, gamble. | |
Gambling, though forming a false reward of success in winnings still hides the dark pitfall of financial and social struggles. | |
Our generation is modernizing with technological advancements rapidly becoming the norm and computer programming languages being the needed subjects to thrive in a modern world. | |
Utilizing modern computer programming tools and ???, we are able to take a deeper look into their this psychological problem and analyze tools to help solve them. | |
This is done with authors Siddhant Karmali, Mason Chen and Saloni Patel, with the esteemed help with advisors, Dr Charles ??? and ???. | |
As previously mentioned millions of people attend casinos per year affecting a large population. | |
With a problem that affects such a large sample size, one of the overarching questions concerns how do we express solutions to the problem of gambling and how do we do this efficiently. | |
Through Siddhant's presentation, we have learned much about original methods | |
that help explain gambling, while also presenting the economic misnomers about gambling, proving that being calm and cautious provides the best results, rather than relying on luck of the game for positive results. | |
All of which was done through Java. This method, however, takes 30 hours just for 92 runs. This is not effective and unusable. Using Python however reduces this time to seconds, while also allowing for higher levels of complexity that provides to be beneficial to the overall methods. | |
To recap, the method required a six player model, each of whom receives two cards in the 16 pack of AKQJ. | |
One of the cards is hidden, with four cards placed on the table. Each player has confidence levels determining how often they fold or continue playing. | |
Continuing playing loses three points and folding loses only one point. This is done in an effort to model players that range from blindly gambling to cautious strategists. | |
Usually when conducting a large scale experiment is very tedious and time consuming to run tests at an adequate amount so that the data that is produced is usable. | |
An efficient alternative is using computer programming, more specifically, using the computer language Python in a Monte Carlo simulation, rather defined as a broad class of computational algorithms that rely on repeated random sampling containing numerical results. | |
The Java program applied here in the diagram is very ineffective. They only allow for random two samples and the process of individually sourcing out each specific sequence is difficult to do. | |
When we are trying to derive larger sets of data, it is important to change this. Analyzing general differences between languages, | |
it is important to identify the Java is staticly typed in a compiled language, while Python is dynamically typed in interpreted language. This single difference makes Java faster at runtime and easier to debug. | |
But Python is easier to use and easier to read. | |
Python is an also an interpreter language with an elegant syntax makes it...making it a very good option for scripting and rapid application development in many areas. This is applied in the following method. | |
One thing we need to look at is the new randomizer, which is applicable, with the full 52 cards set, the AKQJ 16 card | |
model allows for more accuracy in statistical ??? rendering, especially when using a Monte Carlo simulation. | |
One beneficial aspects that we can add with the Python our characters. As Siddhant covered, we can now use wagers. | |
Instead of manually applying different confidence levels on our two card ??? randomized, we can use Monte Carlo to make different choices based off of a certain percent threshold on the ability to add or remove wagers which will see you later on. | |
First, it is important to talk about the deck. Here we see a 16 card array with our shuffling function. This allows the cards to be randomized, | |
similar to the initial function seen in the Java program. | |
This draws two cards from the 16 card total for different players. With this in mind, there are extensive applications to both the original comprehensive method and our worst case method, which will be covered and developed on later. | |
??? the same deck allows us to add changes or move things to affect how we compute the worst case method which is helpful in our end goal. | |
We don't have the same flexibility in our old JAVA method. Python specific changes for the worst case method include specific elif/if | |
statements, so that the player with the worst card is indicated as loss and the formula covered by Siddanth has changed. This is important because this allows more efficiently... | |
more efficiency in data collection, with the probability on making the randomizer's outputs more accurate. You can add specific names to these separate cards, which is also another helpful application in itself. | |
This simplified Monte Carlo simulations allow for more complexity, as it allows us to add our new wagers based off scenario which involves | |
multiple betting rounds that Siddanth has described. We can change characters by changing the current wager, which affects how the player stays or leaves the betting round, this being a key difference from the Java method. | |
To concept in this program has to do with setting a variable that will eventually return value to the funds and the wager to the initial wager argument. | |
Sending the current wager to zero, we set up a while loop to run the condition continuously until the current wager is equal to count. | |
Then for each set where we get a successful outcome, we increase the value by our wager. | |
If we were to add a command telling us or the character to slow down at a certain wager, then we have a simple way of having threshold to betting. | |
We can also edit the same form to accept specific sequences, like the full house, only allowing a wager when the sequence is present. These thresholds create our upper mentioned risk management level. | |
We can plot the probabilities in ???, where we append to each updated current wager to an array of X values and each updated value to an array of Y values, proceeding to plot both PLT(?) to plot X values and y values. | |
The key component of the better function is the condition if...in the if statement that corresponds to a successful outcome. This can be adapted to any | |
outcome needed, including general scenario and worst case scenario. | |
When we apply our comparisons with the two character and multiple character, we can add important statements that make sure the data is compared properly. | |
Using Python you can make sure drawings like two pairs or instead of higher values ruling out players with a lower value, forcing them out of the game. This allows for more efficiency with the new Python program rather than using the original Java program. | |
Something that would take 30 hours originally can now be done in a matter of seconds. | |
After this program is applied, we are able to run a correlation test with the new results against the original Java results. If we look at the red lines for both the general and worst case methods, we see that | |
they're extremely close to one, indicating strong correlations. | |
This is also paired with the higher R squared value. We also run the one proportion hypothesis test, telling us for both methods we failed to reject the null hypothesis. | |
This value, although high, isn't close to...isn't as close to one. For something that we would expect to be almost identical, because this is computer programming. | |
There are two main reasons for this, the first is sample size. 92 seems like a lot, but it isn't strong...isn't as strong a trend as one would expect. | |
To fix this we are able to increase the sample size to 1,000 or even 10,000. One more reason could be the application of Python. As previously mentioned Python is more comprehensive language, rather than a static language. This could change the effect, but mainly stay the same. | |
Here we see the program finally applied with their results presented. With this program we see what each play...which cards each player draws with the cards... | |
which card is shown and hidden, what cards are on the table, how many chips players gain and lose and, finally, who wins, how they win. In the diagram below, we see Player 1 wins with the full house. | |
the ability to run multiple characters into one computer and one function, describing the different sequences while applying | |
different numbers of players, also showing probability of different outcomes, even adding the multiple betting runs in a regular game of poker, which Siddanth has covered. | |
This is vital to further developments, because it allows for people around the world to use this program and method | |
to develop on ideas as a learning tool able to be utilized to act as therapy to gambling addicts. | |
One more development exploits the neural network (AI) aspect, making this program more detailed by adding features like bluffing, added enough for it to make the program more like actual game seen in casinos. | |
Finally, we were able to see by using Python, not only do we experience higher accuracy, but higher...much higher efficiency, ultimately, proving our original hypothesis that being cautious | |
gives more money and more wins, turning a program that originally took hours in just a few seconds. | |
So next time you go to Vegas or even partake in a game with friends, remember this project and remember that being more careful and taking a bit more time with decisions will help you in the long run. | |
Thank you. |