home
on exploration, introspection and creation

Archive for the ‘clever’ Category

Navigation maps facing north

Thursday, November 18th, 2010

I have gotten a lot of shit weird looks from my friends when I explain to them that I like the Nav in my car to have the map facing north (as opposed to facing the direction of travel). Apparently it’s common sense to do the latter.

I disagree. It has everything to do with one’s objectives. If all you care about is optimizing for the user experience understanding directions, then yes, having the map face the direction of travel is better. It’s clear when to turn left and right because the map reflects what ahead of you so you can mimic easily. But for me there is an important objective that I think people undervalue: I value knowing where I am. In other words, I value having a mental model of the area, which allows me to gain intuitive understanding of how far things are and how to get from one place to another without a navigation system (an incredibly useful skill if you don’t have your nav, or if you have the annoying ones that don’t let you the passenger key in directions while you’re driving). There is something really powerful in having a good understanding of your surroundings; it gives you a firm ground.

You simply can’t build that mental model if the map keeps rotating, because there is no invariant that your brain can stick to.

And for anyone who gets confused translating turns on a rotated map into car turns, here is a better paradigm that I use: instead of thinking of turns as “left” and “right”, get used to thinking of them as “clockwise” and “counterclockwise”. Those concepts are invariant under a rotating map so you’ll never get confused.

The Theories of Time Travel

Friday, October 22nd, 2010

