Saturday, March 5, 2016

The return of the Los Alamos Memo 10742 -

Modern rendering of the original 1947 Memo 10742

The mathematician prankster


Can you imagine yourself receiving this memo in your inbox in Washington in 1947? There's a certain artistic je ne sais quoi in this memo...

This prank was made by J Carson Mark and Stan Ulam.  A&S was Administration and Services.

And Ulam, well known for working on the Manhattan project, also worked on really interesting things in mathematics. Specifically, a collaboration with Nicholas Constantine Metropolis and John Von Neumann. You might know this as the Monte Carlo method (so named due to Ulam's uncle always asking for money to go and gamble in a Monte Carlo casino...). Some people have learned about a specific Monte Carlo simulation (the first) known as Buffon's needle.

Copying the prankster

When I stumbled upon this many years ago, I decided that it would make a fantastic programming challenge for a workshop and/or class. I first tried it in a Java class, but people didn't get quite into it. Many years later I redid it as part of a weekly Python class I was teaching at a previous employer.

The document is the output of a Python script. In order to make the memo look like it came from the era, I photocopied it. It still didn't look quite right, so I then scanned that into Gimp, bumped the Red and Blue in the color balance tool to give it that stencil / mimeograph / ditto look.


Your assignment


Here is what I asked the students:

"Replicate either:
a) the whole memo
or
b) the list of numbers 
Whichever assignment you choose, the numbers must be generated programmatically."

That was basically it. So, go ahead and try it. In Python. Or in R, or whatever you fancy and post a solution as a comment.

We will come back in some days (so everybody gets a chance to try it) and present some possible methods of doing this. Oh, and why the title of "the return of the Los Alamos Memo"? Well, I noticed I had blogged about it before some years back, but never detailed it...

Learning more on Stan Ulam


See the wikipedia entry and also:

LOS ALAMOS SCIENCE NO. 15, 1987



[EDIT: Part 2 is at: los-alamos-10742-making-of.html]

Francois Dion
@f_dion

6 comments:

Unknown said...

Why is 12 (twelve) at the beginning? What am I missing?

Unknown said...

Why is 12 (twelve) at the beginning? What am I missing?

Unknown said...

Maybe 'dozen'?

Francois Dion said...

Yes, Carson later stated that they used "a dozen" for 12, instead of twelve, and many people got confused by that.

And yes, this is always brought up in a workshop or class...

Edward Carney said...

Cute little item. Turns out there's a Python module that converts integers to words. It's called, naturally enough, num2words.

Using this module the code is pretty straightforward. I used a list of the line_breaks to make it look similar:

import num2words as n2w
key_set = []
[key_set.append(n2w.num2words(i)) for i in list(range(101))]
key_set[12] = 'dozen'
key_set[100] = 'one hundred'
numset_dict = dict(zip(key_set,list(range(101))))
line_breaks = [14, 30, 46, 62, 78, 94]
for i, k in enumerate(yvals):
    print('{} '.format(k[1]),end='')
    if i in line_breaks:
        print('\n')

12 8 18 80 88 85 84 89 81 87 86 83 82 11 15

50 58 55 54 59 51 57 56 53 52 5 40 48 45 44 49

41 47 46 43 42 4 14 9 19 90 98 95 94 99 91 97

96 93 92 1 100 7 17 70 78 75 74 79 71 77 76 73

72 6 16 60 68 65 64 69 61 67 66 63 62 10 13 30

38 35 34 39 31 37 36 33 32 3 20 28 25 24 29 21

27 26 23 22 2 0



Turns out your version of the memo is missing '10' (between 62 and 13), unless the boys at LANL were having a joke about that as well.

Francois Dion said...

Edward, yep, the missing 10 is a requirement. As to why, they simply forgot it.

Check out the link I posted at the bottom of the blog, it goes into that level of detail.

I'm still giving a few days before I do a follow up article, a few readers have told me they were working through their own solutions.