We’re building an app that will track how you use your Tesla. It’s called TeslaTracks and it looks at your driving habits, battery usage, how efficiently you are using energy and helping you understand the economics and overall awesomeness of electric car ownership.

Let’s talk the most simple question we could ask and explore some of the challenges of understanding the answer to it.

Are you driving?

Logically, this statement could be true or it could be false. But how do we know the answer to this question? The simplified version is

We are paying attention. The cloud server tries to connect to your car over the cellular network. If the car is on the network, it returns the transmission state. If the transmission state is either D, N, R then we know you are driving at a specific time.

(The actual logic coordinates more data-points than this, including phone accelerometer and GPS.)

In the world of boolean logic, the car is driving, or it is not driving. In the real world, if any of those steps fail — the most common reason is that you are driving through an area will no cell reception, which is a huge part of the North Eastern US where I mainly drive, and also plenty of parts inside of New York City where the buildings block things, or maybe that you are in a tunnel or parking underground or whatever — then we don’t know what you re doing. The statement isn’t true or false, the statement has an absence of evidence, it could be truish or falsish, it exists in a limbo state.

In most programming languages you don’t deal with ones and zeros, you actually deal with variables that have values which is nice because one of those values is “no value set”. The database language SQL even has a nice NULL for those values that just aren’t known yet, and I’m going to use that 70s all caps awesomeness to break it down.

How do we answer the question, “Is the car driving?” when we can only sample the car at an irregular frequency and some amount communication failure guaranteed?