Syzygy

Tuesday, February 7, 2012

Why I hate programming (part 4 of n)

back to R:

1. Writing some code, seemed a bit slow, looked to stack overflow for help:
"First of all, for anyone who hasn't seen this yet, I strongly recommend reading this article on the r-wiki about code optimization."

status of link: dead
reason: R's wiki page is dead

2. Populating a matrix from a vector. (In R, a matrix is different from an array is different from a vector.)

vec <- 1:9
mat <- as.matrix(vec, nrow = 3, ncol = 3)
# mat is 9x1 (silent fail on invalid arguments nrow and ncol)
mat2 <- matrix(vec, nrow = 3, ncol = 3)
# mat2 is 3x3

3. How big is my vector?

vec <- 1:9
mat2 <- as.matrix(vec, nrow = 3, ncol = 3)
nrow(vec) # NULL
nrow(mat2) # 3
NROW(vec) # 3
NROW(mat2) # 3

Labels: , , ,

Wednesday, March 23, 2011

On Fuzziness

I have debated (with myself) on whether to blog about my (mis-)adventures in tutoring at the City Heights Farmer's Market/Library as part of SIO GDAWG's outreach efforts. I figure it will be ok to simply remark about both the (1) gaps in knowledge (conceptual or otherwise) of the kids and (2) weirdness of homework that these kids bring.

One girl (who came twice, but whom I haven't seen in a month or two) had trouble in her math class. She was taking Algebra I, and somehow had made it through most of the first semester (I'm guessing they started algebra in the Fall) without anyone noticing that she was having basic trouble with arithmetic. For the most part, she could do basic numerical operations, but had a very flaky grasp of order of operations, distributive properties, and negative numbers. (from what I could tell) Needless to say, it was a bit much to ask her to do operations involving linear equations.

One boy (4th grade?) hadn't yet memorized his multiplication tables. Irregardless of this (which isn't uncommon for his age), he didn't understand that multiplication represented repeated addition. The problem with not knowing this concept is that treating multiplication as a black box operation is going to be very bad news for this kid when he starts algebra (see above).

Last week I also helped a kid with some worksheets dealing with St. Patrick's Day (SPD). The first page was basically a crossword with a single clue running vertically that spelled out "leprechaun". Problem is, there were some really vague (and obscure) clues that depended on both awareness that it was SPD-themed as well as the cultural aspects associated with SPD. (Really, how many people will know of the top of their heads that "Emerald Isle" refers to Ireland?)

In the same packet, there was a word association page where one item would be given and two blanks needed to be filled with items from a word box. Unfortunately, some of the examples were synonyms ("wee" -> "little", "small") and some were same-category-membership ("Japan" -> "Mexico", "Japan"). What this demonstrates and what you were supposed to do if you didn't know some of the words (e.g. the kid didn't know what "wee" meant) is beyond me.

On a later page, there were a series of analogies. Besides the fact that analogies were not explained, a lot of the problems violated the standard guidelines for analogies (as they are used in the SAT and other "important" tests). For example, in A:B::C:D, the relationship between A and B should be the same as that between C and D. The analogy should NOT rely on any association between A and C or B and D. (which is what SAT writers like to do to trip people up)

On another page, there were some weird set exclusion problems (e.g. "What are the numbers that are in the square, but not in the triangle and circle?") in reference to a figure. Problematically, the use of language was imprecise: the questions sometimes used "and" and sometimes used "or", when in both cases, the desired conjunction was "nor"!

The busywork nature of the worksheets also seemed weird to me. I guess the standard purpose of homework these days is to occupy time rather than practice what you learned or apply those skills in reasonable useful example situations. I am reminded of Feynman's remarks on science textbooks:
Finally I come to a book that says, "Mathematics is used in science in many ways. We will give you an example from astronomy, which is the science of stars." I turn the page, and it says, "Red stars have a temperature of four thousand degrees, yellow stars have a temperature of five thousand degrees . . ." -- so far, so good. It continues: "Green stars have a temperature of seven thousand degrees, blue stars have a temperature of ten thousand degrees, and violet stars have a temperature of . . . (some big number)." There are no green or violet stars, but the figures for the others are roughly correct. It's vaguely right -- but already, trouble! That's the way everything was: Everything was written by somebody who didn't know what the hell he was talking about, so it was a little bit wrong, always! And how we are going to teach well by using books written by people who don't quite understand what they're talking about, I cannot understand. I don't know why, but the books are lousy; UNIVERSALLY LOUSY!

