Friday, December 10, 2010

Computer Science Final Project

It is amazing to think that the first semester is practically over.  Besides the few finals I still have to take, I have finished all my class and this afternoon I turned in my CS Final Project!  I spent so much time working on it over the last couple weeks, and I am very happy with the final result.

Basically, the project I choose to do was the generation of "Text Clouds."  These are when you count up the frequency of each word (after stemming them, of course) and the size of the letters in the final image reflect their frequency in the piece of writing.

It was a long process - the stemming took a substantial amount of time, since I wanted it to be fairly accurate, and then I spent a very long time with the special features on the webpage:

http://www.cs.hmc.edu/~jhoffswell/

This site is completely run by the programs and functions that I wrote myself!  An important note for when you decide to play with it:  the URL portion only works for pages at the Claremont Colleges.  Therefore, to get the full effect, I would recommend using the text entry portion.

Of all the various options on this page, the URL and submit buttons were the only parts required.  The various color and display options (as well as the text input) I choose to add just for the fun of it, and as customization of the original project.

It was a good deal of extra work, but it is so much fun to add all the customizations, and I am thrilled with the outcome.  Here are some basic pictures:

The top of the web page with the required URL input.  (Depth is extra),

Most of the additional features that I added to the web page.

A sample text cloud using the example URL

Wednesday, December 8, 2010

Holiday Dinner

Today the Hoch organized a nice holiday dinner to get everyone in the spirit of the holidays despite the looming doom of finals and final projects.

Like the Thanksgiving dinner, all of the tables were set beautifully:

The table settings for the Holiday Dinner
Very cute and simple centerpieces.
It was such a generally festive spirit to come into the dinning hall to find fabric tablecloths and flickering candles.  Then, to help with the celebration, there was an abundance of food, warm fruit cider and sparkling cider,

Delicious drinks (hot and sparking cider)
There was also a large table of delicious breads and cheeses and a table mounded with holiday treats to make everything even better. 

Yule logs, holiday cookies, and fudge.
It was fun, and adorable of course.  In general, it is kind of hard to tell it is almost the holiday season, the weather would certainly not tell you a whole lot, though the leaves are finally changing colors.  Though, to remind everyone of the season, the campus planted poinsettias everywhere, which is so cute and festive.  Otherwise, you could easily forget.

Monday, December 6, 2010

Mail Services

I love the mailman here at Mudd.  I've been worrying about Christmas presents for a while, mostly about how I would get them home, so I kept putting off buying them altogether.  But with a little under two weeks until the end of the semester and start of break, I figured it was now or never.

So, I took a nice walk to buy everything I needed, which was a complete success.  Then, with bags full of gifts, I started the trek back to the college.  On the way back to my dorm, I decided to swing by the mail room to pick up a box so that I could figure out how to mail.

I walk in, and tell the mailman that I need a big box.  He asked me what size, so I told to mail the two full bags of stuff I had with me.  He hops up from his desk, starts looking for a box and then carefully helped me pack everything so that it was safe (with the necessary amount of padding) for a flight back home.  He tapes it up for me, helps me pick a mailing service and finishes up the whole thing in less than 15 minutes.

He was so nice and helpful about the whole thing, and I'm sure that the package will be just fine at this point.  After all that worry, the chore was done swiftly and efficiently.  It was great!

Friday, November 19, 2010

Moody Lecture - "When Mathematics Meets YouTube"

Harvey Mudd College is always trying to introduce opportunities to hear about the wonders of science and mathematics from various individuals in different fields of study.  The Mathematics Department hosts lectures as part of something called the "Moody Lecture Series" once a semester.  Tonight, a man named Jonathan Rogness, from the University of Minnesota was talking about a video he co-created about Mobius Transformations which became a reasonably popular video on YouTube (considering that it is discussing complex mathematics) with over 1.7 million views.

You can watch the video here: http://www.youtube.com/watch?v=JX3VmDgiFnY


The lecture itself was very interesting.  Rogness spent the end of the lecture discussing the mathematics of Modius Transformations, and some of the complexities of creating the video itself.  Rogness and his colleague chose to create the video for a competition searching for visualizations of science and mathematics in a way that can be appealing to the general public.  He also chose to post the video on YouTube, primarily as a way to share the link with friends and colleagues.

At some point, the video received the attention of not just the mathematically inclined, but the general population.  The beginning of Rogness' presentation discussed the response, and the shift of attention achieved by the video.  He mentions how the very first comments are by those who understand mathematics, and were sharing their appreciation for the video.  But as it became more popular, Rogness highlights the change in the comments - from mathematical appreciation to the general wonder of those who cannot understand, but still appreciated the outcome.

