Giter Site home page Giter Site logo

ghostbuster's Introduction

Ghostbuster

This is the script I used to iteratively find the percentage chance that the Ghostbusters from the FiveThirtyEight weekly Riddler Express Question blow up the world when they cross their proton beams at a campfire while shooting ghosts hidden amongst them.

Not spending much time on usability but if you want test it you can import the entire file and run ghostbusters_continuous(iterations) or ghostbusters_discrete(interations) with the number of iterations you'd like. The script returns an array of the moving averages for each iteration of the test, which are also saved as x, and y so that you can easily plot them to see the average converge.

Over 5000 iterations or so it seems to converge at 33.3%.

Due to an argument with my roomate over whether the fact that there are 20 distinct locations among the circle will influence the end probability we test both cases. The continous case randomly samples 4 locations along a unit circle and creates two particle beams and finds if those intersect. The discrete case randomly chooses 20 locations along a circle and then chooses 4 of those locations without replacement for the ghosts and ghostbusters.

As I expected (take that Brett!) the number of people around the fire doesn't matter as it boils down to 4 random locations around the circle and the final percentage appears to converge at ~33.3% or a 1/3 chance that the earth will be destroyed by our intrepid ghostbusters.

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.