Skip to content

React + express app computing solution to the Monty Hall problem

Notifications You must be signed in to change notification settings

trailblazingfive/monty-hall-problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monty Hall problem

The Monty Hall problem is a brain teaser, in the form of a probability puzzle, loosely based on the American television game show Let's Make a Deal and named after its original host, Monty Hall (learn more).

Setup

Clone the repository and run npm install.

Development

Production

Run npm run monty-app builds the React frontend and serves it via express using static middleware at localhost:3100.

Backend API

The express backend responds to POST request at localhost:3100/api/monty.

Request body

{
  "sampleSize":<Integer>,
  "keep":<Boolean>,
  "numberOfDoors":<Integer>
}

Response body

{
  "sampleSize": <Integer>,
  "wins": <Integer>,
  "keep": <Boolean>,
  "numberOfDoors": <Integer>,
  "winRate": <Float>
}

While in production the build React app is served from the same port as the backend; in order to cancel this feature it run rm -rf build in app root folder.

About

React + express app computing solution to the Monty Hall problem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published