Sunday, February 24, 2019

Entropy Inquiry

[I originally made this post 8 years ago, but while I was going through old posts this weekend adding labels, it somehow got marked as new.]

I've been working on a post for a little while now, but getting stuck in some of the calculations, so I've been delayed.  However, I just received a question from my brother, Nate, that I thought I could answer a little more easily.
I was listening to a podcast  yesterday that sidetracked into a discussion of what you'd need to make a fully-sentient AI system, and got to thinking about randomness.

Most "random number generators" on computers are actually pseudo-random-number algorithms.  They're deterministic, but the results are surprising and random-looking.  Like f(x)=10, f(x+1)=284, f(x+2)=-5926, f(x+3)=9

But cryptographic applications demand true randomness, and so lots of work has gone into designing entropy-gathering systems for your computer.  Now your machine can watch all kinds of things like the last key you typed, or the axil-tilt of your laptop's motion sensors, or the last seek-time of your hard drive.  It collects this randomness, and can give a "real" random number when you need one.

So my question for Fundamental Forces is
* Are the numbers we get from these entropy sources /really/ theoretically random?  If you had infinite physicists and computers, could you predict a coin-flip?
* If that's not theoretically random, how might we get there?
* Does true randomness exist?  If yes, how can we know that it's Truly Random and not just really complex-looking?
 The answers to these questions requires a little clarification of what exactly "random" is.  I'm going to assume that "random" means that given any amount of information you wish, the result is still not predictable with a reasonable amount of certainty.  In this case, anything macroscopic, like a coin-flip or hardware measurement, is not random because they follow the classical laws of motion.  Given the initial conditions, these laws will predict the results.  However, it should be noted that these initial conditions can often be exceedingly complex, and difficult to determine, hence the notion of pseudo-randomness.

True randomness, though, is possible through quantum mechanics.  In quantum mechanical systems, particles occupy various "states," which specify properties like position and velocity.  However, a given particle can be in a superposition of states, where each is assigned a probability.  Note that this is not the same as saying the particle is in one of the states and we simply don't know which; the distinction was famously proven by Bell's theorem.  By setting up an experiment which depends on the particle being in one of the particular states for a particular result, we can get truly random results by feeding in particles in superpositions.

This might seem like an impractical proposition for the field of computer science, but it's actually much simpler than it sounds.  A number of years ago, I came across a site showing how to build an alpha radiation visualizer out of a webcam and a smoke detector.  Certain smoke detectors use a small amount of radioactive material as part of their instrumentation.  Directing this radiation into the CCD of a webcam creates small sparks of light, called Cherenkov radiation.  Since the radiation is happening on an atomic scale, it's governed by quantum mechanics, but the light detected by the camera can be used as a source of random numbers (for example, the time between light bursts, or the location they are detected).

Thanks for the question, Nate.  Everyone should feel free to send me their own.

Saturday, February 23, 2019

From the Three Stooges' Cookbook

Earlier this week, my cousin Autumn shared a Reddit post that sounded like a perfect topic for me!
There are varying levels of complexity we could go into here:
  • The question seems to imply a single slap, but that would be a problem, since it would deliver all the energy to a hand-sized spot. I imagine the sudden release of steam from the chicken would explode bits all over you, so let's forget that.
  • Normally the chicken would be cooked in an oven, where the air is held at a fixed temperature, and that energy is transferred to the chicken over time. In this case, we're (presumably) slapping the chicken at room temperature, so we could consider the heat that would be lost to the air, but we're already making assumptions about the energy we're putting into the chicken, so let's forget that.
  • From a physics perspective, your hand isn't too different from the chicken, so if you cook one, the other will be just as hot. This is really just a thought experiment though (I hope), so let's forget that.
The first thing we need to figure out is how much kinetic energy is in a slap. Kinetic energy is defined as
According to this Air Force Systems Command document, the mass of a hand is around 426 grams (shockingly provided in metric). For velocity, I don't think anyone has tested the maximum slapping speed, but I figure it's similar to pitching a baseball, which has a record of 105.1 mph. Putting those together, we get about 470 Joules.

Now we need to know how much heat it takes to cook the chicken. We want to bring it from a refrigerated 40°F to a safe cooking temperature of 165°F. To convert between temperature and energy, we use the specific heat, which has been tabulated for chicken as 2.72 kJ/kg °C. If we have a 3 pound (1.36 kg) chicken, the energy we need is 191 kJ.

Putting that together with the energy in a slap, it will take 406 slaps to cook the chicken! You might be thinking that's doable, but those are 406 record-breaking fastball slaps. Then there are all the issues we set aside at the beginning, including the fact that if ALL the energy is converted to heat, there's no satisfying *smack* sound!

Thanks for passing along that question, Autumn!

Sunday, February 17, 2019

Doge Phusics

(Title come from a typo on my University of Michigan student page)

Whenever I walk our dog, Lorna, and she takes enough of a break from sniffing things to get up to a trot, I'm fascinated by the way her ears bounce:

I thought I'd see if I can model the motion using a similar technique to the one in this post. In this case though, we have a sequence of these angular springs, each exerting a force proportional to its angle from the previous one. I put together a Python script to run the simulation. There are various parameters I tweaked, like the stiffness of the springs, and the distribution of the mass, but none of my models were quite as cute as the real thing! Some samples:

Uniform mass, weak spring
This was my first attempt, but it came out a bit frantic:

Linear mass, weak spring
In the video, it's just the tips of Lorna's ears the bounce, so I wondered about decreasing the mass at the tips. This seemed a bit better, but a little saggy:

Linear mass, strong spring:
To give the ears a little more lift, I increased the stiffness, which looks pretty good, but still lacks the essential "d'aww" factor: