End of Third Week

I had a pretty good week this week. I’ve been mostly walking back from school to get some exercise in (it’s right at 4.0 miles) as well as to save trips on the metro. We also planned our trip to the UK. I’ll probably try to cover things in this post mostly in the same order as I have in the past couple of posts with classes first followed by things I visited and things I plan to go to still.

My classes were good this week, but I have to say that I didn’t quite enjoy them as much as last week. In Algorithms, Merrick covered mostly modular arithmetic and finished up some thoughts from last week. Although we covered modular arithmetic a lot in CS 1050, he found a lot of new material to present, in my opinion. The gist of modular arithmetic, to explain it briefly, is that sometimes you can take a long (often infinite) set of numbers and have them fit on a much shorter scale with repetition. So, for example if we wanted to do all the integers from 0 to 15 in mod 4 it would look like this:

Normal: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
Mod 4 : 0, 1, 2, 3, 0, 1, 2, 3, 0, 1,  2,  3,  0,  1,  2,  3

So, if you thought of time as a number line of all the hours since the start of time, that would be impractical. It’s a quarter to 1.22721379 × 1014 O’clock (About 100 trillion hours) just doesn’t compute. Instead, we work mod 12 such that hours go 1 through 12 repeatedly (or 0 to 23 in mod 24) because this makes more sense for us.

Note: Mod is similar to the remainder after division, but is distinctly not the same. If you divide 37 by 5, there’s a remainder of 2, and that is the same as 37 mod 5, but when you take negative numbers, it doesn’t work the same. -37 mod 5 is 3.

Anyway, there are some neat tricks that come about from this kind of math. An example would be (we did this one for homework) is the number 41536 – 94824 evenly divisible by 35? At first, that definitely seems like a daunting task, but if we work in mod 35, it’s easier. Assuming mod 35, we want 41536 – 94824 to be zero because if it is evenly divisible, then there won’t be a remainder after division (and anything that comes out to 0 after the mod is the same for positive and negatives). So, I’m going to hide the solution in a box both because it is long and mathy in case you don’t want to read it and to give anyone time to think if you want to try to see for yourself if it is evenly divisible.

Show »

The approach we took in class was first see if the number is divisible by 5, then see if it is divisible by 7. If it is divisible by both, then it is divisible by 35, otherwise it’s not. So, start by checking the first number for divisibility by 5.

4^1536 = (4^2)^768 We can take 4^2 and do mod 5 to get 1. So,  (4^2)^768 = 1 ^ 768 mod 5, and 1 raised to any power is 1. 1 mod 5 is still one. 9^4824 is the same as 4^4824 when you apply mod 5, and we can do the same thing as before to get 1^2412 which is just 1 again. So, mod 5, 41536 – 94824 is 0. Meaning it’s divisible by 5.

For 7, it’s similar, but different. It should be obvious that 41536 – 94824 is the same as (4^6)^256 – (2^6)^804. Now, using Fermat’s Little Theorem, we know that any number raised to the p-1 power then modded by p, which is prime is equal to 1. So, 4^6 mod 7 and 2^6 mod 7 are both 1. 1 – 1 = 0, and thus it’s divisible by 7. Divisible by 7 and 5 means divisible by 35.

Anyway, enough math for now. Kevin, Joe, and I went to Mount Tibidabo the other night to take some evening shots of the city.  Unfortunately, when we left, it looked like my camera was fully charged, but when we got there, it seems I misread it, so I wasn’t able to take many pictures. Kevin, however, was able to, so I think I’m going to ask him for those this week.

I’ve been eating in a lot more this week. Both Thomases (How do you pluralize Thomas?) and I have been walking the 4 miles back from school each afternoon in order to save trips on the metro. When we get back, we’ve spent a couple euro on bread to get baguettes, and then chorizo meat and edam or gouda if we’re out of meat or cheese. For dinners, I’ve found that vegetables and pasta are pretty cheap to buy daily, and I’ve been getting a kilogram of meat or so that lasts a bit. I haven’t found any ground beef, which I find surprising. All I’ve found is ground beef pork mix, which tastes pretty much the same, in my opinion. Overall, I’ve found eating in to be a mostly nice option. The biggest flaw is that I lack some basic cooking equipment that makes it a little more difficult. For example, an oven and measuring cups.

So, I found one and was shown another ice cream shop here recently. The first is over by the Picasso museum, which I need to visit. The flavors I’ve tried there were chocolate (which was amazing), Rochet (Which tasted just like the candies), and Café (which actually tasted a little like rum). They were by far better than most ice cream I’ve gotten in the US, especially the chocolate. A few days later, Anya showed me this place in Plaça del Rei where she said her family thought had some of the best ice cream (and by ice cream, I mean gelato). I had their chocolate, which was also amazing, and another flavor that I can’t recall, so I guess I’ll be foreced to go back there to find out. :-)

The city also goes crazy over soccer, or fútbol. The Barcelona team won, I believe, the European cup. Bacelona rioted after the game that night and apparently did 100.000€ (Where we use commas in numbers, they use decimals, and where we use decimals, they use commas. Go figure.) in damages. I started to go out to take pictures of the mayhem, but I was hearing explosions so loud that they hurt my hears with the window closed, I decided to stay in instead. It was certainly interesting to see from the room, but too dark and distant to get any real pictures.

Lastly, a few of us are planning to go to the UK. We bought tickets and we’re going to visit London, Liverpool, and Dublin. I’ll post details later in the week.

4 Responses to “End of Third Week”

  • Chris says:

    I bet you know what I’m going to ask.

    Did you actually go to *the* Tibidabo?

  • Chris says:

    Also, there should definitely be ground beef in the grocery store right by Onix. Downstairs, in the meat section, on the left if you’re facing the main meat section (I think). There should be hot dogs as well.

    • Patrick Eisenmann says:

      I’ll double check next time I’m there, but I really only ever saw ground beef / ground pork combo. It tastes like ground beef either way, so I didn’t really mind.

Leave a Reply