Coder Social home page Coder Social logo

markov-chains-model's Introduction

Rock-Paper-Scissors Markov Chains Model

Introduction

This repository houses a predictive Markov chain model for the classic game of rock-paper-scissors. The model's objective is to forecast an opponent's moves and evolve a counter-strategy, thus simulating a strategic game environment. The theoretical basis of the model lies in the assumption that the opponent's current move is dependent solely on their last move, not on a longer sequence of past moves.

Concept and Strategy

The strategy used in this model is to record the opponent's move transitions and develop a probability matrix, which is then used to predict future moves. As the game progresses, this matrix evolves, reflecting the increasing information about the opponent's strategy. The model makes its predictions and adjusts its strategy accordingly, seeking to maximize its wins over a series of games.

Observations

These visualizations illustrate the model's adaptability across different levels of opponent unpredictability:

High Entropy

Opponent strategy: [1/3, 1/3, 1/3]

Description: This graph represents the model's performance in a highly entropic setting, where the opponent's behavior is equivalent to random guessing.

High Entropy Balance

Normal Entropy

Opponent strategy: [0.1, 0.5, 0.4]

Description: This graph depicts the balance where the opponent's moves follow a certain patterns, but also include a decent variation, allowing for moderate predictability.

Normal Entropy Balance

Low Entropy

Opponent strategy: [0.8, 0.1, 0.1]

Description: This graph shows the model's performance against a highly predictable opponent, which results in a steady gain in balance over time.

Low Entropy Balance

Conclusion

This model serves as a fascinating case study in applying Markov chains to game strategy. It illustrates how predictive analytics can be used even in scenarios with inherent randomness.

markov-chains-model's People

Contributors

kanakx avatar

Watchers

 avatar

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.