How Should We Model Reality?

Does machine learning justify changing our need for a glass box?

Take a look at this paper. It’s titled, “Deep learning and the Schrödinger equation”. It’s implications are really interesting; first let’s take a look at the paper’s claim.

“We have trained a deep (convolutional) neural network to predict the ground-state energy of an electron in four classes of confining two-dimensional electrostatic potentials. On randomly generated potentials, for which there is no analytic form for either the potential or the ground-state energy, the neural network model was able to predict the ground-state energy to within chemical accuracy, with a median absolute error of 1.49 mHa. We also investigate the performance of the model in predicting other quantities such as the kinetic energy and the first excited-state energy of random potentials. While we demonstrated this approach on a simple, tractable problem, the transferability and excellent performance of the resulting model suggests further applications of deep neural networks to problems of electronic structure.

So what does this mean in laymen’s terms? It basically means that we can give a computer a lot of different examples of any given problem we want it to solve and can get answers for questions about that problem that are really accurate.

Let’s say you were looking at some physical phenomenon you wanted to understand. (Let’s use something like the probability of finding a tennis ball that you dropped in a hole in the ground.)

Now in general if you drop a tennis ball in a big hole in the ground it usually falls towards the center where the hole is the deepest. So it’s unlikely that it will get caught on the outer fringes, but still possible.

So you might get some sort of curve of changing probability that looks like this, where x=0 is the center of the hole and the further out you go, the lower the probability gets.

ratchet probability example of how likely you are to find a tennis ball.

Now imagine instead of a tennis ball, you’re looking at an electron, and instead of gravity acting on the tennis ball, it’s now electric potentials that create coulomb forces on that electron that force it into a certain position.

This situation I’ve just described is called the quantum well; something you’ll see a lot in an introductory quantum mechanics course. The usefulness of the quantum well example is that you usually earn how to model it using the **Schrödinger equation**. $$ i\hbar {\frac {\partial }{\partial t}}\Psi (\mathbf {r} ,t)=\left[{\frac {-\hbar ^{2}}{2\mu }}\nabla ^{2}+V(\mathbf {r} ,t)\right]\Psi (\mathbf {r} ,t) $$

You can read more about the Schrödinger equation here, but for our purposes what you should know is that it gets very complicated very quickly. The second you start trying to use it to model two tennis balls, things become very very difficult to solve, especially because we only have the probabilities!

The glass box

When we manipulate equations that we believe accurately model the real world, every valid manipulation of that model is something that we also believe to be “true”, and we continue to manipulate this equation until we arrive at a statement of interest to the question we’re asking. These models are sometimes called a “glass box”. This is because the process we are inspecting is one that we believe that we understand because the model we’re using works for that particular problem.

In the context of this paper something called a Convolutional Neural Network is used. It works by looking at thousands of input-output examples of the thing you want to model, and creates an approximation of the raw numerical operations that are applied to your input in order to “fake” knowing whatever the function actually is. This process of creating a numerical model that doesn’t have to know anything about the function it’s approximating is called a “black box”. We know what we put into the box and we know what comes out, and that’s it. Because we don’t really know what the model looks like other than the numbers, we usually just test it to see how accurate it is and then use it for problems where we don’t have a glass box yet.

This concept of neural networks was actually invented in the 1950’s, but it’s only recently that this method of machine learning has exploded in popularity for solving complex problems. This paper is interesting because it enables us to use computers as black boxes to solve problems that were once thought to only be solved with glass boxes. Now we don’t need to understand a problem in order to be able to use an approximation of the answer. And before you say it, this has nothing to do with the hidden variables theory, which isn’t what we’re talking about. (That’s a question that Einstein)

Now we don’t need to understand a problem in order to be able to use an approximation of the answer.

Author image
  • David Awad

Which models are better?

Well just looking at it heuristically we get exact accuracy with glass boxes but they can take a long time to develop and accurately research.

