# Khan/khan-exercises

Add alternative hints to some exercises for A/B testing

 @@ -0,0 +1,289 @@ + + + + + Counting 1 + + + +
+
+
+
+ randRange( 20, 50 ) + randRange( 20, 40 ) + START + ANSWER - 1 + spin( "{do,did,done,problem|read,read,read,{page|paper|article}}" ).split( "," ) + plural( PROBLEM ) +
+

+ person( 1 ) {had to DO|was assigned} PROBLEMS START through + END for homework {{last {week|night}}|tonight}. +

+

+ If person( 1 ) DID all of the PROBLEMS he( 1 ) was assigned, how + many PROBLEMS did he( 1 ) DO? +

+ +
+

+
+ +
+

+ Instead of counting PROBLEMS START through + END, we can subtract + START - 1 from each number so we can count the + PROBLEMS starting from 1. +

+ +
+

+

+

+ \qquad \array{ + \hspace{40px} & + \hspace{40px} & + \hspace{40px} & + \hspace{40px} & \\ + + \color{GREEN}{START} & + \color{GREEN}{START + 1} & + \color{GREEN}{START + 2} & & + \color{GREEN}{END} \\ + + \color{BLUE}{\downarrow} & + \color{BLUE}{\downarrow} & + \color{BLUE}{\downarrow} & & + \color{BLUE}{\downarrow} \\ + + \color{BLUE}{\llap{-}START-1} & + \color{BLUE}{\llap{-}START-1} & + \color{BLUE}{\llap{-}START-1} & \cdots\hphantom{-} & + \color{BLUE}{\llap{-}START-1} \\ + + \color{BLUE}{\downarrow} & + \color{BLUE}{\downarrow} & + \color{BLUE}{\downarrow} & & + \color{BLUE}{\downarrow} \\ + + \color{PINK}{1} & + \color{PINK}{2} & + \color{PINK}{3} & & + \color{PINK}{ANSWER} \\ + } +

+
+ +

+ Now instead of thinking about PROBLEMS START + through END, we can think about how many PROBLEMS + person( 1 ) would have DONE if he( 1 ) were assigned + PROBLEMS 1 though ANSWER. +

+ +

+ When we think about it this way, we can see that person( 1 ) would have DONE + ANSWER PROBLEMS. Hopefully it also makes sense why we can't just subtract + the first problem number from the last problem number, since if person( 1 ) were + assigned PROBLEMS 1 through ANSWER, he( 1 ) was assigned ANSWER + PROBLEMS, not ANSWER-1. +

+ +

person( 1 ) DID ANSWER PROBLEMS.

+
+
+ +
+
+ randRange( 5, 15 ) +
+

A baker has a whole {baguette|loaf of bread}.

+

How many cuts must {he|she} make to have exactly NUM even slices?

+
+

NUM -1 cuts

+
+
+
+
+ init({ + range: [ [ -1.5, 18.5 ], [ -4, -0.5 ] ], + scale: [ 30, 50 ] + }); + + graph.loaf = raphael.set(); + graph.labels = []; + + graph.drawLoaf = function( slices ) { + var width = 10 + ( slices - 1 ) * 0.5; + + graph.loaf.remove(); + jQuery.each( graph.labels, function() { + this.remove(); + }); + + style({ stroke: "black", fill: ORANGE, opacity: 0.3 }, function() { + graph.loaf.push( arc([ 0.6, -2 ], 1, 90, 270, false ) ); + graph.loaf.push( arc([ width - 0.6, -2 ], 1, 270, 90, false ) ); + for ( var slice = 0; slice < slices; slice++ ) { + if ( slice === 0 ) { + graph.loaf.push( path([ [ 0.6, -1 ], + [ 10 * ( slice + 1 ) / slices + slice * 0.5, -1 ], + [ 10 * ( slice + 1 ) / slices + slice * 0.5, -3 ], + [ 0.6, -3 ] ]) ); + } else if ( slice === slices - 1 ) { + graph.loaf.push( path([ + [ 10 * ( slice + 1 ) / slices + slice * 0.5 - 0.6, -3 ], + [ 10 * slice / slices + slice * 0.5, -3 ], + [ 10 * slice / slices + slice * 0.5, -1 ], + [ 10 * ( slice + 1 ) / slices + slice * 0.5 - 0.6, -1 ] ]) ); + } else { + graph.loaf.push( path([ [ 10 * slice / slices + slice * 0.5, -1 ], + [ 10 * ( slice + 1 ) / slices + slice * 0.5, -1 ], + [ 10 * ( slice + 1 ) / slices + slice * 0.5, -3 ], + [ 10 * slice / slices + slice * 0.5, -3 ], + [ 10 * slice / slices + slice * 0.5, -1 ] ]) ); + } + graph.labels.push( + label( [ 10 * ( slice + 0.5 ) / slices + slice * 0.5, -2 ], slice+1, "", false ) + .css({ fontWeight: "bold", opacity: 1 }) + ); + if ( slice !== 0 ) { + graph.labels.push( + label( [ 10 * slice / slices + slice * 0.5 - 0.2, -3 ], slice, "below", false ) + .addClass( "hint_blue" ).css({ fontWeight: "bold", opacity: 1 }) + ); + } + } + }); + + return loaf; + }; + + graph.drawLoaf( 2 ); + +
+