Let’s assume that what we all secretly hope for is true: that backwards time travel is possible (with a fast enough rocket you can travel forward in time already, thanks to Mr. Einstein). It’s unclear what such time travel would look like — there are many different theories and, consequently, interesting implications on the Universe, the existence of paradoxes, and the existence and the nature of time loops. Note that to help myself think through this, I have a human being travel in time; this may lead to inaccuracies and further questions — in most of the cases below, we can probably replace me with a photon, or even a quark, and get more precise results (“memory” becomes “momentum” or “spin”, etc.). But it’s more fun to think about people traveling in time.

  • Let’s first assume that there is only one version of the Universe.
    • If the links between causes and effects are not maintained, we have a consistent (paradox-free) time travel: moving backwards in time rewrites history and the previous version is lost. The I that travels back in time (call it I1) is not the same as the I that I1 meets in the past (I2). Whether I2 enters the time machine or not is irrelevant to I1. If I1 kills I2′s grandfather, I2 will not be born but I1 will not be affected in any way. It’s a very safe theory of time travel.
    • If the links between cause and effect are maintained (but their temporal relationship isn’t, necessarily), the Universe has to decide how to handle duplicates of matter/energy: it may choose to allow them, or not, or have an opinion somewhere in between.
      • If duplicates are allowed, I1 is identical to I2 but they are allowed to co-exist. If I1 prevents I2 from entering the time machine, I1 will cease to exist. What if I1 kill’s I2′s grandfather (who is also I1′s grandfather)?
        • It’s possible that I1 will simply not be able to do this — this is the theory where the Universe maintains its consistency (by making it prohibitively expensive — either by requiring you to put a lot of energy into your action or outright generating laws that locally forbid you to perform it), somewhat akin to what the writers of Lost did in the show. This energy-effect constrained time travel — the Universe not letting me kill my grandfather — is interesting. In order to maintain its consistency, the Universe would need to propagate all actions forward (“play them out”). If there is a sequence of actions that cause an inconsistency, the energy required to continue along this sequence would increase, proportionally to the probability of an inconsistency. It would be like an invisible magnetic field that steers actions in a particular direction. This could be implemented by a biased averaging out of quantum effects: let’s take light for example. We know that according to quantum theory, the movement of photons from A to B is realized through an infinite number of different paths which average out to a straight line. However, if the probabilities of the paths are different (due to the fact that some paths may cause an inconsistency in the future), the paths could actually average to something that’s not a straight line. To us it would seem that light travels in curved paths (without the presence of any “real” field, such a gravitational one)!

          Of course, these probabilities change gradually so no obviously apparent deviations from the norm would occur at first. For example, if I’m intending to kill my grandfather, the Universe will start steering me away from my intention through a small sequence of very likely events. If I persist in my intentions, the events increase in magnitude, but it’s possible (because there are just so many possible events that can influence me) that I will never realize my intention without even seeing anything strange with the Universe.

        • Otherwise, we have a phenomenon known as the Grandfather Paradox. I1 may create an unstable point in the spacetime: I1 (and thus I2, and the grandfather) will both exist and not exist at the same time, in a kind of macro-Shrödinger effect. What’s worse, anything that either was caused by I2 or the grandfather or would have been caused by I1 will also both exist and not exist. It’s unclear what effect this will have on the rest of the Universe — as these effects ripple through time, they expand their scope (the events that the grandfather caused themselves caused other events) but decrease their magnitude (think of it as a sound wave propagating through space, maybe bouncing off objects).
          • It’s possible that over time, as soon as they become small enough to be captured by quantum uncertainty, they stabilize so the ripple has a finite size (I can’t visualize what the ripple would actually look like, maybe a really fast-flashing grandfather).
          • Or the Universe could cease to exist.
      • If duplicates of matter/energy are not allowed, I1 would need to replace I2 (for this to work, the Universe would somehow need to have a unique identifier for everything in it). It’s difficult to think about replacing something complex like a human being because he or she is made of many building blocks, each having a different identifier, so let’s simplify and think of something that consists of a single block (say, a photon). The photon would replace its version from the past. Does this photon have “memory”, that is, its future state?
        • If so, the photon will likely change its course (behave differently than I1 did). This may mean that I2 may never end up traveling in time, but that’s fine because there is only version of it. This is equivalent to the theory of rewritten history.
        • If not, I1 simply merges into I2 — I2 enters a time loop which it will never be able to leave. It’s not aware of that, however, so to I1, the time travel ends its consciousness.

        If somehow we can maintain this option at a macro scale, it’s possible that an individual may travel back in time and maintain his or her memory, provided that the interval of time travel is small (for example, if I1 travels back to before I2 was born, I1–an individual–would have to replace a bunch of particles which aren’t even part of a human being. That will very likely result either in the destruction of I2–I2 will not be possible given the new state that all of its particles will have assumed before they created it–or in the destruction of I1–the “memory” that each particle has will be insignificant and so I1′s consciousness will end as soon as he travels in time)

      • Another way not to allow duplicates would be for I1 and I2 to “swap” places: as soon as I1 travels backwards in time, it takes I2′s place and I2 takes I1′s place in the future. When I1 gets to the time when it first traveled in time, he ceases to exist. There is no paradox because time travel transfers both I1 and I2. It doesn’t matter whether I1 actually enters the time machine the second time around or not, because his existence ceases past that point anyway.
      • Finally, the Universe may choose some option in between, for example, I1 and I2 will be entangled in a way that doesn’t increase entropy. This may look like a kind of constrained time travel, where paradoxes are not possible because they are prevented by the entanglement of I1 and I2 (in other words, I1′s and I2′s actions will either make both of them survive the interval of their co-existence, or make them both self-destruct. At the event of time travel, I2 goes back and I1 is the only entity remaining.

        This brings me to an interesting idea: what if time travel and quantum theory are actually one and the same? What if the time interval where I1 exists in the past (and influences outcomes) is equivalent to the cat being both alive and dead: it cannot be inspected, and nothing can be said about what happened or what any of the outcome that I1 could have influenced was. The instant at which I1 entered the time machine would then correspond to the box being open — we find out what all those outcomes were.

  • Now let’s suppose there are many versions of the Universe. This is similar to the first case (rewriting history) but if the Universe bifurcates with every time travel, an awful lot of energy is needed to do time travel. Alternatively, the Universe may already exist in its virtually infinite forms, each form corresponding to a different possible unfolding of an event. We know from Newton that at a high level the world seems deterministic, but at a quantum level it’s not — this randomness I see as a basis for the different unfolding of the events (hence, once and for all answering the problem of free will: there is no free will, but there is also no determinism — what we perceive as “choosing” is just a particular folding up of all the quantum uncertainties). So every time we put a cat in a box, there are Universes in which the cat is dead and Universes in which it’s alive. We know which path we’re on as soon as we open the box. Time travel would then simply be an opportunity to follow a different path.

There is one problem with many of the sub-theories above, and that is a problem of the sudden injection of matter/energy. It couldn’t have been created from nothing. It’s possible that as this new matter/energy is injected, some other matter/energy is transferred into the future (where the travel originated). Possibly an arrangement such as one in Primer is needed where travel is only possible to a limited point in time, where all the prep work has been done, for example enough energy has been set aside to be “displaced” by the newly arriving energy. It may also be that the time travel portal has a standby energy consumption — it consumes energy at some rate, like a leaking pipe, all the time — this would allow energy of at most that rate to be transferred from the future.

Another way to solve the sudden injection problem is to borrow me for the duration of the time travel episode from the time chronologically after the event of time travel. That is, if in the year 2010 I go back to the year 2005, my extra existence for five years between 2005 and 2010 will be borrowed from what would have been my existence between 2010 and 2015. In other words, as soon as I reach the year 2010 the second time around, I jump to the year 2015. This is a kind of quantum entanglement, but not of I1 and I2, but rather of I1 and the future version of I1.

It’s Easter Eggs all the way down

Monday, October 11th, 2010

I love the idea of Easter Eggs — small pieces of functionality hidden from the user (and, obviously, undocumented). If you haven’t already, you should read Thompson’s paper on trust, and, related, the possibility of a combination of scary, but very clever Easter Eggs: hidden functionality that allows you to login to any Unix terminal. The login utility is frequently recompiled, but if there is a corresponding Easter Egg in GCC that introduces the backdoor whenever login is compiled, the backdoor could be preserved. GCC itself is recompiled frequently — but it’s recompiled with another, older version of GCC — so if GCC also included an Easter Egg that tells GCC recompiled with it to introduce an Easter Egg whenever login is compiled with it… voilà!

What if we take this principle and apply it even further, as far as we can? Using the fact that as systems get more low-level, they get more complex, and so it’s increasingly more difficult to audit their functionality. So, if we’re worried that people may inspect the assembly language of that original GCC (or write their own GCC), we could put an Easter Egg in the microcontroller that looks for a specific combination of assembly instructions and executes special, tucked away code. At this point inspection becomes very difficult. Of course, the particular sequence of commands to look out for is complicated (and there are probably many such sequences — depending on the compiler optimizations, a simple compiler instruction may get assembled into all sorts of crap). However, with any system that’s complicated enough, you can see any pattern you like, and you shouldn’t underestimate the possibility of even simple patterns remaining undetected for a long time.

Can we keep going (as if there was much point in continuing!)? Of course; people use layout software (and–even better–usually simply just higher level synthesis software such as Verilog) to lay out what will become a microcontroller. We can add an Easter Egg there. This takes us back to software which is compiled with GCC — and you can see how we could continue this process indefinitely, with tools that we would never think would be used in that “critical path”. So I dare you, dear reader, to create the longest chain of Easter Eggs you can. Bonus points for creative inclusions! (Of course, it would be silly to keep doing it a lot, for the resulting code would likely be massive — think lots of lookup tables. Unless we do some serious hackery — it is, after all, possible for very short code to generate very long sequences…).

Can we protect ourselves against such a mindblowing seemingly infinite chain of Easter Eggs (or–more relevantly–security vulnerabilities)?

Life Hack #30: VPN

Sunday, September 19th, 2010

Use VPN if you’re abroad and your favorite movie or TV show streaming service is using some legal excuse to prevent you from catching up on that episode of Lost where they explain everything. (I used to do that back when Skype had free calling anywhere within the U.S.)

You can search for personal VPN services with servers located in the U.S. — I am not in the business of endorsing other services unless they are, like, the best thing since sliced bread — there are even some free ones.

Free parking?

Sunday, September 19th, 2010

I’ve used these parking garages that have a ticket machine by the entrance quite a lot. You pull up, get the ticket, drive in, and on exit you pay for how long you stayed in the parking garage. Usually the garages have a grace period of about 5 minutes.

What prevents me from pulling up to one of these ticket machines, grabbing a ticket, and then driving away instead of in? If nothing, I can enter with one car, with another car just get the ticket, and then use the second ticket to get your first car out. Both cars are out of the parking garage and you paid nothing.

Thoughts on Memory

Saturday, September 18th, 2010

Have I mentioned that I’m fascinated by memory? (And, more importantly, by how little we know about how it works and by how much we think we know, trying to model it as all these things it’s obviously not).

I realized that the first step to forgetting is to forget what it was you were trying to forget. There is one experiment I have been running for several years now. I thought of something relatively unique, such as a pink panda bear (of course the actual thing is not a pink panda bear), and told myself I’ll make myself forget it. However, every so often I remember the experiment which instantaneously means that I’ve failed — because for the next several months I will not be able to forget the thing. Apparently this phenomenon is very useful — people found out that the best way to memorize things is to recall them just as you are about to forget.

This makes me think about the recall mechanics. The way memory is structured, it seems, is that memories have little “pointers” which remain on the surface (I mean conceptually, not visually). These pointers allow you to access the memory, but if not refreshed, they get fainter and eventually the memory is buried altogether. Of course, pointers themselves are interconnected, so re-jiggering one memory may expose another one by pulling the pointer back up to the surface.

This is a very efficient way to keep a large number of memories somewhat accessible — a pretty common use case (memorization for the sake of memorization, it turns out, is not a useful survival skill; however, being able to recall memories as a result of some trigger is very useful — it allowed us to build a large “toolbox” of primitive skills by remembering our reactions to impulses. These reactions are then brought back upon the re-occurrence of the same impulse).

Corruption and capitalism

Wednesday, September 1st, 2010

There is no difference between very efficient corruption and capitalism.

Imagine going to any of a number of shows during a music festival. There are seats but since it’s a festival, seating is sequential and kept in order by the festival staff. Initially the staff seat the customers on a first-come, first-served basis but pretty quickly into the festival, people start offering bribes to the staff in exchange for a better seat. The staff has full discretion over seating so they willingly take the bribes.

As more and more people catch on, the staff begin reserving seats in anticipation for future late-comers who may offer a higher bribe. A secondary market forms where people come to the concert, offer bribes for multiple seats and resell them later. These people now have specialized jobs which allows them to find customers better (and, since they are not staff members, can openly offer good seats for money). This also pleases the staff members because they get bulk pricing and have to spend less time dealing with money.

If this is an efficient market, there is competition between secondary market makers, and the best ones minimize the risk of having a seat unfilled, so all seats are filled, but each seat now has a price tag attached to it. A system where staff members were given the power to seat the customers and they succumb to corruption naturally turns into a fully capitalistic system.

Britain’s Monarchy

Friday, August 6th, 2010

The Brits faced the impossible challenge. They couldn’t have kept their old political system in a new democratized world. But an empire so renowned for (and deriving so much of its strength from) its monarchy could not simply have abolished it. They’ve done a brilliant thing and invented a new kind of balance, one that combines the best of two worlds: the short-term stability of a democracy (giving people the impression that they are empowered to control their own destiny) and the long-term stability (having a uniting figure, a symbol to be proud of and worship–as the desire to worship is in my opinion one of the most fundamental traits of mankind).

Wit and The Art of the One-liner

Tuesday, July 20th, 2010

My three friends and I were driving to a music festival. My friend, seeing a police car parked on the street, instantaneously responded: “There’s my ride home.”

There’s something beautiful about one-liners: a perfect narrative compression of the situation, an almost poetic ability to synthesize while retaining information (I compare poetry to lossless data compression: a way to say to much in so few words). They are closely related to the concept of wit: the ability to comment on a situation with insight and humor. Probably the most extreme — and hilarious — example of that relation were “the battles of the wits” that my friends would engage in: a dialogue where each subsequent response built upon the previous but towered over it in wit. Unsurprisingly, the dialogue consisted almost entirely of one-liners.

Telephones

Sunday, July 11th, 2010

The telephone has some pretty impressive, clever ideas behind it. First is the concept of tone dialing which older people will be familiar with, where the number to dial is expressed as a set of digits in unary expressed through quick breaking of the phone circuit. For example, to dial 911, you could quickly press and release the “hang up” button that the headset normally resides on nine times, then (after a pause) once, and finally (after another pause) once more. This is why old phones had these funny circular dial pads — each rotation of the pad from one digit to the next would break the circuit once so if you reached for the digit “9″ and then released the pad, it would break the circuit nine times.

The next-generation — used until cell phones showed up — system was just as clever. The idea was for the exchange to listen to the sound from the headset and interpret certain frequencies as digits. The frequencies that would stand for digits were actually sets of two sounds which were not harmonics of one another — i.e. if you tried to play the sound on any instrument, or whistled, you couldn’t generate these frequencies. What a brilliant way to minimize conflicts!

For posterity, and because I’m strangely attracted to it, here is the Dual-Tone Multifrequency keypad — the row/column headers correspond to the frequencies, in Hz. The cells tell you which two frequencies are used (so the digit “7″ generates a tone that’s a combination of an 852 Hz and a 1209 Hz sounds):


·····1209·1336·1477·1633
687···1····2····3····A
770···4····5····6····B
852···7····8····9····C
941···*····0····#····D