Coding Challenge 170: The Monty Hall Problem

Subscribers:
1,740,000
Published on ● Video Link: https://www.youtube.com/watch?v=0zac-cDzJwA



Duration: 32:16
148,171 views
4,103


It's the Monty Hall Problem! In JavaScript! With p5.js! Yes, you really double your chances of winning by switching doors. I hope to convince you of this in this video! https://editor.p5js.org/codingtrain/sketches/pLW3_PNDM

p5.js Web Editor Sketches:
๐Ÿ•น๏ธ Monty Hall: https://editor.p5js.org/codingtrain/sketches/pLW3_PNDM
๐Ÿ•น๏ธ Monty Hall (variable speed and doors): https://editor.p5js.org/codingtrain/sketches/PVuN7NPjj

GitHub Repo and Demo:
๐Ÿ’ป Repo: https://github.com/CodingTrain/Monty-Hall
๐Ÿ’ป Demo: https://codingtrain.github.io/Monty-Hall/

๐ŸŽฅ Previous video: https://youtu.be/_H9JIwWP7HQ?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
๐ŸŽฅ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH

Links discussed in this video:
๐Ÿ”— Game Show Problem, Ask Marilyn, Parade Magazine 1990: https://web.archive.org/web/20130121183432/http://marilynvossavant.com/game-show-problem/
๐Ÿ”— Document Object Model (DOM): https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model
๐Ÿ”— CSS Basics: https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/CSS_basics

Other videos mentioned in this video:
๐ŸŽฅ The Basics of CSS - p5.js Tutorial: https://youtu.be/zGL8q8iQSQw
๐ŸŽฅ 8.11 - Callbacks on Multiple DOM Elements - p5.js Tutorial https://youtu.be/KeZBpeH59Q4
๐ŸŽฅ Local Storage in JavaScript with p5.js https://youtu.be/_SRS8b4LcZ8

Timestamps:
0:00 What is the Monty Hall Problem?
1:50 Solution for Monty Hall Problem!
6:55 Starting the Code
8:53 Centering a DIV
10:22 Callback Events
15:40 Refactoring into Functions
23:11 Adding Stats
27:04 Playing the game!
28:21 Bayes Theorem
31:45 Goodbye!

๐Ÿš‚ Website: http://thecodingtrain.com/
๐Ÿ‘พ Share Your Creation! https://thecodingtrain.com/Guides/community-contribution-guide.html
๐Ÿšฉ Suggest Topics: https://github.com/CodingTrain/Rainbow-Topics
๐Ÿ’ก GitHub: https://github.com/CodingTrain
๐Ÿ’ฌ Discord: https://discord.gg/hPuGy2g
๐Ÿ’– Membership: http://youtube.com/thecodingtrain/join
๐Ÿ›’ Store: https://standard.tv/codingtrain
๐Ÿ“š Books: https://www.amazon.com/shop/thecodingtrain
๐Ÿ–‹๏ธ Twitter: https://twitter.com/thecodingtrain
๐Ÿ“ธ Instagram: https://www.instagram.com/the.coding.train/

๐ŸŽฅ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
๐ŸŽฅ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA

๐Ÿ”— p5.js: https://p5js.org
๐Ÿ”— p5.js Web Editor: https://editor.p5js.org/
๐Ÿ”— Processing: https://processing.org

๐Ÿ“„ Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct

Editing by Mathieu Blanchette
Animations by Jason Heglund
Images licensed by Getty Images
Music from Epidemic Sound

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/website/issues/new