Age Calculator and Life Visualization

Posted In: Counting

This is a simple age calculator that calculates your age down to the second.

The age calculator should be relatively self-explanatory, just enter your birthdate into the tool.  You can also enter the time of birth (if you want to), otherwise it will assume you were born at midnight.

There are two options for viewing your “age”.

  • The first (“Numerical Age“) is a table that shows the number of years, months, days, hours, minutes and seconds since you were born. It also shows how long it will be until your next birthday.  You can also use the Start Clock button to see your age change each second.
  • The second (“Graphical age“) is a figure that shows your age in the context of a 90 year lifespan.  Each block shown is one week and there are 52 weeks (blocks) in a year (row) and 10 years (rows) per decade (group of blocks).

This visualization is based on the the very interesting Wait But Why post “Your Life in Weeks” by Tim Urban.  It’s a bit humbling to see your life laid out in this way, and to think about how you will spend the (hopefully many) remaining weeks of your life.

You can click the URL button to create a URL that is based on the your birthday (so you don’t have to type it in again).  Just copy the URL in the address bar at the top of your browser (after pressing the button) to share with others.

Programming: this program was written in javascript and uses the moment.js library to simplify the date calculations.

age calculator visualization

How long does it take to count to 1 million? 1 billion? 1 trillion?

Posted In: Math | Programming

My son likes large numbers (like septillion, googol and googolplex) and once asked me how long it would take to count to septillion (which is 1 followed by 24 zeros).  I told him it would take longer than the age of the universe to do that, so he started working his way down.  He asked me about counting to one million.  I did a little math (assuming one number per second) and got about 11-12 days . . . but then thought, the large numbers (like 658,243) take more than a second to say.

Looked on the web a little to see if anyone else had done a more sophisticated calculation.  Lots of calculations were like my own (assuming one number per second).  Others acknowledge that it would take longer for large numbers and made assumptions about what that would be.  But nothing definitive, so I thought I’d make one.  This counting calculator is based on the number of syllables in every number and counts all the syllables you’d have to pronounce in order to count from one to one million (or other numbers).


Tesla Model 3 Sales Tracker

Posted In: Energy | Technology | Transportation

Tesla has been building innovative and industry-leading battery-powered cars for about a decade, starting with the Roadster, and then the Model S and Model X. The company unveiled the Model 3 (their first mass-market electric car with 220 miles of range, priced at “$35,000”), in early 2017 and hundreds of thousands of people put down a $1000 deposit within a few days. Overall, the number of these pre-orders total about half a million! It was impressive for a car most people have not driven or even seen.

The company also has had optimistic timeframes for producing and shipping these vehicle: they had originally estimated production rates of 5000 cars/week by the end of 2017 and 10,000 cars/week(!) in 2018. That’s Civic or Camry levels. These have since been delayed due to reports of “production hell” in scaling up mass production for the vehicles. Given the unprecedented demand and production challenges as Tesla transitions from niche automaker to mass-market production, I thought it would be worthwhile to track the sales of Model 3s as they are built and shipped to customers with the Model 3 Sales Tracker. Average sales price has been far above the $35,000 price initially announced. Production has reportedly passed 5000 cars/week intermittently, if not continuously, in the summer of 2018.


How Much Water is in California Reservoirs? – Current and Historical Visualization

Posted In: Water

California has had an issue with drought, especially for the past few years now.  Recently, 2016’s El Nino weather pattern has brought a significant amount of rain to the state and helped alleviate some, but not all, of the major issues.  
I’ve been very curious to understand how the rain storms we experience are lessening the impact of the drought, and whether one wet season (like 2016) can really “get the state out of a drought”.  One way to assess this is to look at the status of California reservoirs.


Current Bay Area Air Quality

Posted In: Environment | Health

Fires are once again raging in California and air quality in one of the most populated metropolitan areas in the country (the San Francisco Bay Area) is quite poor. This map show current air quality in the Bay Area. For more information see the EPA’s Air Quality website.

AQI colors

EPA has assigned a specific color to each AQI category to make it easier for people to understand quickly whether air pollution is reaching unhealthy levels in their communities. For example, the color orange means that conditions are "unhealthy for sensitive groups," while red means that conditions may be "unhealthy for everyone," and so on.

Air Quality Index
Levels of Health Concern
Good 0 to 50 Air quality is considered satisfactory, and air pollution poses little or no risk.
Moderate 51 to 100 Air quality is acceptable; however, for some pollutants there may be a moderate health concern for a very small number of people who are unusually sensitive to air pollution.
Unhealthy for Sensitive Groups 101 to 150 Members of sensitive groups may experience health effects. The general public is not likely to be affected.
Unhealthy 151 to 200 Everyone may begin to experience health effects; members of sensitive groups may experience more serious health effects.
Very Unhealthy 201 to 300 Health alert: everyone may experience more serious health effects.
Hazardous 301 to 500 Health warnings of emergency conditions. The entire population is more likely to be affected.

For more information and additional maps see the EPA’s Air Quality website.

Bitcoin Energy Consumption – Does It Consume More Energy Than Your State?

Posted In: Energy | Money

This visualization looks at the staggeringly high energy use of Bitcoin and puts it into context: comparing it to electricity usage of US states. Unfortunately for Bitcoin, high energy usage is an intended feature of the system, rather than an unintended consequence. This is because mining is an increasingly energy intensive process, based upon increasingly computationally intensive calculations that are performed on high powered computers and graphical processing units.

Currently, 28 out of 50 states plus the District of Columbia all have lower electricity consumption than estimated annual bitcoin electricity consumption (~73 TWh per year). These states are highlighted in variations of yellow. This is approximately equal to the average annual electricity usage across all US States. States with higher electricity consumption than bitcoin are highlighted in shades of red.

