Coin Tosses Not Totally Random

It’s generally assumed that a coin toss is “fair” because it’s considered “random” as long as you don’t use a double headed coin. In fact professional sports like football use it. While previously known or at least suspected, it’s not so random. Research shows it has a 1% bias. Making the odds 51-49, hopefully in my favor. They were even able to build a machine to predictably flip a coin.

James Devlin at Coding The Wheel has a great writeup simplified for those who don’t have a head for all the math (pun intended):

  1. If the coin is tossed and caught, it has about a 51% chance of landing on the same face it was launched. (If it starts out as heads, there’s a 51% chance it will end as heads).
  2. If the coin is spun, rather than tossed, it can have a much-larger-than-50% chance of ending with the heavier side down. Spun coins can exhibit “huge bias” (some spun coins will fall tails-up 80% of the time).
  3. If the coin is tossed and allowed to clatter to the floor, this probably adds randomness.
  4. If the coin is tossed and allowed to clatter to the floor where it spins, as will sometimes happen, the above spinning bias probably comes into play.
  5. A coin will land on its edge around 1 in 6000 throws, creating a flipistic singularity.
  6. The same initial coin-flipping conditions produce the same coin flip result. That is, there’s a certain amount of determinism to the coin flip.
  7. A more robust coin toss (more revolutions) decreases the bias.

There’s also some potential strategy, a worthwhile read.

There paper is also available as as well if your so inclined, though you’d need to be a real math/stats nerd to want to read that.

UNIX Apocalypse

Apparently Unix time/POSIX time will hit a rather impressive 1234567890 in the next few days. What is even more interesting is that this is happening on Friday the 13th, 2009. You can find out when it will happen in your local time by running perl -e 'print scalar localtime(1234567890),"\n";'. Just another milestone on the way to Y2K38.

As a sidenote, on Friday April 13, 2029 99942 Apophis will have a close encounter with earth.

Yea it’s superstition, but it sure is fun ;-) .

[Via Slashdot]

Super Mario Gravity

The other day I mentioned there is a JS implementation of Super Mario brothers. I also mentioned that the physics feel about right compared to the real game.

Apparently someone did some analysis on the series and correctly concluded that the gravity physics are totally not realistic (shocking). The real nuggets are that he can jump 5 times his body height and should be unconscious on the way down since his falls achieve 9.31 g, which should render a human unconscious without a G-Suit. Maybe those are special overalls after all.

Science!

Z2k9 Bug Strikes The Zune

From the company that brought you Windows ME, and Windows Vista, Microsoft Corporation today introduced the world to the Z2K9 bug. Apparently all 30GB Zune’s reboot and freeze due to a bug in the date/time drivers. Classic. Microsoft’s solution is to simply wait until 2009 (a few more hours). Even more classic.

This does bring up one of every programmer’s biggest pet peeves: date/time code. I’ve mentioned my hatred of time before. It’s one of the most obnoxiously complicated things to work with due to all of the complexities from leap seconds to leap years. If you need to do something involving old dates, it gets even more complicated. Remember Julian Thursday, 4 October 1582 was followed by Gregorian Friday, 15 October 1582. Yes you read that right. Also don’t forget that only certain countries (mostly those under strict influence of the Pope) switched on that date. There was dual dating for some time. Then you have timezones, which ideally would be geographically correct and 15° of longitude apart, but instead zigzag and not even along territorial borders. Worst of all is daylight savings time. Not everyone participates in that, and sometimes just not every year, or at the same time. Even states are split, just check out the chaos in Indiana.

Griping aside, none of these likely caused the Zune bug. Since it’s a freeze, I’d guess it’s nothing more than an infinite loop or some other trivial programming error on a leap year.

Everyone remembers the infamous Y2K bug. Many uneducated folks still claim it was nothing to worry about and overblown, but it still cost between $300-600 billion dollars depending on whose estimates you believe (3.596 billion from the US military alone). Since a large portion of the cost was in the private sector, there’s no true tally.

The next big day to keep in mind is January 19 2038 3:14:07 GMT. That’s when the 32 bit computing will officially freak out since most Unix-like computers store time as a signed 32 bit integer counting the seconds since Jan 1, 1970 (Unix Epoch). After that we go back to 1901. There will likely be some 32 bit computing left in 2038 considering how long embedded systems can be ignored and silently slaving away in the background. For reference the B-52 Stratofortress entered operation in 1955 (they were built until 1962). They are expected to be taken out of service in 2040. This is the exception for US military aircraft, but don’t think this is the only old hardware out there. The Hubble Space Telescope has a 32 bit 486 processor and launched in 1990 and assuming the backup computer is functional it will be serviced soon to extend it’s life by another few years making it’s service life 20+ years. It’s unlikely Hubble will make it to 2038 but Hubble shows how long expensive systems can survive in active use. This date is only 30 years away. This will cost the world some serious cash.

