Posts

Showing posts with the label Maths

Monty Hall Problem Simulation

""" This is a simulation of Monty Hall Problem. https://en.wikipedia.org/wiki/Monty_Hall_problem Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice? """ import random NUM_DOORS = 3  # three doors in the game MAX_ROUND = 10000  # number of rounds for statistics change_win_count = 0 for _ in range (MAX_ROUND):   # randomly to put a car behind a door   car_door = random. randint (0, NUM_DOORS - 1)   # the player firstly selects a door   player_first_guess = random. randint (0, NUM_DOORS - 1)   # the host opens another door without a car   host_door = random. choice ([       x for x in range (NUM_DOORS) if x != player_first_guess and...

Pluses and Minuses: How Math Solves Our Problems

Image
  Pluses and Minuses: How Math Solves Our Problems "Pluses and Minuses: How Math Solves Our Problems" by Stefan Buijsman is a thought provoking book about the role of Mathematics in our daily life. The book starts with examples of Google Map and Netflix to present that Maths is not only an abstract exercise in a classroom but also closely related with us everyday. Following that, it describes how human being interpret Maths and its development along the history in various cultures. The later chapters demonstrate about the history and applications of two advanced topics, Calculus and Probability. The last topic is about graph theory and explores its usage in navigation, streaming service, cancer treatment and social media. The last chapter is not only a conclusion but also rethinks the nature of Maths and how we correctly and mistakenly apply it in our daily experiences. While the book contains a few content describing Maths formula and theorems in this book, it primarily focu...