Posts

Showing posts with the label computer science

Great Big House in New Orleans and the Josephus problem

Image
Six years ago, when I was a freshman in college, I wrote a series of three posts on this blog about a game that I used to play in elementary school music class called "Great Big House in New Orleans". In those posts, I attempted to write a program in Java and Python that would calculate the winning position of the game given the number of players. "Great Big House in New Orleans" (published Monday, November 06, 2017) "Great Big House in New Orleans: Improved Code" (published Thursday, November 09, 2017) "Great Big House in New Orleans: The Special Case" (published Friday, February 02, 2018) At the time, I had less than a year of experience in computer programming and had only recently decided that I would study computer science. Because of my naivete, the posts have many problems, and they are a little embarrassing to look back on. The posts ramble excessively about basic programming principles and assume without proof that a pattern will hold...

ChatGPT is the future

On Thursday, June 8, 2023, a lawyer by the name of Steven A. Schwartz stood with his head hung low— humiliated —before a federal judge in Manhattan. He was there to represent a man named Roberto Mata in his lawsuit against the airline Avianca. Schwartz had asked ChatGPT for past legal cases that could support his client's case against Avianca. ChatGPT cheerfully replied with case names like " Martinez v. Delta Air Lines , Zicherman v. Korean Air Lines and Varghese v. China Southern Airlines ," and—perhaps feeling a similar sense of cheerfulness at the sheer convenience of this newfangled online tool—Schwartz went ahead and cited these cases in the final document he submitted to the court. However, any such cheerfulness quickly dissipated, for if Schwartz had done any cursory examination of the cases provided by ChatGPT, he would have soon discovered that none were real. ChatGPT had made them all up. ChatGPT is a form of artificial intelligence. The term "artificial...

Onion routing: class demonstration

In June 2020, I published a post on this blog that discusses onion routing , a method in computer networking whereby computers can send anonymous messages to one another. If I were an instructor at a school or university teaching about onion routing in some computer science class, I would demonstrate it to the class in the following way. Items needed Post-it notes or sheets of paper, one for every student in the class Envelopes, four for every student in the class The more students in the class, the better, but at minimum there needs to be five students . Goal Each student in the class, using the method demonstrated here, will be able to write an anonymous note to someone else in the class. The recipient of the note will not be able to determine who wrote them the note without convincing at least two other students in the room to reveal information. Procedure Preparation ( Optional ) Have every student in the class draw a name from a hat that has every student's name in it. The ...

Onion routing

Back in August 2018, I wrote a post called " Secret messages ". In that post, I discussed how in elementary school my friends and I devised a rudimentary "secret language" to send coded messages to each other without our enemies knowing what we were writing. I then discussed a little bit of modern cryptography (which I described as "the scientific study of sending secret messages"), specifically the RSA encryption scheme . This post is a bit of a follow-up to that post. With today's technology, it is quite easy to send someone a secret message that not only can be read only by the intended recipient, but also allows the intended recipient to verify that the message was not modified by an eavesdropper or "man-in-the-middle". It happens everyday on the Internet: see the part of this blog's URL that says " https ". That 's' there is extremely important. It means that you can trust that this blog post was delivered to you by...

Great Big House in New Orleans: The Special Case

A few months ago, I published a post called Great Big House in New Orleans , in which I discuss a game I used to play in my elementary school music class. In that post, I explained how I designed an efficient algorithm that allowed me to quickly find the winning position of the game given how many people are playing. I published the actual algorithm itself in a second post . Basically, in the game, all students in the class sat in a circle and passed a stuffed pumpkin around while singing a song. The rules of the game were such that every eighth student gets out (i.e. exits the circle), and the last student to remain in the circle wins. Essentially, I discovered that if you have add one person to the group of people playing the game, the winning position shifts to the right by eight. For example, in an elementary school class of 21 students sitting in a circle, the student sitting at position 10 will win. If I add one student to the class, the winning position increases by eight. ...

Great Big House in New Orleans: Improved Code

Image
On Monday, I wrote a post about how I wrote a program in Java and later Python that could solve an old game I used to play in my elementary school music class called Great Big House in New Orleans. It was a lengthy post, and you can read the entire thing here . Basically, in the game, all students in the class sat in a circle and passed a stuffed pumpkin around while singing a song. The rules of the game were such that every eighth student gets out (i.e. exits the circle), and the last student to remain in the circle wins. The program that I initially wrote in Java used arrays to simulate an actual game of Great Big House in New Orleans. However, using data of winning positions based on class sizes up to 1000, I was able to identify a pattern in consecutive winning positions that I could use to simplify my program so that it could solve for the winning position without having to simulate a single game with arrays or lists. The code is structured as follows. You are given (by the ...

Great Big House in New Orleans

Image
Note: This post has many errors and omissions. See this 2024 post for an update. When I was a student at Scottish Corners Elementary School, we occasionally played a game in our weekly music class with Miss Bowman called Great Big House in New Orleans. In this game, all of the students in the class sat in a circle. One student – the student at position 1 – held a small stuffed pumpkin. While singing the following song, we passed the pumpkin around the circle. Great big house in New Orleans, Forty stories high, Every room that I've been in, Filled with pumpkin pie. The purpose of this exercise was to teach elementary school students about rhythm. As a rule, the pumpkin has to be passed to the next student on every beat of the song. A student can't ignore the rhythm of the song and pass the ball offbeat (i.e. too quickly or too slowly). The pumpkin has to be passed on the beat. Whoever has the pumpkin when the song reaches the word high  and the word pie  is out of the ...