randRange( 0, 2 )
1 / randRange( 2, 5 )
randRange( 1, 3 )
[ deskItem( 0 ), fruit( 0 ), "X" ][ INDEX ]
[ "# of " + plural( UNIT ), "# of " + plural( UNIT ), "X" ][ INDEX ]
[ "Price of " + plural( UNIT ), "Price of " + plural( UNIT ), "Y" ][ INDEX ]
[ "the number of " + plural( UNIT ), "the number of " + plural( UNIT ), "X" ][ INDEX ]
[ "the price of " + plural( UNIT ), "the price of " + plural( UNIT ), "Y" ][ INDEX ]
How does Y_AXIS_QUESTION change as X_AXIS_QUESTION increases?
init({
range: [[-3, 10], [-1, 10]],
scale: [30, 30]
});
grid( [10, 10], [10, 10], {
stroke: "#ccc"
});
style({
stroke: "#888",
strokeWidth: 2,
arrows: "->"
});
path( [ [-0.5, 0], [10, 0] ] );
path( [ [0, -0.5], [0, 10] ] );
style({
stroke: "#000000",
strokeWidth: 0.9,
arrows: "->"
});
label( [ 0, 9.2 ], "\\text{" + Y_AXIS_LABEL + "}", "right");
label( [ 8.5, 0], "\\text{" + X_AXIS_LABEL + "}", "below");
style({
stroke: "#6495ED",
strokeWidth: 2,
arrows: "->"
});
plot( function( x ) {
return ( M ) * x + B;
}, [0, 10]);
Increases
- Increases
- Decreases
- Stays the same
style({ fill: "", stroke: "#000000" });
line( [ 4, 4 * M + B ], [ 7, 4 * M + B ] );
style({ stroke: "#40a020" });
line( [ 7, 4 * M + B ], [ 7, 7 * M + B ] );
Looking at the graph, we see that as x
increases (\color{#000000}{\text{black arrow}}
), y
also increases (\color{#40a020}{\text{green arrow}}
).
We can say that the slope of the line is positive, or that the variables have a direct relationship.
Thus, as X_AXIS_QUESTION increases, Y_AXIS_QUESTION also increases.
1 / randRange( 2, 5 ) * -1
randRange( 6, 8 )
Decreases
style({ fill: "", stroke: "#000000" });
line( [ 4, 4 * M + B ], [ 7, 4 * M + B ] );
style({ stroke: "#ff0000" });
line( [ 7, 4 * M + B ], [ 7, 7 * M + B ] );
Looking at the graph, we see that as x
increases (\color{#000000}{\text{black arrow}}
), y
decreases (\color{#ff0000}{\text{red arrow}}
).
We can say that the slope of the line is negative, or that the variables have an inverse relationship.
Thus, as X_AXIS_QUESTION increases, Y_AXIS_QUESTION decreases.
0
randRange( 2, 8 )
Stays the same
Looking at the graph, we see that as x
increases, there is no change in y
.
We can say that the slope of the line is zero, or that the variables have no correlation.
Thus, as X_AXIS_QUESTION increases, Y_AXIS_QUESTION stays the same.