On the other hand we can get black boxes that can give us a 0.1% margin of error and provide us with models for a lot of different problems a LOT faster because all we have to do is collect some data and then train a machine learning algorithm.

That brings up a more important question for us then, what’s more important? Is numerical accuracy all that matters? What is a model supposed to do for us?

I think the answer is that the model we choose in general entirely depends on the problem. Up until recently we’ve never really had the option to use anything other than a pure math, glass box solution to model any given situation to the best of our ability.

It is important to state though that this does have it’s limits. The predictions of these machine learning models are based solely upon our experimental data. So if there are unusual qualities we don’t know about, we won’t be able to notice until we hit edge cases.

For example, the ultraviolet catastrophe was a fault in the Rayleigh-Jeans law that was only uncovered because we could use test the model on much smaller wavelengths that we hadn’t used in experiment to see what it would predict. Only then did we find that it was unrealistic and needed to be revised.

So how should we model reality? Do we need to understand how a particular phenomenon works in order to make meaningful use of our predictions? Or can we ignore it and go on to use machine learning to speed up research and engineering at the cost of understanding.

The Engineer in my says who cares, but the physicist in me cares quite a lot and believes that there shouldn’t be a black box in our understanding of fundamental aspects of reality like schrodinger evolution.


The Email disclaimer, Explained.

This blog post was written only for its intended recipients.

The opinions expressed in this blog and those providing comments are theirs alone, and do not reflect the opinions of David Awad or any employee thereof. David Awad is not responsible for the accuracy of any of the information supplied. If you choose to do stupid things after reading this blog, that constitutes a “you-problem” for which the author takes o responsibility.

So what did you just read?

A disclaimer that’s what.

You probably have seen something like this before. The idea of this concept is a poor attempt to shield an entity from any form of legal repercussions as a consequence of emails as well as create consequences if that information ends up being sent to the wrong person.

What is an email disclaimer?

Let’s start from the ground up with a simple definition.




a statement that denies something, especially responsibility.

e.g. “the novel carries the usual disclaimer about the characters bearing no relation to living persons”, “a disclaimer of responsibility”

synonyms:denial, refusal, rejection

legal — an act of repudiating another’s claim or renouncing one’s own.

  • definition

So when used in the context of an email, I suppose the intention here is to avoid being liable to some sort of consequences that could come from the contents of the email.

History of disclaimers:

For the younger readers, you may find it interesting that letters were written up and sent in an envelope.

After that; archaic machines were forged to transmit bits of information over telephone lines in order to send a document to a unique identifying address. You may never have seen one, but this machine was called a fax. They made it really easy for you to simply type in a number in order to send a document to someone by simply knowing the right numbers to use.

Shockingly, this led to a lot of people sending documents to the wrong locations.

In addition, faxes were often sent to people at hotels, where the fax would be received by a business center and delivered to a hotel room. This led to concerns that the information in the fax might be misdelivered or read by persons for whom it was not intended.

THAT is how this whole message disclaimer business began. It really makes sense in this context.

Enter the world of the email. Lawyers were sending messages that could contain “legally privileged information” and wanted some sort of similar protection despite it no longer being necessary.

e·mail — ˈēmāl/
messages distributed by electronic means from one computer user to one or more recipients via a network.

  • definition

However, rather than putting the disclaimer at the beginning of an email, by virtue of reasoning I cannot understand, by nearly universal practice the disclaimer is placed at the end of the e-mail. Thus, the unintended recipient would read the entire e-mail, only to discover the frightening language informing him or her of their wrongdoing.

Why do people use them now?

An email disclaimer could provide you a few things.

  • potentially refuse responsibility.

  • is virtually free to add on to an email.

  • does virtually no harm outside of looking a bit silly.

So it makes sense why they’ve started to see widespread use; but does it actually make sense?

So here is an example email disclaimer I received once, take a look and we’ll break it down.

