Logic Puzzles vs. Hat Problem II

This is closer to the unsolved hat problem I have previously discussed than the solved hat problem I discussed. It made the rounds on a “Math Enthusiasts” mailing list I’m on today.

There are n people who have been given a challenge: tomorrow, a hat will be placed on each of their heads. There are n different colors of hats, and colors can be repeated (or not used at all). Everyone will be able to see the hats on everyone else’s head but not their own. No one is allowed to communicate in any way while looking at each others’ hats. Then everyone is lead away into separate rooms and each person is asked the color of their own hat. If at least one person answers correctly, the group as a whole wins (unlike the unsolved hat problem mentioned above, no one is penalized for an incorrect guess). The people can discuss strategy amongst themselves before the challenge starts, but cannot communicate in any way once anyone gets a hat.

What strategy can they use to guarantee that the group wins?

and for the pedants out there: all participants are told all possible hat colors before the challenge starts (no need to guess what the unseen colors might be), and n is small enough that all colors can be distinguished on sight (it uses less than a million different shades of blue, for instance).

An Unexpected Annoyance

My car keys have an RFID chip in them, and my car has an RFID scanner that allows me to unlock the doors and drive the car without taking the keys out of my pocket. The transceiver in my new cell phone is strong enough that it jams the RFID communication when it’s in the same pocket as my keys. I now need to get in the habit of keeping my keys and my phone in separate pockets. :-P

Edit: to be clear on the unexpected part, not only did I not foresee this issue, I’ll wager that neither the RFID makers, nor the car designers, nor the phone designers considered this confluence, either.

A fun web series

It revolves around Mr. Deity (creator of the universe), his assistant Larry, Jesse (also known as Jesus), and Lucy (short for Lucifer).

More episodes are at mrdeity.com, and extra stuff as well as a Seinfeldesque project they did are on their YouTube channel. Two of the YouTube episodes even feature Michael Shermer and PZ Meyers.

It’s so strange to think that something this entertaining can be made by the same people that did the infamously bad Windows 7 video.

Question for a physicist and/or chemist

I have some wild rice. The instructions on it say to boil some water in a saucepan, stir in the rice, cover, reduce heat to a simmer, and wait a while. When I stir the rice into the boiling water, I also stir in some butter and a spice mix (sugar, powdered soy sauce, onion, sesame seeds, garlic, and some other stuff). I mix everything thoroughly, cover it (so I can’t see what happens), reduce the heat, and wait.

When the rice is done, I uncover it, and all the sesame seeds are in a ring around the edge of the pan. The ring is maybe an inch thick; the pan is about 8 inches in diameter. The butter and sugar are mixed throughout and not clustered in any place, but the other spices, like the sesame seeds, seem to be in higher concentrations in the ring and lower concentrations in the center of the pan. I have a gas-powered stove, if that makes a difference.

Why does this happen?

Science is Awesome: Speciation Happening Within Our Lifetimes

(found via the Skeptic’s Guide to the Universe)

The short version: British bird enthusiasts have (unintentionally) split a population of birds into two separate groups, and over the past 50 years they have slowly but surely been turning into two separate species.

The long version (copied here for fear that the original article will disappear):
Article behind cut →

Ligature Alternatives in LaTeX

I’ve been corresponding with Dario Taraborelli and Will Robertson, and we have concluded a couple things about LaTeX and alternative glyphs for ligatures: Don’t bother reading behind this cut if you don’t use LaTeX →

Like XKCD for History Buffs

Take a look at Hark! A Vagrant:

She also has an LJ at beatonna.

An Interesting Idea

Reading the Canterbury Tales, old school

After my previous encounters with the Canterbury Tales, I’ve decided to read the entire thing. As before, I think that reading a modern translation loses the interesting parts of the language and screws up the poetry, so I want to read it in Middle English. and just because I can, I’m reading (a copy of) a 600-year old handwritten version. Those are images of the Hengwrt (“HENG-urt”) manuscript, which was probably written sometime between 1400 and 1410 (note that Chaucer himself died in 1400, but it’s hard to get closer to when he was alive). The images are very high quality; click the “all sizes” button towards the top to enlarge it a bit, then the “original resolution” link to see its true glory. I wish there was a way to set the default resolution higher, but I don’t know if that’s possible.

Sure, I could read a version with original spelling in a modern font, and towards the end I probably will. but for the moment, the novelty of reading a handwritten manuscript hasn’t worn off, so I’m persisting. It took a bit of time to get the hang of the handwriting and grammar, so in the interests of helping others follow in my footsteps, here is an illustrated guide to reading the manuscript.

Learn about letters and the alphabet, grammar, spelling and vocabulary, and other tips for reading Middle English manuscripts behind this cut →

C++ is bad: structs aren’t the same as structs

Here’s a fun little problem. Suppose you’ve got a system that makes use of the following struct:

struct User {
  unsigned int user_id;
  unsigned short access_level;
  float account_balance;  // stored as US dollars
}

Your system is ridiculously well-tested, all the tests pass, everything works totally fine. I’ll be so bold as to say it’s (kinda) bug-free.

One day, you decide to add a new field to the User struct, a string called name. You recompile everything, and suddenly all kinds of tests fail! New users have all kinds of access levels, some have account balances in the billions while others have accounts worth negative billions. What happened, why, and how do you fix it (without removing name again)? Edit: and no, the code does not rely on brittle assumptions about the value of sizeof(User), nor does it break type safety and have unsafe casts or void*’s pointing into the middle of Users. That would be too easy.

The answers, and more →