On the upside according to Wikipedia 64 bit systems will be good until Sunday, December 4, 292,277,026,596. Odds are that won’t be a concern for most people alive today.

Reassuring? Yes. But your Zune is still fried for a few more hours.

Update [1/5/2009]: Here’s some pretty detailed confirmation that it was indeed an infinite loop error. I know my crashes ;-) .

Making Products Easy To Repair

Lately consumer protection and financial laws seem to be a favorite of politicians who want to help the American people “keep their hard earned money”, er whatever slogan it is they go with these days. For a long time I’ve been of the feeling that they are overlooking the obvious. Making things easier to fix, hence longer lasting. Sames money, and helps the environment. How’s that for killer legislation?

Most household items are surprisingly simple to repair. Thanks to automation at the factory, everything has been pretty much broken down to LEGOs in complexity. Simple modules that are interconnected to form products. This technique also allows them to use the parts in multiple models hence lower cost of production. But every so often one part breaks rendering the product to be a giant paperweight. From home appliances to your computer, it really doesn’t matter what the product does.

What’s really needed is easier access to parts. Every manufacturer’s policies vary, but in many cases it’s extremely difficult to find parts. When you do your often paying hundreds of times what that tiny piece of plastic is really worth. Of course it’s still sometimes cheaper than replacing the product, but not by a huge margin.

This should really be law:

  • Standard Screws – Products should be assembled using standard screws. No more proprietary heads. In situations where a screwless design is used (iPod for example) explanation of how to open should be available.
  • Parts breakdown – Every product should either include on paper, or upon request from manufacturer a list of all parts in the product with part number.
  • Easy Access To Parts – Replacement parts should be available at cost + 10-15% + shipping & handling. Keep them affordable and easy to order. It should be either through the manufacturer directly or via an authorized agent, via phone or online. Parts should be available for a minimum 3 years after the last warranty expires for home electronics. Home appliances should be longer, I’d say 10 years. If the manufacturer provides repairs themselves or service parts to authorized technicians the parts should be available for as long as they are to service centers, whatever is longer.
  • Warranty Disclaimer – Should state what are “user serviceable parts” and can be replaced within warranty, and that anything else will void the warranty (it’s your problem not theirs).
  • Hazards Warning – Should warn of any obvious and non-obvious hazards within the device, such as capacitors that can contain high voltage even when unplugged (yes, newbie, it common, and I’m sure it hurts if you make that mistake), chemicals, or sharp objects. Ideally devices would color code such hazardous parts, and perhaps things that need to be disposed of specially such as batteries.

By making things easier to repair, this would ensure that people can conserve money by not replacing products because of one small problem. This would also be a major environmental win because people can conserve and avoid filling landfills with mostly working products. This is especially true for electronics.

LCD AssemblySo far the only one who seems to come close to meeting my guidelines is IBM/Lenovo. They make it very easy to order replacement parts (though it’s hard to find the page). They also have excellent diagrams of the whole product exploded so you know exactly how it goes together. This makes owning a IBM/Lenovo product a lot cheaper since you can just order the replacement part as needed. If your under warranty they seem to have no problem shipping replacement parts if your comfortable installing and don’t want to ship your laptop out for repairs (which sucks, trust me).

A close second is LG. I’ve ordered replacement cell phone parts a few times. No diagrams or assistance from them, but their parts # is very helpful in identifying the actual part every single time. Just give the model number and explain the part. Required overnight shipping which added significantly to the cost, but overall not a bad deal.

NordicTrack isn’t bad either. I was able to order a replacement controller and turn a seemingly dead-as-a-doornail treadmill into a perfectly working treadmill in a matter of minutes. Nice diagrams on paper, and online ordering process was pretty painless. That simple replacement saved significant cash and kept a heavy treadmill out of a landfill. Price of parts weren’t too bad either.

For those who suggest eBay, that’s really a last resort. Your essentially buying salvaged parts of unknown quality or origin. If you treat your stuff well, why put in some part that’s likely been tortured by a previous owner to the point where the product was sent to salvage? Low cost replacement parts are the way to go. Also prevents bogus counterfeits, buying damaged goods.

That would go a long way to helping people save some cash, give companies a new revenue model (10-15% above cost is a pretty nice margin), and help the environment all in one sweep. Some companies are already much closer to fully complying with this list than others. That just proves to me that this is a reasonable proposal. It’s insane to replace something because of one small piece.

Image From Lenovo

MTA’s Fail Whale

Apparently the Fail Whale in tech is a disease lately. The latest obvious occurrence has been New York’s MTA with their MetroCard vending machines. I noticed on Monday walking into the station, the lines in front of the vending machines were insanely long (normally 2 people max, now 15+) and presumed just a large group of tourists. Then saw it when I got off at my stop (hmm… two stations overloaded with customers? Strange). This morning it was less but still crowded (I guess some people gave up), and learned the problem myself. Apparently they can’t process credit cards lately.

Many New Yorkers purchase an $81 30-Day Unlimited Ride MetroCard,a s opposed to putting a fixed amount on a card. I suspect many do not carry $81 cash on them because we are a society that uses credit cards for convenience. So those people just pulled a couple dollars out of their wallet and bought a regular fare card with the intent to come back later. At $2.00 a fare this could provide a nice bump for the MTA, who I might add is cash strapped and looking to raise the fees after just cutting the bonuses from 20-15%.

Now regarding that bonus cut, that creates a whole new can of worms. For those who don’t know: if you purchase more than $7, you get a bonus. 20% always leaves a nice even number. 15% on the other hand leaves you with spare change. Leaving room for things like the MetroCard Bonus Calculator. What a mess. You could always put a few dollars on the card to clean it up, but then you loose the 15% bonus on that money. Over time that adds up. I’m sure many people just throw away the cards with change on it, but I find that somewhat silly.

Twitter seemed to survive the Chino Hills earthquake, so the MTA wins the Fail Whale award for today.

How To Steal A Credit Card

I said a while back RFID credit cards still have to prove themselves. Today I saw this interesting story on CNet:

As part of his presentation Wednesday, Laurie asked for someone from the audience to volunteer a smart card. Without taking the card out of the volunteer’s wallet, Laurie both read and displayed its contents on the presentation screen–the person’s name, account number, and expiration clearly visible.

You can find a ton of information including code and the hardware necessary to duplicate this his website RFIDIOt.

Another real potential issue is companies using RFID for security badges. Considering how easy it is to read and duplicate, potentially anyone who can get close to someone walking into an office can capture the data necessary to produce their own ID card. In this case only matching the photo stored by the company on their computer system (not the one on the badge) to the person’s face is security. So for those offices who don’t have security staff doing this, anyone could theoretically get in.

The best security mechanisms are the most simple and discrete. Credit cards are naturally pretty secure if used correctly. Nobody can abuse a credit card unless they know the number. Nobody can read it through a wallet. The wallet in this case is a great security feature. To read it you need to either visually inspect it for the numbers, copy it, get an impression of it, or swipe it through a reader. All things that require intimate contact with the actual card. Impressive security for some old technology isn’t it?

I’ll stick with swiping a credit card for the foreseeable future. Your only not liable for a stolen credit card if you and your credit card company mutually agree it’s stolen or being misused. Otherwise you may be on your way to an expensive dispute. Regardless it may have hit your credit, and you’ll spend a lot of time sorting it out and getting it corrected. Bad credit costs you money. Some individuals make it sound like it’s just a phone call and your done, but people who have had their credit card stolen sometimes spend several months fighting to save their credit.

Hacking A Boeing 787?

According to Wired the Boeing 787 Dreamliner connected the networks for passenger services to critical flight systems:

The computer network in the Dreamliner’s passenger compartment, designed to give passengers in-flight internet access, is connected to the plane’s control, navigation and communication systems, an FAA report reveals.

Here’s what a Boeing spokesperson had to say:

…it is employing a combination of solutions that involves some physical separation of the networks, known as “air gaps,” and software firewalls. Gunter also mentioned other technical solutions, which she said are proprietary and didn’t want to discuss in public.

Would it really be that much more costly to create 2 networks. One for the important stuff like navigation and control systems, and another completely independent network for passengers to download porn? Networking gear isn’t that expensive. Internet access at 35,000 feet is high latency anyway.

I’m really not so sure I’d feel comfortable knowing that the same network that’s carrying a Rob Schneider movie to the guy in 11F is also carrying packets intended for the horizontal stabilizer.

Maybe I’m just paranoid. After all, I’m not to comfortable with the Airbus A380 apparently running windows in the cockpit.

Hopefully they get it all figured out quickly.