This e-mail is intended for the addressee shown. It contains information that is confidential and protected from disclosure. Any review, dissemination or use of this transmission or its contents by persons or unauthorized employees of the intended organisations is strictly prohibited. If you are not the intended recipient please delete this message and notify the sender immediately.

The contents of this email do not necessarily represent the views or policies of REDACTED, its employees or students.

Warning: You are about to attend this publication’s fiiiiiirst,

“Legal Roast!”™℠®©℗tr.

Copyright © 2016 by Probably the government #drumpf2016 #byefelicia

All rights reserved. No part of the “Legal Roast!”™℠®©℗ brand may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic methods such as a website. (No, in fact definitely not a website because that would be easily accessible.) without the prior written permission of the publisher, except in the case of brief quotations or talking about how great “Legal Roast!”™℠®©℗is and other noncommercial uses permitted by copyright law. If one wishes to talk about how great Legal Roast!”™℠®©℗ is in a commercial setting, please send a messenger on horseback across the pacific ocean for 12 days and 2 nights, where he will then reach euphoria, learn to fly and forget about email which would have been a useful way for you not to keep wasting good workers. If he makes it back; pay that man! For permission requests, write to the publisher, addressed “Supreme Leader,” at the address below:

8765309 Let’s do the timewarp again avenue, LN, 01924

It’s Roastin’ time. Grab your popcorn™ now.

Let’s start with the obvious. You receive an email, and proceed to read it, you get to the bottom of the email and notice this disclaimer. It begins with the following:

“This e-mail is intended for the addressee shown.”


But let’s say this email was actually intended for someone else, how the heck would you know? It was sent to me; the addressee shown. How does one actually know if they were the intended recipient when an email is sent to them, the recipient! Are you a mind reader? Would proof need to be shown to a court room that you knew you weren’t the intended recipient at the time of unintended receipt?

“If you are not the intended recipient please delete this message and notify the sender immediately.”

And what if I dont?

Oh no! I’ve read it exactly like I shouldn’t have because the disclaimer is at the bottom of the email despite being something that should obviously be read beforehand! What do I do?

First of all, this is my blog post, I’ll be asking the questions here. Second, keep your voice down, I’m right here; there’s no need to be so loud. Third I am not a lawyer, so take this advice with a grain of salt. No this disclaimer of me talking to you isn’t like those other disclaimers from before.

So on the one hand, if I am not the recipient, I am told that I cannot act on information in the message. On the other hand, I am instructed to take particular actions in that case.

“It contains information that is confidential and protected from disclosure.”

Protected by what?! COME ON!!

Being that there is no statute or law given to provide some context as to why, and it’s only “prohibited” and doesn’t explain the nature of the consequences I can’t say that I’m scared.

Also, If the mail system always adds a disclaimer saying that the message doesn’t represent official policy… how do you state official policy by email?

It is just Wasting space.

Imagine going back and forth for just a few emails.

A message posted to a mailing list that contained exactly five lines of real content.

1: greeting
2: blank
3: a quick question, followed by a thank you
4: blank
5: <author’s name>
6: blank

This is a huge waste of space, and feels really stupid if you’ve received something like this. The signal to noise ratio is terrible!

We’re now getting to the equally entertaining, but less outlandish and ridiculous section of the blog post. Bear with me, we’ll get through this together.

So ultimately does this actually do anything?

Well, according to The Economist¹, these types of agreements are not legally enforceable.

“In the United States, several courts have ruled that email disclaimers may have a legal effect when intentionally included in an email, generally before the text of the email or in the body of the email. However, no court appears to have ruled on the effectiveness of boilerplate email disclaimers appearing below the signature line in every email².”

To cite an actual case that this author happens to find hilarious, let’s take a look at Romero v. Romero³ which pushed the limits of what can be, “disclaimed.”

One family court case spilled over into an email that stated “pay-back is really a b**” and that the recipients “still have a gigantic debt to pay to me, which will be paid no matter what.” Romero v. Romero, 2011 Cal. App. Unpub. LEXIS 8706 (Cal. App. 4th Dist. Nov. 14, 2011)³. The e-mail concluded with, “Your most determined, unstoppable, and visceral enemy.”

