# A Penny Doubled Every 30 Days or One Million Dollars

**one**

**million**dollars or

**one**

**penny**?

Seems like an easy decision, but what if we knew that our

**penny**would

**double every day for**

**30**

**days**?

This may be a harder decision than we thought.

Let's see which would be worth more at the end of

**30**days.

### How to Calculate the Value of the Penny

All we have to do is raise **2** to the power of the **number of days minus one** and then multiply by **.01**.

Here's an example implementation in JavaScript:

```
function calcPennyValue(number_of_days) {
// 2 to the power of the number of days - 1
// 2 to the power of 0 is 1
// each time we raise the power of 2 it doubles
return Math.pow(2, number_of_days - 1) * .01;
// multiply by .01 to go from dollars to cents
}
}
```

We must understand the power of binary in programming, but it is also often helpful in the real world.

### Why Compound Interest is Important

Understanding compound interest is crucial to our financial literacy and success. Compound interest is the interest calculated on the initial principal and the accumulated interest from previous periods. This means that as time goes by, the interest earned on our money also grows. We see power of compounding with our example of a penny doubling every day for 30 days.

At first, it may seem like a penny doubling every day for 30 days would only result in a small amount. However, if we take a closer look, we can see the significant impact of compound interest. On day one, we have one penny, and on day two, we have two pennies. On day three, we have four pennies, and on day four, we have eight pennies. This doubling pattern continues for 30 days.

By the end of the 30th day, we have $5,368,709.12! This means that in just 30 days, our initial investment of one penny has turned into more than a million dollars. This example shows how the power of compounding can turn a small investment into a substantial amount over time.

Understanding compound interest is especially important when it comes to long-term investments such as retirement savings. By investing our money in a retirement account with compound interest, we can ensure that our savings grow over time. Even small amounts of money invested regularly can grow into a significant amount over several decades, thanks to the power of compounding.

It's also essential to understand the impact of compound interest when it comes to borrowing money. When we take out a loan, we're essentially borrowing money and agreeing to pay interest on that loan. With compound interest, the interest we owe grows over time, meaning that we end up paying more in interest than we may have initially anticipated.

### Conclusion

In conclusion, understanding the power of compound interest is important. By taking advantage of compounding through investments and being aware of its impact when borrowing money, we can make informed financial decisions that will benefit us in the long run.

### Resources