Category Archives: Mathematics

OK, Now An Open Office Problem

So, I’m trying to import my Perl-generated file as a CSV into Open Office. Apparently, if the data coming into a cell is of the form “D.D.D” where “Ds” are digits, it obviously and absolutely must be a date, and it converts the incoming cell to that format.

Well, no. I wanted it to be (for example) literally “1.3.5.” Really. No kidding. It’s not 01/03/05. But it won’t let me do it.

I don’t want to have to manually go in and change the format for each cell where this happens, and even if I did, there’s no obvious way to do it and retain the original info without manually retyping the number with a single quote in front. Is there an Open Office guru out there?

BTW, I really appreciate the help with the Perl problem. It was invaluable (which means, it was very useful, but I don’t know how to pay for it, or what it was worth to those providing it).

Perl Problem

I’m going crazy with a script. Here’s the code:

$parent = @line_elements[8];
$lower_req = @line_elements[1];
print DEBUG “BEGIN \$lower_req is $lower_req, \$parent is $parent, \$req_num is $req_num.\n”;
if ($req_num eq $parent) {
print DEBUG “\$req_num is $req_num, \$parent is $parent, got a match!\n”;

And here’s the output:

BEGIN $lower_req is “2.1.1”, $parent is “1.1”
, $req_num is “1.1”.
BEGIN $lower_req is “2.1.2”, $parent is “1.1”
, $req_num is “1.1”.
BEGIN $lower_req is “2.1.3”, $parent is “1.1”
, $req_num is “1.1”.
BEGIN $lower_req is “2.1.4”, $parent is “1.1”
, $req_num is “1.1”.
BEGIN $lower_req is “2.1.5”, $parent is “1.1”
, $req_num is “1.1”.

Note that in each case, that $req_num is equal to $parent, and the line should be repeated with the statement that a match was found. Can another pair of eyes tell me why it’s not?

Fondling Balls

Iowahawk breaks out the calculator on poll reliability:

So if the sample size is 400, the margin of error is 1/20 = 5%; if the sample size is 625 the margin of error is 1/25 = 4%; if the sample size is 1000, it’s about 3%.

Works pretty well if you’re interested in hypothetical colored balls in hypothetical giant urns, or survival rates of plants in a controlled experiment, or defects in a batch of factory products. It may even work well if you’re interested in blind cola taste tests. But what if the thing you are studying doesn’t quite fit the balls & urns template?

  • What if 40% of the balls have personally chosen to live in an urn that you legally can’t stick your hand into?
  • What if 50% of the balls who live in the legal urn explicitly refuse to let you select them?
  • What if the balls inside the urn are constantly interacting and talking and arguing with each other, and can decide to change their color on a whim?
  • What if you have to rely on the balls to report their own color, and some unknown number are probably lying to you?
  • What if you’ve been hired to count balls by a company who has endorsed blue as their favorite color?
  • What if you have outsourced the urn-ball counting to part-time temp balls, most of whom happen to be blue?
  • What if the balls inside the urn are listening to you counting out there, and it affects whether they want to be counted, and/or which color they want to be?

If one or more of the above statements are true, then the formula for margin of error simplifies to
Margin of Error = Who the hell knows?

I think that the disparity among the polls is pretty good evidence of this. A lot of it, particularly the weighting is guess work, educated or otherwise. There’s only one poll that matters (though with all of the chicanery going on, even that one is going to be in doubt, particularly if it’s close on Tuesday). What a mess.

Doing The Math

The Obama campaign has been lying about its donor base:

If, as Obama says, most donations are grassroots and in small amounts, the numbers do not match up. If this many people donated to his campaign he would be polling at well over 50%.

In a grassroots movement, you smell the green. He’s raised $600 million, as you say, in small donations. So divide it by ten bucks apiece and there’s 60 million donors. If 120 million people vote on Tuesday, and he gets 50% that equals …60 million voters! Honestly, you cynical rightwing losers, what’s so suspicious about that math?

On Fox Newswatch on Saturday, Jane Hall said that many of her (journalism) students couldn’t even calculate a percent. Of course, in this case, they’re not motivated to figure it out, even if they know how.