Rogness had a great presentation and was a very interesting speaker.  I think that one of the best parts about his presentation, was the fact that he seemed to share the general wonder for the mathematics itself - it was something that he was deeply interested in, and this could show in his presentation of the topic.

It was very interesting, and I am glad that I was able to attend the lecture.

Thursday, November 18, 2010

Thanksgiving Dinner

In order to celebrate the holiday season here at Harvey Mudd College, the dinning hall held a massive Thanksgiving dinner.  They served turkey and roast beef, and all sorts of different trimmings (the stuffing was delicious)!  It seemed to be a huge event, and the lines for food ended up getting very long.  Then, there was a huge table of bread and cheese, and another separate table full of Thanksgiving desserts like apple pie and sweet potato pie.

All of the tables were set with paper place-mats and colored napkins to help perpetuate the holiday feeling. And in order to help with the communal, festive feeling, many of the main tables in the dinning room were rearranged to from longer areas to accommodate a larger more social setting.

But it was also very sweet. Overall, it felt very friendly and comfortable; something only a small school could do, and it was something that I know many of the other students appreciated.  The food was delicious and the setting festive.  It was a great experience!

Friday, November 5, 2010

Southern California A Cappella Music Festival (Scamfest)

The Claremont Colleges have a number of different A Cappella groups ranging from the Claremont Shades (the group hosting the festival) to the Kosher Chords.  Not only did the various Claremont groups perform tonight, but there were some groups from other schools in the area (USC and UCLA), including a group which made an appearance in the new movie about Facebook, "The Social Network."

One of the perks of being a Freshman is that the upperclassmen are always providing free opportunities to go to such events, so I was able to get a free ticket to the show.  It was located in a very large and impressive auditorium on Pomona, so there were a lot of people in attendence.

Overall, it was a lot of fun!  Many of the groups were absolutely wonderful, and everyone was full of energy and excitement.  It is no surprise that there were a large range of songs (the 12 groups each did 2 to 3 songs), and the performers and audience alike were energized and excited throughout the whole festival.

It was the 15th annual Scamfest festival, and it was absolutely great.  It is a wonderful thing to have on campus, and I am really glad that I was able to go, and will certainly consider going again next year.

Monday, November 1, 2010

Mastermind!

I remember playing mastermind all the time when I was a little kid, so it was fun to have it appear again in college.  And where else would it appear besides CS?  This week, we had the choice between a couple games (Mastermind and Nim) and the creation of phylogenetic trees.  I ended up creating both games, but Mastermind was generally the more interesting because of the ability to customize the graphic.

The program itself began with some simple output into the python shell (the board is simply printed onto the screen as shown):

The output for a game of Mastermind.
While this is not all that exciting, and really was not even that hard to program, the optional extra credit is where the game actually got interesting.

But first, some logistics.  Both versions of the game (text and graphic) allow for the selection of the number of holes, the number of rows, and the number of colors.  This prompting can be seen at the top of the image above.  Of course, the program tests to make sure that this input is valid (meaning it is greater than zero) before allowing the user to continue.  The program itself generates a random code which the user must then guess in the number of rounds (rows) specified.  When the guess is completed (and checked for validity), the program calculates and prints the score before the user's next turn.  It is a simple game of mastermind, and extremely easy to implement.

The fun part comes in the graphic, which evenly spaces the rows and holes so that it fits within the frame of the screen.  I was also able to include colors (which is much more bright and exciting) instead of simply just numbers.  However, each number is still tied to a color in the graphic game in order to allow for easy of user input.

The games can range from fairly simple (only three possible colors):

I could have won sooner if I was paying attention.
Notice, the code is displayed upon victory and a winning message is printed at the top.

But the games can get much more complex with the addition of more holes and more colors:

I had some pretty good luck on this one.

I just could not guess that last color.
In this picture, unfortunately, I lost.  Notice the message at the top: I included an option to view the code if it is not guessed at some point during the game, but in this case, the code is not visible.

All of these graphic displays were controlled by text input similar to the first picture, the only difference being that the board is displayed graphically instead of as text in the python shell.

There was another extra credit option: to implement a code by which the computer would guess a code chosen by the user.  But I ran out of time this week, and was unable to actually get to this part of the problem.  As usual, it was all a lot of fun, with a generally pleasing result (though it had a number of annoying bugs along the way).

Too much procrastination happened this weekend, so I still have quiet a bit to do.  No more fun and games: back to work.

Friday, October 29, 2010

Prank a Frosh Day



Today was a very special day for us Frosh, the prank.  Because most of the upperclassmen do not have class on Friday, while all of the Freshman (Frosh) have an early chemistry class, today was the perfect opportunity for the upperclassmen to orchestrate their prank.  So, when we all got out of class, we returned to our dorms to find them all done up in a number of different ways.

