Category Archives: math

Pi Day 2020 and Thoughts on Coronavirus

A weird pi day this year, as the world shuts down around us to prevent the spread of coronavirus / covid-19.

Things have moved super fast this week, from out-of-state field trips being cancelled a week ago, to local colleges and universities shutting down early in the week, to our engineering advisory board discussing backup plans (thinking of them as a good precaution but not likely to be needed) for a virtual senior capstone symposium on Wednesday, to Friday’s systemwide professional development being cancelled on Thursday morning so teachers could spend the day preparing “packets of work” for the unlikely event of a school closure at some future time, to the state superintendent and governor announcing school closures later that afternoon.

Our math department had purchased t-shirts for the math teachers (in whose ranks I am grateful still to be an honorary member), which say “Pi Day inspires me to make irrational yet well-rounded decisions.” Due to pi day falling on a weekend this year, we were all planning to wear them Monday. But now with no school Monday (officially we are out for two weeks, 3/16-27, though there’s every chance it could be extended longer; other states and districts that have cancelled school seem to be out for at least a month) there won’t be a chance to celebrate the day with students as I have for the past fourteen years. In fact, we didn’t have a chance to see our students after the decision to close schools was made, what with Friday being school-staff-only for professional development / packet planning, and school closure beginning Monday.

This could be the chance to experiment with online learning, but as I mentioned our district has gone old-school, requiring teachers to prepare (with short notice) two weeks’ worth of work to be photocopied and distributed. The argument is that using digital tools can increase inequity, since many of our students do not have computers or internet access at home. This “digital divide” is certainly real: many of our students do lack a desktop or laptop computer needed to run engineering software like Autodesk Inventor or CNC Base, or Python or Java coding softwares. But at the same time, I feel that inequity is also being increased by us only providing hastily-prepared written packets, while other counties and school districts do use richer online learning tools. Even a perfectly-prepared packet of work, that excellently scaffolds instruction for students from one page to the next, teaching new concepts in clearly written language, which may be a rich learning experience for self-motivated students with good reading comprehension skills, will not adequately teach students like those at my high school who read on an average of a fourth-grade reading level, who may not have English as their first language and are still learning it as a second or third or fourth, who learn more from demonstrations and hands-on projects, who demonstrate amazing ingenuity in the projects and work they are able to accomplish but often do poorly on standardized tests like the SAT, the engineering EOC exams, the AP exams, in part because of the heavy reliance on long questions and reading. When instead, we could be using online tools that allow for video instruction, interactive feedback, discussion fora, and screenshare videoconferencing to teach in a more audiovisual and interactive way instead of only relying on the static written word. I don’t know if the inequity of packets is more or less than the inequity of digital, and I know there is no good solution here, but I feel bad that Baltimore may be making the wrong choice, which puts our students even further behind.

I wasn’t sure today if I would do my traditional pi day email & blog post. I haven’t written a blog post since last pi day. And I figure, there can’t be any new pi facts or cool things that I haven’t already shared with you all over the past nearly two decades. Well, as I finish typing this it’s actually past midnight into the Ides of March here, though I figure it’s still pi day somewhere (specifically anywhere west of US Eastern Time and east of the International Date Line) so I can still count this as a pi day post. Although it hasn’t been much on pi facts & figures, more of a reflection on current events.

Some news about me from the past year:

I travelled to India with my friend Matt last April; it was amazing! Had plans to do one or more blog posts but never got around to it; you can see some photos on my instagram page.

I took a semester sabbatical from teaching to finish up my master’s degree in computer science with Georgia Tech. I am now officially graduated! 🙂 It was tough structuring my time so that I could work from home and not be distracted, but somehow I pulled it off. Guess it was good practice for the next two weeks or more of remote work and social distancing.

Anyway, hope you all had a happy pi day! I celebrated with a crab pie from Matthew’s Pizzeria in Baltimore. And stay safe/healthy/well!

Nick

Leave a comment

Filed under computer science, engineering, math, teaching

Pi Day 2019

Today was a very pi-saturated day for me (which is wonderful!). After waking up, I took a shower behind a pi shower curtain:

