February 5th, 2017

Burger King Is Out Of Burgers

Just over 20 years ago, I arrived in Berkeley California for college. 1996 was an election year, though not remotely as contentious at the presidential level as the most recent one. At the time, talk of red state/blue state would have brought to mind
Sandra Boynton not Clinton Dole. However at the state level, proposition 209 (repealing affirmative action) sparked a bitter fight and it’s passage (55% – 45%) spawned mass demonstrations at and around UC Berkeley.

All the recent chatter about the 1960s Berkeley Free Speech Movement living on or dying last week during the MILO riots reminded me that while not an overtly political person, I attended a rally denouncing prop 209 mainly out of curiosity…perhaps a rite of passage as a new Bezerklean. IIRC at the time I believed in the importance of diversity (and still do) but not strongly enough to make a sign or paint my face. Here are a few photos:

Prop 209 Protest Sproul Plaza UC Berkeley 1996-11-06

Prop 209 Protest March Down Bancroft Way Berkeley 1996-11-06

Circumstances dictated the laughable quality of the images (maybe someday I’ll look for the prints and re-scan):

  1. The camera used was a cheap Vivitar point-and-shoot.
  2. There were only a couple of flat bed scanners on campus available to the general student population and they required signing up in advance for 1 of only a few 15 minute time-slots per week.
  3. I did not get into on-campus housing i.e. no ethernet, and the images were originally served over the web from my personal computer via a 14.4kbps dial-up connection.

It’s not quite, “back in my day I used punch cards” but the university provided two forms of internet connectivity to off-campus students; the Warhol pool of 32 19.2kbps lines that automatically disconnected you after 15 minutes, and the main home Internet Protocol (HIP) pool of 256 14.4kbps lines that would allow one to stay connected indefinitely as long as it though you were “active” (setting the Eudora e-mail program to check for new mail every 15 minutes seemed to do the trick). They even had a convenient subdomain registration so anytime my web server was running it could be accessed at http://figment.hip.berkeley.edu (someday I’ll mirror the full contents on madpickles.org).

Unlike the potential repeal of the America Cares Act i.e. Obamacare, I don’t remember discussions regarding any replacement for affirmative action. After its passage the makeup of the student body predictably, drastically changed. I didn’t know it at the time, but looking back at a geographic map of yes/no votes, counties the San Francisco Bay Area and Los Angeles voted no and all others voted yes. Carter and Mondale (Democrats) also both carried San Francisco and Alameda counties in the 1980 and 1984 elections against former governor Reagan (Republican). Perhaps more than just the 3rd wave of punk rock drew me to Berkeley, I suppose most of my beliefs at that time (and still now) lean towards what would be deemed modern US liberalism with touches of libertarianism thrown in.

I don’t remember my level of agitation after the the 2000 election; if I had to guess it would have been mild considering I was a new grad at a dot-com company in the midst of the bubble bursting and didn’t have much of a clue (nor a care) as to how bad the new administration might be. A few years later in 2003 I went out to document a protest (war in Iraq), this time making a short video with some tongue in cheek accompaniment. Again, this happened mainly out of curiosity as while certainly not pro-war I don’t remember being furious about the war. In 2008 I remember attending a meetup of people looking to help with the Obama campaign, but the focus seemed to be on affecting Nevada which was more effort than I was willing to put in. The last political related thing I remember doing was writing an analysis of prop 8 data (legalize gay marriage) after the 2008 election.

After much agonizing about how big of a disaster it might be to try and take our toddler to the Women’s March Oakland on January 21st 2017, my wife and I got on our bikes with our daughter and headed to the North Berkeley BART station around 9:30a, figuring we’d be more likely get on a train at a stop further from Oakland. As we got closer, people walked past us heading away from the station. Once the station came into view we saw a line of people around the block waiting to get in. Time being of the essence, I didn’t even stop to take a photo, just turned around and headed back home as we knew there was an AC Transit 88 bus scheduled to arrive by our house soon that would get us within half a mile of the march’s meeting point. We got on a bus around 10:10a and it slowly filled up:

Women's March Oakland 2017-01-21

We made it to the mass of people, stood around with them for a while and ran into a couple of people we knew.

Women's March Oakland 2017-01-21

Women's March Oakland 2017-01-21

After about 30 minutes our daughter couldn’t take the situation anymore, there was no marching, and one of her ears was hurting (not from noise, but from an oncoming illness). So shortly after 11:30a we made our way out of the crowd and headed towards the 12th st Oakland BART station. We stopped at a Walgreens to get some children’s Tylenol and then to a Burger King as the idea of a hamburger appealed to her (and I had brought coupons, of course). There were a few people in front of us and as we got closer to ordering one of the workers announced they were out of burgers, but still had fish and chicken. Burger King…out of…burgers. Welcome to the new administration.

January 13th, 2017

Hi Ho! Cherry-O

As our daughter approaches 3 years old she has begun to play some simple board games, one of which is Hi Ho! Cherry-O. While playing it recently my wife lamented that the game was taking forever to end. The analysis in the Wikipedia page is for a single player, but the majority of the time 2-4 players are present. It wasn’t obvious to me how to easily extend the Markov chain for a multi-player game. Does one add a 3rd dimension with 1 slice of the transition matrix per player? So instead I wrote a little Python program to play lots of games and compute the mean and standard deviation (it’s at the end of the post).

I then ran 10,000 simulations each for games of 2-4 players with 10 fruits per tree:

$ for i in 2 3 4; do ./hi-ho-cherry-o.py $i 10 10000; done
players,spins,stddev
2,18.619100,12.388267
3,21.197900,12.418629
4,24.335700,12.889896

It’s interesting that the minimum number of spins necessary to win with a single player is 3 and the number of additional spins necessary for a game to end when adding a player is ~3. Now we know 90% of the games we play with our daughter will take fewer than 40 spins, which is comforting. Though it’s scary to think that 1% of the time a game will take 70 or more!

#!/usr/bin/python

import random
import sys
from math import sqrt


def pick(num_fruit, max_num_fruit, player, players):
  """Execute a turn by picking fruit; modifies the game state.

  Args:
    num_fruit: If positive, it's as if the player is picking
      fruit from their tree and placing it in their basket. If
      negative, it's as if the player is putting fruit back
      into their tree from their basket.
    max_num_fruit: The maximum amount of fruit in a tree.
    player: The index of the player who's picking.
    players: The list of players in the game.

  Returns: The amount of fruit left in the player's tree.
  """
  new_num_fruit = players[player] - num_fruit

  # Can't pick more fruit than exist in the tree.
  new_num_fruit = max(new_num_fruit, 0)

  # Can't put back more fruit than fits in the tree.
  new_num_fruit = min(new_num_fruit, max_num_fruit)

  players[player] = new_num_fruit
  return new_num_fruit


def spin(max_num_fruit):
  """Execute a spin of the wheel.

  There are 7 possibilities, each with equal probability:
    Pick 1-4 fruit from a tree and place in a basket.
    Put 2 fruit back in the tree (landed on bird or dog).
    Put all fruit back in the tree (broken basket).

  Args:
    max_num_fruit: The maximum amount of fruit in a tree.

  Returns: Number of fruit to move. Positive indicates pick
    from the tree, negative indicates put back into the tree.
  """
  temp = random.randint(1, 7)
  if temp < 5:
    return temp
  elif temp < 7:
    return -2
  else:
    return max_num_fruit * -1


def play(players, max_num_fruit):
  """Plays a complete game.

  Args:
    players: A list of players taking part in the game.
    max_num_fruit: The maximum amount of fruit in a tree.

  Returns: The number of spins needed to complete the game.
  """
  num_spins = 0
  keep_playing = True
  num_players = len(players)
  while keep_playing:
    for i in xrange(num_players):
      num_spins += 1
      num_fruit_to_pick = spin(max_num_fruit)
      new_num_fruit = pick(
          num_fruit_to_pick, max_num_fruit, i, players)
      if new_num_fruit == 0:
        keep_playing = False
        break
  return num_spins


def mean(data):
  """Compute the mean of data."""
  n = len(data)
  return sum(data) / float(n)


def stddev(data):
  """Compute the standard deviation of data."""
  c = mean(data)
  ssd = sum((x - c) ** 2 for x in data)
  v = ssd / (len(data) - 1)
  return sqrt(v)


def trials(num_players, num_fruit, num_games):
  """Play games and compute basic statistics.
  
  Args:
    num_players: The number of players playing the game.
    num_fruit: The amount of fruit in each players tree.
    num_games: The number of games to play.

  Returns: Mean number and standard deviation of spins
    needed to finish a game.
  """
  spins_per_game = []
  while num_games > 0:
    players = [num_fruit] * num_players
    spins_per_game.append(play(players, num_fruit))
    num_games -= 1
  return (mean(spins_per_game), stddev(spins_per_game))


if __name__ == '__main__':
  num_players, num_fruit, num_games = map(int, sys.argv[1:4])
  mean_spins, stddev_spins = trials(
      num_players, num_fruit, num_games)
  print '%d,%f,%f' % (num_players, mean_spins, stddev_spins)

January 7th, 2017

At The Library

A couple of weeks ago my wife mentioned an upcoming show at 924 Gilman St, a well known music venue in Berkeley California. The lineup for January 7 2017 was curious: The Mr. T Experience, Pansy Division, The Smugglers, Squirtgun, Brent’s TV, The Potatomen and Kepi Ghoulie. I thought she was joking, this was 2016 not 1996 right? We have a dog and a toddler, we’re not in college. The only thing slightly out of place was seeing Kepi Ghoulie instead of the Groovie Ghoulies.

It turns out as part of the 30th anniversary of 924 Gilman St there was a festival of sorts called The Lookouting. Of course my first thought was, “hmm it starts at 5p, we don’t start our daughter’s bedtime routine until between 6:30p and 7p, if we got her some hearing protection she could at least see Kepi.” After all Gilman is “all ages”. And I’m so out of it, that the tickets had been sold out for months ($75 4 day pass) though there would be some $20 day of tickets available at the door (what happened to $2 membership $5 show?). Clearly we did not gamble on those tickets as it sounded like a recipe for disaster, especially with the predicted Atmospheric River tonight. Silly as it may be, Gilman was one of the reasons I wanted to go across the country for college in Berkeley; I’d seen all of the bands except for Brent’s TV at least once ~20 years ago, maybe it’s better this way.

Instead, this morning while putting puzzles together with our daughter, I played her a couple of records: The Smugglers’ Selling The Sizzle and Pansy Division’s Deflowered. And we went to the first 20 minutes of The Lookout! Bookout! Bash (had to leave early to start naptime) at the North Berkeley Public Library.

During that brief time, Larry Livermore spoke about how he stumbled into co-founding Lookout! Records, his roots were in Detroit Michigan, the first two shows he went to were The Supremes and MC5, he was destined to be a factory rat unless he left. He read an excerpt from the end of his recent book How To Ruin A Record Label encouraging the youth of today and the future to follow their heart etc. don’t listen to people who tell them how great the past was and they missed out etc. (fitting since this festival was organized by a 19 year old guy). I also learned the supervising librarian, Jake, of the Berkeley Library’s North Branch is probably about the same age as me. Here’s a photo of Jake introducing Larry.

The Lookout! Bookout!

While I was showing our daughter the Pansy Division record this morning I noticed part of the liner notes had a directory of lesbian/bisexual/gay youth groups in the USA; names and numbers, no web or email addresses since it was printed in 1994. There were only 38 states (and D.C.) listed (Delaware, Idaho, Kansas, Louisiana, Mississippi, Montana, Nevada, New Hampshire, North Dakota, Oklahoma, South Dakota and Wyoming were missing). It’s easy to forget how much harder it was to access information 20+ years ago and also how much has changed (and still needs to).

Our daughter is very much into music and I’ve played the piano, acoustic guitar, recorder etc. with/for her but haven’t yet played the electric guitar. I haven’t even shown it to her, though she has seen the black case that holds it and asks me about it every time. “Someday” I tell her.

Guitar Front

Guitar Back

She’s heard some of the music from the band I was in during college (glg20*s) but I don’t think she associates it with me yet. I wonder what music she’ll be listening to 10+ years from now and what she’ll think of it 20 years later. Anyway, it’s raining, The Smugglers are probably getting ready to take the stage and I need to make some bread dough before going to bed.

Oh and who actually read to the bottom and caught the post title reference to a song from the most famous Lookout! Records artist?