Archive for British Columbia

going on a bear [and a whale] hunt

Posted in Mountains, pictures, Travel with tags , , , , , , , , , , , , , , on August 27, 2018 by xi'an


Among many and diverse outdoor activities during our vacations on Vancouver Island, a rather unique trip was to go kayaking near Tofino to try to watch black bears. In a group of three sea kayaks, at dusk, with a fantastic guide. Bears foraging for crabs on the shore at low tide are not unusual but, as it happened, we were quite lucky to spot five different bears over the two hours we paddle along the fjord, including a big one standing on its back legs to catch berries. From a few meters away, this was an incredible sight! [About the title: We’re going on a bear hunt is a classic of children books.]
We were less lucky when whaling out at sea, only spotting a blow on the trip, even though we spotted many seals and a few sea otters. The most exhilarating wildlife experience of the Van trip was however swimming with seals on the northern coast of the island, where on several days one or two seals came to check on me while I was swimming in the ocean in the early morning. (Managing to avoid cold shock and hypothermia by only staying less than 20 minutes in the 17⁰ water.)

impressions soleil couchant [jatp]

Posted in Mountains, pictures, Running, Travel with tags , , , , , , , , , , , , , , , , , on August 25, 2018 by xi'an

the ocean at the end of the lane [book review]

Posted in Books, Kids, pictures, Travel with tags , , , , , , , , , , , , , on August 24, 2018 by xi'an

While in Vancouver, waiting for a friend at the Waterfront ferry station, we entered the Simon Fraser University bookshop across the street. This was a most disconcerting experience in that the bookstore contained essentially no book! Just a tiny bookshelf with local authors and another one with a medley of genres. Including Gaiman’s The Ocean at the End of the Lane. Which I bought against my better judgement as I had tried to read American Dogs years ago and failed. (But liked very much Neverwhere, again a chance occurrence on a bookstore shelf!) As I started reading the book on the ferry to Vancouver Island, hence on the Pacific Ocean!, I first thought this was about the author’s childhood in rural Sussex, with no other friends than his books, finding some ways to relate to the story of a modest household in the early 60’s, only to be interrupted by three whales swimming along the ferry route. The cheek of them! When I picked up the short novel later in Tofino (with Tonkin Beach above), reality started to unravel (in the book!) and horror to creep in (!). Without getting into spoilers, the  other world or old country starts appearing to the narrator, a seven year old, with about everything taking another and sinister meaning. And no-one else in his household paying any attention to his warnings. What I really enjoy in the book is the sheer ambiguity of the tale, where one cannot be sure this is pure fantasy made up by a lonely seven year old who strongly dislikes a new nanny and is impacted by his parents’ relationship, or an opening into that alternate reality and its dangers that he and only he is able to enter. The book never concludes and this is a strength of the story. Which works for both adult and children readers. It also reminded me of Miyazaki’s Chihiro Spirited Away (千と千尋の神隠し), in that the supernatural beings here and there are neither evil nor good but simply utterly alien. (This fantastic² movie is considered by my daughter as the most traumatic one she ever saw as a child!) Concluding about the book, this was a very good read, somewhat on the light side although full of forking paths.

Comox [K’òmoks] snapshot [jatp]

Posted in Statistics with tags , , , , , , , on August 23, 2018 by xi'an

beach walk in the fog [jatp]

Posted in pictures, Running, Travel with tags , , , , , , , , , , , on August 22, 2018 by xi'an

riddles on a line

Posted in Books, Kids, R with tags , , , , , , , , , on August 22, 2018 by xi'an

In the Riddler of August 18, two riddles connected with the integer set Ð={2,3,…,10}:

  1. Given a permutation of Ð, what is the probability that the most likely variation (up or down) occurs at each term?
  2. Given three players choosing three different integers in Ð sequentially, and rewards in Ð allocated to the closest of the three players (with splits in case of equal distance), what is the reward for each given an optimal strategy?

For the first question, a simple code returns 0.17…

winofail<-function(permz){ 
  if (length(permz)>1){
    lenoperm=length(permz[-1])/2
    win=(permz[1]<permz[2])*(sum(permz[-1]>permz[1])>lenoperm)+
     (permz[1]>permz[2])*(sum(permz[-1]<permz[1])>lenoperm)+
      (runif(1)<.5)*(sum(permz[-1]>permz[1])==lenoperm)
    win=win&&winofail(permz[-1])
  }else win=TRUE
  return(win)}

(but the analytic solution exhibits a cool Pascal triangular relation!) and for the second question, a quick recursion or dynamic programming produces 20, 19, 15 as the rewards (and 5, 9, 8 as the locations)

gainz<-function(seqz){
  difz=t(abs(outer(2:10,seqz,"-")))
  cloz=apply(difz,2,rank)
  return(apply(rbind(2:10,2:10,2:10)*
   ((cloz==1)+.5*(cloz==1.5)),1,sum))}

timeline<-function(prev){ 
  if (length(prev)==0){ 
   sol=timeline(10);bez=gainz(sol)[1] 
   for (i in 2:9){ 
    bol=timeline(i);comp=gainz(bol)[1] 
    if (comp>bez){
        bez=comp;sol=bol}}}
  if (length(prev)==1){
    bez=-10
    for (i in (2:10)[-(prev-1)]){
      bol=timeline(c(prev,i))
      comp=gainz(bol)[2]
      if (comp>bez){
        bez=comp;sol=bol}}}
  if (length(prev)==2){
    bez=-10
    for (i in (2:10)[-(prev-1)]){
      bol=c(prev,i)
      comp=gainz(bol)[3]
      if (comp>bez){
        bez=comp;sol=bol}}}
  return(sol)}

After reading the solution on the Riddler, I realised I had misunderstood the line as starting at 2 when it was actually starting from 1. Correcting for this leads to the same 5, 9, 8 locations of picks, with rewards of 21, 19, 15.

Tofino from the air [jatp]

Posted in Statistics with tags , , , , , , , , , , on August 21, 2018 by xi'an