Physical constants and factorials

The previous post mentioned that Avogadro’s constant is approximately 24!. Are there other physical constants that are nearly factorials?

I searched SciPy’s collection of physical constants looking for values that are either nearly factorials or nearly reciprocals of factorials.

The best example is the “classical electron radius” re which is 2.818 × 10−15 m and 1/17! = 2.811 × 10−15.

Also, the “Hartree-Hertz relationship” Eh/h equals 6.58 × 1015 and 18! = 6.4 × 1015. (Eh is the Hartree energy and h is Plank’s constant.)

Here’s the Python code I used to discover these relationships.

from scipy.special import gammaln
from math import log, factorial
from scipy.optimize import brenth
from scipy.constants import codata

def inverse_factorial(x):
    # Find r such that gammaln(r) = log(x)
    # So gamma(r) = x and (r-1)! = x
    r = brenth(lambda t: gammaln(t) - log(x), 1.0, 100.0)
    return r-1

d = codata.physical_constants
for c in d:

    (value, unit, uncertainty) = d[ c ]
    x = value
    if x < 0: x = abs(x)
    if x < 1.0: x = 1.0/x
    r = inverse_factorial(x)
    n = round(r)
    # Use n > 6 to weed out uninteresting values.
    if abs(r - n) < 0.01 and n > 6:
        fact = factorial(n)
    if value < 1.0:
        fact = 1.0/fact
    print c, n, value, fact

Avogadro’s number

Avogadro’s number NA is the number of atoms in 12 grams of carbon-12. It’s about 6.02 × 1023. (Update: Avogadro’s number is now exactly NA = 6.02214076 × 1023 mol−1 by definition. More details here.)

Here are a few fun coincidences with Avogadro’s number.

  1. NA is approximately 24! (i.e., 24 factorial.)
  2. The mass of the earth is approximately 10 NA kilograms.
  3. The number of stars in the observable universe is 0.5 NA.

The first observation comes from here. I forget where I first heard the second. The third comes from Andrew Dalke in the comments below, verified by WolframAlpha.

For more constants that approximately equal factorials, see the next post.

Related posts

The most powerful people are right

From Seth Roberts:

If you ignore data, the answer to every hard question is the same: the most powerful people are right. That way lies stagnation (problems build up unsolved because powerful people prefer the status quo) and collapse (when the problems become overwhelming).

Science is far more political than I had imagined before starting a career in science. Data trumps politics eventually, but it may take a long time.

California knows cancer

Last week I stayed in a hotel where I noticed this sign:

This building contains chemicals, including tobacco smoke, known to the State of California to cause cancer, birth defects, or other reproductive harm.

I saw similar signs elsewhere during my visit to California, though without the tobacco phrase.

The most amusing part of the sign to me was “known to the State of California.” In other words, the jury may still be out elsewhere, but the State of California knows what does and does not cause cancer, birth defects, and other reproductive harm.

Now this sign was not on the front of the hotel. You’d think that if the State of California knew that I faced certain and grievous harm from entering this hotel, they might have required the sign to be prominently displayed at the entrance. Instead, the sign was an afterthought, inconspicuously posted outside a restroom. “By the way, staying here will give you cancer and curse your offspring. Have a nice day.”

As far as the building containing tobacco smoke, you couldn’t prove it by me. I had a non-smoking room. I never saw anyone smoke in the common areas and assumed smoking was not allowed. But perhaps someone had once smoked in the hotel and therefore the public should be warned.

Related post: Smoking

Two suns in the sunset

NASA’s Kepler mission has discovered a planet orbiting two stars, something like Tatooine in Star Wars. However, unlike Tatooine, this planet is a gas giant about the size and mass of Saturn. But if you had a place to stand near the surface of this planet, you might see a sunset something like the one Luke Skywalker saw.

Source: Science Daily.

Bad science is tolerable, résumé padding is not

