ML that learns to predict and play a simple wagering game
I have a simple game I'm building for fun, just to see how well ML can work with simple data sets.
Basically it's just a game where it has turns that go like this:
Computer generates a random number $x$, and does not show the player.
Player wagers that they can guess a number lower than $x$. Call the wager amount $w$
Player tries to guess a low number $g$.
If $g \lt x$, then player gains $wg$ points.
If $g \ge x$, then player loses their wager, $w$ points.
If player has funds $f_t$ at start of turn $t$ then another way to put this is:
$$f_{t+1} = \begin{cases} f_t + wg, \text{if } g\le x\\ f_t - w, \text{otherwise} \end{cases}$$
Here's an example of play:
- Start with $f=50$
- Turn 1, $x=11$, player wagers $w=8$ and guesses $g=9$. Player gains $+72$ points, so $f=122$ at the end of the turn.
- Turn 2, $x=10.5, w=4, g=7$, points change by $+28$, $f=150$.
- Turn 3, $x=20, w=1, g=6$, points change by $+6$, $f=156$.
- Turn 4, $x=2, w=10, g=15$, points change by $-10$, $f=146$.
I wanted to use ML to try and predict this by feeding it pre-generated turns to see if it can find any patterns. There are only a few variables involved, so I figured it shouldn't be overly complicated. Ideally I would like for the ML to learn how to play the game.
I am wondering what type of ML is applicable to this kind of problem? It is not clear to me where to start, even though I have made the game simple. I have more complex games that I made in the past that I would like to try to apply ML to as well.
Topic game python machine-learning
Category Data Science