Below that, the email included the following boilerplate disclaimer:

“DISCLAIMER: Not one word herein should be construed by anyone as meaning violent or threatening intentions, and instead the entire contents is to be taken by the strict literary meaning. There have not been, and will be any elucidated threats of violence or intent, either expressed or implied, within the entirety of this document.”

Unsurprisingly, the recipient of the e-mail sought a protective order. The sender claimed his emails were protected by his First Amendment right of free speech and that the “disclaimer” prevented the emails from being used as the basis for a protective order. The court explained to the sender that his documented threat and harassment of the recipient would not be ignored “by simply putting a disclaimer on it.”

“L O L, Nah son.” — California District Court.

Suppose we ignore my previous citations and take these disclaimers at face value.

It may be a little paranoid to be using these from a legal perspective anyway. An incredible amount of trust is already given to the internet and the different servers that move your emails across the globe. Yes, we can fight this with PGP encryption and other techniques, but it can only get us so far if a determined third party were to obtain our data.

Consider for a moment sending an overnight mail package: Have you ever read the delivery contract? (I already know you haven’t read the EULA for half of the websites you were on today, let alone one for this site) Most likely, it gives the carrier the absolute right to open the package for almost any reason. How good is the security of that package along the way? Who might be opening your package and reading the contents?

In actual fact, the likelihood of a particular email message being intercepted by a truly interested party is relatively low. That being said you, as either a lawyer, or as a representative of an interested party in this particular communication, have an obligation to take reasonable steps to protect the confidentiality of theoretical client information.

So, in summation, Email disclaimers are unnecessary.

Thanks for reading!

The following parody email disclaimer has been left as an exercise for the reader.

Disclaimer: This email is intended for the use of the individual addressee(s) named above and may contain information that is confidential, privileged or unsuitable for overly sensitive persons with low self-esteem, no sense of humour or irrational religious beliefs. If you are not the intended recipient, any dissemination, distribution or copying of this email is not authorised (either explicitly or implicitly) and constitutes an irritating social faux pas. Unless the word absquatulation has been used in its correct context somewhere other than in this warning, it does not have any legal or grammatical use and may be ignored. No animals were harmed in the transmission of this email, although the yorkshire terrier next door is living on borrowed time, let me tell you. Those of you with an overwhelming fear of the unknown will be gratified to learn that there is no hidden message revealed by reading this warning backwards, so just ignore that Alert Notice from Microsoft: However, by pouring a complete circle of salt around yourself and your computer you can ensure that no harm befalls you and your pets. If you have received this email in error, please add some nutmeg and egg whites and place it in a warm oven for 40 minutes. Whisk briefly and let it stand for 2 hours before icing.


Additional resources:

How to play Monopoly Like a Programmer

An in depth tour of the game using simple stats, an intro to MongoDB atlas, and 100,000 trips to old Park Place.

Most of my friends know I’m a big fan of monopoly. I had been saying for a while that there must be an optimal way to play this game that can be modeled by simulating multiple monopoly games.

One question that’s worth answering is what spaces are landed on the most?

So we’re going to play monopoly like a programmer would. We’ll run a simulation of 100,000 games to model what spaces a single player is most likely to land on. Based on that we’ll know which spaces are the most valuable to purchase.

For the record this is a hideous brute force approach to the problem and there are much more interesting monopoly simulations you can do using markov chains; unfortunately I am not Hannah Fry and cannot simply do these things in a blog post.

Since it’s a good set of sample data, I’ll show you how to store this data in MongoDB Atlas to make it easy for you when you need real database storage in the future. If you’ve never used MongoDB before, all you need to know is that it’s an Open Source Database that doesn’t use a formal mechanism in order to store data, you simply give mongo the objects and data you want to store and it handles the rest for you.