The Economist posted an article online this weekend about the scandal over irreproducible cancer research by Anil Potti. My colleagues Keith Baggerly and Kevin Coombes have been crying foul about this since 2007. I first blogged about it in January 2008.

The story started getting widespread attention last summer when the Cancer Letter reported that Dr. Potti had lied on grant applications. Since then there have been articles in the popular press, and people are staring to file lawsuits.

Apparently the tipping point in the story was finding a fib on Potti’s resume. According to The Economist

He falsely claimed to have been a Rhodes Scholar in Australia (a curious claim in any case, since Rhodes scholars only attend Oxford University).

So what finally got people to pay attention was not accusations of incompetent or fraudulent science, but résumé padding. As Keith Baggerly commented,

I find it ironic that we have been yelling for three years about the science, which has the potential to be very damaging to patients, but that was not what has started things rolling.

Related posts

Software exoskeletons

There’s a major divide between the way scientists and programmers view the software they write.

Scientists see their software as a kind of exoskeleton, an extension of themselves. Think Dr. Octopus. The software may do heavy lifting, but the scientists remain actively involved in its use. The software is a tool, not a self-contained product.

Spiderman versus Dr. Ock

Programmers see their software as something they will hand over to someone else, more like building a robot than an exoskeleton. Programmers believe it’s their job to encapsulate intelligence in software. If users have to depend on programmers after the software is written, the programmers didn’t finish their job.

I work with scientists and programmers, often bridging the gaps between the two cultures. One point of tension is defining when a project is done. To a scientist, the software is done when they get what they want out of it, such as a table of numbers for a paper. Professional programmers give more thought to reproducibility, maintainability, and correctness. Scientists think programmers are anal retentive. Programmers think scientists are cowboys.

Programmers need to understand that sometimes a program really only needs to run once, on one set of input, with expert supervision. Scientists need to understand that prototype code may need a complete rewrite before it can be used in production.

The real tension comes when a piece of research software is suddenly expected to be ready for production. The scientist will say “the code has already been written” and can’t imagine it would take much work, if any, to prepare the software for its new responsibilities. They don’t understand how hard it is for an engineer to turn an exoskeleton into a self-sufficient robot.

More software development posts

Manga guides to physics and the universe

I recently received review copies of the Manga Guides to physics and the universe. These made a better impression than the relativity guide that I reviewed earlier. The guide to physics has been out for a while. The guide to the universe comes out June 24.

The Manga Guide to Physics basically covers force, momentum, and energy. The pace is leisurely. There’s not much back story; it cuts to the chase fairly quickly.This guide will not prepare you to solve physics problems, but it does give you a good overview of the basics.

(These books are not entirely manga; all three books I’ve seen in the series have several pages of more traditional textbook content.)

The Manga Guide to the Universe gives a tour of cosmology from the geocentric view to current theories. It contains some very recent material, such as references to the WMAP project.

This book is more rushed than the physics guide. That’s to be expected considering its ambitious scope. It devotes a fairly large amount of space to the back story and this contributes to the book being rushed.

I mentioned in my review of The Manga Guide to Relativity that although Americans associate cartoons with children, that book was not written for children. The physics guide, however, would be appropriate for a wide range of readers. Young readers may not fully appreciate the content, but they would not find anything offensive.

The Manga Guide to the Universe is inoffensive with one exception. There are a couple provocative frames in the prologue that will keep the book off some school library shelves.

What was the most important event of the 19th century?

According to Richard Feynman, the most important event of the 19th century was the discovery of the laws of electricity and magnetism.

From a long view of the history of mankind—seen from, say, ten thousand years from now—there can be little doubt that the most significant event of the 19th century will be judged as Maxwell’s discovery of the laws of electrodynamics. The American Civil War will pale into provincial insignificance in comparison with this important scientific event of the same decade.

From The Feynman Lectures on Physics, Volume 2.

Related post: Grand unified theory of 19th century math