An empty tree puts in 50, 30, 70, 20, 40 and 60, in that order. How many comparisons do the six puts make in all?
the answer, and why
the answer is D
50 is the top, 0. 30 and 70 meet 50, 1 each. 20 and 40 meet 50 and 30, 2 each. 60 meets 50 and 70, 2. That is 8.
step 17 of 21
To put 60 in, start at the top.
numbers compared: 0
step 18 of 21
60 is bigger than 50, so go right.
numbers compared: 1
step 19 of 21
60 is smaller than 70, so go left.
numbers compared: 2
step 20 of 21
The way runs out, so hang 60 to the left of 70.
numbers compared: 2
Operation 6 puts 60 in. It meets 50, then 70, and hangs to the left of 70. 2 comparisons.
if you chose another
AThat counts every number before each put, as if the tree were a path.
BThat counts 1 comparison a put after the first, but 20, 40 and 60 hang on level 2.
CThat counts only the last three puts.
2question 2
Which order of these seven numbers, put into an empty tree, costs the fewest comparisons?
the answer, and why
the answer is B
45 is the middle, then 25 and 65 are the middles of each side. 45 costs 0, 25 and 65 cost 1 each, and the 4 numbers on level 2 cost 2 each, 8. That is 10.
if you chose another
AIn order, each number meets all before it, a path, 21.
C45 is the middle, but each side goes in order, a path on each side, 12.
D25 is not the middle, so the tree leans right, 12.
3question 3
Which is true of putting different numbers into an empty binary search tree?
the answer, and why
the answer is D
In order, put meets all numbers before it, in all, which section 4 squeezes between two multiples of .
BA shuffle costs on average, which section 4 squeezes between two multiples of .
CSection 3's grid puts the same seven numbers in four orders, from a path costing 21 to a tree costing 10.
4question 4
An empty tree puts in 30, 10, 50, 40 and 60, then takes 30 out. How many comparisons do the six operations make?
the answer, and why
the answer is D
The puts make 0, 1, 1, 2 and 2, which is 6. The take meets 30 at the top, 1. 40, the smallest number to its right, takes its place, reached by following links with no comparison. That is 7.
step 18 of 24
Here is 30.
numbers compared: 1
step 20 of 24
Go right once, to 50.
numbers compared: 1
step 21 of 24
Go left, to 40.
numbers compared: 1
step 23 of 24
40 moves up to where 30 was, and 30 is out.
numbers compared: 1
Operation 6 takes 30 out. It is met at the top. Then the walk goes right to 50 and left to 40, and 40 moves up to where 30 was.
if you chose another
AThat leaves out the take's comparison with 30.
BThat counts the walk to 50 and 40 as 2 comparisons; it only follows links.
CThat counts the walk to 40 as 1 comparison; it only follows links.
pen and paper
5question 5about 8 minutes
Put 1 to 8 into an empty tree in the order 4, 2, 1, 3, 6, 5, 7, 8.
Draw the tree.
How many comparisons does each put make?
Check your total against , line 12 of the question on the cheapest order.
a hint
Middle first ends with every level full but the last, 1 number, then 2, then 4.
a worked answer
4 is the top, 0. 2 and 6 meet 4, 1 each. 1, 3, 5 and 7 meet two numbers, 2 each. 8 meets 4, 6 and 7, 3. That is 13. With 3, 9 times 3, less 16, plus 2, is also 13.
puts
level
comparisons each
4
0
0
2, 6
1
1
1, 3, 5, 7
2
2
8
3
3
in all
13
Levels 0, 1 and 2 are full, and 8 sits alone on level 3.
Why can no order cost fewer than comparisons, and which order costs just that?22 of 22 shown
1the move: price a number by its level
the line:
step 21 of 25
To put 7 in, start at the top.
numbers compared: 0
step 22 of 25
7 is bigger than 4, so go right.
numbers compared: 1
step 23 of 25
7 is bigger than 6, so go right.
numbers compared: 2
step 24 of 25
The way runs out, so hang 7 to the right of 6.
numbers compared: 2
1 to 7, the middle first. Levels 0, 1 and 2 hold 1, 2 and 4 numbers. Putting 7 in meets 4 and 6, 2 comparisons, as 7 hangs on level 2.
why it is allowed: The top is level 0. A put meets one number on each level above where it hangs, and never its own, as the numbers are all different.
2the move: count what a level holds
the line:
why it is allowed: Each place has at most two children. So level 0 holds 1 number, level 1 at most 2, level 2 at most 4, and so on.
guess it, then
3the move: count level by level
the line:
number
its level
met on level 0
met on level 1
4
0
2
1
1
6
1
1
1
2
1
1
3
2
1
1
5
2
1
1
7
2
1
1
in all
10
6
4
Each row adds to a number's level; each column counts the numbers below a level. Both ways, 10.
why it is allowed: By line 1, a number on level 2 is met once on level 0 and once on level 1. So instead of adding each number's level, add, for each level, the numbers below it. In the table, 6 numbers hang below level 0 and 4 below level 1: 10.
guess it, then
4the move: count what hangs below
the line:
why it is allowed: By line 2, levels 0 to hold at most numbers between them, and every other number hangs below. For 7, at least 7 less 1, which is 6, below level 0, and 7 less 3, which is 4, below level 1, as in line 3's table.
guess it, then
5the move: see middle first fill the levels
the line:
1 to 8, middle first, a row a level. Each heavy box is a stretch, its upright edges its gaps, its middle in blue. At the right, the numbers below each level, line 7's terms.
level
stretches
gaps each
middle numbers
0
1 to 8
9
4
1
1 to 3; 5 to 8
4; 5
2; 6
2
1; 3; 5; 7 and 8
2; 2; 2; 3
1; 3; 5; 7
3
8
2
8
9 gaps become 4 and 5, then 2, 2, 2 and 3. Down to level 2 each place gets at least 2, so holds a number.
why it is allowed: Full means a level holds all line 2 allows. Count gaps: numbers have , one before each and one after the last; in the drawing, a stretch's upright edges. The middle number splits them as evenly as can be, and halving rounded down twice is quartering rounded down once, the same rounded up. So each place on level gets gaps shared by , rounded down or up. Up to level , is at most half of , since is at most , as the page on halving and logarithms shows. So the share is more than 2: for 8, level 2 gets 9 shared by 4. Rounded down it is at least 2, and 2 gaps hold a number.
guess it, then
6the move: see the rest fill the last level
the line:
why it is allowed: At level , shared by is at most 2, since is less than , by the same page. So each place there holds one number or none, with nothing below it. In line 1's picture, level 2 holds 1, 3, 5 and 7; in line 5's table, level 3 holds 8.
guess it, then
7the move: add the levels
the line:
why it is allowed: is the comparisons of the cheapest order. By lines 3 and 4, no order adds fewer for levels 0 to . Levels from on add at least 0, so leaving them out leaves a floor. By lines 5 and 6, middle first adds just these, and nothing for level .
guess it, then
8the move: add each doubling
the line:
where does this come from?
question 1 of the page doubling and halving sumsAdd . What is the total?
1the 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.
2the 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.
3the 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.
4the move: tidy the left side
the line:
why it is allowed: Two lots of less one lot is one lot.
5the 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.
6the 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.
7the 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.
8the 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.
why it is allowed: The doublings 1, 2, 4 and on add up to one less than the next doubling, as the box under this line shows. So 1 + 2 is 3, and 1 + 2 + 4 is 7. For 7 numbers, is 2 and is 6 + 4, which is 10.
guess it, then
9the move: write each term with n + 1
the line:
why it is allowed: Taking away one less than a power of 2 is taking away the power and adding 1, so is . There are terms.
guess it, then
10the move: gather the n + 1s
the line:
why it is allowed: The terms of line 9 each hold one .
guess it, then
11the move: add the doublings again
the line:
why it is allowed: By the box at line 8, the doublings from 1 add up to one less than the next doubling. Here the first 1 is missing, so it is two less. For 7 numbers, 2 + 4 is 6, which is 8 less 2.
guess it, then
12the move: open the bracket
the line:
why it is allowed: Taking away a bracket takes away each thing in it. For 7 numbers, 8 times 2, less 8, plus 2, is 10, as in line 3's table.
guess it, then
13the move: a ceiling
the line:
why it is allowed: Each of the terms of line 9 is less a power of 2, at least 2, so each is less than .
guess it, then
14the move: a simpler ceiling
the line:
why it is allowed: is at most .
guess it, then
15the move: read it as a bound
the line:
why it is allowed: By line 14.
guess it, then
16the move: a floor
the line:
why it is allowed: is at most , so is at most half of . So each term of line 9 but the last is more than half of , and the last is at least 1. From 2 numbers on, line 9 has at least one term. For 8, 4 is half.
guess it, then
17the move: leave out the 1
the line:
why it is allowed: Taking 1 away from the floor of line 16 leaves a floor.
guess it, then
18the move: a floor with logs only
the line:
why it is allowed: is rounded down, so it is more than less 1, and is more than .
guess it, then
19the move: what 8 numbers allow
the line:
why it is allowed: From 8 numbers on, is at least 3, so 2 is at most two thirds of it, and taking 2 away leaves at least a third. At 8, 3 less 2 is 1, exactly a third of 3.
guess it, then
20the move: a simpler floor
the line:
why it is allowed: Put line 19 into line 18.
guess it, then
21the move: read it as a bound
the line:
why it is allowed: By line 20.
guess it, then
22the move: ceiling and floor together
the line:
why it is allowed: Lines 15 and 21 bound by the same growth, .
guess it, then
try it with a small : at , line 7 gives , which you can work out by hand
The tree: 4 on top, 2 and 6 below it, 1, 3, 5 and 7 below them, 8 under 7.
Comparisons 0, 1, 2, 2, 1, 2, 2 and 3: 13.
The formula giving 13 at 8.
6question 6about 8 minutes
Shuffle 1, 2, 3 and 4, every order as likely, and put them into an empty tree.
How likely are 1 and 2 to be compared? And 1 and 4?
Add the chances over all 6 pairs.
Check against at 4.
a hint
1 and 4 are compared when 1 or 4 goes in before both 2 and 3.
a worked answer
1 and 2 have nothing between them, so they always meet. 1 and 4 meet only when 1 or 4 comes first of the four, 2 in 4. The 3 pairs 1 apart give 3, the 2 pairs 2 apart 2 times 2 thirds, and the pair 3 apart 1 half: 4 and 5 sixths. , 1 plus a half plus a third plus a quarter, is 25 twelfths. The formula: 2 times 5 times 25 twelfths is 20 and 5 sixths; less 4 times 4, 16, it is also 4 and 5 sixths.
pairs
apart
compared in
1 and 2, 2 and 3, 3 and 4
1
2 in 2, each
1 and 3, 2 and 4
2
2 in 3, each
1 and 4
3
2 in 4
in all
4 and 5 sixths
Each pair is compared in 2 of every shuffles, where is how far apart they stand.
Why does a shuffle cost comparisons on average?23 of 23 shown
1the move: name the numbers
the line:
why it is allowed: Only how the numbers compare matters to the tree, so any different numbers act like 1 to .
2the move: watch two numbers
the line:
why it is allowed: Take two numbers, the smaller and the bigger. A number already in the tree that is below or above sends every number from to the same way. Watching 2 and 5, a 1 already in sends 2, 3, 4 and 5 all right, and a 6 sends them all left.
guess it, then
3the move: a number between parts them
the line:
step 18 of 22
5 is bigger than 3, so go right.
numbers compared: 1
step 19 of 22
5 is smaller than 6, so go left.
numbers compared: 2
step 20 of 22
5 is bigger than 4, so go right.
numbers compared: 3
step 21 of 22
The way runs out, so hang 5 to the right of 4.
numbers compared: 3
3 comes first of 2 to 5, so 2 hangs down its left side. Putting 5 in meets 3, 6 and 4, and never 2.
why it is allowed: By line 2 it hangs where all of them would go. Then goes down its left side and down its right, so neither is ever above the other. In the picture, 3 comes first of 2 to 5.
guess it, then
4the move: an end meets the other
the line:
step 10 of 24
2 is smaller than 5, so go left.
numbers compared: 1
step 11 of 24
2 is bigger than 1, so go right.
numbers compared: 2
step 12 of 24
The way runs out, so hang 2 to the right of 1.
numbers compared: 2
3 and 5 traded. Now 5 comes first of 2 to 5, and 2's put meets 5, then 1.
why it is allowed: By line 2 the other comes later and goes the same way, down to it, so its put compares them. By line 6 of the question on numbers in order, in section 4 of the learn page, no pair is compared twice. In the picture, 5 comes first, and 2's put meets it.
guess it, then
5the move: see an end of the pair come first
the line:
order
first put
1 and 2 meet
1 and 3 meet
2 and 3 meet
comparisons
1, 2, 3
1
1
1
1
3
1, 3, 2
1
1
1
1
3
2, 1, 3
2
1
0
1
2
2, 3, 1
2
1
0
1
2
3, 1, 2
3
1
1
1
3
3, 2, 1
3
1
1
1
3
in all
6
4
6
16
Every order of 1, 2 and 3, each as likely, with a 1 where a pair meets. An order's comparisons are its 1s added up.
why it is allowed: Trade two of the numbers from to , as lines 3 and 4 trade 3 and 5. The 1 and the 6 go where they did, and the first of 2 to 5 is now 5. Trading back undoes it, so the orders with 3 first pair off with those with 5 first. A shuffle makes every order as likely, so each of the numbers comes first equally often. By lines 3 and 4, the pair is compared when it is or . In the table, 1 and 3 meet in 4 of the 6 orders.
guess it, then
6the move: count the pairs k apart
the line:
why it is allowed: Two numbers stand apart when the bigger is the smaller plus . Each of 1, 2, and on up to pairs with the number above it. With 4 numbers, 3 pairs stand 1 apart. From to there are then numbers, so line 5 gives 2 in .
guess it, then
7the move: average pair by pair
the line:
why it is allowed: is the comparisons averaged over every shuffle. A shuffle's comparisons are the pairs that meet in it, each once by line 4. Adding every shuffle's comparisons counts each pair once for each shuffle where it meets. Dividing by the shuffles gives each pair's share, from line 6. In the table: 6 + 4 + 6 is 16 comparisons over 6 orders, or 1, plus 2 thirds, plus 1.
guess it, then
8the move: write each term with its bottom
the line:
why it is allowed: Each term's bottom is , from 2 to . Its count of pairs, , is less that bottom; for the first term, is .
guess it, then
9the move: multiply out each term
the line:
why it is allowed: The second term, , is , since 3 times 2 over 3 is 2. Every term takes away 2 the same way.
guess it, then
10the move: gather the terms
the line:
why it is allowed: The terms of line 9 each take away 2, and each hold over their bottom.
guess it, then
11the move: name the harmonic sum
the line:
where does this come from?
question 4 of the page expected costHow does grow?
1the move: name the sum
the line:
why it is allowed: Let be the harmonic sum to 1 over , for from 2.
2the move: group in blocks
the line:
The sum to 1 over 12, about 3.10, each term a column 1 over k tall. Behind each place of a block stands its first term, dashed, so 4 dashed columns of 1 over 4 make 1. The last block is cut short.
why it is allowed: Number blocks by from 0. Block starts at 1 over 2 to the power : 1, 1 over 2, 1 over 4, 1 over 8. It stops just before the next start, so it has 2 to the power terms: 1 over 4 to 1 over 7 are 4. The last block may be cut short at 1 over .
3the move: each block at most 1
the line:
why it is allowed: Each term of block is at most its first, 1 over 2 to the power , as a bigger number underneath makes a smaller fraction. So its 2 to the power terms, or fewer, add to at most 1. is at most 1 per block: 4 for 12.
4the move: count the blocks
the line:
where does this come from?
question 2 of the page halving and logarithmsHalve , rounding down each time. How many halvings reach 1?
1the move: name the log rounded down
the line:
Rounding down, 11 halves to 5, 2 and 1. In blue, each log rounded down: 3, 2, 1, 0, one less at each halving.
why it is allowed: Here is the number halved, from 2 up; for 11, is 3.
2the move: rounding down never adds
the line:
why it is allowed: For 11, 3 is at most 3.46.
3the move: rounding down takes off less than 1
the line:
why it is allowed: For 11, 4 is above 3.46.
4the move: raise 2 to each side of line 2
the line:
why it is allowed: 2 raised to a bigger power gives a bigger number. For 11, 8 is at most about 11.
5the move: 2 to the log of n is n
the line:
why it is allowed: By what a log is. For 11, 8 is at most 11.
6the move: raise 2 to each side of line 3
the line:
why it is allowed: As in line 4. For 11, about 11 is below 16.
7the move: 2 to the log of n is n
the line:
why it is allowed: As in line 5. For 11, 11 is below 16.
8the move: halve both sides of line 5
the line:
why it is allowed: For 11, 4 is at most 5.5, which is not whole.
9the move: write the half as a power
the line:
why it is allowed: Half a power of 2 has one 2 fewer. Half of 8 is 4.
10the move: round the half down
the line:
why it is allowed: is the half rounded down, 5 for 11. A whole number at most 5.5 is at most 5. The left side, 4 for 11, is whole, as is at least 1 for from 2 up.
11the move: halve both sides of line 7
the line:
why it is allowed: For 11, 5.5 is below 8.
12the move: write the half as a power
the line:
why it is allowed: As in line 9. Half of 16 is 8.
13the move: round the half down
the line:
why it is allowed: Rounding down never adds. For 11, 5 is below 8.
14the move: take the log of line 10
the line:
why it is allowed: A bigger number has a bigger log. For 11, the log of 4 is at most the log of 5.
15the move: the log of a power of 2 is the power
the line:
why it is allowed: For 11, the log of 4 is 2, at most about 2.32.
16the move: take the log of line 13
the line:
why it is allowed: As in line 14. For 11, the log of 5 is below the log of 8.
17the move: the log of a power of 2 is the power
the line:
why it is allowed: For 11, about 2.32 is below 3.
18the move: round the log down
the line:
the number
at least
below
its log rounded down
11
8
16
3
5
4
8
2
2
2
4
1
1
1
2
0
Each halving takes 1 off the log rounded down.
why it is allowed: By lines 15 and 17, the log of the half is at least one less than and below , so it rounds down to one less. For 11, about 2.32 rounds down to 2.
19the move: use line 18 again and again
the line:
why it is allowed: While the log rounded down is 1 or more, the number is at least 2 to the power 1, which is 2. So line 18 takes 1 off each halving, down to 0 after . For 11, 3, 2, 1, 0.
20the move: a log rounded down to 0 belongs to 1
the line:
why it is allowed: Such a log is at least 0 and below 1, so its number is at least 1 and below 2. It is 1.
why it is allowed: is read the log of rounded down. By lines 5 and 7 of the page halving and logarithms, 2 to that power is at most , and the next power of 2 is above . So blocks start at 1 over 2 to the powers 0 to . For 12, 3.58 rounds down to 3: the 4 blocks of line 2.
5the move: drop the rounding
the line:
why it is allowed: Rounding down never adds, so putting for can never lower the right side. For 12, 4 becomes about 4.58.
6the move: a fact about n
the line:
why it is allowed: is at least 2, the log of 2 is 1, and a bigger number has a bigger log.
7the move: put the log in place of the 1
the line:
why it is allowed: By line 6 this makes the right side of line 5 no smaller. For 12, 4.58 becomes about 7.17.
8the move: add the logs
the line:
why it is allowed: Two lots of .
9the move: a ceiling
the line:
why it is allowed: By line 8, is at most 2 times for every from 2. , read is in big O of , says a fixed multiple of is a ceiling of : here 2.
10the move: blocks after the first term
the line:
The sum to 1 over 12. Inside each term of a block stands its last term, dashed, so 2 dashed columns of 1 over 4 make one half. 1 over 9 to 1 over 12 are left over.
why it is allowed: For a floor, group the terms after the first in blocks ending at 1 over 2, 1 over 4, 1 over 8 and on. Each term is then at least its block's last. Whole blocks end at 1 over the powers of 2 from 2 to .
11the move: drop the leftovers
the line:
why it is allowed: Leftover terms are above zero, so leaving them out makes the total no bigger.
12the move: whole blocks at least one half
the line:
why it is allowed: Number the whole blocks by from 1. Block runs from just after 1 over half of 2 to the power to 1 over 2 to the power . That is half that many terms, each at least its last, so at least one half. For 12, 1 over 3 + 1 over 4 is at least 2 times 1 over 4. With line 11, is at least 1 plus one half per whole block: 2.5.
13the move: count the whole blocks
the line:
where does this come from?
question 2 of the page halving and logarithmsHalve , rounding down each time. How many halvings reach 1?
1the move: name the log rounded down
the line:
Rounding down, 11 halves to 5, 2 and 1. In blue, each log rounded down: 3, 2, 1, 0, one less at each halving.
why it is allowed: Here is the number halved, from 2 up; for 11, is 3.
2the move: rounding down never adds
the line:
why it is allowed: For 11, 3 is at most 3.46.
3the move: rounding down takes off less than 1
the line:
why it is allowed: For 11, 4 is above 3.46.
4the move: raise 2 to each side of line 2
the line:
why it is allowed: 2 raised to a bigger power gives a bigger number. For 11, 8 is at most about 11.
5the move: 2 to the log of n is n
the line:
why it is allowed: By what a log is. For 11, 8 is at most 11.
6the move: raise 2 to each side of line 3
the line:
why it is allowed: As in line 4. For 11, about 11 is below 16.
7the move: 2 to the log of n is n
the line:
why it is allowed: As in line 5. For 11, 11 is below 16.
8the move: halve both sides of line 5
the line:
why it is allowed: For 11, 4 is at most 5.5, which is not whole.
9the move: write the half as a power
the line:
why it is allowed: Half a power of 2 has one 2 fewer. Half of 8 is 4.
10the move: round the half down
the line:
why it is allowed: is the half rounded down, 5 for 11. A whole number at most 5.5 is at most 5. The left side, 4 for 11, is whole, as is at least 1 for from 2 up.
11the move: halve both sides of line 7
the line:
why it is allowed: For 11, 5.5 is below 8.
12the move: write the half as a power
the line:
why it is allowed: As in line 9. Half of 16 is 8.
13the move: round the half down
the line:
why it is allowed: Rounding down never adds. For 11, 5 is below 8.
14the move: take the log of line 10
the line:
why it is allowed: A bigger number has a bigger log. For 11, the log of 4 is at most the log of 5.
15the move: the log of a power of 2 is the power
the line:
why it is allowed: For 11, the log of 4 is 2, at most about 2.32.
16the move: take the log of line 13
the line:
why it is allowed: As in line 14. For 11, the log of 5 is below the log of 8.
17the move: the log of a power of 2 is the power
the line:
why it is allowed: For 11, about 2.32 is below 3.
18the move: round the log down
the line:
the number
at least
below
its log rounded down
11
8
16
3
5
4
8
2
2
2
4
1
1
1
2
0
Each halving takes 1 off the log rounded down.
why it is allowed: By lines 15 and 17, the log of the half is at least one less than and below , so it rounds down to one less. For 11, about 2.32 rounds down to 2.
19the move: use line 18 again and again
the line:
why it is allowed: While the log rounded down is 1 or more, the number is at least 2 to the power 1, which is 2. So line 18 takes 1 off each halving, down to 0 after . For 11, 3, 2, 1, 0.
20the move: a log rounded down to 0 belongs to 1
the line:
why it is allowed: Such a log is at least 0 and below 1, so its number is at least 1 and below 2. It is 1.
why it is allowed: As in line 4, whole blocks end at 1 over 2 to the powers 1 to , that many blocks. For 12, 3.
14the move: rounding takes off less than 1
the line:
why it is allowed: Rounding down takes off less than 1, so putting less 1 for can only lower the right side. For 12, 2.5 becomes about 2.29.
15the move: halve each part
the line:
why it is allowed: Half of ( less 1) is half of , less one half.
16the move: change the order
the line:
why it is allowed: Adding and taking away go in any order.
17the move: 1 less one half
the line:
why it is allowed: 1 less one half is one half.
18the move: drop the one half
the line:
why it is allowed: Taking away one half makes the right side smaller. For 12, about 1.79.
19the move: a floor
the line:
the ceiling,
the harmonic sum
the floor,
From 2 terms on, the harmonic sum lies between its ceiling and floor. At 16: 8, about 3.38, and 2.
why it is allowed: By line 18, is at least one half times for every from 2. , read is in big omega of , says a fixed multiple of , above zero, is a floor of .
20the move: ceiling and floor together
the line:
why it is allowed: , read is in big theta of , says both: by lines 9 and 19, for every from 2, lies between one half and 2 times . It grows like .
why it is allowed: The bracket of line 10 is without its first 1. The box under this line shows how grows.
guess it, then
12the move: open the first bracket
the line:
why it is allowed: Taking 1 away inside the bracket takes away .
guess it, then
13the move: gather
the line:
why it is allowed: and add up to , the 2 and the take-away 2 cancelling. For 3 numbers, 2 times 4 times 11 sixths, less 12, is 16 over 6, the table's average.
guess it, then
14the move: how big the harmonic sum gets
the line:
why it is allowed: The box at line 11 shows this, in its line 5.
guess it, then
15the move: a ceiling
the line:
why it is allowed: Put line 14 into line 13.
guess it, then
16the move: open the bracket
the line:
why it is allowed: Multiply by each of and 1.
guess it, then
17the move: gather
the line:
why it is allowed: less leaves .
guess it, then
18the move: drop what is not positive
the line:
why it is allowed: From 1 number on, is at most 0.
guess it, then
19the move: a simpler ceiling
the line:
why it is allowed: is at most , and is not negative.
guess it, then
20the move: read it as a bound
the line:
why it is allowed: By line 19.
guess it, then
21the move: a floor from the cheapest order
the line:
why it is allowed: No shuffle costs less than the cheapest order, so neither does their average. The cheapest order costs at least this, by line 20 of the question on the cheapest order, in section 4 of the learn page.
guess it, then
22the move: read it as a bound
the line:
why it is allowed: By line 21.
guess it, then
23the move: ceiling and floor together
the line:
why it is allowed: Lines 20 and 22 bound by the same growth, .
guess it, then
try it on small rows: over every order of 8 numbers, the average is about 16.92