(that’s right, I have a shower curtain filled with the digits of pi, which are colored differently to make the shape of the pi symbol stand out…)

I dressed with a pi day t-shirt as my undershirt, and a pi tie (the same pi tie I wore last year).

On my way into work, I did a few pi day routines:

  1. reciting pi to myself to make sure I still know the digits (I usually falter in the mid 100’s and need to refresh my memory the day before so I’m solid at 200 like I was in high school, then I continue to practice that morning)
  2. buying some pies from the grocery store for my students
  3. decorating my board with pi digits and facts

We had been invited on a field trip to have our students celebrate Pi Day in Annapolis at the Maryland State House Office Building, with legislators, the lieutenant governor, and representatives from other schools and STEM education organizations. So we brought six students and three bins full of projects and things to show off, from our engineering program, our computer science program, and our STEM after-school clubs. We brought a 3D printer, which was a big hit, in constant operation producing little raven figurines which we gave away to visitors to our table (many of them younger children). We brought a laptop with Python and Java programs coded by my students that simulated flipping coins, drew a beautiful geometric flower, merged two photos together (a primitive Photoshop), and an “artificial intelligence” program that interacted with a weather API to obtain the current weather and give advice to humans on what to wear. Also some tablets with student-coded apps, and electronic devices like a robot butterfly, a random-number-generator dice LED board, and a soda-can lamp. There was also a solar-powered car, a hovercraft, and designs and blocks and shapes carved out by students using CNC mill and lathe.

For lunch there was pizza pi(e) and mini dessert pi(e)s, as you can see in the following picture of the students each holding up a slice of pie, a pie, or a pi:

Returning to school for my last period class and our after-school makerspaces club, we celebrated in the traditional way by eating more pie. 🙂

When I got home, my neighbors invited me over for a pi day and birthday celebration for their kid. So even more pizza pie for dinner, lemon meringue and key lime pies for dessert, and some discussion of pi day trivia at the dinner table, as well as anecdotes of how the neighbors celebrate pi day at their offices. A wonderful time!

Overall, lots of pi and pie from morning ’til night. A great way to celebrate a great day!

Here are some pi-day tidbits of news, information, and links about pi:

  • Today, Google announced that one of their employees, Emma Haruka Iwao, together with the Google Computing Engine, calculated pi out to 31,415,926,535,897 digits (i.e. pi times ten trillion digits, some self-referential humor in their choice of where to stop). This shatters the previous world record of 22 trillion! (sources: BBC, Forbes, 538)
  • Here are some ways NASA uses and celebrates pi.
  • As pi day gets more and more popular, I’ve seen more backlash of pi day skeptics recently (though nothing like the great pi / e wars and debates of my Williams College days, nor the great Pi/Tau Debate of 2011). I am still a pi fan, but here are some other numbers you might enjoy and wish to celebrate as well!
  • Since we handed out 3D-printed ravens as Maryland-themed souvenirs at today’s event, I feel like I need to re-post this link to the renowned retelling of Poe’s “The Raven” which has words of lengths equal to the digits of pi. Poe, E. Near a Raven.
  • In honor of my new neighbor’s birthday, there are some other famous folks who share a birthday with pi day: Many people know about Albert Einstein, but also Waclaw Sierpinski, the Polish mathematician famous for fractals, and also Alexey Pajitnov, the developer of Tetris. (h/t to Michael Lugo for the latter fact).

And finally, a few pi day jokes. Each image is linked to its source:

Hope you all had a wonderful pi day, and continue to celebrate math all year long!

Nick the Pi Guy

Leave a comment

Filed under computer science, engineering, math, teaching

Triangle Spaghetto?

So, this is an interesting question to think about…

If you were to break a piece of spaghetti randomly twice, to yield three smaller pieces, what are the chances that your three pieces would form a triangle?

spaghetto_poll.PNG

I encourage you to take some time to think about this before reading my solution.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

I had a little intuition based on the triangle inequality, which says that for any pair of sides of a triangle, their sum must be greater than the third side: a+b>c.

