< Return to main blog page

Mancala

Note: in this entire blog, the only Mancala board that is considered is the classic board with 6 slots per side and 2 banks.

Some years ago I started playing Clubhouse Games on the Nintendo Switch, and I discovered this game named "Mancala". After learning how to play it I got some questions... "How many possible games are there?" "Do I win more often if I'm first or if I go as second" "How often do you tie?". So being the programmer that I am, I started working on an answer to all of these questions.

Research

Mancala is a game that is more than 2000 years old (sources differ drastically), but despite that, I haven't found anyone who reported any statistics about this game. The closest information that I actually found was a reddit post with a comment saying that the rough estimate of possible games being "6^20" (3656158440062976). I also found some integer sequences on OEIS, but they only got sequences about a solitaire version of Mancala. The street leading to the answers I'm looking doesn't exist, so I'll have to create one myself.

Coding

Since computing approximately 6^20 games would require great performance, I obviously used Rust.

Rust is an high-level programming language that compiles to an executable that is as fast as C/C++.

Before starting coding, I checked out crates.io (rust's libraries) and I found what I was looking for, the library mancala_board. I instantly started contributing to the library, improving it and making it faster. After that, I started writing my "Mancala Calculator" and I discovered the followig things:

Results

After letting it run for around a minute, it used up 4GB of RAM and it finally gave the result I was waiting for.

How many unique games of 48 piece Mancala are there?

There are 19836470448856257280 distinct Mancala games. Taking the 6th logarithm of 19836470448856257280, results into ~24.8, which is the average game length counted in moves. If you also wanted to consider the flipped board state (since our board is rotationally symmetric, it doesn't change anything, except multiplying the total games by two) which results into 39672940897712514560 games.

Is it better to play as first or as second in Mancala?

It's slightly beneficial to play as first, but only by around 0.41%. Out of all possible games, 9051489445278008834 are won by the first player and the second player won 8971659732539005146 games. First player: 45.63% of games won. Second player: 45.22% of games won.

How often do you tie in Mancala?

Tying happens in 9.14% of the games.

What about games with different quantities of pieces per slot?

Here's a table with ""everything"" I found

pieces per slot

unique games

first wins

second wins

ties

1

1060

560

500

0

2

16988464

6835542

9172100

980822

3

1508385906874

717687745003

710485191934

80212969937

4

19836470448856257280

9051489445278008834

8971659732539005146

1813321271039243300

5

?

?

?

?