New York New York [jatp]

Posted in pictures, Travel with tags , , , , , , , , , on April 25, 2022 by xi'an

a year ago, a world away

Posted in Statistics with tags , , , , , , , , , , , , on February 24, 2021 by xi'an

riddle on a circle

Posted in Books, Kids, R, Travel with tags , , , , , , , on December 22, 2019 by xi'an

The Riddler’s riddle this week provides another opportunity to resort to brute-force simulated annealing!

Given a Markov chain defined on the torus {1,2,…,100} with only moves a drift to the right (modulo 100) and a uniformely random jump, find the optimal transition matrix to reach 42 in a minimum (average) number of moves.

Which I coded in my plane to Seattle, under the assumption that there is nothing to do when the chain is already in 42. And the reasoning that there is not gain (on average) in keeping the choice between right shift and random jump random.

```dure=min(c(41:0,99:42),50)
temp=.01
for (t in 1:1e6){
i=sample((1:100)[-42],1)
dura=1+mean(dure)
if (temp*log(runif(1))<dure[i]-dura) dure[i]=dura
if(temp*log(runif(1))<dure[i]-(dura<-1+dure[i*(i<100)+1]))
dure[i]=dura
temp=temp/(1+.1e-4*(runif(1)>.99))}
```

In all instances, the solution is to move at random for any position but those between 29 and 41, for an average 13.64286 number of steps to reach 42. (For values outside the range 29-42.)

not for the faint-hearted!

Posted in Books, Kids, pictures, Travel with tags , , , , , on March 21, 2016 by xi'an

While flying over to Boston yesterday, I had a look at The Martian on my seat screen but this proved too much of a hardship: after watching the early self-surgery scene, which is definitely realistic and somewhat gory, I just fainted. Really and truly fainted, which means I came back to my senses being dragged on the plane floor by two Air France flight attendants!, hearing and seeing them but being unable to react for a dozen seconds. There was a doctor in the plane who checked upon me while I was coming back to my senses and his final advice was to stop watching this “kind of movies”, as if I knew I was going to faint from watching a  PG-13 movie… (It actually happened to me once earlier, in that I came close to fainting from watching The Last Temptation of Christ in Ithaca in the 80’s, while protesters were demonstrating outside the cinema.) Quite an embarrassment, frankly! And I did not even watch the rest of the movie…

flight to Berlin

Posted in Kids, pictures, Travel with tags , , , , , on December 11, 2012 by xi'an

Tough ride to Berlin, although nothing terrible in the end! First, the plane departure was quite delayed in Paris by snow falling over Berlin, meaning the runways had to be cleaned. Second, loud kids in the seat behind me with a fairly ineffective if equally loud father repeating he was going to get angry if they did not stop…and eventually switching seats with his wife who surprise surprise managed much much better! Third, more delays in Berlin as the runways were only partly cleared and all gates were busy and the bags took more than one hour to come…

Here is a sample of the conversation in the plane (French fluency clearly superfluous!, but I could not transcribe Henri’s part, as it was half in French, halbst im Deutsch…):

Henri, ce n’est pas gentil, tu arrêtes de donner des coups de pied à Joséphine!

Attaches-toi, Henri, sinon Papa va se fâcher…

Donne-lui des serviettes pour essuyer, chacun une. Fais-le bien…

Encore un gâteau, Henri ? Je vais demander au stewart.. Maman dit non, plus de gâteau.

Tu lui as fait mal, Henri, ramasse ton biberon. Et le chapeau du biberon, il est où?

Henri, tu te rattaches et tu te détaches plus, sinon Papa se met en colère.