doubling and halving sums
the maths you need
what it is
A doubling sum from 1 ends one short of its next term, and a halving sum from one half stays short of 1. Such sums show that a full heap, a tree met below, is built in fewer sinking steps than it has items.
Add 1, 2, 4 and 8, each twice the one before: a doubling sum. The total, 15, is one less than the next term, 16. So the last term outweighs the rest: 1, 2 and 4 make 7. , read 2 to the power , is 2s multiplied together. Each 2 fewer halves it, 8, 4, 2, so 2 to the power 0 is 2 halved, 1. So 1, 2, 4 and 8 are 2 to the power 0, 1, 2 and 3.
Halve from one half instead: one half, one quarter and one eighth make 7 eighths. Each term covers half the gap still left to 1, so the gap never closes.
- the halving sum
- its ceiling, 1
Multiply each halving term by a count that climbs by one: 1 over 2, 2 over 4, 3 over 8. This weighted sum makes 11 eighths, 1.375, so far. Question 3 shows it stays under 2.
- the weighted sum
- its ceiling, 2
A heap here keeps items, such as numbers, in a tree: levels of 1, 2, 4 and on, each item joined to at most two below. Each is at least as big as those under it, so the biggest is on top. To build a full heap, every level filled, lay the items in level by level from the left. Then each item with items under it sinks, from the last back to the top. While an item under it is bigger, it swaps with the biggest: one sinking step. Those below have already become heaps, so the whole tree ends as one.
A full heap's levels hold 1, 2, 4 and on items, a doubling sum. The bottom level outnumbers the rest. Its items cannot sink, and each level up holds half as many, each able to sink one level more. For 4 levels that is 4 × 1 + 2 × 2 + 1 × 3, which is 11. That is 8 × (1 over 2 + 2 over 4 + 3 over 8), the bottom's 8 times the weighted sum (question 4, line 4).
where the formulas come from
Each question is worked out one numbered line at a time. A line shows the move it makes, the line itself, and why the move is allowed. A line either follows from the lines above it, or brings in something the question needs, such as how the method works, a small fact about , or a result from another page, with its own reason. Press 'hide the lines, then guess each one' to cover the lines and uncover them one by one, guessing each before you see it.
the move: name the sum
the line:why it is allowed: Let be the doubling sum up to . For as 3, it is 1 + 2 + 4 + 8.
the move: double both sides
the line:why it is allowed: Each term doubled is the next one along, and becomes . Doubling both sides keeps them equal. The plan: the two sums share all but their ends.
guess it, thenthe move: take line 1 away
the line:why it is allowed: Take from both sides of line 2. On the right, write out as line 1 does.
guess it, thenthe move: tidy the left side
the line:why it is allowed: Two lots of less one lot is one lot.
guess it, thenthe move: cancel what both brackets share
the line:when n is 3 1 2 4 8 16 first bracket 2 4 8 16 second bracket 1 2 4 8 left over take away 1 16 Line 4 when is 3. The 2, 4 and 8 cancel, leaving 16 less 1, which is 15. why it is allowed: Every term from 2 to is in both brackets and cancels, leaving less 1.
guess it, thenthe move: the terms before the last
the line:why it is allowed: The sum of line 5 stopping one term sooner: line 5 with for . For 3, it is 1 + 2 + 4. At as 0 no terms are left, adding to 0, and 2 to the power 0, less 1, is 0 too.
guess it, thenthe move: tidy the power
the line:why it is allowed: One more than is . For 3, 1 + 2 + 4 is 7, one less than 8.
guess it, thenthe move: read it
the line:why it is allowed: By lines 6 and 7, the terms before the last add to one less than it: the last outweighs them all. By line 5 the sum is under , twice the last.
guess it, then
try it with a small : at , line 1 gives , which you can work out by hand
the move: name the sum
the line:Line 1 for 3, 7 over 8, short of 1 by 1 over 8. why it is allowed: Let be the halving sum from one half down to 1 over . The bars add it for 3.
the move: double both sides
the line:why it is allowed: As in question 1: double, take away, and all but the ends cancel. Doubled, one half becomes 1, and 1 over becomes 1 over , as is twice . For 3, 2 × 1 over 8 is 2 over 8, which is 1 over 4.
guess it, thenthe move: take line 1 away
the line:why it is allowed: Take from both sides of line 2. On the right, write out as line 1 does.
guess it, thenthe move: tidy the left side
the line:why it is allowed: Two lots of less one lot is one lot.
guess it, thenthe move: cancel what both brackets share
the line:why it is allowed: Every term from one half to 1 over is in both brackets and cancels, leaving 1 less 1 over . For 3, 1 less 1 over 8 is 7 over 8.
guess it, thenthe move: a ceiling
the line:why it is allowed: Line 5 takes 1 over , above zero, from 1, so is under 1, and so at most 1.
guess it, thenthe move: read it
the line:why it is allowed: By line 5 the sum falls short of 1 by its last term, which halves each time but never reaches zero. Line 6 makes 1 its ceiling.
guess it, then
try it with a small : at , line 1 gives , about 0.88
the move: name the sum
the line:why it is allowed: Let be the weighted sum, term being over 2 to the power , up to . For 3, it is 1.375.
the move: double both sides
the line:why it is allowed: As in question 1, double, then take away. Doubling a term halves its bottom. For 3, 3 over 8 becomes 3 over 4.
guess it, thenthe move: take line 1 away
the line:why it is allowed: Take from both sides of line 2. On the right, write out as line 1 does.
guess it, thenthe move: tidy the left side
the line:why it is allowed: Two lots of less one lot is one lot.
guess it, thenthe move: take away term under term
the line:bottom first bracket second bracket left over 1 1 1 2 2 over 2 1 over 2 1 over 2 4 3 over 4 2 over 4 1 over 4 8 3 over 8 take away 3 over 8 Line 4 when is 3, term under term. why it is allowed: Stand each term of the second bracket under the one of the first with the same bottom. The top above is one more, so each pair leaves 1 over that bottom. The front 1 and over have no partner.
guess it, thenthe move: the halving sum, one term shorter
the line:why it is allowed: The halving sum of question 2 with terms, its line 5 with for . At as 1 both sides are 0.
guess it, thenthe move: put the front 1 back
the line:why it is allowed: Add 1 to both sides of line 6. For 3, 7 over 4 is 2 less 1 over 4.
guess it, thenthe move: use line 7
the line:why it is allowed: Line 7's total takes the place of line 5's halving terms. For 3, 7 over 4 less 3 over 8.
guess it, thenthe move: put both over the same bottom
the line:why it is allowed: 1 over is 2 over , since is twice . For 3, 1 over 4 is 2 over 8.
guess it, thenthe move: add the two fractions
the line:why it is allowed: Taking away 2 over , then over , takes away over . For 3, 2 less 5 over 8 is 1.375.
guess it, thenthe move: a ceiling
the line:why it is allowed: Line 10 takes over , above zero, from 2, so is under 2, and so at most 2.
guess it, thenthe move: read it
the line:why it is allowed: In line 10 the top climbs by one each term while the bottom doubles. So the gap to 2 shrinks toward zero, never reaching it, as line 11 says. The gap is 5 over 8 at 3 terms and 12 over 1,024 at 10, where the sum is about 1.99.
guess it, then
try it with a small : at , line 1 gives , about 1.38
the move: add up each item's most
the line:A full heap of 3 levels, numbered 0 to 2 down from the top. Each place shows the most its item can sink, 4 in all. levels under it, items, most each sinks, most steps, 0 4 0 0 1 2 1 2 2 1 2 2 in all 7 4 Line 1 for 3 levels, a row per level. It adds the last column, 4. why it is allowed: Here counts levels, each holding twice the one above, from 1 at the top. Number a level by , the levels under it, as the table does for 3. It lies below the top, so it holds items, each able to sink . , read the sum of, adds the term after it for each from 0, under it, to , over it. For 3 levels it adds the table's last column, 0 + 2 + 2, which is 4. No build takes more than .
the move: leave out the bottom level
the line:why it is allowed: The term for as 0 is 0, so start at 1. With 1 level nothing is left to add, giving 0, as one item cannot sink.
guess it, thenthe move: split each power
the line:why it is allowed: The plan: bring in question 3. Dividing by takes of its 2s away, leaving . For 3 levels and as 1, 4 over 2 is 2.
guess it, thenthe move: take the bottom count out in front
the line:why it is allowed: Every term has the factor , the bottom level's items: multiply by it once, after adding. For 3 levels, 1 × 2 + 2 × 1 is 4 × (1 over 2 + 2 over 4), 4 × 1.
guess it, thenthe move: use question 3
the line:why it is allowed: Line 4's sum is the weighted sum of question 3 with terms: its line 10, for . With 1 level both are 0. For 3 levels, 2 less 4 over 4 is 1, and 4 times 1 is 4.
guess it, thenthe move: multiply out
the line:why it is allowed: times 2 is , and times over is .
guess it, thenthe move: tidy the bracket
the line:why it is allowed: is . For 3 levels, 8 less 4 is 4, as line 1 counts.
guess it, thenthe move: count the items
the line:why it is allowed: The levels hold 1, 2, 4, up to items, by lines 6 and 7 of question 1. For 3 levels, 7.
guess it, thenthe move: a ceiling
the line:levels items the guess line 7 2 3 3 1 3 7 14 4 4 15 45 11 5 31 124 26 The guess, items times the most the top item can sink, beside line 7. Only line 7 stays under the items. why it is allowed: As is at least 1, line 7 takes at least 2 from , so is at most .
guess it, thenthe move: the count is reached
the line:step top middle bottom laid in 1 2, 3 4, 5, 6, 7 3 sinks 1 2, 7 4, 5, 6, 3 2 sinks 1 5, 7 4, 2, 6, 3 1 sinks 7 5, 1 4, 2, 6, 3 1 again 7 5, 6 4, 2, 1, 3 1 to 7 laid in smallest first, one sinking step a row, 4 in all. why it is allowed: Lay different items in smallest first, as the table does. Each is then smaller than everything under it, and sinking below only swaps those items among themselves, so it stays so. So each sinks all the way: 3 and 2 sink 1 each, and 1 sinks 2, all 4 steps. Some build takes all steps.
guess it, thenthe move: read it
the line:why it is allowed: By lines 8 and 9, a full heap of items takes at most sinking steps, fewer than its items. That ceiling grows in step with the items, the rung the growth ladder calls linear.
guess it, then
try it with a small : at , line 1 gives , which you can work out by hand
a worked example
Build a full heap of 3 levels from 3, 6, 2, 5, 1, 4, 7.
- Laid in: 3 on top, 6 and 2 under it, 5 and 1 under 6, and 4 and 7 under 2.
- 2 swaps with 7, the bigger of 4 and 7: 1 step. 6 is bigger than 5 and 1 and stays.
- 3 swaps with 7, then with 4: 2 steps. The heap reads 7, then 6 and 4, then 5, 1, 3 and 2.
- 3 steps in all, fewer than the 4 that question 4 allows for 3 levels.
the trap
check yourself
A method does 64 steps, then 32, then 16 and on, halving down to 1. How many steps in all?
the answer
Read from 1 up, it is the doubling sum up to 64, 2 to the power 6. By question 1, 128 less 1, which is 127.
What is one half + one quarter + one eighth and on, up to 1 over 1,024?
the answer
1,024 is 2 to the power 10, so by question 2, 1 less 1 over 1,024, which is 1,023 over 1,024.
A full heap has 5 levels and 31 items. At most how many sinking steps build it?
the answer
By question 4, with as 5, which is 32 less 6, 26, fewer than 31.