In the Danish movie Broen (Om Fordomme) two groups who can not stand each other have to collaborate in order to build a bridge. The movie is visible online.

# Fun and trivia

## Thank you Scott!

I just read this blog post by Scott Hanselman (I'm a phony. Are you?), and it was a bit of a group therapy moment. It's nice to know that you're not alone in something!

## Data-parallelism vs Task-parallism

Adapted from an article I found by Googlin'. There are many ways to define this, but simply put:

- Task parallelism is the simultaneous execution on multiple cores of many different functions across the same or different datasets.
- Data parallelism (aka SIMD) is the simultaneous execution on multiple cores of the same function across the elements of a dataset.

## Idea: Automatic theft prevention in public spaces

## Background

When I'm at the library, I'd like to be able to go to the toilet, without collecting all my stuff from the table. Part of the solution is to have a camera installed that films all the tables, but assuming we can hire someone to look at the camera-feeds, that person might not notice that my laptop was stolen. Of course they could be notified, and the culprit identified from the tapes, but what if the culprit is "disguised? The only solution is to capture the thief before he/she leaves the building. For that to work, the security personel must be notified of the theft exactly when it happens!

## Formal problem definition

**Problem**:

- Person
*A*, me, leaves an artifact (computer) at a table in a public space and goes somewhere (restroom). - Person
*B*drops by table and steals computer - By the time
*A*is back,*B*has left the building - Because
*B*was wearing sunglasses and a blue beard,*B*can not be identified from the surveillance tape - Person
*A*is sad

**Solution requirement**: Person *B* should be apprehended before he/she leaves the building, namely before person *A* is back and notices the theft. This means that an algorithm must detect the theft as it happens!

**Solution approach**:

- Camera feed is routed to bank of algorithms
- Algorithm
*X*detects people and their location, and assigns unique IDs to different people - Algorithm
*Y*detects artifacts, and associates each artifact with the ID of its owner - Algorithm
*Z*detects the situations: 1) An owner has lefts his/her artifact 2) A person which is not the owner is very near an artifact. If both 1 and 2 hold for a given artifact, an event is fired

The events from algorithm *Z* are handed to the security staff, who can investigate visually whether a theft is taking place.

## How does the number of leafs on a tree grow with the height of the tree?

As a was lying on my back in the University park to day, resting a bit between reading papers (more on that later), I looked up at a pine tree and asked myself a very computer sciencey question. How does the number of needles *L* on the tree grow, as the tree grows taller? If the height of the tree is *h*, what is the size of L?

## Exponential?

I initially thought that surely this must be exponential, after all just think of a binary tree: The number of leaf nodes in a balanced binary tree of height *h* is . So maybe:

## Back on my regimen

Sometimes my head hurts from all the papers I have to read. All the lines of software I have to code. All the pages of high quality scientific output I have to write. All the people I have to impress.

At those times I'm a little whiner, a weak quiter, feel so sorry for myself, and blame it all on something stupid like: I must know what going on on Facebook, or in my GMail inbox. I think I need a cup of coffee, a walk, to go to the rest room, to air out, to take of my shirt, put my feet up, not enough blood in the head, or whatever. Whatever keeps me from working.

At those times I'll watch this video, just once, take a few deep breaths, exhale slowly, and then get to m*therf*cking work on that m*therf*cking Ph.D.

## Simulating the Golden Balls game show

In this eposide of Golden Balls, an inspired event takes place:

I retold the event at DIKU APL lunch (nice to have a job where game theory is a valid conversation topic), and we had a conversation about it. At first I thought this was prisoners dilemma, but it was quickly revealed that it is a different game. What is cool about it is, that Nick basically forces Abraham to pick split. I don't think the same approach would work again though. The person in Abrahams position might be tempted to try a counter-steal. The person in Nicks position might be tempted to actually steal the money, which would be a dirty thing to do, but not completely unlikely.

## Simple programs for simple turing machines

I've always wanted to understand Turing Machines better. I believe that the best understanding comes from the intuition developed by solving puzzles.

So here, I give myself some challenges. Solve simple problems by writing programs for a simple Turing Machine, using this simulator: http://ironphoenix.org/tril/tm/

## Creating visually random images

How complicated does a mathematical function, pseudorandom(x), have to be to create something that seems random, and how do you check whether it seems random? Looking at a long list of numbers is not a good way, because our ability to look at long lists of numbers is very limited. Our ability to look at images is much better.

So, to inspect whether a list of numbers is seemingly random, a fun way is to create an image using the numbers for each pixel, and simply look at it.

Given a number *x* in the series {0, 1, 2, ..., huge n}, let's create an image that plots a random function that's implemented using the sin() function and a 3rd degree polynomial function:

color_range = 2**8 a = -3.0 b = -5.0 c = 13.0 def pseudo_randombit(x): color255 = math.sin(a*x**3 + b*x**2 + c*x) % color_range # make black/white bit = color255 / 127 return bit |

## Never forget your password again, version 1

The recommended practice is to have different passwords on different websites. But how do you remember all those passwords without storing them somewhere? The tricks is, you don't. You remember a single strong password, and use a mechanism to generate other passwords from that.

This is not for securing government secrets, but should work for your twitter account.

## Create a *single* very strong password

There are many ways to do this: https://xkcd.com/936/