I finished moving my old Animated Arithmetic pages into the new Sandbox site. In case anybody was interested.
*****************************
* *
* gfrlog *
* *
*****************************Eat it before it gets cold!
I finished moving my old Animated Arithmetic pages into the new Sandbox site. In case anybody was interested.
I got to have more fun playing with Treetop and context-free grammars today by creating a new Sandbox item that decorates algebraic expressions with boxes indicating factors and terms. As I've found myself doing a bit of algebra tutoring lately, it might be helpful.
Several times now I’ve been in a classroom situation where the professor has mentioned the well-known birthday paradox, and had the time and people to perform a demonstrative experiment, but didn’t seem as interested as I was. This morning I realized I could perform the experiment on my own without having to bother anybody else thanks to the magic of Facebook profiles. Since most people have their birthdays listed, I just opened up my list of friends alphabetically and starting listing birthdays to see how long it would take before one of them repeated:
Statistics says that there isn’t a better-than-average chance of a birthday collision until a group has at least 23 people in it. For only 13 people, as we have here, the probability of a collision is only
1 - (365!/352!)/36513 = 19.4%
Everybody try this at home!
This is just what I need. Why didn’t I think of it before?

I wish I had thought to click on it before it went away. I’ll check it out if I see it again. Should be an exciting experience.
I thought it might be fun to compute the total number of possible movies, based on frame rate, resolution, and the number of possible colors on a standard high-definition digital blu-ray or something. So with some input from people who know more than I do about those things, I came up with the following numbers:
2203 = 10648000 colors/pixel 24 frames/second 1920*1080=2073600 pixels/frameAnd I want to calculate all of the possible movies with runnings times less than or equal to exactly four hours.
(4 hours = 14400 sec) * (24 frames/sec) = 345600 framesBased on the numbers for colors/pixel and pixels/frame, the number of possible frames should be
106480002073600So for any particular number of frames n, we should have exactly
(106480002073600)npossible movies. So for all possible movies less than or equal to four hours, we have to sum up these terms for all n from 0 to 345600. According to the appropriate summation formula, this is equal to exactly
| (106480002073600)n+1 |
| 106480002073600-1 |
| (106480002073600)345601 | = |
| 106480002073600-1 | |
| 10648000716638233600 | |
| 106480002073600-1 |
log10(10648000716638233600) = 716638233600(log1010648000) = 5036008956987So we're talking about a number that has over five trillion digits. That's so many movies that if you watched a movie every day for the rest of the month, you still wouldn't be done!
Don’t these Facebook applications have access to profile information such as gender? These English pronoun misuses shouldn’t be necessary.

And if you’re thinking perhaps the person didn’t actually specify gender in her profile, good guess. But she did.
This morning I discovered a minor issue with Rails serialization. Any class such as
class Thing < ActiveRecord::Base serialize :value enduses YAML for serialization, and issues come up if you want to store a String object that happens to have some YAML in it:
>> my_string="---\n:this_should_be_a_string:\n- 1\n- 2\n- 3"
=> "---\n:this_should_be_a_string:\n- 1\n- 2\n- 3"
>> t=Thing.new(:value=>my_string)
=> #<Thing id: nil, value: {:this_should_be_a_string=>[1, 2, 3]}>
I checked the
YAML spec and they
certainly provide for this (as expected in any serious markup language), using
escaped double-quotes. Things get really weird when I try to store a string representing
the YAML escaped-double-quoted representation of the above string:
>> t=Thing.new(:value=>"---\n\"#{my_string.gsub("\n","\\n")}\"")
=> #<Thing id: nil, value: "---\n:this_should_be_a_string:\n- 1\n-
2\n- 3">
>> t.value
=> {:this_should_be_a_string=>[1, 2, 3]}
>> t
=> #<Thing id: nil, value: {:this_should_be_a_string=>[1, 2, 3]}>
I check the rails source and couldn't
find anything about YAML anywhere (though several instances of JSON and XML). So
I don't know what's going on. I doubt this problem would come up much, but it still
surprised me.
I've rearranged my website. Aside from my blog, there is a Sandbox area where I'm grouping my programming projects and web applications. I had an old original section, but I'm phasing that out now.
I've also finished a new interactive Polynomial Enumerator for the Sandbox. It's based on something I tried on my old site, but never made into anything user-friendly until now. If you like silly visual math things like I do, try it out. It falls into the category of playing-around-with-infinite-things. There's also an accessible explanation for people who don't regularly dream about set theory.
I promise $25 to the first person who can explain to me what the difference here is:
error: no matching function for call to `Station::setStationAnimationID(int)’ note: candidates are: void Station::setStationAnimationID(int&)
SCREAMING!!!!
I was taught undergraduate discrete math by Dr. László Székely, who taught it in a very dry, robotic way; he may as well have been reciting a graduate-level textbook. As far as I remember, he told about two jokes the entire semester. One of them was my favorite moment in that class, but nobody else seemed to think it was funny, or even recognize it as a joke.
He was working with a particular limit, and apparently the relevant behavior we were looking for was whether or not it converged to zero as it approached infinity. He showed with some algebra or something that the function was simply the constant one, “…and one does not go to zero as far as we know.”