Archive for sailing

blind monty hall

Posted in R, Statistics with tags , , , , , , , , on January 10, 2022 by xi'an

As I was waiting for my boat on a French Guiana beach last week, I thought back about a recent riddle from The Riddler where an item does a random walk over a sequence of N integers. Behind doors. The player opens a door at the same rate as the item, door that closes immediately after. What is the fastest strategy to catch the item? With a small value of N, it seemed that repeating the same door twice and moving from 1 to N and backward was eventually uncovering the item.

Here is the cRude code I later wrote to check whether or not this was working:

  p=1+t%%N #starting item position
  h=v=s=m=1 #h=door, v=attempt number, s=direction, m=repeat number
  while(h-p){
    p=ifelse(p==1,2, #no choice
             ifelse(p==N,N-1, #no choice
                    ifelse(p==h-1,p-1, #avoid door
                           ifelse(p==h+1,p+1, #avoid door
                                  p+sample(c(-1,1),1))))) #random
    m=m+1
    if(m>2){
      h=h+s;m=1
      if(h>N){
        h=N-1;s=-1}
      if(!h){
        s=1;h=2}
      }
    v=v+1

and the outcome for N=100 was a maximum equal to 198. The optimal strategy leads to 196 as repeating the extreme doors is not useful.

best unbiased estimator of θ² for a Poisson model

Posted in Books, Kids, pictures, Statistics, Travel, University life with tags , , , , , , , , , , , , on May 23, 2018 by xi'an

A mostly traditional question on X validated about the “best” [minimum variance] unbiased estimator of θ² from a Poisson P(θ) sample leads to the Rao-Blackwell solution

\mathbb{E}[X_1X_2|\underbrace{\sum_{i=1}^n X_i}_S=s] = -\frac{s}{n^2}+\frac{s^2}{n^2}=\frac{s(s-1)}{n^2}

and a similar estimator could be constructed for θ³, θ⁴, … With the interesting limitation that this procedure stops at the power equal to the number of observations (minus one?). But,  since the expectation of a power of the sufficient statistics S [with distribution P(nθ)] is a polynomial in θ, there is de facto no limitation. More interestingly, there is no unbiased estimator of negative powers of θ in this context, while this neat comparison on Wikipedia (borrowed from the great book of counter-examples by Romano and Siegel, 1986, selling for a mere $180 on amazon!) shows why looking for an unbiased estimator of exp(-2θ) is particularly foolish: the only solution is (-1) to the power S [for a single observation]. (There is however a first way to circumvent the difficulty if having access to an arbitrary number of generations from the Poisson, since the Forsythe – von Neuman algorithm allows for an unbiased estimation of exp(-F(x)). And, as a second way, as remarked by Juho Kokkala below, a sample of at least two Poisson observations leads to a more coherent best unbiased estimator.)

Sailing the Exumas

Posted in Kids, Mountains, pictures, Travel with tags , , , , , , , on September 4, 2011 by xi'an

A few weeks ago, taking advantage from being in Florida, the four of us sailed the Exumas islands in the Bahamas with Sylvia Richardson’s family (Sylvia, Jessie, and Alex) on a charter catamaran, Stray Cat, piloted by Captain Mark Pomerenke. Although “sea, sun, and sail” is not in my top ten list of outdoor activities, I enjoyed it very much, along with all members of the trip! Here at last is the shiplog of our week in the Exumas, mostly written by Sylvia (with a few additions of mine for the ‘Og). Continue reading

Life on a boat

Posted in Kids, pictures, Travel with tags , , , , on August 15, 2011 by xi'an

Spending one week on a sailboat as we just did in the Bahamas is an interesting experience! The boat, Starycat III, was a catamaran of a respectable size, with five cabins, and well-equipped with several showers, air conditioning, showers, a freezer and even a washing machine!, but it remains nonetheless a confined space with very little privacy and no way of getting away either from the sea or the clammy heat from the tropics (the air conditioning unit is a major fuel consumer). I ended up sleeping on the deck most of the nights, trying to catch whatever breeze was available. although this made for particularly short nights and glorious sunrises! Getting used to the constant rocking of the boat was not a problem (it is actually funny to have to get reacquainted to land!) but the unpleasant issue of uncleanliness is… Taking a swim only alleviated the problem for a short while, especially because we had to save water and thus limit showers to a minimum. This was another interesting part of the trip, namely to be fully aware of our consumption of gas, electricity, and water. The boat was equipped with solar panels, a water generator, and ten batteries, but having eight people working on those resources was too much for the energy thus produced and we had to stop twice to refuel for water as well as gas, and dump our garbage bags. (Next to luxurious behemoths carrying a single family with an army of staff members, as well as a pair of jetskis…) We were not particularly lucky with the wind, which was mostly blowing the wrong way, so had to use the engine quite a lot, and did not get any luck with our fishing, since the only fish that came near our line cut it in one bite!

Cooking was surprisingly easy as the boat carried two propane barbecues that we used almost every night, discovering “Straycat potatoes”, a recipe made of potatoes chunks cooked with onions and peppers and a lot of seasoning in a sheet of aluminum foil. (The fact that we used sweet potatoes made it even better!) Although we could only be at most two in the kitchen and cleaning (again!) was never entirely successful.

%d bloggers like this: