Some familiar context. See the term cheatsheet
4 30
14 29
3 / \ / \
/ \ / \
/ \ / \
/ \ / \
2 6 . . 13 21 28
/ \ / \ / \ / \
1 2 | 5 | 9 | 12 | 17 | 20 | 24 | 27 | --- massif tree line massif height index = 1
/ \ |/ \ | / \ | / \ | / \ | / \ | / \ | / \ |
0 1|3 4|7 8|10 11|15 16|18 19|22 23|25 26| MMR INDICES
-----|-----|-----|-------|------|------|------|------|
0 1|2 3|4 5| 6 7| 8 9|10 11|12 13|14 15| LEAF INDICES
-----|-----|-----|-------|------|------|------|------|
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | MASSIF INDICES
-----|-----|-----|-------|------|------|------|------|
- n shall be the
mmrPosition
, themmrSize
and the count of nodes. - g shall be the zero based height index of an MMR. The height index of a leaf is 0.
- h shall be the one based height of an mmr
- e shall be the zero based
leafIndex
- f shall be the one based
leafPosition
or count of leaves.
Shifting left is raising 2 to the power:
Dividing by two is just shifting right. Or subtracting 1 from the existing left shift in a power expression.
Multiplying by two is just shifting left. Or adding 1 to the existing left shift in a power expression.
Where the factors are powers of 2 these generalise as
For example, where
Then,
[1]
[2]
From [1] & [2] we can get
Then,
[3]
From [3] we get