Saturday, September 24, 2011

Last week's puzzler

I mean this puzzler [2015-07-26: instead try this] from Car Talk -- yes, that Car Talk. The answer is linked from there, but of course rather than figuring it all out by hand I wanted to use a computer to do something about it.

Here's my paraphrase of the puzzle: What is special about the numbers (and the spellings) in this list: 4, 6, 12, 30, 33, 36, 40, 45, 50, 54, 56, 60, 70, 81, 88, 90, 100? The order is not important, and the property we're talking about is met by no other numbers between 1 and 100. I'll put a little space here so if you don't want to know the answer quite yet, you don't need to see it :)
  OK, so I thought, "H'm, why 'four' but not 'five'? Well 'four' and 'five' are both 4 letters long; 4 is a factor of 4 but isn't a factor of 5. 'six' is three letters, 3 is a factor of 6."

So I typed this little list into a file, which I imaginatively called tmp/cartalk-number-puzzler:

one hundred
Now, rather than counting letters by hand, I did this:
$ while read X; do echo $X ${#X}; done < tmp/cartalk-number-puzzler
four 4
six 3
twelve 6
thirty 6
thirty-three 12
thirty-six 10
Let me explain that.
  • while read X; do means "read a line and assign it to $X, then execute the following."
  • echo $X ${#X} means to echo (on the terminal display) the values of $X and the length of $X (which is the translation of ${#X})
  • done is the other end of the do we saw above
  • < tmp/cartalk-number-puzzler means "and read from this file, not from what I'm typing"
Now 12 isn't a factor of 33, and 10 isn't a factor of 36. So I wasn't sure about this whole factor business. But then I noticed that if you count only letters, then the length of "thirty-three" comes to 11, which is a factor of 33. So I tweaked my little loop:
$  while read X; do  Y=${X// /}; Y=${Y//-/}; echo $X ${#Y}; done < tmp/cartalk-number-puzzler 
four 4
six 3
twelve 6
thirty 6
thirty-three 11
thirty-six 9
forty 5
forty-five 9
fifty 5
fifty-four 9
fifty-six 8
sixty 5
seventy 7
eighty-one 9
eighty-eight 11
ninety 6
one hundred 10
The two new things here are... Y=${X// /}, which means "replace all the 'blank' characters from $X by '' (nothing) and put the result into $Y — and Y=${Y//-/}; which takes $Y (i.e., the de-blanked version of $X) and replaces all the hyphens by '', storing the result back into $Y

We then print the length of $Y -- the de-blanked, de-hyphen'd version of $X -- and by inspection I think these all match the hypothesis: 10 goes evenly into 100, 6 goes evenly into 90, 11 goes evenly into 88, etc.

But wait, that's not enough! The puzzler specified that these are the only numbers between 1 and 100 with that property. I'm way too lazy to type 'twenty-one' and 'seventeen' and 'eleven' in, and I thought somebody must have written a routine to do this, so I googled "python numbers to text" (no quotes) and downloaded "Convert Numbers to Words (Python)", which works like a champ. I coded this little thing which uses num2word, like this:

import num2word 
for i in range(1,101):
    tweaked = num2word.to_card(i).replace(' ', '').replace('-', '')
    if i % len(tweaked) == 0:
        print i, tweaked, 'len =', len(tweaked)
What this says is, take all positive integers up to and including 100, and calculate "tweaked" -- which is the de-blanked, de-hyphen'd version of the textual representation (i.e., num2word.to_card(i)( of the number. Then, display a message on the terminal if the length of tweaked is a factor of i. The result was:
4 four len = 4
6 six len = 3
12 twelve len = 6
30 thirty len = 6
33 thirtythree len = 11
36 thirtysix len = 9
40 forty len = 5
45 fortyfive len = 9
50 fifty len = 5
54 fiftyfour len = 9
56 fiftysix len = 8
60 sixty len = 5
70 seventy len = 7
81 eightyone len = 9
88 eightyeight len = 11
90 ninety len = 6
100 onehundred len = 10
which was the list we started with.

"You've done it again—you've wasted another perfectly good hour listening to Car Talk."

Monday, September 12, 2011

London sept 2: British Library and Museum

We went to the "new" British Library -- there was no budget for it so it seemed to take forever. (The reading room and collection used to be inside the British Museum.) Construction workers were reported to say they were working on the Library and thus were employed for life.

I saw a few pages from an early printing of the King James Bible of the 17th century, which I could actually read; I can't say the same of either the 16th century Gutenberg Bible (it's in Latin and the font is sufficiently strange to me) or the 5th (not a typo) century Codex Sinaiticus. The latter was opened to Psalms 9-13 but the lighting was quite low and the ink rather light (faded, or just written that way). I don't know Greek either. (The sign nearby said that psalms 9-10 were written as a single psalm in the Codex, a single acrostic poem. I suspect this was the way the LXX has it too.) Anyway I thought I recognized a word, but turns out I was wrong. At least I think I was.

But it was pretty darned exciting to see these old documents. Codex Sinaiticus especially.

At the British Museum we saw the Rosetta Stone! I mean the real one! Its story is the stuff of adventure film -- rediscovered by French soldiers, but then being given to the English as spoils of war; Thomas Young's attempts at deciphering it; then Jean-François Champollion's discovery of several keys, which enabled him to see ancient monuments and, for the first time in maybe 2000 years, being able to say what it meant.

Champollion was apparently given to fainting; he'd translate a monument, faint, and translate another. Can't say I blame him, though; if I were the first person in 1500-2000 years to be able to read a monument I'd be pretty excited, too.

Lunch was at "Tas" Restaurant, 22 Bloomsbury St.; their domain registration seems to have expired, but here's a cached copy.

We took the £9.15 per person lunch menu -- 2 persons minimum. Lots of good stuff, no meat. What I can remember it had: eggplant, something like ratatouille; hummus; bread of course; tabbouli; cracked? bulghur with walnuts, spinach/yogurt, fresh hot falafel, freshly baked(?) thing that reminded me of spanakopita but was probably pronounced something like "boo-regh".

was at the Ebury Wine Bar at Ebury and Elizabeth Streets, right next to the hotel.










While I'm here I'll tell you about Thursday 9/1









Learned a few interesting things today (8/30)

First, "Peace in our time" or "Peace for our time," as Neville Chamberlain said after a 1938 meeting with Hitler, was not nearly as daft as some have claimed. He was no dummy and certainly knew Hitler was plotting war; he knew England would need to prepare for war. He also knew that England wasn't ready to fight in 1938; by apparently appeasing Hitler he bought the UK time to prepare.

Until today, I'd heard only the traditional view, that Chamberlain was silly for believing Hitler. But upon reflection, what I heard today makes a lot more sense. The wikipedia article at offers both sides of the story.

Something else we heard today was that during WW II, relationships were formed much more quickly than had been usual before that. Young people would meet in Trafalgar Square -- scandalously, without regard to social class, level of education, etc. -- and take the short walk to St James's Park, which was not mowed during those years. London suffered nightly bombings 57(?) days in a row at one point, which made people ever more aware that tomorrow we may die. Besides disregarding class, some of these young people even ignored nationality (how many thousands of British married Americans during the war?) -- and England (indeed the world) was never the same.

Hearing this, I immediately thought "Of course!" though I wouldn't ever have come up with the insight myself.
Not nearly as important...
but we had lunch at The Two Chairmen, a nice pub at the end of Lewisham St. (really an alley) where it meets Old Queen Street. The address seems to be 39 Dartmouth St.; more location info here.

In the National Gallery

Our guide, the superb Tom Hooper, explained several paintings hanging in the National Gallery; I remember some of his comments on two of them. The first, which you see at right, was the Arnolfini Portrait. Tom's comments were not quite the same as what Wikipedia says, and you can look up the latter, so I'll try to relate what Tom told us. First, the man is considerably older than his wife. She's wearing green, not an expensive color (Wikipedia says it's fur-lined, indicating its expense). Tom also pointed out that the man is wearing fur, but not the most expensive fur; he's of the merchant class and has done well. The girl is not pregnant, but she's got enough of a belly to show she's been eating well; lifting her green outer garment, we see that her inner garment reaches to the floor (further emphasizing the wealth of her husband-to-be).

By the way, the perspective and realism of the painting (note the convex mirror along the back wall) were what one would expect for the period (dated 1434 by Van Eyk), but this sort of technique hadn't made it to England by then.

One interpretation of the painting holds that the girl is afraid because of the high expectations placed upon her (at this time: to bear sons), communicated by the ample but not extravagant clothing she wears, by the age difference, by her submissive posture. The dog (man's best friend; most faithful creature) suggests the husband expects faithfulness from his new wife (or -to-be). The picture may document a betrothal (note the date/signature on the rear wall).

The idea of this picture as documenting the new/prospective husband's possessions (does he consider the girl as one of them?) and expectations is rather a mind-blower to me. As a father of daughters I find it offensive, but I also understand that the world often is and was that way.

Tom also interpreted for us "An Allegory of Venus and Cupid," seen here at left. The painting was evidently a "gift" for Francis I of France. Here's my recollection of his interpretation.

Cupid (Eros), son of Aphrodite (Venus), is here fondling his mother's breast and kissing her on the lips -- a kiss she's returning. An act of incest is about to happen, which Oblivion (upper left corner, with eyeless sockets) is trying to cover up. Father Time (upper right, with hourglass on his shoulder) is trying vehemently to foil oblivion -- suggesting that in time, one's sins will find one out.

Cupid's posture is unnatural (as the act of incest would be?) and he's about to step on a bird (a European swallow??); there's a girl on the right side of the painting also with a very unnatural (impossible) posture: she seems to be looking over her left shoulder at us (that's her left hand holding something near Venus's left arm). The girl's right hand holds a scorpion's tail (or something resembling it), and her left foot (near the right foot of the rose-clutching boy) is some sort of animal's paw -- so she's not really a normal human girl but some sort of mixed creature; foot of a wolf?, tail of scorpion, hands and head of a girl.

The old woman(?) in agony, whose head is below Venus's right elbow, may represent syphilis, which according to some accounts eventually killed Francis I.

Putting together syphilis on the left, the scorpion's tail on the right, and Father Time at top, one might think the painting a warning against indiscriminate sex: the danger of disease, the eventual exposure of the deed, and a (delayed) sting. Personally, I suspect that Cupid's unnatural and uncomfortable posture (Venus's too) suggests a great deal of discomfort may accompany the act itself.

Rather a shocking message to send with a gift; I tend to think it rather a futile gesture, but who knows? Maybe it was sent with good intent (Proverbs 24:11; James 5:20). Whatever the motive, the intensity of the painting's message rather shocked me.
We took a break at our hotel then had dinner at Boisdale (of Belgravia). Quite fancy decor (white tablecloths, etc.) and the music is great (live jazz most nights I think). The food was OK -- Dave ordered a mini "haggis" -- Carol and I each tried a bite. I had sausage and mash -- which was not low-sodium. The "Jacobite Menu" is a prix-fixe set -- three courses I think for about 20 pounds. Not bad considering the decor and music.

First days in London

We arrived without incident on United 954 (nonstop SFO→LHR), went through immigration (passport control), picked up our bags, and exited via the line marked "Rien à déclarer" (or it should have been -- I don't remember what it actually said in English - "No declarations" maybe).

We exchanged some money -- quite a spread as I recall: I think we paid something like US$ 1.88 to get UK£ 1, but if we have any £s left over, each will get us $1.49.

Anyway, we took our little trolley (that's what they call baggage carts here) down some ramps then up an elevator to the central bus station by 7:40 -- next bus to London was 8:30am and it was £5 per person; great.

With 50 minutes to go, we visited "Caffe Nero" for snacks and a decaf latte. When our bus (501-London) appeared in the window, we went outside to the pick-up location -- stand#8 or something like this. The staff were unloading baggage from the belly of the bus.

Some of you grammarians may complain about my choice of verb in the preceding sentence. You're American, aren't you? Here's the thing: what pronoun would you use for "the staff" -- would you say "they"? Well yes, because two or more people are being discussed. So if I said "The staff appeared very quickly" then "they were unloading baggage..." the verb would be correct there, wouldn't it? Therefore "The staff were unloading" is fine, right? It's like in the advertisement "Pan Am are now offering direct flights to..." which I read in an English paper some decades ago....
Once the Heathrow baggage was off, they checked our tickets and took our bags. The bus went directly from Heathrow's central bus station to London's Victoria coach (in the US we'd normally say "bus") station -- not to be confused with the "Victoria Station" that usually means the rail or Underground or "tube" station. Once off the bus, we retrieved our bags and walked to the Lime Tree Hotel.

The hotel is just a few minutes' walk away. We arrived before 9:30am, and the fellow at the desk greeted us warmly. No, our room wasn't ready; yes, he could prioritise the cleaning staff's work so that the room would most likely be ready by 10:30. (This wasn't necessary, as it turned out.) And yes, he could suggest some interesting things to do. First, he told us how to get to Buckingham (pronounced “bucking’em”) Palace for the changing of the guard at 11:30, but he also told us about a smaller ceremony at the nearby St James's Palace where we wouldn't have 4,000 people blocking the view. What we didn't realize at the time was the ceremony at Bucking'em would take an hour, vs. 15-20 minutes for the smaller ceremony (viewed from maybe 15 yards away).

Then, as we had tickets for the musical Chicago that afternoon, we asked him how to get to the Cambridge Theatre. He took out his pink highlighter and showed us where to catch the #34 bus, what route it would take and where to get off. Very helpful!

We "popped our bags round the corner," and headed off, eventually finding St James's Palace. We also found an astonishing little plaque commemorating a visit of a legation (delegation?) from the Texas Republic! After watching the ceremony (which involved a 1978 Barry Manilow song) we walked to St James's Park and had lunch at the restaurant, just missing a brief but intense rain shower.

After lunch we headed back to the hotel, got settled in briefly, then had a run-in with the bus ticketing system: exact change required! A mad dash followed, but we got on the bus in time to allow for a little confusion at the far end. But we eventually got to the Cambridge Theatre, and we even got to our seats before they lowered the lights. The musical was "Chicago" -- about which I knew nothing. The acting was superb, but the costumes were a little disconcerting. wikipedia told me it was a satirical account (I had thought it rather cynical before reading that).

There was water on the ground when we emerged from the theatre around 5:30, and we got a light supper at "kopapa". There was a large hanging on the wall; I thought the material and colors looked Hawaiian, but our server called it a "tapa" from New Zealand.

We caught a cab back; our driver was a former investment banker. Quite a job change I'd say. He recommended "Boisdale," which has live jazz most evenings and is within a block or two of our hotel.

Sunday 8/28

From our little map we saw that "St Michael's" was a short walk away from the hotel. Their website gave a good impression, so we attended their 10:30am service. We couldn't see how to get in, but the guest organist's mother (who was visiting) led us round to the entrance. We sat down directly, and the lovely Carol said to the young lady in the next chair, "Hi! We're from California." Jennifer Garner (her real name) said, "Well I'm from North Carolina!"

The congregation was very friendly, and one of the folks, Mary-Lois I think, turns out to know the pastor who officiated at our wedding 25 years ago. Small world indeed.

We enjoyed the hymns, the readings from 1 Timothy 5 and Luke 14, and the sermon -- which was about parents (well, really about our priorities). Jennifer joined us for lunch -- she recommended a pub round the corner, probably the Thomas Cubitt -- we ate outside, but moved inside when the raindrops fell.

We met our tour guide, Tom, that afternoon, and he took us on a walk around the neighborhood. We got practice catching the bus and the Underground, and ate together at Grumbles, not too far from Victoria Station.

This tour includes a transit pass (bus and tube; also discounts on some boat rides) for the week. I'm tempted to buy a weekly pass for our time in Paris too, but we'll see....

Monday 8/29

In the morning, we visited Westminster Abbey -- quite impressive. If you're lucky, you'll do this tour in the morning rather than late afternoon (when "people lose their will to live"). A lot of people are buried under there.

We then took a boat ride, and had a very capable narrator describe several sights around the river. He called out the various bridges, the Tate Gallery, the London Eye, and so on. He mentioned the Bloody Tower (the Tower of London actually has several towers), relating the answer to the question "Which one is the Bloody Tower?" -- i.e., "the one behind the bloody trees, which is why you can't bloody see it."

Upon landing, we ran off to get lunch (we went up the hill to "EAT") then back for a Beefeater tour. These fellows have all served at least 22 years in the British Army with (in their words) no misdeeds detected, iirc. It was disconcerting to think of all the killings that happened in the tower complex.

We made our way back to the hotel for a quick freshen-up, then walked to Victoria (tube) station, transferred at Oxford Circus, and emerged above ground at Marylebone (pronounced "Marley Bone") for fish and chips at "Seashell", a short walk away. Very generous portions (a HUGE piece of cod) were provided, though Carrie's piece was seriously undercooked (we shared a table with her and Jim). They corrected this cheerfully and promptly. Good food.

Friday, September 09, 2011

What a Rosetta Stone Can't Do

My buddy Todd posted this the other day, with this note on facebook:
Imagine what might be possible if we had a Rosetta Stone to help us actually "hear" what others really meant, instead of what they were saying.
I saw the Rosetta Stone last week, at the British Museum. It's got an astonishing story, having been decoded by an Englishman and a Frenchman, the latter having quite a tendency to faint. Not that I blame him; if I were the first person in over 1500 years who could read the inscription on some monuments, I'd faint too.

Remarkable as the rosetta stone is, I'm afraid that it won't do what Todd's posting wants for at least two reasons:

  1. The Rosetta Stone only showed equivalent sentences in different scripts (ancient Egyptian hieroglyphs, demotic, ancient Greek); we need to go to a much higher level.

    To describe what I mean by a higher level, let me first describe some lower levels. In the 1980s, the International Organization for Standardisation (ISO) defined a reference model for computer communications. Lower levels described signaling techniques, like this one, describing an encoding technique at the "physical layer":

    ...a logic 0 is indicated by a 0 to 1 transition at the centre of the bit and a logic 1 is indicated by a 1 to 0 transition at the centre of the bit.
    A higher layer might describe how data are presented -- e.g., is "Ô" represented as 11010100 (iso 8859-1) or 11000011 10010100 (UTF-8) or 00100110 00110000 01111000 01000100 00110100 00111011 (i.e., "&0xD4;"), etc.

    A yet higher layer might specify how semantics are communicated, e.g., if we want a file named "foo" to instead be named "bar", do we say:

    • mv foo bar
    • rename foo,bar
    • os.rename('foo', 'bar')
    As "mv foo bar" is higher than "a 0 to 1 transition at the centre of the bit", so deriving human intentions between individuals is a higher level than translating between "tres heureux de faire votre connaissance" and "delighted to make your acquaintance."
  2. Even if our intentions could be translated, they're in conflict because of The Fall.

    A buyer for example has the intention of paying the lowest possible price for a box of goods, whereas the seller has the intention of getting the highest price. We can translate the intention, but we all knew that anyway.

    What if "Anna" wants a world where we pay teachers more if they have to work harder to educate tougher kids who have less parental support, but "Michelle" wants to pay teachers more when they work in districts with higher property tax revenues? Is it reasonable that a richer district should be able to pay its teachers more? Is it reasonable that among teachers in the same county, teachers with harder jobs should be paid less than those with easier jobs?

    Suppose "Billy" wants a world where their companies can destroy competition by exploiting monopoly power but "Sherm" thinks government should restrict what he calls "anticompetitive" behavior. What do these have in common?

    How about if "Phyllis" wants popular media to affirm family values (e.g., marriage commitments that survive conflict, hardship—even betrayal), but "Jane" wants to show "the world as it is" including the behavior of typical US college students, the high US divorce rate, etc.?

    Besides conflicts like this, how about the observation that we've had decades now of consumers fighting workers and finally winning? Even within one person, the desires/goals are terribly mixed up.

I don't think the answer is to give up and die, but neither do is the answer as simple as clearly communicating our intentions and goals. I'd like to think that if like-minded people will listen to each other in search of common ground (think "marriage counseling"), this could make some things better, but I'm afraid there will never be a "silver bullet."

I'll be happy to be proven wrong!

Wednesday, September 07, 2011

Washed and Waiting by Wesley Hill

It's subtitled, "Reflections on Christian Faithfulness and Homosexuality." (Zondervan, 2010; excerpt here; publisher info here)


  2. The Scriptures commonly used to condemn homosexual behavior are either
    • misinterpreted [they're really about idolatry, lack of hospitality, promiscuity, etc] or
    and in either case irrelevant; -or-
  2. tries to explain away "troublesome" Scriptures, but many Christians can't believe either the "really talking about idolatry..." explanation nor the "bacon and shrimp" one (indeed, as indicates, some gay Christians find such explanations specious).


Do we say, "Pray so that you can be healed from this"? I think that's a wonderful idea, which also applies to our brothers and sisters with other persistent issues (those paralyzed in one or more limbs, those dying from cancer or AIDS, brothers and sisters who are blind, who can't sleep nights, who struggle with chronic depression, etc.) -- but what happens when, as in the vast majority of cases, healing doesn't come?

We should not say they lack faith [etc] -- we've no right to say that, and besides we could be 100% wrong anyway. Eutychus was dead and therefore had no faith at all when Paul raised him to life (Acts 20:9-10) -- ditto Jairus's daughter (Mark 5:35). And if the problem is sin, well, everybody's got sin, even those who did get healed or raised from the dead.

No, The Remaining Problem is, when all that other stuff has been tried, how do our brothers and sisters live when they

  • have homosexual urges;
  • feel no attraction to members of the opposite sex;
  • earnestly desire to trust, obey, honor, serve Christ; and
  • yearn for love and intimacy and acceptance just like the rest of us?


[T]his book is neither about how to live faithfully as a practicing homosexual person nor about how to live faithfully as a fully healed or former homosexual man or woman. J. I. Packer, commenting on Paul’s hopeful word for sexual sinners in 1 Corinthians 6:9-11, writes, “With some of the Corinthian Christians, Paul was celebrating the moral empowering of the Holy Spirit in heterosexual terms; with others of the Corinthians, today’s homosexuals are called to prove, live out, and celebrate the moral empowering of the Holy Spirit in homosexual terms”† This book is about what it means to do that—how, practically, a non-practicing but still-desiring homosexual can “prove, live out, and celebrate” the grace of Christ and the power of the Holy Spirit in homosexual terms.

† J. I. Packer, “Why I Walked,” Christianity Today 47 (January 20, 2003) 46.

Washed and Waiting p.16

Heard last week, on a boat ride on the Thames

As we approached the Tower of London area, the waterman (who claimed not to be a guide, but he was very good) described some historical events that occurred in the "Bloody Tower."

"People ask, where is the Bloody Tower? Well, it's behind the bloody trees, which is why you can't bloody see anything!" This guy was pretty funny -- every bit as funny as he thought he was :)