After making that guess, I actually tried to prove this to myself geometrically before moving to try a simulation via computer program, so I guess I’m still a mathematician at heart even though my current teaching load is all computer science courses! 🙂

tri_spaghetto

The outer triangle, AEF, is the probability space for the spaghetto we’re talking about, assuming (without loss of generality) that the original spaghetto has length 1. The x-axis represents our (random) choice for the first break, which could be any number between 0 and 1 with equal/uniform probability.  Let’s call the random number chosen x*. The y-axis then represents our (random) choice for the second break, which is now constrained with an upper bound of 1-x*, based on however long our first broken piece was (thus the hypotenuse of the right triangle, y=1-x). Only two breaks (or, equivalently, random numbers) are needed, 0≤x*≤1, and 0≤y*≤1-x*, since the third piece is completely determined by the first two, as 1-x*-y*.

Within our probability space, the bluish-green region in the lower right is out-of-bounds for trianglehood, since an initial break of my first piece x*>0.5 would mean that I’m left with a piece less than 0.5 which still needs to be broken into two, and that means those two pieces could never sum to more than my first piece (the triangle inequality). The magenta region near the top is similarly off-limits, even if my initial break is small enough, if my second break yields a y*>0.5, the first and third pieces could never sum to more than the second. Finally, the yellow region near the bottom represents non-triangles where both the first and second breaks are two short, yielding a combined sum less than 0.5, and therefore a third/final piece greater than 0.5 which would dominate the first two and thus not allow triangularity to flourish from our three pieces of spaghetti.

So the only triangularly-valid region is the center, which is 1/4 the total area of our probability space.

After becoming certain of this answer, I did mock up a quick random number generator function in Python:

py_spaghetto

While this was indeed closer to 0.25 than any other option in the initial poll, the fact that I ran 10,000,000 trials and got consistently less than 0.2 (and not closer to 0.25) does worry me that I coded one of the assumptions wrong. I’m still 99% certain that 0.25 is the correct answer. But if anyone spots a program error, or a logic error, please let me know!

Leave a comment

Filed under computer science, math

PI DAY 2018!

Happy pi day!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Pi Day as a holiday is 30 years old this year (unless someone had been celebrating quietly on 3/14’s before Larry Shaw publicly founded Pi Day at the San Francisco Exploratorium in 1988)!

While last year was a pi day snow day for us, this year the snow has mostly missed us in Maryland, while Boston area folks have had several huge storms in a row, and some of them do have a pi day snow day today!

The day was off to a good start this morning with a beautiful pi day sunrise:

I was up early to buy some pies, as per usual, when I stumbled across a pi-day pie sale! While I’ve seen photos of these before on social media, this is the first time I’ve actually come across one in person on a pi day myself!

 

I made my chalkboard a little busier than usual, including a few extra pi facts:

I also wore a new pi tie today (some years I’ve worn pi t-shirts). You can’t tell from the photo, but the image/pattern is made up of pi’s digits!

My first period AP CS A (Java / object-oriented programming class, with juniors and seniors) is the only class I did a pi-focused lesson with this year. In my other classes, we took a ten-minute pi and pie break, and talked about pi facts while eating, then back to our regularly-scheduled lesson. But in AP CS A, we coded an infinite series for pi in Java. We used the Leibniz formula, relatively easy to understand and code: 1/1 – 1/3 + 1/5 – 1/7 + 1/9 – 1/11 + 1/13 – …

This actually converges fairly slowly, compared to other infinite series for pi. Here are the results after ten terms, with the terms included on the left, and the running summation on the right of each line:

Here we are after 1000 iterations, just the sums:

And after a million terms, we’re getting pi accurate to five digits:

A million terms took a few minutes to run, so we didn’t dare try ten million, for fear we would break our ancient computers! Nor did we try to break the record of 22 trillion digits of pi, which would need many many times more terms if we were to use this series 🙂

Also today, in other news, a nationwide walkout against gun violence, which students at my school participated in as well. And I took two students on a field trip; the students had built a custom-engineered bicycle for a kid with a disability last month during National Engineering Week, and today we got to deliver the bike to the kid and his mother. So that was pretty cool.