MongoDB Atlas is a database as a service created by the experts who design and engineer MongoDB. It provides all of the features of MongoDB, while removing most of the operational overhead. With MongoDB Atlas you can deliver your applications quickly, and focus on what matters most to you and your customers. ~ They’ll host a database for you, and do it really well.

Without further ado; Let’s get to work!

Running our Simulation

Here is my code for running our bare-bones monopoly simulation. (you can find the source here)

# models a single monopoly player's Tour around the board multiple Times
from random import shuffle, randint
# simulate 10^5 games
games  = 10**5
# average number of turns per game
finish = 35
# create array of all squares on the board
squares = [0]*40
# track the number of games so far
games_finished = 0

while games_finished < games:
# set of community chest cards
    master_chest = [0,40,40,40,40,10,40,40,40,40,40,40,40,40,40,40]
    chest = [i for i in master_chest]
# set of chance cards
    master_chance = [0,24,11,'U','R',40,40,'B',10,40,40,5,39,40,40,40]
    chance = [i for i in master_chance]
doubles  = 0
    position = 0
    turns = 0
while turns < finish:
        d1, d2   = randint(1, 6), randint(1, 6)
        diceroll = d1 + d2
# increment number of doubles
        if d1 == d2: doubles += 1
        else: doubles = 0
# go to jail
        if doubles >= 3: position = 10
            position = (position + diceroll) % 40
# Chance Card
            if position in [7,22,33]:
                chance_card = chance.pop(0)
                if len(chance) == 0: # chance deck is spent
                    chance = [i for i in master_chance]
                if chance_card != 40:
if isinstance(chance_card, int):
                        position = chance_card
                    elif chance_card == 'U': # utilities
                        while position not in [12,28]:
                            position = (position + 1)%40
elif chance_card == 'R': # railroad
                        while position not in [5,15,25,35]:
                            position = (position + 1)%40
elif chance_card == 'B': # back 3 spaces
                        position = position - 3
# Community Chest
            elif position in [2,17]:
                chest_card = chest.pop(0)
                if len(chest) == 0:
                    chest = [i for i in master_chest]
                if chest_card != 40: position = chest_card
# Go to jail
            if position == 30: position = 10
squares.insert(position, (squares.pop(position)+1))
        turns += 1
games_finished += 1
# a player lands on a space (finish_order * games) times

There are some things to note about this simulator:

  • It doesn’t track money which can affect the number of turns, but is independent of the dice rolls themselves.

  • It assumes that the average monopoly game takes about 35 turns before a game ends.

  • It assumes that the “Go To Jail” space is not one that can be landed on, but results in landing on the “Jail” space.

  • This code makes no distinction between “just visiting” jail and “being in” jail. For our purposes the two are functionally the same, as we don’t get anything out of someone being in jail.

total number of turns = (turns per game \times number of games played)

So after running our simulator for 100,000 games what are our stats?

Take a look at this spreadsheet; we’ve listed the name of each numbered space on the board along with our calculated information. The frequency percentage has been calculated as the number of times landed on a space divided by the total number of turns in the simulation.

First Half of the Monopoly Statistics

Second Half of the Monopoly Statistics

Storing our data in MongoDB

Now for showing off your fancy new data to your friends just in case they don’t believe your conclusions, we’ll store the data in MongoDB Atlas. (Arguably they should learn your conclusions the hard way, but let’s use MongoDB anyway; it’s a great tool for serious data storage and replication and the knowledge will come in handy in the future!)

The process of connecting to the Atlas hosted database is fortunately really simple.

There’s two components to this, we create our database in Atlas, and then simply connect to it from another computer or application to store our information.

Making our database in Atlas

Start by making an account on

Once you’ve done that, you should get a screen that looks like this with no clusters.

screenshot taken from the actual mongodb blog :)

Go ahead and make your cluster with whatever number instances you want, you can set this up with the lowest tier settings with additional options for more complex setups, but for now we’ll stick with the small stuff.

