Save this video free

Lecture 6: PI

Professor Rosen · 1:06:18 · Watch on YouTube

Part of Temple University CIS 1051. See all 23 lectures and search them

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

Overview

Professor Rosen uses the Madhava–Leibniz series, π/4 = 1 − 1/3 + 1/5 − 1/7 + ···, to teach Python loops, ranges, accumulators, and alternating signs. The lecture then connects the series’ slow convergence and floating-point limits to binary representation, addition, and two’s-complement subtraction.

Key takeaways

Chapters

0:00 Pi as the Circumference-to-Diameter Ratio
2:10 How Computing Accelerated Pi-Digit Calculations
4:00 Madhava and the History of Pi Approximations
7:20 Reading the Madhava–Leibniz Series for Pi
11:30 Breaking the Pi Program into Smaller Tasks
13:20 Python for Loops and the Three Forms of range()
21:30 Summing a Range with an Accumulator
30:50 Using range() to Generate Odd Denominators
34:00 Turning Odd Numbers into Fractional Terms
38:10 Alternating Signs with a Sign Variable
44:00 Testing Convergence and Understanding Float Precision
49:00 Decimal Place Value and Binary Representation
56:10 Binary Addition, Two’s Complement, and Low-Level Computing

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

Transcript excerpt

0:01 So probably one of the most important mathematical terms uh that we have or constants in is pi which we've been deal which we touched on a bit last lecture when we figured out uh basically how to draw a circle by not actually drawing a circle. So um they've got a static version of this now. Cool. Yeah, this is one of my favorite illustrations that we've that that illustrates really what pi is. Pi is the ratio of a circle circumference to its diameter. So the idea here is that if we take a circle that's of unit length, in other words, has a diameter of one, and we unroll it, then the amount it's going to unroll is going to

0:49 be equal to pi, 3.14159. Now pi is this ratio uh or this constant that has a this ratio this rational irrational number it means that it can't be expressed as a fraction of two integers um it means it goes on essentially forever but before we understood that it was an irrational number and before we understood a lot of other things about it we und stood we we were still you using a formula to create the uh for this ratio or trying to calculate this ratio as best we could. Um so we had various ways of approximating uh pi

1:38 in other words figuring because again uh you know when you were maybe in third grade or whatever you pro might have learned pi or fourth grade or I don't know when they teach this kind of stuff but at some point you learned pi and you started out by learning pi is 3.14 which is an it's three digits so that's easy enough to remember right so um is that and it's honestly good enough

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

In this course

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.