The first that something was going on was the site upon walking up to my dorm.

The entrance of Atwood blocked off with steamers.
First, here is what happened in the various suites of Atwood.  My suite first:

This is my suite.  Notice the mattress blocking the hallway.
The first obstacle was to navigate the pool.
Because of the mattress, the only way to my dorm was this tunnel.
Now, this was not actually too bad for our suite.  The worst was probably what happened to the 1st floor proctor suite:

All of their clothes strung up in the courtyard.
And you can see the Halloween pumpkins, unrelated to the prank.
Besides the rope, a net held a bunch of other clothes.
And the people from this suite were also lucky enough to have their room toilet-papered as well.

Clothes missing, room destroyed, and mattresses switched with another suite.
Another suite on the third floor had all of their stuff moved out of their room, and placed in the suite.  While I did not go into this room, I also heard that their room itself was covered with porn.

All of their stuff moved into the suite area and piled all over the place.
On the first floor - in what is considered the party suite - they decorated the girls' room with all of their alcoholic stuff, including a full beer-pong table in their dorm room.

The entrance to their room was set up like the bar.
One of my favorite things from Atwood, was the complete removal of someones room onto the lawn.  They also left a picture of the stuff photo-shopped onto Scripps in the room, so he would think his stuff was completely gone.

It is so funny having it set up like the room, with clothes hanging in the tree.
Next, the dorm Case - which is known for having only one entrance - blocked this area off with an obstacle course and a group of upperclassmen above with water balloons, a hose, and full buckets of water.  I am so glad that I did not have to deal with that:

It was easy to see what was going on, but some people had to go in.
I am sure they must have been freezing.
North dorm was not particularly exciting as far as I could tell.  We did not actually go in to look around the dorm rooms, but they had blocked off the entire courtyard with a wall of furniture.

Pretty boring, since it was still easy to get inside.
South removed the mattresses from everyone's rooms - and of course left the placed trashed.  But what they did with the mattresses was interesting.  They created a very large mattress pile, and had people jump onto it from the second floor.  The distance is not very high, so it was not a problem.

It did not look particularly safe, but not too dangerous either.
In East, for one of the Frosh rooms, they moved everything from their dorm room to the lounge and vice versa.

All of the furniture was replaced with couches and tables, with all their stuff removed.
When it came to West, Linde, and Sontag, we did not really see any pranks worth noting, which is too bad.

Overall, it was very entertaining and definitely a surprise since I had completely forgotten that they were planning on pranking us, and I had no idea it would be happening today.  Of course, it seemed like everyone took it in good humor, and it was just another normal occurrence at Mudd.  One we will be sure to replicate in the years to come.

Wednesday, October 27, 2010

Mandelbrot Set

The lab assignment for CS this week was to create a function which determines if various complex numbers are in the Mandelbrot Set.  To determine if the number is in the set, begin with the complex number z = 0 +0i.  Then, follow the sequence such that z(sub x+1) = z(sub x) + c.  In this case, c is the complex number which you are attempting to identify in the set.  If the sequence diverges (meaning that it continues towards infinity), then the complex number c is not in the set.  Then, the program I wrote plotted all of the points which are in the set, creating a fractal like this:

The black points are in the Mandelbrot Set.
This image in and of itself is pretty, just because it is a fractal and has a interesting shape which has been computed mathematically.  There is a special trick to determine if a Mandelbrot set diverges: if the magnitude of the complex number z every exceeds 2, the complex number c is not in the set.  For convergence, there is no definitive formula, which means that the absolute accuracy of the image (the plotting of the points) depends on how many iterations (the number of times you step through the sequence).

Since there is this definitive sequence, it is possible for the points not in the set to diverge at different rates depending on the value of c.  Because of this difference, it is also possible to look at the rate of divergence and plot diverging points in different colors to signify how quickly they diverge.  I spent about two hours playing with this part of it, since there are so many things you can do with the different colors.  Consider the following examples:

The varying degree of red signifies the rate of divergence.
In this example, the colors are assigned not in a gradient, but in a rainbow.
In this example, it is easier to see the gradient of various velocities.
An interesting part of the Mandelbrot Set (and other fractals) is the ability to zoom into the image and to be able to see a high degree of detail even at some of the smallest stages.

Zoomed into the medium circle in the image above.
Fractals are beautiful and so much fun to play with.  I would really love to look into some other fractal equations and implement them myself in order to create other interesting and attractive images, if only for fun.  If you would like your own personal fractal for a background or whatever, let me know what color you would like and I can said you one.

The remainder of this CS assignment consist of the option to program a couple games: Nim and Mastermind, which I am really looking forward to since it should be fun to play with these as well.