Note: make a note of the admin username and password as you’ll need them to connect in the future.

Setting up the mongo cluster

Once you have your cluster, click the connect button on the top right, and configure your whitelist entry to allow connections from anywhere. Hit confirm and we should be all set!

Note: Even though your database is hosted in the cloud, allowing access from anywhere is incredibly dangerous and you should use more strict rules in production.

Our VERY DANGEROUS security whitelist

Connecting for that sweet, sweet data transfer

Note: If you don’t have mongo installed already, you should definitely do a quick brew install mongo to get it. If you don’t have OSX or brew just check out this page on how to install mongo.

So you’ve hopefully just installed the Mongo Client. You should be able to run the mongo application from the command line. mongo is the client program that’s going to do the talking to our actual database, which is hosted for us on the Atlas platform.

Hit the connect button again and take a look through the page; you should see a segment titled; “Connect with the Mongo Shell.”

Copy the sample connection command that is templated out for you.

copy that command; it’s gold!

mongo “mongodb://cluster01-shard-00–,cluster01-shard-00–,cluster01-shard-00–” — ssl — username admin — password <YOUR_PASSWORD_HERE>

MongoDB shell version v3.4.1

connecting to: mongodb://,,

2017-01-23T16:16:31.737-0500 I NETWORK  [main] Starting new replica set monitor for Cluster01-shard-0/,,

MongoDB server version: 3.4.1


Using the database

If you can see something like the screen above, you now have access to your database cluster!

So let’s do some of the basics! (you can read about more of the mongo shell and what it can do here)

We’ll go on with the basics, at the first mongoDB prompt, you can create a database right from the start, we’ll call ours monopoly.

Cluster01-shard-0:PRIMARY> use monopoly

switched to db monopoly


Now we can create a table of properties and start doing operations!

Well insert a few objects into our hosted collection in Atlas and then list them back out to make sure things went smoothly.

Cluster01-shard-0:PRIMARY> db.spaces.insert({'GO':95251})

WriteResult({ "nInserted" : 1 })
Cluster01-shard-0:PRIMARY> db.spaces.insert({'Mediterranean Avenue':68130})

WriteResult({ "nInserted" : 1 })

Cluster01-shard-0:PRIMARY> db.spaces.find()

{ "_id" : ObjectId("5886d25f482270f08c4e44a1"), "GO" : 95251 }

{ "_id" : ObjectId("5886d2d8482270f08c4e44a2"), "Mediterranean Avenue" : 68130 }


You’ll find that this paradigm of choosing a db, selecting a collection and inserting documents into that collection, remains consistent throughout all of the mongo drivers for all of the different programming languages.

And now you’re all set to do anything with your Mongo powered Monopoly Database. Now please enjoy this completely unaltered photo of a walrus wearing a party hat.

“The Walrus in Question”

So what did we learn here?

  • Interestingly, the space that ends up being landed on the most is Jail. What that means for monopoly or capitalism is beyond the scope of this blog, but it is an interesting fact nonetheless.

  • The space that collects rent that is landed on the most is New York Avenue! The other orange properties seem to be solid investments probabilistically as well.

  • The dark blue properties like Park Place, (or Park Lane in the UK!) are never worth it.

Lastly, the MongoDB Atlas platform has some fantastic features and is incredibly flexible; definitely take a look at if you’re interested in open source database software.

This post was originally inspired by Hannah Fry. Her latest book, The Indisputable Existence of Santa Claus uses mathematics in a lot of unique and interesting ways. If you found this post interesting; she takes an entirely different approach to the monopoly problem and many others!

Special Thanks to MongoDB for giving me the Atlas credits to write this blog post!

How Does Bitcoin Work?

disclaimer This post aims to introduce the functionality of bitcoin along with a general one for a non-technical reader.

If you want just the technical stuff, skip to the “How” section.


So if you’ve been on the internet at all you’ve probably heard of a lot of things about Bitcoin. If you google search what bitcoin is right now you’re going to get a pretty comprehensive, but not very approachable definition.



a type of digital currency in which encryption techniques are used to regulate the generation of units of currency and verify the transfer of funds, operating independently of a central bank

  • Definition
So a digital currency is something we’ve seen before. We make payments online everyday through services like PayPal, Venmo, and all sorts of other ACH transactions. What would make bitcoin any different from the money we already use? To answer this question, we have to identify what we think currency is in the first place. currency: a system of money in general use in a particular country. Aha, so currency is something specific to a country and government. A group of people live in the same country and agree that country’s currency has value in exchange for goods and services. That value is then backed by the government, and the currency is regulated by a central bank. Bitcoin is built without the need for any central authority (decentralized) and built in such a way that the currency is reliable enough to be used instead of something like the USD or the Euro. It can be transmitted securely, and has value anywhere in the world regardless of what different governments do that could affect their currency. (such as brexit, and Trump) that influence the value of their nation’s currencies.


this is where you want to skip to for more info on the protocol.

There are a couple problems to worry about when making an online and decentralized currency, mostly that currency can’t be counterfeited and that the same money can’t be spent twice. The intricacies of those problems are outside the scope of this post, but we’ll talk a bit about what the bitcoin protocol does.

Let’s imagine that Alice and Bob want to send money to each other using this hypothetical virtual currency. Alice needs to use the internet to do it, and there’s no bank or clearing house to validate it.

How do we start our transaction? By having alice declare it to the world.

So Alice prepares a message stating, “Alice is sending bitcoin 82303348 to Bob.” She then encrypts this message and sends it out to everyone on the bitcoin network.

Everyone receives this message, including Bob. When bob gets this message, he knows that Alice sent the money, and so does everyone else. As other people on the network hear that message, each adds it to a list of pending transactions that they’ve been told about, but which haven’t yet been approved by the whole network. The approval process starts with other observers on the network.

Let’s say that an observer on the network, David, checks his copy of the list, and can see that each transaction is valid. He would like to help out by broadcasting news of that validity to the entire network.

However, before being able to tell anyone as part of the validation protocol David is required to solve an intentionally hard computational puzzle called the proof-of-work. Without the solution to that puzzle, the rest of the network won’t accept his validation of the transaction.

Without a solution to that puzzle, the rest of the network won’t accept his validation of a transaction.

The puzzle that he has to solve, is something like the following:

Let $h$ be a fixed hash function known to everyone.

note: a hash function is an operation that attempts to produce a unique signature for each possible input. The hash function used in the bitcoin protocol, for example, is SHA-256.

Suppose we add a fixed value $x=0$ to a block of transactions $L$ in a peer’s queue. where $h(L+x) = out$

for simplicity, we’ll use $L$=hello world, but this would work the same for any $L$ that could be represented numerically. Even say, a number that encodes a bunch of people sending each other money.

h('Hello, world!0') =


Now if we set $x=1$ and try that value

h('Hello, world!1') =


The puzzle solution might be to find a value of $x$ that creates 4 consecutive zeroes at the beginning of the output value.

Note that this is a problem that can take a long time to find the answer to, but can be checked very quickly.

If we keep incrementing $x$ and recalculating the SHA value, we won’t actually find an acceptable nonce for this value of $L$ until we get all the way up to $x=4250$

h('Hello, world!4250') =
you can check this on your own machine as well with the sha256sum command.
echo -n 'Hello, world!4250' | sha256sum

It’s important to remember that this is a hypothetical example, and that instead of requiring leading zeroes, the Bitcoin proof-of-work puzzle requires the hash of a transaction block’s header to be lower than or equal to a number known as the target. This target is automatically adjusted to ensure that a Bitcoin block takes, on average, about ten minutes to validate.

So it would take a computer a while to find the right value for $x$, but once we know the answer, other computers can use this $x$ value to see if it’s right, and if it is we can say that David’s computer has proof of work for this block of transactions $L$. When he has the answer he sends it out to the other computers on the bitcoin network.