Anyway, I'm happy with this book, because it's the first example of applying arithmetic to science. I'm a bit unhappy when I read about the stars' temperatures, but I'm not very unhappy because it's more or less right -- it's just an example of error. Then comes the list of problems. It says, "John and his father go out to look at the stars. John sees two blue stars and a red star. His father sees a green star, a violet star, and two yellow stars. What is the total temperature of the stars seen by John and his father?" -- and I would explode in horror.

My wife would talk about the volcano downstairs. That's only an example: it was perpetually like that. Perpetual absurdity! There's no purpose whatsoever in adding the temperature of two stars. Nobody ever does that except, maybe, to then take the average temperature of the stars, but not to find out the total temperature of all the stars! It was awful! All it was was a game to get you to add, and they didn't understand what they were talking about. It was like reading sentences with a few typographical errors, and then suddenly a whole sentence is written backwards. The mathematics was like that. Just hopeless!

Labels: , ,

Thursday, January 27, 2011

Why I hate programming (part 3 of n)

1. Matlab's inability to remember the current folder. Sure, you can set it so that the default location is a different location, but would it be so hard to remember the current folder when quitting and to automatically open that location when started again. Seems like a no-brainer to have some sort of checkbox for this in the preferences...

2. Matlab's default renderer's inability to handle transparency. Yes, that's right, I want to plot two histograms on top of each other, but the only way it can do transparency is to enable the OpenGL renderer. This would be fine if the OpenGL renderer could do fonts properly, but it can't, and moreover is unable to save images in vector format. (Don't even get me started on trying to draw patterned bars...)

more to come...

Labels: , ,

Monday, December 6, 2010

Dear Puerto Rico

I humbly ask that you consider declaring independence. I realize that you may enjoy your position as an unincorporated territory of the United States, but the fact is, our federal government is, to put it nicely, insane. In this day and age, who still lives without representation at all levels of government? (dictatorships don't count!) I think it is only fair for Puerto Rico to take the reins of governing its own country and have the ability to assess and collect taxes and tariffs for its own well-being. Think of all that EEZ that you control and can make money off of. Or how about getting rid of the tariff for Roquefort cheese that Bush II passed out of spite? Such wonders (and more!) await a people that throw off the shackles of Western Imperialism!

(Note that that is not in any way related to my trying to get NSF to give me international travel money to visit your fine state in February for a conference.)

Labels: , , ,

Tuesday, October 12, 2010

Why I hate programming (part 2 of n)

The difference between using "=" and "<-" for assignment in R:

It seems that, historically, "=" was not allowed for variable assignment. My understanding is that in modern R, using "=" for assignment is (mostly) equivalent to using "<-", so that:

x = 2 % This line is the same as
x <- 2 % this line.

However, one should be aware that when using "=" to give parameters for functions, assignments do not occur (in the global workspace):

x <- rep(2, times=5) % "times" does not have value 5
times % gives an error
x <- rep(2, times<-5) % "times" IS set to have value 5
times % this will have value 5


There's also some weird differences with how "<-" and "=" get interpreted (maybe has to do with order of operations / syntactic sugar?):

x = y = 5 % both "x" and "y" will have value 5
x <- y <- 5 % both "x" and "y" will have value 5
x = y <- 5 % both "x" and "y" will have value 5
x <- y = 5 % gives an error


This is what R's documentation has to say about this nonsense:
"The operators <- and = assign into the environment in which they are evaluated. The operator <- can be used anywhere, whereas the operator = is only allowed at the top level (e.g., in the complete expression typed at the command prompt) or as one of the subexpressions in a braced list of expressions."

Labels: ,

Monday, June 21, 2010

US Customs Language FAIL

When I was returning from the US yesterday, I had to pass through customs and fill out a form. Question 15 threw me for a loop, however:

"15. Residents -- the total value of all goods, including commercial merchandise I/we have purchased or acquired abroad, (including gifts for someone else, but not items mailed to the U.S.) and am/are bringing to the U.S. is:"

and then a blank for the monetary value.

The obvious intended meaning is for you to give the monetary value of all goods being brought back that have not been subject to US taxes. As written, the wording on the actual form is, at best, ambiguous. The problematic portion is "including commercial merchandise", which SHOULD be a parenthetical statement. However, some IDIOT dropped a comma, such that the parenthetical statement is now "including commercial merchandise I/we have purchased or acquired abroad", which now renders 15. as "the total value of all goods", instead of "the total value of all goods I/we have purchased or acquired abroad"

The instructions on the US Customs webpage says this more clearly, perhaps because whoever was writing it knows HOW TO USE PUNCTUATION: "15. If you are a U.S. resident, print the total value of all goods (including commercial merchandise) you or any family members traveling with you have purchased or acquired abroad (including gifts for someone else, but not items mailed to the United States) and are bringing into the United States." The instructions on back of the actual form are much less detailed and are essentially useless.

When I asked the guy at Customs about it, he admitted it was confusing, but said it made sense after more readings. I did not want to press the issue at the time, cuz they can confiscate your laptop without due process. I think it's pretty clear that I was doing an accurate job of interpreting the syntax AS WRITTEN when I asked if I had to report the value of all the objects I brought with me to Finland as well.

Labels: , ,

Thursday, May 20, 2010

I used to like wall-jumping

until I started playing the Super Metroid Redesign rom hack.

On the one hand, I admire people who make rom hacks. Different maps, different items, different controls and interface, and increased challenge all sound like a really great idea.

However, I must say that the people who come up with these have taking the challenge bit so far to the extreme that it is no longer fun. Harder bosses = yes. Spending the first half-hour of the first dungeon without a sword = crap.

I figured I'd at least give the Super Metroid rom hack the same amount of time I gave to the Zelda: A Link to the Past one, given that I quit last time because I didn't know where to go.

This time, I actually stumbled across the fake wall that was necessary to go through to progress. The one fake wall I remember from Super Metroid (the original) at least had an enemy on the other side so that you would notice it...

So I fight the boss, fall down the pit and finally get the wall-jump boots that will allow to me to climb back to the surface. Then, after 10 minutes of trying to wall-jump, I decided to quit. If wall-jumping is such a critical component of the game, it should not have to be this hard. (unless you don't want people to play your hack)

I am, however, amused that other people have wasted similar copious amounts of time on wall jumping in this game.

Labels: , ,

Monday, April 12, 2010

Dynamic Range Compression

Taken at face value, Maaya Sakamoto's Everywhere is a pretty good value: 30 pretty famous songs spanning her career for just 700 yen more than a regular CD, and it includes a DVD with some promotional videos on it.

Here's the problem. At some point in the past, I stumbled across Richard's website, which really is just an index to his vast collection. (You should be aware that searching for "Animephile" now returns some rather sketchy results in Google -- this wasn't always the case...) Anyway, as Richard points out, dynamic range compression has now infected our beloved Jpop imports!

Compare, for instance, the waveform from the Nikopachi* version of Hemisphere looks like this:

The version on Everywhere, whioh I believe to be a remaster of the Nikopachi version (based on length and waveform) looks like this:

On first playing the two, the most noticeable difference is the increased volume in the "Everywhere" version. The obvious reason for this is simple psychology: people generally prefer louder music, hence increasing the volume on a song makes people like it more. With a hard limitation on the maximum amplitude in a given format, this naturally results in a reduction in dynamic range. In essence, the softer sounds become louder while the louder sounds get clipped. For a song like Hemisphere with both loud sections and soft sections, this makes a pretty big difference.

A good analogy is going to a rock concert vs. going to a classical music concert. In a rock concert, the music is blared at near pain-inducing levels to a point where it can be hard to make out subtleties in music. Contrast this with classical music concerts, where the venues are (usually) designed for acoustics, everyone tries to be super-silent (you'll notice a distinct increase in the number of coughs in-between movements). There's a ton more dynamic range between the softest solo portions and the bits where the orchestra is going full blast. Because of these differences, I avoid rock concerts even for artists I really like, but will go to any classical music concert if it's in my budget or if I really like the pieces.

* For those of you who are curious, the Nikopachi version looks noticeably different from the single version beyond the addition of some silence at the end. It looks like at least some parts may have been rerecorded or remastered. Here's the waveform for the single version:

Labels: , , ,

Sunday, December 6, 2009

Q: How hard can copy-paste be?

A: as overly complicated as anything else that comes out of the Mac BU of Microsoft. Hey Microsoft, stop playing around with multi-touch in Windows 7 and get some engineers working on very basic aspects of your OS and major software. (You'd think they'd have a better business strategy than developing features for 0.01% of their users when features used by 90% of the users don't work properly. But that's what you get when you have a de-facto monopoly on the industry. I mean, people still use Powerpoint instead of Keynote!)

Well, through trial and error, here is what I have discovered. Let's say you have some data. You plot it in excel and format it all nice and pretty. Then you copy-paste it into Powerpoint for your talk at an upcoming conference. Uh-oh, it doesn't work! Turns out, you need to go back, and save that spreadsheet in .xls format (previous version format). Then you've got to copy and paste-special as a Microsoft Excel Chart Object. Now your format is screwed and your chart looks like shit. No worries, double-click it, tell it to convert, wait a ridiculously long 5 seconds, and now you can edit your chart directly in Powerpoint.

To review:
1) you can't copy and paste from .xlsx to .pptx format directly.
2) when copy and pasting from .xls to .pptx, you need to paste-special (Microsoft Excel Chart Object)
3) the pasted chart needs to be converted before you can format it and for it not to look like crap

I had similar problems copy-pasting from pdf. Solution? save as png and then paste it in.

Labels: , ,

Friday, December 4, 2009

Now I know why the Empire stuck with plain TIE fighters

As they say, the TIE/D Defender's high cost was one of the major obstacles for adoption by the Imperial Navy.

Here, the LEGO version (coming out in 2010) is priced at $49.99. Which is a pretty bad deal, even for a 304 piece Star Wars set. Maybe Lucas is upping the price for the license?

I'm also upset with image showing two lasers coming from the cockpit. Come on people, it only takes two minutes to read the Wookieepedia page and realize that there are two lasers on both of the bottom panels, and two ion cannons on the upper panel. The weapons on the cockpit module should be the warhead launchers. Tsk, Tsk.

[Thanks to FBTB for the image.]

Labels: ,

Wednesday, November 11, 2009

Physics do not apply in the Star Wars universe.

I'm not just referencing Solo's "Kessel Run in less than 12 parsecs" claim, which can be explained away as a boast about navigational and piloting ability rather than ship speed. (Though there may be relativistic reasons for why speed would affect the ability to accomplish the Kessel Run in a shorter distance.)

In the latest BrickMaster (LEGO's magazine), there's a fake ad from Koensayr for the Y-Wing that claims "Goes from 0 to 2,700G in less than a parsec!" I was going to try and figure out what that meant, and then realized that 2,700G is acceleration and parsec is distance! When car manufacturers boast that a car goes from 0 to 60 in 4 seconds, what they are bragging about is acceleration, that within 4 seconds, the power is such that the car can be accelerated to 60 mph from rest. What the hell does 2,700G mean? (Besides the fact that G is meaningless in Star Wars unless it references a specific planet.) If we take G to be 10 m/s^2, then 2,700G = 27,000 m/s^2. At that acceleration, it would take about 7 seconds to accelerate to lightspeed. I'm fairly certain that's not possible in the X-Wing flightsim games. Hyperspeed, yes, STL acceleration, no way.

Labels: , , ,

Why I hate MS more and more...

I used to be fairly positive towards Microsoft in the past: sure, OS X is a much nicer experience, indie applications for the Mac are polished to a much higher degree than on Windows, and the free (!) IDE in XCode is quite good, but Windows has to deal with backwards-compatibility, it is *the* platform for PC gaming, and sometimes Microsoft Research churns out some cool stuff.

Still, I find myself more and more annoyed by Microsoft's UI design sense (or lack thereof). Perhaps I have merely become spoiled by living on a Mac or become more observant due to reading Siracusa's rants (exhibit A, exhibit B). Yes, Apple doesn't listen to its own UI guidelines - everyone (well, anyone in the "know") admits that - but sometimes this gives us good things. (And sometimes, horrible abominations), but at least it has the good sense to make sure at least one engineer brings key interfaces up to new UI standards. (Yes, I'm talking about the control panel UI crap shown here.)

I feel like Microsoft has become a company with no guiding vision - some people work on cool things, some people work on the behemoths known as Windows and Office, but there's no one there with the bullwhip making sure things are consistent. Just look at the Office UI - for something that is the de facto office productivity suite, you'd think they wouldn't just up and change the interface on us. (but that's what Office 2007 did). And then when they released the next update for OS X, you'd think they'd fix things or add functionality, but instead they removed VBA scripting. And if the Ribbon is such a GREAT UI idea, why isn't it in Office 2008? Yes, I hate the Ribbon, but it's super-annoying when I'll work on something at school, transfer the file to home, and suddenly wonder why everything behaves differently. Formatting titles in Excel charts used to be so easy! I do like the fact that Office 2008 UI behaves more traditionally, but what I don't like is the formatting palette that is clearly an Inspector Tool wannabe. Do the people at the Mac BU not know how to make OS X native apps, do they just don't care, or are they hideously understaffed? (maybe all 3?)

One would think that Office 2008 would run faster than Office 2004 on an Intel Mac (because 2008 is a Universal Binary and 2004 is PPC-only and requires Rosetta). Nevertheless, I find that Office 2007 running on emulated Windows XP using half the memory and one core still runs rings around both "native" Office versions. (at least as far as computation in Excel is concerned.) Any version of Excel still seems to be faster than the Numbers app in iWork, though...

I already use Keynote for presentations, and Pages / LaTeX for word processing - can someone please make me a good/fast spreadsheet app so that I can put Office out of its misery?

Labels: , ,

Tuesday, October 20, 2009

The quest for resolution independence

I sent this in an e-mail to a friend who was complaining about the lack of high DPI (dots per inch) consumer-grade LCD desktop displays. (Some models do exist, but are intended for the medical community and are pricey.)

A comparison of DPI for previous/current Apple computers and display products

Laptops:
13.3" (1280 x 800) = 113.49 DPI
15.4" (1440 x 900) = 110.27 DPI
17" (1920 x 1200) = 133.19 DPI

Cinema displays and old iMacs:
23" (1920 x 1200) = 98.44 DPI
24" (1920 x 1200) = 94.34 DPI
30" (2560 x 1600) = 100.63 DPI

New iMacs: (note that these are now 16x9, suitable for watching "widescreen" video without black bars instead of the 16x10, which is much more common for widescreen computer displays)

21.5" (1920 x 1080) = 102.46 DPI
27" (2560 x 1440) = 108.79 DPI

And while Apple has touted a push for resolution independence (along with 64-bit) for a while now, some things still appear to be broken (at least in the first Snow Leopard release. I haven't installed Snow Leopard yet, so I can't say if it's been fixed since then.):

http://arstechnica.com/apple/reviews/2009/08/mac-os-x-10-6.ars/21
(scroll down to the Resolution Independence section)

On a further note, I do have minor gripes about the 16x10 computer displays, since my current HP display scales up widescreen input (via component) to the full size, so video games are stretched vertically ever so much (+11.1%). I believe this is simply because component is analog, and is being decoded by an onboard chip that then gets sent into the analog to digital converter (probably the same one that would decode a VGA signal). Not sure if this is still an issue on the newer LCD displays from HP and Dell that take consumer digital inputs like HDMI. (not that I have a PS3 or 360 to test anyway) I imagine it's still an issue with component video in. On the other hand having 16x10 IS useful for watching 16x9 video, because the black bars allow for UI popup that does not obscure the video at all.

Labels: , , ,

Tuesday, September 1, 2009

The Snow Leopard Cometh

Well, Snow Leopard is out, and I've read the review. Here's my brief rundown:

Pros:
- performance improvements (resolving that dreaded kernel_task/CPU/overheating issue somewhat, I hope)
- decreased size (freeing up a few GBs for my paltry 80GB hard drive)
- gamma 2.2 (so I don't have to worry about color differences when my website is viewed on Mac vs. PC)

Cons:
- 64-bit apps (breaking the widescreen hack to Mail and the SIMBL-based color hack to Terminal) [these are not insignificant UI fixes that would not be particularly difficult for Apple to implement natively...]

Things I'm excited about that don't affect me at all:
- XCode 3.2 & Clang (cuz who doesn't like a compiler with a metallic silver dragon logo that doesn't support the programming language you use)
- QuickTime X (cuz hardware-based H.264 acceleration is nice IF your graphics card/chipset is supported)

Labels: , ,

Wednesday, July 1, 2009

wonderful security lesson from UCSD

From UCSD (summarized by me):

How to use the UCSD encrypted wireless network:

1. download this file from our website
[note: safari wouldn't let me save it as it was, forcing me to change the extension when saving, and then changing the extension back after it was downloaded]

2. double-click the icon

3. if it asks you for your password, enter it in and click ok

[...]

Yes, I was told to download a file, open it, and enter in my computer's password. Hmmm, if I didn't know what was actually going on, this would set off all kinds of warning bells. It is so nice that UCSD neglects to explain what it is I am doing and why I should click the "always trust" button when "this root certificate is not trusted", because any potential scammer/botnet creator/hacker/identity theft is sure to explain the mechanics behind why a root certificate is not verified and why entering in my password is ok.

Labels: , ,

Thursday, June 25, 2009

Histograms in Excel for Mac 2008

While I do have a whole 'nother post coming up about the failings of Excel 2008, one major issue that was resolved is the analysis toolpak causing Excel 2004 to crash. "Luckily", this problem is fixed by removing VBA from Excel 2008, which means there is NO analysis toolpak. Not that it was ever great to begin with, but I guess histograms are nice. Anyway, I figured people might actually want to do histograms of their own. To that end, I created an excel file that does histograms.

Some of the stuff is a bit of kludge, but I'm sure it's fairly self-explanatory: put your data in column A, and the number of points in the appropriate cell. If you need more bins, change the number of bins and adjust the chart accordingly.

Link Here

Obviously, this is intended for Excel 2008 (and 2007), but it should be backwards compatible with earlier versions, as long as you have the necessary updates to read the new file format.

EDIT: As noted by a comment, the previous file had an error in the formula that was incorrect. It is now fixed, and the total frequency should be the same as the number of data points. (Thanks, Matt!)

Labels: ,

Monday, June 22, 2009

You keep using that word [logic]: I do not think it means what you think it means.

From Francis Collins, who argues the following as scientific evidence for God:
An additional set of observations I found quite breathtaking and do to this day is the fact that the physical constants that determine the nature of interactions between matter and the way in which energy behaves have precisely the values they would need to have for any kind of complexity or life to occur.


I interpret the argument to be thus:
(1) the physical constants necessary to support life are extremely rare
(2) because the life exists, then God must exist.

I am skeptical that (1) is true, since we don't know ANYTHING about extraterrestrial life to say what could or could not be supported by different physical constants. It is outside our realm of knowledge to say that lifeform X could not exist under conditions Y because we don't know about all the different types of X or even all the different types of Y.

But for argument's sake, let's suppose you accept (1). Then you hit the BIG logical fallacy:

Because life exists (and the conditions to support life are astronomically rare), God must exist.

Which is completely ass-backwards, because the logical sequence of events is:

God exists => the physical constants of the universe are tuned perfectly => life exists.

Since we are alive, this statement CANNOT be disproven. It can only be disproven if we find (a) perfect tuning of physical constants of the universe and (b) the LACK of life. By definition, it would seem difficult to both determine the physical constants of the universe while not being alive and also proving that no life existed elsewhere in the universe.

This is an extremely basic logical fallacy that I learned about in 8th grade in the math unit on logic, but I'm sure I had an intuitive sense of why this was incorrect earlier than that. Claiming that this is "scientific evidence" for God is just plain BS, cuz last I checked *real* scientists (and scientists-to-be) use logic.

Labels: , ,

Friday, June 5, 2009

11-year old genius, my ass

From the 11-year old graduating from East LA Community College:
"I feel it's a waste of time playing video games because it's not helping humanity in any way"

Yes, but so too is martial arts. (unless perhaps, you go into special forces. Let's not even mention his goal of being a movie actor...) For mental well-being, people do all sorts of activities to relax. Sure, some of them help humanity (volunteering at a homeless shelter, for instance), and some of them don't (yoga, television, video games). To take a stance on video games when you yourself are engaged in activities that don't help humanity is simply hypocritical.

Of course, calling an 11-year old a hypocrite is just plain silly, but when you're being put on a pedestal for graduating from college early, I feel justified in attacking your narrow view of the world.

And just to be clear, graduating from a community college when you are 11 is NOT a big achievement. I have no doubts that this kid is gifted, but to claim that he has thoroughly mastered any academic subject is a bit of a joke. The 14 year-olds making groundbreaking achievements in mathematics are geniuses; all this kid has shown is that he can read and recite from textbooks. His description of wormholes clearly demonstrates a lack of deep understanding of the topic.

Labels: , ,

Wednesday, May 20, 2009

this is NOT fiscal responsibility

Apparently, the governator intends to take the unconstitutional law on selling violent video games to minors all the way to SCOTUS after having been rejected by the 9th Circuit court of appeals. (via ars technica)

Still, I guess it's chump change compared to the massive amount of bond-based borrowing that was authorized by last year's Prop. 1 to build a high speed rail.

Labels: , ,

Wednesday, May 13, 2009

Fisheries, Finance, and Physics

[edited for clarity]

See what I did there with the phonetic alliteration? :)

Q. What is the difference between the LHC (Large Hadron Collider) and Banks?

A. Black holes created by the LHC are more transparent about where stuff goes...



One theory about the potential dangers associated with the LHC puts the risk of it destroying the Earth at 50-50 (watch the clip!). Of course, this must be qualified by examining the probability that this theory of assessing the risk of the LHC is correct (0%). Other estimates of the risk posed by the LHC suggest that the probability of destroying the Earth is at 10^-9. As Ord, HIllerbrand, & Sandberg rightly point out, this should be qualified by the possibility that the model is incorrect or that calculation errors have been made.

In most cases, it is impossible to gauge the failure probability for something like a single bolt on the space shuttle. In these cases, mathematical models are often used. Clearly, estimates of the probability of "rare" events need to take into account the possibilities that the models used to generate such probabilities are accurate.

Andy Haldane describes a similar problem with how the financial industry assessed risk: some of the initial events that sparked the issue were "unlikely"* Well, either we are extremely "lucky" or the model is incorrect. Unless you can demonstrate to me that the probability of the latter is less likely than seeing that kind of impossible event, I'm going to bet that someone somewhere screwed up. In fact, it's plain to see from Chart 1 of the notes for Haldane's speech how this could happen. In the chart, data collected over the last 10 years (1998-2007) suggested that the probability of negative GDP growth was, effectively, zero. Looking over the whole sample of time (1857-2007) in which this data has been collected, however, suggests that negative GDP growth occurs maybe 15% of the time. That doesn't seem like a big difference, but when you bet billions of dollars on what you think is a sure thing (non-negative GDP growth), but actually occurs maybe 1 in 7 times, that's an f-ing big risk.

What does this have to do with Fisheries, you ask. Well, according to the Magnuson-Stevens Act (yep, THAT Ted Stevens), "Conservation and management measures shall be based upon the best scientific information available.". I suppose this means that fishing should not be a level where there is a significant risk of collapse. (whatever significant means...) Of course, the estimation of collapse risk is done using a model, which is fallible, possibly with high probability. If your best available science is not very good, is that sufficient to go plowing (or trawling, I guess) ahead? Your "best" model may suggest that you can fish 100,000 tons per year with < 1% chance of collapse, but if your model is only ~80% accurate (which is really good for fisheries models!), the upper bound on the probability of actual collapse is closer to 21% (0.8 * 1% + 0.2 * x, where x is unknown, but up to 1, potentially).

Logic and stats are nice when they're applied correctly, but more often than not, their use is exaggerated. And part of the blame does rest on the shoulder of scientists, who necessarily play up their results to get funding/acclaim/jobs. Still, that *is* why we have scientists advising the government, right? So that government officials will be able to take the best information available to make decisions? (and then we cross our fingers that our elected officials (or their appointees) know enough to weigh information properly...)

* shifts on the order of 25 standard deviations, which Andy calculates to occur roughly once every 10^135 years or
1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 years.

1) Ord, T., Hillerbrand, R., & A. Sandberg. Probing the improbable: methodological challenges for risks with low probabilities and high stakes. [preprint] (2009).

2) Haldane, A.G. Why banks failed the stress test. [speech] (http://www.bankofengland.co.uk/publications/speeches/2009/speech374.pdf) (2009).

Labels: , ,