Monthly Archives: October 2012

Next Homework Program: Ratio Exercise

The Badb just had a couple of weeks of reviewing ratios. This was a good limbering-up exercise, since the problem sets were all about converting between different units and manipulating fractions. After all, ratios are just a different way of writing fractions. The general form of the problems wound up being, “Given that the ratio of thingumbob : doohickii is γ, how many doohickii are there if there are N thingumbobs?” She’d have to set up the equation and solve for the doohickii quantity.

In the evenings, this was really not a problem (until she got really tired) but first thing in the morning it was a tough job, converting from decimals to fractions, simplifying fractions, and doing other straightforward (at 4 in the afternoon) operations. So let’s think about fractions for a minute. There are really two major operations one performs on fractions: multiplication and addition. Multiplication is easy (numerator times numerator, denominator times denominator, simplify, done) but addition is kind of a pain; you have to have a common denominator. Finding any common denominator is easy (heck, just multiply each denominator by the other) but we would prefer to work with the smallest whole numbers we can get away with, because smaller numbers are easier to handle and because humans, at least the smart ones, are lazy and hate doing extra work. So what we want, given two denominators A and B, is to find the least common multiple (LCM) of the two numbers.

Let’s say we want a program that lets you input two fractions as four integers (numerator A, denominator A, numerator B, denominator B) and it will output the original fractions, the required multipliers, and the multiplied fractions which have common denominators. That is, it’ll take something like this:

5/6

7/10

and give you

5/6 * 5/5 = 25/30

7/10 * 3/3 = 21/30

It should accept improper fractions (but not decimals and not mixed numbers). We’ve already got code that will spit out the prime factors of a number; I bet it will be useful here.

I’m Worried about Truth

This morning I saw this headline: “Samaras advierte de que la situación de Grecia es similar a la que permitió el triunfo del nazismo en Alemania.” Hard on the heels of the presidential circus wherein Mitt Romney lied his way to “victory”, this has got me thinking about style versus substance. One of my friends tweeted in the aftermath, “Stop talking like fact-checks after the ‘big event’ are meaningful. Show up and play the game or go home.” He’s got a point as far as debates go, where the event is all about thinking on your feet and presenting a facile argument. I’m just not sure that it’s a good idea to set the fate of millions on a course determined by glib statements not founded in reality. I believe that “think” is an important component of “think fast. The love of my life reminded her Facebook friends that, “The Revolution Will Not Be Televised,” and when I said I thought it disingenuous for Republicans to claim Obama was not bipartisan after they refused to vote for anything he proposed, observed that all politics is disingenuous.

Back to Greece, then: the Greek government did not engage in a big war which they lost and were then forced to pay huge reparations for. The Greek government begged to be admitted to the EU and their economy has not been up to the task. The Greek people feel let down by their government and oppressed by the austerity measures, so if I were a Greek government minister, sure, I would probably look at the seething unrest, the horrible inflation, the massive debt, and think, “Man, I am one demagogue away from being thrown out of office and shot.” But I’m not at all sure that this is a real and valid parallel. I reckon that it’s important to call people on their bullshit. To that end, let’s invoke a corollary to Godwin’s law and say the Greek government has ended the discussion and lost.

Miscellany

A lot of things have been going on, but I don’t have a lot to say about any one of them.

On Saturday I played at the Dixon highland games. Dixon is about two hours away from Boulder Creek, so rather than driving out the night before and getting a hotel room, I figured I’d just get up at my normal time and drive out on Saturday morning. I didn’t know when I was supposed to compete but I saw that the games were supposed to open at 9. I got there at 8:30, only to discover that I was up at 8:45. Quick, warm up, tune up, then bang bang bang, slow air, 2/4 march, and piobaireachd. None were my best performances, (the less said about the 2/4 the better) but I was disappointed not even to have placed with the piob. or the slow air.

On Sunday Junglemonkey and I spent a lot of the day shopping and then watching movies. “Fargo,” “Hedwig and the Angry Inch,” “Breakfast at Tiffany’s” — these are movies that we can’t watch without remembering the early days of our relationship. Feeling nostalgic, I started thinking about the music we shared with each other. Junglemonkey gave me Cake and Pepe and the Bottle Blondes. I gave her Deep Forest and Afro Celt Sound System. We shared a lot of music, with occasional duplications but mostly different albums by the same artists. Now, many years later, she’s still discovering cool music that’s fun to listen to. I’m discovering cool music, too, but I feel ambivalent about sharing it. Take, for instance, this piobaireachd performance. These pipers are amazing and they make the music beautiful. I find Barnaby Brown’s performances particularly amazing. There’s this modern tradition of playing this music and the competition scene has really sidelined other piping traditions. And yet, as Brown demonstrates, these other traditions have some amazing and beautiful art to them. My neighbors say they love hearing me practice my pipes, and I love hearing these performances, but I still have a hard time believing that non-pipers want to hear this. Why? Probably because there’s not a single radio station within a hundred miles that will put bagpipe music into the rotation. That should totally change. Another album I recently found out about is “Drokk” — I also feel self-conscious sharing that, since ambient dystopia is really not the mood I want to evoke when I’m hanging out with the people I love.

With the Badb’s return to school, we’re once again doing arithmetic homework. She’s actually good at math even though she doesn’t like it. This year she’s going to be tackling some of the interesting bits of pre-algebra and dimensional analysis. This year may be the last time for a decade that my daughter will admit that I know anything, so I sure want to be available to help her out. She’s been reviewing exponents and roots, fractions, division, and factorization. The past couple of weeks have been full of her asking, “Daddy, can you help me with this…?” and me saying, “Sure, now here’s the process you can follow to get the right answer for this and any other problem like this, and you don’t need to worry about getting confused…” For my own sanity, I rewrote my BASIC prime factorization program in Java. I started doing that back in May but only did a command line version; now I stuck a GUI on it with validation and looping and so on. At the time, I set it up with a Mercurial repository. Last week I was looking once more at revision control systems and found this blog entry comparing git with Mercurial. Together with the work I did on dumbster this got me thinking about what I really want in a “how to use git” reference. I think I’m going to have to write it myself, so maybe that will be my winter software project this year.