Coder Social home page Coder Social logo

adibaejaz / smart-gambler Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 13 KB

A simulation of the gambler's ruin problem: the traditional set-up with 2 players, as well as a general solution in n players.

Python 100.00%
gamblers-ruin gambler-problem statistics probability probability-theory simple-random-walk

smart-gambler's Introduction

smart-gambler

A simulation of the gambler's ruin problem: the traditional set-up with 2 players, as well as a general solution in n players.

You will ruin yourself because the house always wins โ€“ and this game will help you simulate that feeling of loss virtually!

Inspiration

This summer, I took part in a probability theory reading seminar under Dr. Xuan Wu, a postdoc att the University of Chicago, alongside 2 other college students.

We surveyed topics such as the monkey at the cliff, transience and recurrence in simple random walks, and Markov chains.

One of the 3 presentations I gave was on something called the gambler's ruin problem. Around this time, I also watched the movies Casino, 21, and The Big Short.

Naturally, I've been feeling like losing some money.

PS Notes for the seminar and recordings of my talks are available upon request.

Problem statement

Traditional 2-player set up

A gambler G starts with $ i and decides to stop playing after m rounds. The gambler's opponent, O, on the other hand, has $f โ€“ when playing against the house, f is usually several times i. With each round, G either gains or loses a constant bet amount, usually $1, with fixed probabilities p and 1-p respectively. G can also choose to 'double down', i.e. double the bet amount when G wins and halve it when G loses. The game ends when either G or O has $0 remaining.

My extensions

  • What happens when we generalize to n players?
  • What happens when the probability of success depends on the immediately preceding outcome?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.