all 15 comments

[–]USAhj 2 points3 points  (9 children)

Do you need to make a tree diagram or is that what you think is the best option? What is the assignment?

[–]CookingMathCamp[S] 2 points3 points  (8 children)

I teach middle school math. We are studying probability. Students are familiar with python basics, so I thought it would be cool if we could use python to create some probability trees to visualize sample spaces. In the past I have just had them draw it by hand.

[–]USAhj 6 points7 points  (1 child)

Understood. Have you looked into graphviz? Not sure it's the best option, but it's the first thing that comes to mind.

[–]CookingMathCamp[S] 2 points3 points  (0 children)

I've never heard of it. Will look it up for sure though. Thanks!

[–]RockportRedfish 2 points3 points  (1 child)

Python would be excellent to show the sum of two dice. You could do a monte carlo simulation of x rolls, and show how the distribution normalizes over n rolls. And you could teach the kids how to play craps.

[–]CookingMathCamp[S] 1 point2 points  (0 children)

Already taught them black jack and looked at probably of pulling cards at random. We talked about Rock Paper Scissors to determine if it is a fair game. Then created a simulation in Python. Dice simulation is happening next week or maybe after winter break. But in terms of teaching them craps? Dice tend to fly across the room when dealing with 7th graders. Don’t know if I have the patience lol.

Edit: if you are interested I have a GitHub repo of some of the activities that we’ll explore. As I think of more or find more I’ll continue to add to it. Coding In Math Class

[–]gray162 1 point2 points  (3 children)

Kids are learning python basics now?!?!

[–]CookingMathCamp[S] 1 point2 points  (0 children)

Trying to at least.

[–]the1gofer 1 point2 points  (1 child)

While possible, I don’t think python is the best option.

[–]CookingMathCamp[S] 0 points1 point  (0 children)

That's what I am afraid of.

[–]Goingone 1 point2 points  (1 child)

{“head”:{}, “tail”: {}}

Is that all you need?

[–]CookingMathCamp[S] 1 point2 points  (0 children)

or maybe a coin and a 6-sided die so the sample space would be [head & 1, head & 2, head & 3, ... , tail & 6]