Coder Social home page Coder Social logo

2017chipbets's Introduction

2017ChipBets

Your have 2 bags containing 200 chips each.

There are red and white chips distributed between the two bags:

White dominant bag: 160 white chips and 40 red chips
Red dominant bag:   120   red chips and 80 white chips

You have a bank account of $1000.

The object is to guess which bag chips are being selected from and to bet up to 100% of your bank on the guess. E.g. you guess bag "wd" and bet $50. If you are correct, you get $50; if you are wrong, you lose $50.

You will get 100 bets. At the beginning of each session, a bag is selected at random. You can buy chips from that bag for $9.30 each using your bank account. Chips are purchased 1 at a time and you can switch from buying chips to betting at any time.

Chips are not replaced in the bags at any time. If you buy all of the chips from any one bag, your session(s) is ended.

Highest bank account at the end of 100 bets wins.

Your strategy must be coded in the file "strategy.py" with the function "bet_strategy" with the signature:

def bet_strategy(session, bank, chip_color, session_history, **kwargs)

session is an int [0, 99] enumerating your bets
bank is your current bank balance
chip_color is the color of a chip if your last move was a "buy" ["w","r"]
session_history is the list of all of your moves during the current session including
     the color of chips you bought ["w","r","u"]

Your function returns the tuple defining a chip buy or a bet:

move_choice="bet" or "buy
bet = [1, bank]
bet_bag_dominant_color = "wd" or "rd"

I have provided the simulation code that will be used to evaluate your strategy at the end of the competition in "sim.py". You can change anything here you like, but there probabaly isn't any need. To see your bank account balance at the end off 100 bets, code your strategy in "strategy.py" and run "sim.py".

If you plan to do a parameter search, use the kwargs. See meta.py for an example of how this is done.

The example code shows a strategy of random selection base on buying a single chip before betting. Run this example to see how it works, then do something better!

Good luck!

2017chipbets's People

Contributors

drskippy 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.