MENU

Fun & Interesting

Coding Challenge 170: The Monty Hall Problem

The Coding Train 160,568 3 years ago
Video Not Working? Fix It Now

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

Comment