Anyway, that’s how my day went, hope your pi day was similarly awesome!

Here’s my round-up of a few Pi Links:

And a few really creative pi-related photos, found via Twitter (linked to their sources):

1 Comment

Filed under computer science, math, teaching

Number Systems

Binary and hexadecimal today in AP CSP:

binary.jpg

hex.jpg

When I was in elementary school, I was fascinated with number systems. I know I read about some different number systems used by different cultures through history in a book of number history my parents had, and was also inspired by some discussion of binary / ternary / base-4 in The Math Curse. I asked my mom to explain them, and she did.

Somehow (I forget the source, if it was a news article or an “interesting fact” in some book), I got really into the Inupiaq number system, both the symbols and the base-20 place value system for writing them. I remember writing the date in the upper right-hand corners of my papers using Inupiaq numerals each day in Mrs. McCarthy’s 4th grade class (or was it 6th grade? — she was my teacher both those years).

Always lots of fun teaching number systems! One of my favorite topics. 🙂

#day16 #apcsp #teach180 #180blog

Leave a comment

Filed under computer science, math, teaching

Daily Agendas on Google Docs

I’ve been doing this with a few classes for the past two years, but this year made the move to all: I keep a Google Doc with the day’s agenda for each class. This is useful as a central location from which all of the day’s activities can progress, with links to assignment documents, links to online quizzes, links to videos, and links to resources all embedded in there. In review surveys at the end of each class, this has consistently been a highlight and something they really appreciate. For example: “The links on the agenda and the directions that gave us to do what we had to do”, and “Somenthing that I really liked about this class was the agenda because if by any reason you was absent you just have to go to the online agenda and you can make up from your home.”

Because of these reviews, this year I’m moving to all classes having an online agenda. Combined with the fact that I’m a fan of the tinyurl.com website for shortening and choosing your own url, I was laughing with a few of my students this afternoon that today I had my students use 5 different tinyurls for these agendas (and of course have to keep them straight in my head):

CSP_Agenda

[Year 12, Day 2 post]

 

Leave a comment

Filed under computer science, engineering, math, teaching

Year 12, Day 0

This week teachers headed into school to prepare for next week and students’ return. This will be my twelfth year!

My teaching this year will include more computer science than ever before:

  • AP Computer Science Principles (full year)
  • AP Computer Science A (full year)
  • Foundations of Computer Science  (spring)
  • Computer Integrated Manufacturing (fall)
  • Precalculus independent study (fall, three students, three separate periods)

I’ll also be working with our new engineering teacher and our librarian+new-computer-science-teacher to help them with their lessons, and collaborating with two geometry teachers around standards-based-grading.

Extracurricular activities and competitions:

  • Coding Club (app development, cybersecurity, & more)
  • Women’s Transportation Seminar’s “Transportation You!” Mentoring Program
  • TRAC bridge builder competition
  • CyberPatriot competition
  • STEM Competition
  • possible (in my mind, I want to do each of these this year): Cyber Movie Mondays, Saturday AP & PLTW study groups, Girls Who Code club
  • probably several others…

Ongoing projects that will occupy some of my time this year include:

  • Comp Hydro (teaching hydrology and flooding through computational simulations & modeling, in partnership with the Baltimore Ecosystem Study)
  • MyDesign (engineering design process app and learning management system, in partnership with NSF & the University of Maryland)
  • Internet of Things project to measure air quality and other environmental factors in schools (in partnership with Cool Green Schools, Johns Hopkins University, and Morgan State University)
  • Continuing work toward my Master’s Degree in Computer Science (taking “Artificial Intelligence ” course this semester)
  • Baltimore City Engineering Alliance, a nonprofit 501(c)(3) we created to provide opportunities to Baltimore City students to further their engineering education, and for which I am treasurer

School starts for students on Tuesday, after Labor Day for the first time in my twelve years here teaching in Baltimore. Wish us luck!

Leave a comment

Filed under computer science, engineering, math, teaching