BTC \$3527.50

# The 3 wallets problem

by

This post was released for Issue 17 of Bitcoin Magazine as part of a series of articles about puzzles and games that started with Issue 12.

Here I present a few challenges for bitcoin hoarders, about keeping bitcoins in separate wallets according to some restrictions. Have fun solving them!

Suppose that I have 10 bitcoins and I want to store them in 2 separate wallets (A and B) without splitting coins (that is, not using fractional units). Keeping a wallet empty is allowed. It’s easy to figure out that there are 11 ways of doing so: (0,10), (1,9), (2,8), (3,7), (4,6), (5,5), (6,4), (7,3), (8,2), (9,1) and (10,0).

Figure 1: Example of legal distribution

Challenge 1: Now suppose that I have 1,000 bitcoins¹. How many ways of distributing them among the two wallets are there?

Now suppose that, for security reasons, I don’t want to keep more than 800 bitcoins in a single wallet.

Figure 2: Example of legal distribution.

Figure 3: Example of illegal distribution (there are more than 800 bitcoins in the right wallet).

Challenge 2: How many ways of distributing those 1,000 bitcoins are there now?

Now suppose we add a 3rd wallet and I have no capacity restrictions. Remember that keeping some wallets empty is legal.

Challenge 3: How many ways of distributing those 1,000 bitcoins among the 3 wallets are there?

Figure 4: Example of a legal distribution for 3 wallets and 1,000 bitcoins.

Let’s add a capacity restriction of 800 bitcoins per wallet once again.

Challenge 4: How many ways of distributing those 1,000 bitcoins among the 3 wallets are there now?

Now for those that have cheated by using a computer to solve the previous challenges…

Challenge 5: How many ways of distributing 21 million bitcoins among 3 wallets with a maximum allowed capacity of 10 million each are there?

And now for those that have solved all the challenges so far, suppose that wallet A has a maximum allowed capacity of 5 million bitcoins, wallet B has a maximum allowed capacity of 10 bitcoins and wallet C has a maximum allowed capacity of 15 million bitcoins.

Challenge 6:  How many ways of distributing those 21 million bitcoins among the 3 wallets are there now?

And finally, let’s add a fourth wallet and remove the capacity restrictions.

Challenge 7:  How many ways of distributing those 21 million bitcoins among the 4 wallets are there now?
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}