Shadow System / 2-Block Cards - Variable Image Stacking Simulator

(Disclaimer: I have zero background or experience with coding!)

I wanted to find a program that would simulate random deck configurations and determine how many loci would be needed to memorize the deck via the variable image stacking technique in the Shadow System.

I wrote out a set of flowchart-like steps and then asked chatGPT to write a python script to run it.

The result is quite amazing.

This program randomized 52 items (26 black, 26 red) draws one pair at a time, and based on the first item’s color creates loci that follow VIS rules.

The user inputs a number of simulations to run and the results are displayed. It will tell you the average number of loci needed per run and the number of times a specific loci amount occurs within the simulation.

The results follow the expected bellcurve where 13 and 14 loci runs are the most common with decreasing results for each step up or down. I was able to do a simulation of 100,000 shuffled decks and only saw a result of 6 loci five times, while a deck needing 21 loci only appeared twice. Below 6 and above 21 didn’t appear once in the 100000 simulations run.

This info might be useful for those looking to build memory palaces for 2-block card systems. You can likely get by with a palace of 17 or loci. The odds of needing more than that are vanishingly small.

Again, I’m not a programmer, so I’m trusting chatGPT’s abilities here, but the results are in line with the expected bellcurve.

2 Likes

I was able to simulate 1 MILLION decks, and here’s the distribution:

2 Likes

Here’s a link if you want to play around with it. If you understand python coding and want to check it over, that’d be cool too!

EDIT: Not sure why this site formats really weird in the posts, but I think the link works!

[Shadow System - Variable Image Stacking - Loci Simulator - Replit]

You can get it to work by changing the format of the link:

[link text](url goes here)

Or paste the URL into a list item to prevent the forum from generating a larger preview:

- https://example.com/
1 Like

Hi! I think I know how to calculate theoretical probabilities for this.
Basic task is “how many red cards are on odd positions in deck?”
But the last position should not be counted. (If the last card pair in a deck is red you don’t go to next loci, right?)

Let me firstly do for a small 6 card deck: 3 red cards and 3 black cards.
In how many ways you can put 3 cards on 6 positions?
A formula from combinatorics:
C(k,n)= (n!/(n-k)!) /k!
k - number of objects (don’t care what order will they go)
n - number of positions
C(3 red cards, 6 places) = (6!/(6-3)!) / 3! = 20 — number of all possible red-black combinations for 3 red and 3 black;
Explanation
First red card can go on either of 6 positions.
Second red card can go on either of 5 left positions.
Third red card can go on either of 4 left positions.
This is 6x5x4 combinations
6x5x4 = 6!/3! = 6!/(6-3)!
But we don’t care what order do red cards appear.
Different red card orders mean the same for us.
So we should divide by the number of different 3 card orders(3!).
That’s why [6!/(6-3)!] / 3!

How many of these combinations will lead to 2 loci attempt?
Deck should have only 1 red card on odd position(except last).
If we multiply combinations of cards on odd positions(except last) by combinations of cards on other positions we will get number of all combinations.
One card can go to 2 odd positions in 2 combinations.
2 red cards go to 4 other positions in 6 combinations(4!/(4-2)! / 2!).

So it is 2x6=12 situations will lead to 2 loci attempt.
Bell curve for 3 red and 3 black cards deck
Format:
[number of loci in attempt]:[number of combinations for cards on odd positions(except last)]*[number of combinations for cards on other positions(except last)] = [how many combinations will lead to this number of loci]

1 loci: C(0 red cards, 2 places)*C(3 red cards, 4 places) = 2!/2!/0! * 4!/1!/3! = 4
2 loci: C(1 red cards, 2 places)*C(2 red cards, 4 places) = 2!/1!/1! * 4!/2!/2! = 12
3 loci: C(2 red cards, 2 places)*C(1 red cards, 4 places) = 2!/0!/2! * 4!/3!/1! = 4

probability of 1 loci is 4/20=20%
probability of 2 loci is 12/20=60%
probability of 3 loci is 4/20=20%

Normal 52 card deck:
C(26,52) = (52!/26!)/26! = 495 918 532 948 104 -number of all possible red-black combinations.

Let’s count the Bell curve
Format:
[number of loci in attempt]:[number of combinations for cards on odd positions(except last)]*[number of combinations for cards on other positions(except last)] = [how many combinations will lead to this number of loci]
1 loci: C(0,25)*C(26,27) = [(25! / 25!) / 0!] * [(27! / 1!) / 26!] = 27
2 loci: C(1,25)*C(25,27) = [(25! / 24!) / 1!] * [(27! / 2!) / 25!] = 8775
3 loci: 877 500
4 loci: 40 365 000
5 loci: 1 021 234 500
6 loci: 15 727 011 300
7 loci: 157 270 113 000
8 loci: 1 067 190 052 500
9 loci: 5 069 152 749 375
10 loci: 17 235 119 347 875
11 loci: 42 617 749 660 200
12 loci: 77 486 817 564 000
13 loci: 104 309 177 490 000
14 loci: 104 309 177 490 000
15 loci: 77 486 817 564 000
16 loci: 42 617 749 660 200
17 loci: 17 235 119 347 875
18 loci: 5 069 152 749 375
19 loci: 1 067 190 052 500
20 loci: 157 270 113 000
21 loci: 15 727 011 300
22 loci: 1 021 234 500
23 loci: 40 365 000
24 loci: 877 500
25 loci: 8775
26 loci: 27
(Numbers sum up to 495 918 532 948 104, as they should. I’ve checked)

So probability of 26 loci is 27/495 918 532 948 104 = 0,0000000000000544

Hope it helps. It was fun to count :smile:

3 Likes

Awesome. This is a smart way of looking at it! I THINK I follow haha