Champagne and the Experimental Method

winebottleThere is a belief, common in France anyway, that the fizziness of an opened bottle of champagne can be preserved by placing a metal spoon, handle down, in the mouth of the bottle.  Both my wife and brother-in-law, both French, believe that this a sure way to better enjoy an opened bottle the next morning, or even the morning after that.

But is this belief true?  Examining it critically is an excellent, non-technical way of understanding the experimental method.  In brief, the method is a way of separating the possibly true from the definitely false.  We, as citizens, need to do this just as much as does the scientist in the laboratory.

So let’s have at it.  What arguments pro and con are there for the spoon-the-bottle hypothesis?  On the pro side of the ledger is that people I know and respect believe the hypothesis. Also in favor is that the belief is shared by many others, and has been around for a long time.  This is a version of the Argument from Authority.

What about the con side?  When I first heard about this use of a spoon — after half-finishing the second bottle of champagne with friends — I objected that “it just didn’t seem right.”  Pressed to explain, I questioned the mechanism: how could the spoon stop bubbles from forming in the liquid below, then escaping though the neck, passing around the spoon, which “obviously” did not form real barrier.

We argued back and forth, but these theoretical arguments failed to convince my drinking companions. To decide the issue, I proposed an experiment.  We would half-drink two more bottles of champagne so as to have three identical bottles, A, B, and C, then proceed a follows:  re-cork bottle A, put a spoon in the neck of bottle B, and do nothing to bottle C.  All would be placed in the refrigerator.  We would test the three bottles the next morning and for two mornings thereafter.

My proposal was accepted, and we set about preparing the experiment.  The next morning, not so many hours after putting the bottles in fridge, there was not much difference among the bottles.  I thought B and C were a bit stale, but my companions disagreed.  The next day there was a considerable difference, with bottles B and C definitely stale, definitely lacking in that bubbly tang.  B and C seemed equally stale. The day after it was clear to all: B and C were quite flat, while A retained its fizzyness.  The spoon had done nothing.

This little tale illustrates the essence of the experimental method in science: formulate a precise question, then design and carry out experiment to answer it.  Nothing more, nothing less.  Simple, effective, and useful in everyday life.

One more thing

There is one more thing.  You do not have to accept my judgement of the spoon-in-the-bottle hypothesis.  Rather than accepting my authority, you can carry out the experiment yourself.  If you get the same results, or similar once, this confirms the hypothesis.  A good experiment is repeatable.

 

Barnes and Noble, in Memoriam

dylan_bookshelf

A few days ago my son Dylan came to give me the sad news: Barnes and Noble had closed.  Forever.  Not the whole chain of stores, thank goodness and not yet, but the one where we had spent many afternoons after school, sometimes staying till closing time: our hangout, the store on Tremont road in Columbus, Ohio, midway between my house and the high school.  The tradition of going to Barnes and Noble began early, certainly by age seven or eight, when Dylan still lived Mexico.  We would visit the big store in Tribeca, where Dylan got to know one of the store managers.  He always recognized Dylan when he came to New York, and he saw him grow from a little boy to a young man.

The routine was always the same.  I would find a few books and would go to the cafe to read and work.  Dylan would disappear into the stacks to collect a shopping basket of books, sometimes two, that he found interesting.  When he was quite young, I would be called to carry the baskets, now quite heavy, to the cafe.  Dylan would then sort through the books, reading a bit from each, narrowing down his choices.  I would be asked to make my independent evaluation.  Then came the hard part: deciding what to buy.  “Dad, how many books can I get today.” Me: “two, maybe three.” Eventually the choice would be made.

This process, called “editing,” was occasionally carried out on the floor of the store, where it was much easier to sort the books into categories and make a choice.  And also much easier to get into trouble.

We visited B&N wherever we traveled or lived: New York, Columbus Ohio, Chicago, Salt Lake City, Miami, are the cities I remember.

This year, the year of our beloved store’s demise, is Dylan’s gap year.  We are spending it in Paris, where we have discovered an excellent bookstore, Librairie Gaglignani, at 234 rue de Rivoli.  No editing there, as we were politely told, but the selection of books is superb, and we have taken many prize finds home, much to Nicole’s dismay: how will we transport our new library back to the US?

We carry the habits established at Barnes and Noble wherever we go.  On our father-son bonding trip in August, we visited bookstores in Copenhagen, Stockholm, Oslo, and Helsinki, finding small treasures in each, and lugging them back to Paris.  Of course, we haven’t read all these books, though Dylan is doing much better than am I.  But we have stored riches for the future.  And if another pandemic forces us to stay at home, we are immunized from that most dreaded of diseases: boredom.

A List of Science Books

Today when my son Dylan and I were out walking, he asked if I would write down a list of serious but popular science books.  So here goes.  I have most of them at various points in my life — high school, university, sometimes much later.

  1. George Gamow, One, Two, Three, Infinity.  This is a classic, written by a great physicist, known for his work on the Big Bang as well as other things.  I read this book in high school.  It had a great influence on me.
  2. Richard Feynman, The Character of Physical Law. See this review by Frank Wilczek.
  3. Richard Feynman, QED: The Strange Theory of Light and Matter.
  4. Steven Weinberg, The First Three Minutes. This books talks about what happened during the first three minutes after the big bang.
  5. George Johnson, The Ten Most Beautiful Experiments. Of course there are more than ten, but this is a very good selection.
  6. A. Douglas Stone, Einstein and the Quantum.
  7. Adam Hart-Davis, Le Chat de Schrödinger: 50 éxperiences qui ont revolutionné la physique.
  8. Chad Orzel, How to Teach Quantum Physics to your Dog. The title may seem bizarre, but Orzel’s literary device of using his dog actually works, and his explanations are both clear and beautiful

