Save this video free

Lecture 21: Pig

Professor Rosen · 1:11:42 · Watch on YouTube

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Lecture 21: Pig Watch on YouTube →

Overview

Andrew Rosen turns the Pig dice game into a step-by-step Python programming exercise, building a turn simulator, Monte Carlo experiments, and a single-player game that compares hold thresholds. Simulations of up to 100,000 games suggest holding around 19 or 20 points minimizes average game length, while the lecture also explains how to manage a public GitHub project repository and complete the final-project proposal process.

Key takeaways

Chapters

0:00 Final-Project Proposal Requirements and GitHub Repositories
3:12 Proposal-Day Meetings, Approval, and Missed-Appointments Policy
9:27 Past Project Examples and Public Repository Access
12:30 Pig Rules and the GitHub Desktop Project Workflow
20:09 Breaking the Pig Programming Assignment into Stages
22:10 Python Dice Rolls and the Hold-at-20 Turn Simulator
31:25 Monte Carlo Counts for Pig Turn Outcomes
40:04 Default Arguments and Hold-at-X Strategies
46:27 Comparing Risky Targets with Monte Carlo Experiments
49:49 Adding the Current Score to Pig's Turn-Ending Rules
56:15 Simulating a Complete Single-Player Pig Game
59:00 Measuring Average Game Length Across Simulations
1:04:00 Finding a Strong Hold Threshold with 100,000 Games
1:08:50 Monte Carlo as Practical Statistical Analysis and GitHub Code Sharing

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:01 So, let's go ahead and get started with this. We're going to work on an in-class exercise today. Um, that used to be a homework, but I'm going to but I've converted it into an in-class exercise because I found that having a new homework plus is getting started on the final project plus the exam all happening at the same time was a bit much. Now before we get into it, let's just talk about the announcement and um and the um sorry the the GitHub lab um the pre-posal and proposal, right? For the pre-posal and the proposal, what you need to turn in is a link to your GitHub repo,

0:52 right? So you got to go to GitHub github.com. You need to set up a repo which you can do by just you doing this plus sign over here. Create new repository and then either uploading that file or editing that file or um but it all becomes a lot easier if you use the GitHub desktop. There's lots of tutorials on GitHub online but you can also refer back to Thursday's lecture right about it. But you submit a a link to that repo. Um, for the proposal, I've to make it uh to make it easier to understand, I've got two separate grades for final project for your final project uh proposal now.

1:40 Okay, which is uh let's see, do I have it here? Nope. Let's go ahead and add it. Assignment. Um, proposal day. Add item. There we go. Proposal day, which is due the same day. Um, way. And I can edit this to um right there we go. Proposal day and your proposal get a

2:29 blank. So when you meet with me uh to get your project checked off, I will my I will get you I will give you

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Professor Rosen.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.