Skip to content
July 8, 2012 / steve8

Hello world!

Welcome to WordPress.com! This is your very first post. Click the Edit link to modify or delete it, or start a new post. If you like, use this post to tell readers why you started this blog and what you plan to do with it.

Happy blogging!

Advertisements
February 4, 2012 / steve8

A quick look at pypy

As a lover of Python, I was excited to learn of efforts to make it run at speeds in the same class of C or Java.

Many programers consider python vs java as a battle of ease-of-programming vs speed…
Does pypy offer python programs the speed of statically typed languages?
Let’s throw a couple programs at it and see what happens:
Read more…

January 30, 2012 / steve8

Lost and Found: a log

0h25 on 1/28/2012: I step out of a taxi in Higienópolis in Sao Paulo to catch a late-night film…
note: SP has a metro population of 19.9 million humans.
0h26 on 1/28/2012: We realize the shopping center with the cinema is already closed, ruining our movie plans…
note: It’s raining, because that’s what it does in SP
0h27 on 1/28/2012: I realize my mobile phone (galaxy nexus) which I had in the cab, is no longer with me.
note: A Galaxy Nexus costs ~R$2000 ~= US$1140 here in Brasil
0h28 on 1/28/2012: I asked my friend about a cabbie lost and found with the police, but her semi-smile tells me all I need to know… Even if there was one, and the cabbie was an honest guy, why would he hand anything over to the police?
note: no one here seems to trust the police.
Read more…

January 27, 2012 / steve8

Try it: middle school math?

Laura is 3 times as old as Maria was when Laura was as old as Maria is now.
In 2 years Laura will be twice as old as Maria was 2 years ago.
How old are they now?

This is ripped from an Algebra 1 textbook used for 13 yr olds in the US.

April 7, 2011 / steve8

The New Look

This website runs on wordpress, always has.  I made the choice because the thought of writing a blog-like platform from scratch felt very daunting, and the vast library of plugins and themes available for wordpress made it seem like the obvious choice.  Indeed I was left impressed by the very easy installation and essentially turn-key setup.

Years later I can say the vast majority of the thousand or so themes have one of the following problems:

Read more…

March 31, 2011 / steve8

100,000 bits in space

The march 2011 ponder this puzzle was one of my favorites:

A spaceship has 100,000 bits of storage, and one of these bits is known to be faulty. You can locate the faulty bit using agents that run on any given subset of bits and return "OK" if all of the bits are good and die if they encounter the faulty bit. It takes an agent one hour to run a query, regardless of the size of the subset, but an infinite number of agents can run simultaneously. You need to find the wrong bit in two hours.
Since we must decide, in advance, how many agents to send with the spaceship, we are interested in the following questions:
A. What is the minimal number of agents needed? (Bonus question: Find a formula for the number of agents needed for n bits and t hours).
B. Suppose we want to send enough agents to be able to repeat the same task a second time with the remaining agents (i.e., those who did not die during the first invocation). How many agents are needed in that scenario?
Update March 2nd: Different agents can access the same memory bit at the same time.

I’ve written up a handful of these ponder-this puzzles and continue to see value in doing so, not just for my own record, but also to help people get better at problem solving.  I do this knowing that the ponder-this people publish a solution (which I’ve appended to this post), because the expanded path that I walk through is more helpful to those who might have problems, and it shows what I think is an honest look at what goes into understanding these things.

I do Strongly suggest trying the puzzle for yourself before reading my solution.

Enough with the prologue, let’s start:

Read more…

March 10, 2011 / steve8

Number in a haystack

 

Last month’s ponder-this puzzle caught my eye, so I decided to give it a whirl.

in short, its to find an integer n which has 3 properties:

A: n is flippable and flip( n) = n

B: n*n is flippable

C: n is divisible by 2011

where the flip of an integer, is the number that appears when the decimal representation in old style 7-segment font is rotated 180 degrees.

I will walk through how my solution evolved.

Read more…