Log For Haskell: Week 2

Day 1, April 17, 2020: Typeclasses

Typeclasses are among the most powerful features in Haskell. They allow us to define generic interfaces that provide a common feature set over a wide variety of types; defining  a set of functions that can have different implementations depending on the type of data they are given.

Here is a typeclass is defined:

class BasicEq a where
isEqual :: a -> a -> Bool
isEqual x y = not (isNotEqual3 x y)

isNotEqual :: a -> a -> Bool
isNotEqual x y = not (isEqual x y)

and here is how it is used (instantiated):

instance BasicEq Bool where
isEqual True True = True
isEqual False False = True
isEqual _ _ = False

and also

instance BasicEq Color where
isEqual Red Red = True
isEqual Green Green = True
isEqual Blue Blue = True
isEqual _ _ = False

This is like refl in Martin-Löf type theory.  If BasicEq or ==is not implemented for a type, you could say (in the abstract) that that type has no notion of equality since = is uninhabited.)  You can instantiate an existing typeclass for a new type:

instance Show Color where
show Red = "Red"
show Green = "Green"
show Blue = "Blue"

On the Read and Show typeclasses:

You may often have a data structure in memory that you need to store on disk for later retrieval or to send across the network. The process of converting data in memory to a flat series of bits for storage is called serialization. It turns out that read and show make excellent tools for serialization. show produces output that is both human- and machine-readable. Most show output is also syntactically valid Haskell, though it is up to people that write Show instances to make it so.

Example

First write a data structure to disk:

ghci> let d1 = [Just 5, Nothing, Nothing, Just 8]::[Maybe Int]
ghci> putStrLn (show d1)
[Just 5,Nothing,Nothing,Just 8]
ghci> writeFile "test" (show d1)

Now read it back:

ghci> input <- readFile "test"
"[Just 5,Nothing,Nothing,Just 8]"
ghci> let d2 = read input
Ambiguous type variable `a' in the constraint:
`Read a' arising from a use of `read' at <interactive>:1:9-18
Probable fix: add a type signature that fixes these type variable(s)

ghci> let d2 = (read input)::[Maybe Int]
ghci> print d1
[Just 5,Nothing,Nothing,Just 8]
ghci> print d2
[Just 5,Nothing,Nothing,Just 8]
ghci> d1 == d2
True

Automatic derivation

data Color = Red | Green | Blue
deriving (Read, Show, Eq, Ord)

Pragmas

{-# LANGUAGE TypeSynonymInstances #-}

Data versus Newtype

data DataInt = D Int
deriving (Eq, Ord, Show)

newtype NewtypeInt = N Int
deriving (Eq, Ord, Show)

When we declare a newtype, we must choose which of the underlying type’s typeclass instances we want to expose. Here, we’ve elected to make NewtypeInt provide Int’s instances for Eq, Ord, and Show. As a result, we can compare and print values of type

NewtypeInt: ghci> N 1 < N 2
True

Since we are not exposing Int’s Num or Integral instances, values of type NewtypeInt are not numbers. For instance, we can’t add them:

ghci> N 313 + N 37
--> error

Further example (hiding implementation):

newtype UniqueID = UniqueID Int
    deriving (Eq)

The compiler treats UniqueID as a different type from Int. As a user of UniqueID, we know only that we have a unique identifier; we cannot see that it is implemented as an Int.

Recap: defining types

  1. The datakeyword introduces a truly new algebraic data type.
  2. The type keyword gives us a synonym to use for an existing type. We can use the type and its synonym interchangeably.
  3. The newtype keyword gives an existing type a distinct identity. The original type and the new type are not interchangeable.

 

.

 

 

 

The Reason Why

merlin_171584709_5ddc217b-264c-41ac-8bca-8e1b90794d4c-superJumbo
Bubble chamber image showing muon neutrino traces. Jan. 16, 1978, at FermiLab

In the beginning, at the instant of creation, there came into being numerous particles: quarks and antiquarks, protons and and antiprotons, electrons and antielectrons, each kind paired with its opposite. Thus was matter and antimatter created in equal measure. But when particle met antiparticle, an exceedingly frequent occurrence in those early times, the encounter was brief, violent, and almost always fatal, as both were destroyed, their substance vanishing in a flash of  pure energy. When the great annihilation came to an end, there were few survivors of this many-fold decimation: no more than one in a billion remained.  They were all of one kind, the kind we now call matter.  It is of these particles that all we see about us is made, from the grains of sand on the seashore to the trees to the sun, the stars, and to the most distant galaxies.  The clue for our improbable and miraculous existence is hidden in the image above, an image of muon neutrino traces in a bubble chamber, the paradoxically huge microscope that physicists use to probe the smallest realms. In the laws that govern us, it turns out, there is a small asymmetry, a kind of distinction between right and left, charge and anticharge, which are otherwise equal mirror images of one another. Neutrinos, born of the annihilation of particle and antiparticle, of the explosions of stars which create the iron and nickel of which our earth’s core is made, of the proton-proton reactions which power our sun,  carry to us the message of this tiny discrepancy, the reason for our existence.

(Draft #1)

Article by Dennis Overbye, New York Times

Physics note: Neutrinos are ghostly particles that interact very weakly with matter.  The proton-proton reactions that power the sun send out a huge stream of neutrinos.  Each square centimeter of the Earth’s surface is bombarded by roughly 100 billion neutrinos per second.  Almost all of them pass through the Earth, exiting unchanged on the opposite side.