Everyone has similar records of all transactions (including the one david’s computer just worked on) that they keep and manage as they hear about them from everyone else, and remember which ones are validated. This public list of transactions that everyone shares is called the blockchain.

The proof of work puzzle of calculating a nonce ($x$) for a specific block of transactions is called mining. And the protocol gives monetary rewards to those who mine blocks, making the currency more reliable as other people constantly validate your transactions and share that information with everyone else; and eventually getting to Bob! This is why it tends to take a couple minutes for someone to confirm it when bitcoin is send to them.

There’s plenty more to this process than what we’ve gone over here, but I hope this was an easy to understand introduction to bitcoin that ignores most of the fluff. If you’re interested, the blockchain ledger itself is managed through a merkle tree data structure which is the first place to start reading if you want to learn more.

Small Distances Don't Mean Anything

Small distances don’t mean anything

Newton once famously said something that came to be known as his “flaming laser sword.” It came from a shared scientific belief that if something couldn’t be measured, it was useless to debate the nature of that thing.

Consider the classic question of an unstoppable force meeting an immovable object. The fact is that neither of the two can exist (which one begins to realize after taking a few physics courses). But even so, the question is ill formed, because it’s asking about things we can’t observe. At which point we are left with pure speculation as to what would happen.

We can only find out by setting up an experiment. Take an unstoppable force and an immovable object, place one in the path of the other and observe what happens. The object will either move or not, disproving the nature of one of the two.

But until we perform that experiment, it means nothing to speculate.

Here’s another consequence of this interesting worldview. Imagine the following, Heisenberg’s Uncertainty Principle is the following.

The uncertainty principle asserts a fundamental limit to the precision with which certain properties of a particle can be known simultaneously, such as position $x$ and momentum $p$. Where $h$ is Plank’s constant.

Imagine we wanted to know momentum, well that’s not terribly difficult right? Simply divide by the position.

However, what if we wanted to observe what happens at $10^{-35}$ m ? This is where things start to get interesting.

That shouldn’t be too hard, you might say. It’s just $Δx$ right?

Well, imagine what would happen. Because $E = pc$, we know that if we wanted to probe smaller and smaller distances, one way we could have that large of a momentum would be using photons with higher and higher energies.

The math lands us within the order of around $10^{19} GeV$. That’s a shitload of energy.

shit·load — /ˈSHitlōd/

noun, vulgar slang

a large amount or number.

“I have a shitload of work to do this week”

Author image
  • David Awad
  • * Definition from Google

There’s actually an interesting consequence that happens here, because $E= m c^{2}$ we’ve got a bit of a problem. That energy can also be considered mass, for reasons that we won’t go into here. That’s a mass of about $ 10^{19} GeV / c^{2} $.

But if we compress this much mass to a space on the order of $1/10^{35}$ . . . it becomes a black hole. It's worth pointing out that a black hole is only called that because the escape velocity is larger than the speed of light, so we don’t actually know what happens inside of one because we can’t measure it. (this could change with the recent discovery of gravitational waves)

Well this is weird. If we have no way to measure what’s going on at such a small distance scale, now it doesn’t mean anything?

Well, according to some physicists. . . yeah.

This is an interesting consequence of what you might now realize is a bit of a Polarizing view. In fact, Adler goes on to say the same.

“While the Newtonian insistence on ensuring that any statement is testable by observation […] undoubtedly cuts out the crap, it also seems to cut out almost everything else as well”, as it prevents taking position on several topics such as politics or religion." 

Author image
  • Michael Adler

This way of looking at the world, while undoubtedly clear, ends up being surprisingly narrow when it comes to problems that aren’t very well defined or well understood. Perhaps better described as human problems.


Newton’s Flaming Laser Sword

The Uncertainty Principle

Why is mass equal to energy (a blog post all on it’s own)