When dividing the total energy use (73 TWh) by the current number of transactions (93 million), we get an average energy consumption of 783 kWh per transaction. Click on the “Energy per Transaction” button to see this visualization. What’s crazy is that a transaction is simply a transfer of bitcoin between “wallets”, recording the transaction, and a validation of the process. There’s no good reason why verifying digital transactions should take this much energy, except that it was built into the fundamental process of validating and mining bitcoin. 783 kWh is larger than the monthly per capita electricity consumption in 10 US states. It could also drive you and your family over 2000 miles in an electric car (e.g. Tesla Model S).

I’m not expert enough in this area to know how much more energy consumption will rise into the future, but if crypto advocates’ predictions come true and bitcoin is used extensively, millions of transactions will occur per hour instead of per year and the price of bitcoin may rise much higher than it currently is. If the price rises, then miners will be willing to expend more energy to “mine” the more valuable bitcoin. Needless to say, this sounds like a very bad idea from an energy consumption and sustainability standpoint.

Data and Tools:
State energy data comes from the US Department of Energy. Estimates of Bitcoin energy use come from Digiconomist’s Bitcoin Energy Consumption Index. The choropleth map is visualized using javascript and the Leaflet.js library with Open Street Map tiles.

bitcoin energy

Solar (Sun) Intensity By Location and Time

Posted In: Energy | Science

This visualization shows the amount of solar intensity (also called solar insolation and measured in watts per square meter) all across the globe as a function of time of day and day of year. This is an idealized calculation as it does not take into account reductions in solar intensity due to cloud cover or other things that might block the sun from reaching the earth (e.g dust and pollution).

As would be expected, the highest amount of solar intensity occurs on the globe right where the sun is overhead and as the angle of the sun lowers, the solar intensity declines. This is why the area around the equator and up through the tropics is so sunny, the sun is overhead here the most. If you click on the map you should see a popup of the intensity of sunlight at that location.

As the earth rotates over the course of a day, the angle of the sun changes and eventually the angle is so low, the sun is blocked by the horizon (this is sunset).

  • The default is to show the sunlight intensity for the current date and time but you can change it by moving the sliders for hour or day.
  • You can also toggle between the orientation of the surface that you measure the sunlight on. The default shows the intensity of sunlight on a horizontal surface. The other option shows the intensity on a surface that is oriented to face the sun (i.e. perpendicular)

Again, the intensity will depend on the angle it makes with the sun and so it depends on your location on earth (i.e. latitude). Latitudes around the equator will receive more sunlight because their angle is closer to perpendicular.

Shifting through the days of the year, you can start to see the cause of the seasons as the amount of sunlight changes and more or less sunlight goes to each of the northern and southern hemispheres.

Calculations and Tools:
The calculations for solar intensity are based on equations from “Renewable and Efficient Electric Power Systems” by Gilbert Masters Chapter 7. Calculations were made using javascript and visualized using the Leaflet.js library with Open Street Map tiles.

This was a fun project for me to learn online mapping tools and programming.

Most Stressed States

Posted In: Health

Long-term stress has been shown to be detrimental for your health. While it’s probably not possible to completely eliminate stress from people’s lives, there are many individual choices and decisions that can influence the amount of stress that people experience, including where they live, what job they have, their socio-economic conditions etc. . . One interesting bit of data analysis looks at an aggregate level to understand how stress differs from state to state depending on specific economic, demographic and other geographic factors.

This post shows a map of the most stressed states in the United States. The map is color coded from red (most stress) to blue (least stress) as a ranked list. Stress is divided into several categories including:

  • Work Stress is calculated from data on work hours, commute times, job security, unemployment rate, income growth and other metrics.
  • Money Stress is calculated from data on income, debt, credit scores, bankruptcy, housing affordability, poverty levels and other metrics.
  • Family Stress is calculated from data on divorce rates, single parents, childcare costs, parental leave policies and other metrics.
  • Health and Safety Stress is calculated from data on adult health, depression, mental health, health insurance, physical activity rate, crime rate, and other metrics. 

Click on the buttons below the map to switch between the different categories.

Data and tools: The data comes from Wallethub’s analysis of data from a wide range of sources including the US Census, BLS, CDC etc.. Unfortunately the data used is a ranked list rather than a set of scores. The ranking doesn’t tell you if a state is 10% more stressful or 10 times more stressful, just that one is higher than the other. Click the link for a full description of their methodology and data sources. The choropleth map was created using javascript to parse the data and the open source graphing library to visualize it.

When Can I Retire? Early Retirement Calculator / FIRE Calculator

Posted In: Financial Independence | Money

How long do I need to save before I can retire?

This early retirement calculator / visualizer is designed to project the number of years until you can retire, based upon a few key inputs such as annual income and spending, income growth rate, expected annual spending in retirement and asset allocation. It is a pre-retirement calculator that is useful before you retire to get a sense of how many years it is likely to take to accumulate enough money to retire. The three primary modes that are available in the early retirement calculator are: (1) constant, single fixed-percentage real return rates, (2) historical series of real returns are applied to account for likely variability in future returns and (3) monte carlo simulation of the variable returns based upon user-specified input parameters.

This interactive calculator was built to let you play with the inputs and help you understand how savings rate and retirement spending strongly determine how long it will take you to save up for retirement. Note: it does not simulate the post-retirement period when you start to draw down your savings. That can be done on this post-retirement calculator (Rich, Broke or Dead) which compares the frequency of various outcomes in retirement (running out of money, ending up with way too much money, and life-expectancy).