One cut will make two slices.

+
+ +
+
+ graph.drawLoaf( 3 ); +
+

Two cuts will make three slices, and so on.

+
+ +
+
+ graph.drawLoaf( NUM ); +
+

+ Therefore, we need NUM - 1 cuts to make NUM slices. +

+
+
+
+ +
+
+ randRange( 10, 20 ) +
+

person( 1 ) is building a straight fence, with posts one meter apart.

+

+ If the fence is LENGTH meters long, how many fence posts does he( 1 ) need? +

+
+

LENGTH + 1 fence posts

+
+
+
+
+ init({ + range: [ [ -1, LENGTH + 1 ], [ -2, 3.5 ] ], + scale: [ 600 / ( LENGTH + 2 ), 20 ] + }); + + style({ stroke: null, fill: BLUE, opacity: 0.3 }, function() { + path([ [ 0, 0 ], [ 0, 1.8 ], [ 1, 1.8 ], [ 1, 0 ], [ 0, 0 ] ]); + }); + + style({ stroke: GREEN, strokeWidth: 3 }, function() { + line( [ 0, 0 ], [ 0, 2 ] ); + line( [ 1, 0 ], [ 1, 2 ] ); + }); + label( [ 0, 1.8 ], "1", "above", false ).css({ color: GREEN }); + label( [ 1, 1.8 ], "2", "above", false ).css({ color: GREEN }); + + style({ stroke: BLUE, strokeWidth: 2 }, function() { + graph.brace = path([ [ 0, -0.2 ], [ 0, -0.4 ], [ 0.5, -0.4 ], [ 0.5, -0.6 ], [ 0.5, -0.4 ], + [ 1, -0.4 ], [ 1, -0.2 ] ]); + }); + graph.length = label( [ 0.5, -0.4 ], "1 meter", "below", false ).css({ color: BLUE }); + +
+

+ If the fence is one meter long, he( 1 ) needs + two posts (one for each end). +

+
+ +
+
+ style({ stroke: null, fill: BLUE, opacity: 0.3 }, function() { + path([ [ 1, 0 ], [ 1, 1.8 ], [ 2, 1.8 ], [ 2, 0 ], [ 1, 0 ] ]); + }); + + style({ stroke: GREEN, strokeWidth: 3 }, function() { + line( [ 1, 0 ], [ 1, 2 ] ); + line( [ 2, 0 ], [ 2, 2 ] ); + }); + label( [ 2, 1.8 ], "3", "above", false ).css({ color: GREEN }); + + graph.brace.remove(); + graph.length.remove(); + style({ stroke: BLUE, strokeWidth: 2 }, function() { + graph.brace = path([ [ 0, -0.2 ], [ 0, -0.4 ], [ 1, -0.4 ], [ 1, -0.6 ], [ 1, -0.4 ], + [ 2, -0.4 ], [ 2, -0.2 ] ]); + }); + graph.length = label( [ 1, -0.4 ], "2 meters", "below", false ).css({ color: BLUE }); +
+

+ If the fence is two meters long, then he( 1 ) needs + three posts, and so on. +

+
+ +
+
+ for ( var x = 2; x < LENGTH; x++ ) { + style({ stroke: null, fill: BLUE, opacity: 0.3 }, function() { + path([ [ x, 0 ], [ x, 1.8 ], [ x + 1, 1.8 ], [ x + 1, 0 ], [ x, 0 ] ]); + }); + + style({ stroke: GREEN, strokeWidth: 3 }, function() { + line( [ x, 0 ], [ x, 2 ] ); + line( [ x + 1, 0 ], [ x + 1, 2 ] ); + }); + label( [ x + 1, 1.8 ], x + 2, "above", false ).css({ color: GREEN }); + } + + graph.brace.remove(); + graph.length.remove(); + style({ stroke: BLUE, strokeWidth: 2 }, function() { + graph.brace = path([ [ 0, -0.2 ], [ 0, -0.4 ], [ LENGTH/2, -0.4 ], [ LENGTH/2, -0.6 ], + [ LENGTH/2, -0.4 ], [ LENGTH, -0.4 ], [ LENGTH, -0.2 ] ]); + }); + graph.length = label( [ LENGTH / 2, -0.4 ], LENGTH + " meters", "below", false ).css({ color: BLUE }); +
+

+ Therefore, for his( 1 ) LENGTH meter fence, + person( 1 ) needs LENGTH + 1 posts. +

+
+
+
+ +
+
+ +

#### 1 comment on commit 71f1fb3

Owner
commented on 71f1fb3 Sep 11, 2012
 bleh, that's all wrong :(