diff --git a/exercises/number_line.html b/exercises/number_line.html index f03afa8c6..1442da95d 100644 --- a/exercises/number_line.html +++ b/exercises/number_line.html @@ -1,60 +1,77 @@ - + Number line -
- randRangeNonZero( -5, 5 ) + randRange( -15, 15 ) + randRange( -2, 2 ) + randRangeNonZero( max(MIDPOINT-5, MIDPOINT-5-DISTANCE),min(MIDPOINT+5, MIDPOINT+5-DISTANCE) )
-

What number does the orange dot represent?

-
-
- init({ - range: [ [ -6, 6 ], [ -1, 1 ] ] - }); +

What number is plural( abs( DISTANCE ), "position") to the leftright of the orange dot? The distance between adjacent tick marks is 1.

+

What number does the orange dot represent?

+
+ init({ + range: [ [ MIDPOINT-6, MIDPOINT+6 ], [ -1, 1 ] ] + }); - line( [ -5, 0 ], [ 5, 0 ] ); - for ( var x = -5; x <= 5; x++ ) { - line( [ x, -0.2 ], [ x, 0.2 ] ); - } + line( [ MIDPOINT-5, 0 ], [ MIDPOINT+5, 0 ] ); + for ( var x = MIDPOINT-5; x <= MIDPOINT+5; x++ ) { + line( [ x, -0.2 ], [ x, 0.2 ] ); + } - style({ stroke: "#6495ED", strokeWidth: 3.5 }); - line( [ 0, -0.2], [0, 0.2]); - label( [ 0, -0.53 ], "0", "center", { color: "#6495ED" }); - - style({ stroke: "#FFA500", fill: "#FFA500" }); - graph.orangeDot = circle( [ NUMBER, 0 ], 0.10 ); -
-
NUMBER
-
-
+ style({ stroke: "#6495ED", strokeWidth: 3.5 }); + line( [ MIDPOINT, -0.2], [MIDPOINT, 0.2]); + label( [ MIDPOINT, -0.53 ], MIDPOINT, "center", { color: "#6495ED" }); -
-

We know where 0 is on this number line because it is labeled.

-

Numbers to the right of 0 are positive, while numbers to the left of 0 are negative.

-
-

Starting from 0, we move abs( NUMBER ) to the leftright to reach the orange dot.

-
- style({ stroke: "#6495ED", fill: "#6495ED", strokeWidth: 3.5, arrows: "->" }); - line( [ 0, 0 ], [ NUMBER, 0 ] ); - graph.orangeDot.toFront(); + style({ stroke: "#FFA500", fill: "#FFA500" }); + graph.orangeDot = circle( [ NUMBER, 0 ], 0.10 ); +
-
-
-

Thus, the orange dot represents the number NUMBER.

-
- label( [ NUMBER, -0.53 ], NUMBER, "center", { color: "#FFA500" }); +
NUMBER+DISTANCE
+ +
+

We know where MIDPOINT is on this number line because it is labeled.

+

Numbers to the right of MIDPOINT are bigger, while numbers to the left of MIDPOINT are smaller.

+
+

We need to find the number represented by the blue dot, which is plural( abs( DISTANCE ), "position") to the leftright of the orange dot.

+
+ style({ stroke: "#6495ED", fill: "#6495ED" }); + graph.blueDot = circle( [ NUMBER+DISTANCE, 0 ], 0.10 ); +
+
+
+

Starting from MIDPOINT, we move abs( NUMBER-MIDPOINT+DISTANCE ) to the leftright to reach the blueorange dot.

+
+ var color = "#6495ED"; + if ( DISTANCE === 0 ) { + color = "#FFA500"; + } + style({ stroke: color, fill: color, strokeWidth: 3.5, arrows: "->" }); + line( [ MIDPOINT, 0 ], [ NUMBER+DISTANCE, 0 ] ); + graph.blueDot.toFront(); +
+
+
+

Thus, the blueorange dot represents the number NUMBER+DISTANCE.

+
+ var color = "#6495ED"; + if ( DISTANCE === 0 ) { + color = "#FFA500"; + } + label( [ NUMBER, -0.53 ], NUMBER, "center", { color: "#FFA500" }); + label( [ NUMBER+DISTANCE, -0.53 ], NUMBER+DISTANCE, "center", { color: color }); +
+
-
diff --git a/exercises/properties_of_numbers_2.html b/exercises/properties_of_numbers_2.html new file mode 100644 index 000000000..393ba4746 --- /dev/null +++ b/exercises/properties_of_numbers_2.html @@ -0,0 +1,59 @@ + + + + + Properties of numbers 2 + + + +
+
+ randRange( 1000, 9999 ) +
+ +
+
+

NUM \times 1 =

+

NUM

+
+

Any real number multiplied by 1 equals itself.

+

Without performing any multiplication steps, we know that NUM \times 1 = NUM.

+

This fact about multiplying by 1 is known as the identity property of multiplication, and it is useful for finding equivalent fractions.

+
+
+ +
+

NUM + 0 =

+

NUM

+
+

Any real number plus 0 equals itself.

+

Without performing any addition steps, we know that NUM + 0 = NUM.

+

This fact about adding by 0 is known as the identity property of addition.

+
+
+ +
+

By what number can we multiply NUM to get 1?

+

1 / NUM

+
+

Any real number x (except 0) can be multipled by \dfrac{1}{x} to get 1.

+

Without performing any multiplication or division, we know that NUM \times \dfrac{1}{NUM} = 1.

+

Thus, the answer is \dfrac{1}{NUM}.

+

This fact about multiplying by \dfrac{1}{x} is known as the multiplicative inverse property. +

+
+ +
+

What number can we add to NUM to get 0?

+

-1 * NUM

+
+

Adding the negative inverse of a number to that number equals 0.

+

Without performing any addition or subtraction, we know that NUM +(-1 * NUM) = 0.

+

Thus, the answer is -1 * NUM.

+

This fact about adding negative inverses is known as the additive inverse property.

+
+
+
+
+ +