Sunday, October 24, 2010

Dad's Visit 2

Today, Dad and I visited the La Brea Tar Pits in Los Angeles.  This consisted of the Page Museum and surrounding area containing the tar pits themselves.  It was a wonderful day, so it was a great time to visit since we spent a lot of time walking around outside.  Besides the larger tar pits, there are small pits throughout the park that are fenced off with waist-high fences.  The first thing Dad and I saw was a woman plucking her child out of one of these enclosures after he fell in.  It was not particularly dangerous, but it was really funny.

The smaller pits had a lot of stuff thrown into them.  This was our first encounter.
Before exploring the park and larger pits, we went into the Page Museum.  The tar pits have claimed the lives of thousands of different animals, from small rodents to large mammoths.  The museum houses many full skeletons which had been excavated from the various tar pits, many of which were in beautiful condition since the tar preserved the bones.

The skull of an extinct Camel.
For many of the skeletons, an artistic rendition displayed the animal itself.
The Columbian Mammoth was particularly magnificent with his large twisting tusks and his substantial size.

I thought the curvature of his tusks was particularly interesting.

The next part of the museum had a display of the various birds trapped in the tar.  I thought it was clever how they included the artist rendition of the birds behind each specimen drawn in the same position as the skeleton was placed.


The museum itself had a number of interesting features.  For example, they had an area where they placed two polls into barbells of tar.  One of them was simply a straight bar, while the other had significantly more surface area; it is no surprise that it was almost impossible to pull the second out of the tar and the example really instills a fear of the tar itself, since it is more than willing to simply consume those creatures that are stupid enough to wander into the pits.  The museum also contained what they called a "Fishbowl laboratory."  This was an area where you could watch as the paleontologists cleaned up or worked on some of the fossils taken from the tar.

A paleontologist cleaning a bone taken from the tar.
A work station in the fishbowl with some bones and tools.
The tar bits have existed for tens of thousands of years, and consequently, they have consumed the lives of many animals (and a single human).  This means that it is not necessary to display every skeleton found.  For instance, there was a display with the skulls of nearly 400 Dire Wolfs, a minuscule portion of those found in the pits.  A portion of the museum had a window into a small storage area, filled with racks of sorted bones.

A single wall of storage, with a tray of bones sitting out.
At the center of the museum, was a small park-like area.  Though I am not sure what significance it holds in terms of the tar pits themselves, the area was beautiful with lovely green foliage and flowers.  In the water, there were a bunch of turtles and koi fish.

Some beautiful white flowers from the Atrium.
The atrium was beautiful, with clean water for the turtles and koi.
The park area outside the museum has a number of large tar pits, a couple of which are currently being excavated.  Project 23 is the current focus of the site, though we were unable to find a direct way to view this site.  However, Pit 91 consisted of a viewing station for the pit.

A overall view of Pit 91.  I want to point out a couple things.  One, notice the ladder in the lower right, yuck!  Also, the red flag is making the location of a Harlon's Ground Sloth Pelvis.
Here, the blue flag marks a Western Horse Radius, the flag below it (green) marks a Sabertooth Cat Scapula, and the yellow marks the location of a Dire Wolf Scapula.
Although it is fairly evil, the tar really could be beautiful.  There was one small pit that kept producing these beautiful bubbles.  I have some video of their quick creation and dissipation, if you would like to see them, send me an email or remind me when I see you next.

This one is so clear and amber colored, it is beautiful.
This time there are two bubbles!
As I mentioned above, we could not really see Project 23.  When we were walking past the area where we believed it was located, Dad pointed out that you could kind of see the start of results of some excavation in a tent towards the back.

Under the white tarp, you could sort of see the excavation product.  I also love this picture for the repetition of shape.
Besides the various tar pits, the area worked as a park as well, with flowers and other fun plants.

If you have never seen a bee pollinate a flower, it is a weird thing.
These plants were all over, and they have such a great texture and appearance.
A dew drop in the plant above.
This whole area of LA was filled with different museums.  Right next door was an art museum, and outside there were a bunch of sculptures.  Like usual, some of them were pretty silly and uninteresting (but fun to photograph) and others seemed very familiar.

Not the most exciting piece of art...
This seems very familiar, right?
Within the biggest tar pit - or the "Lake Pit" - the museum has set up a very tragic display of the terror of the tar pits in ancient times.  The despair is clear.

A large elephant-like creature being sucked into the pit...
... and on the shore the baby wails in terror.
It was a wonderful experience, and I would certainly recommend this museum to anyone visiting LA.  The one word of warning I would add, would be to avoid bringing young children: there were more than a couple that left the park tar smeared and filthy.