Python Forum
Seeking creative and knowlegeable coder for help!
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Seeking creative and knowlegeable coder for help!
#1
I am relatively new to python and coding in general but I had the balls to say that I would make a program for a maths project. What I have said I would do is to replicate the Monty Hall problem in a program and be able to change the variables like the amount of trials and the amount of doors in the problem. I am not asking for someone to write the program for me but I would just want someone to point me in the right direction when it comes to what I need to know and possibly where I could learn it since I still want to write it myself. I am guessing that I would need to learn how to:

- Code probability and randomness
- Print results in percentages involving many numbers
- Repeat parts of code

Any help would be appreciated, especially if someone had the time to read a little about the Monty Hall problem and see if there is anything I missed.

Thanks!
Reply
#2
I'm familiar with the Monty Hall problem. If you want to code the exact probabilities you are either going to need to calculate the math, or use combinatorics. Combinatorics would probably require importing the itertools module. Combinatorics would probably be easier to generalize. Randomness would be the random module. Printing the results would be the print function (or print statement if use v2.7) and the format method of string objects. Repeating parts of the code would require loops, either while loops or for loops. With loops you could estimate the probabilities using a simulation.

Monty Hall for the curious: https://en.wikipedia.org/wiki/Monty_Hall_problem. My brother-in-law still refuses to believe that you should switch doors.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#3
If you are seriously wanting to learn Python, start with the Python docs tutorial
Reply
#4
as Yoriz suggests, you really want to start at the beginning
From there you can advance as rapidly as you wish

If you just want to see what is involved with writing one, look at
Monte Hall problem 50 examples
Reply
#5
if you are told that python 3 is a goat would you switch from python 2 to python 1?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Seeking advice on dask distributed sawtooth500 4 285 Apr-15-2024, 11:07 PM
Last Post: sawtooth500
  [NEW CODER] TypeError: Object is not callable iwantyoursec 5 1,392 Aug-23-2023, 06:21 PM
Last Post: deanhystad
  New user seeking help EdRaponi 2 45,315 Jun-23-2020, 12:03 PM
Last Post: EdRaponi
  non-coder asking for coder input on domain dropcatching randomguy 0 2,188 Jan-16-2019, 08:43 PM
Last Post: randomguy
  seeking suggestions for function option name Skaperen 1 2,553 Dec-22-2018, 05:27 AM
Last Post: Gribouillis
  Newbie seeking help with DNS query DaytonJones 0 2,234 Sep-21-2018, 06:29 PM
Last Post: DaytonJones
  "Invalid Syntax" (I am a new coder) Marius2002 8 4,767 Sep-08-2018, 06:39 AM
Last Post: Marius2002
  Seeking understanding with the python import function. Intelligent_Agent0 2 2,623 Feb-18-2018, 11:57 PM
Last Post: snippsat
  Seeking feedback on my script-in-progress league55 2 2,662 Feb-12-2018, 03:03 PM
Last Post: league55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020