animal( 1 ) plural( animal( 1 ) )
roundTo( 1, animalAvgLifespan( 1 ) * ( randRange( 80, 120 ) / 100 ) ) roundTo( 1, animalStddevLifespan( 1 ) * ( randRange( 20, 120 ) / 100 ) )
randRangeNonZero( -3, 3 ) { "-3": 99.7, "-2": 95, "-1": 68, "1": 68, "2": 95, "3": 99.7 }[ Z ] { "-3": 99.85, "-2": 97.5, "-1": 84, "1": 16, "2": 2.5, "3": 0.15 }[ Z ]
The lifespans of ANIMALS in a particular zoo are normally distributed. The average ANIMAL lives `MEAN` years; the standard deviation is `STDDEV` years.

Use the empirical rule `(68 - 95 - 99.7\%)` to estimate the probability of a ANIMAL living longer than `roundTo( 1, MEAN + STDDEV * Z )` years.

ANSWER / 100
init({ range: [ [ MEAN - STDDEV * 3.5, MEAN + STDDEV * 3.5 ], [ -1.5, 4.3 ] ], scale: [ 475 / ( STDDEV * 7 ), 40 ] }); style({ stroke: "#bbb" }, function() { line( [ MEAN - STDDEV * 4, 0 ], [ MEAN + STDDEV * 4, 0 ] ); }); graph.pdf = function( x ) { return gaussianPDF( MEAN, STDDEV, x ) * 4 / gaussianPDF( MEAN, STDDEV, MEAN ) + 0.2; }; style({ stroke: BLUE }, function() { plot( graph.pdf, [ MEAN - STDDEV * 3.5, MEAN + STDDEV * 3.5 ]); }); style({ stroke: PINK }, function() { graph.meanLine = line( [ MEAN, 0 ], [ MEAN, graph.pdf( MEAN ) ] ).toBack(); }); graph.meanLabel = label( [ MEAN, 0 ], MEAN, "below", { color: PINK } ); graph.zLine = []; graph.zLabel = [];

We know the lifespans are normally distributed with an average lifespan of `MEAN` years.

graph.meanLine.attr({ stroke: "#bbb" }); graph.meanLabel.css({ color: "#bbb" }); $( "#meanHint" ).removeClass("hint_pink"); style({ stroke: PINK }, function() { graph.zLine[ -1 ] = line( [ MEAN - STDDEV, 0 ], [ MEAN - STDDEV, graph.pdf( MEAN - STDDEV ) ] ).toBack(); graph.zLine[ 1 ] = line( [ MEAN + STDDEV, 0 ], [ MEAN + STDDEV, graph.pdf( MEAN + STDDEV ) ] ).toBack(); }); graph.zLabel[ -1 ] = label( [ MEAN - STDDEV, 0 ], roundTo( 1, MEAN - STDDEV ), "below", { color: PINK } ); graph.zLabel[ 1 ] = label( [ MEAN + STDDEV, 0 ], roundTo( 1, MEAN + STDDEV ), "below", { color: PINK } );

We know the standard deviation is `STDDEV` years, so one standard deviation below the mean is `roundTo( 1, MEAN - STDDEV )` years and one standard deviation above the mean is `roundTo( 1, MEAN + STDDEV )` years.

graph.zLine[ -1 ].attr({ stroke: "#bbb" }); graph.zLine[ 1 ].attr({ stroke: "#bbb" }); graph.zLabel[ -1 ].css({ color: "#bbb" }); graph.zLabel[ 1 ].css({ color: "#bbb" }); $( "#zm1Hint" ).removeClass("hint_pink"); $( "#zp1Hint" ).removeClass("hint_pink"); style({ stroke: PINK }, function() { graph.zLine[ -2 ] = line( [ MEAN - STDDEV * 2, 0 ], [ MEAN - STDDEV * 2, graph.pdf( MEAN - STDDEV * 2 ) ] ).toBack(); graph.zLine[ 2 ] = line( [ MEAN + STDDEV * 2, 0 ], [ MEAN + STDDEV * 2, graph.pdf( MEAN + STDDEV * 2 ) ] ).toBack(); }); graph.zLabel[ -2 ] = label( [ MEAN - STDDEV * 2, 0 ], roundTo( 1, MEAN - STDDEV * 2 ), "below", { color: PINK } ); graph.zLabel[ 2 ] = label( [ MEAN + STDDEV * 2, 0 ], roundTo( 1, MEAN + STDDEV * 2 ), "below", { color: PINK } );

Two standard deviations below the mean is `roundTo( 1, MEAN - STDDEV * 2 )` years and two standard deviations above the mean is `roundTo( 1, MEAN + STDDEV * 2 )` years.

graph.zLine[ -2 ].attr({ stroke: "#bbb" }); graph.zLine[ 2 ].attr({ stroke: "#bbb" }); graph.zLabel[ -2 ].css({ color: "#bbb" }); graph.zLabel[ 2 ].css({ color: "#bbb" }); $( "#zm2Hint" ).removeClass("hint_pink"); $( "#zp2Hint" ).removeClass("hint_pink"); style({ stroke: PINK }, function() { graph.zLine[ -3 ] = line( [ MEAN - STDDEV * 3, 0 ], [ MEAN - STDDEV * 3, graph.pdf( MEAN - STDDEV * 3 ) ] ).toBack(); graph.zLine[ 3 ] = line( [ MEAN + STDDEV * 3, 0 ], [ MEAN + STDDEV * 3, graph.pdf( MEAN + STDDEV * 3 ) ] ).toBack(); }); graph.zLabel[ -3 ] = label( [ MEAN - STDDEV * 3, 0 ], roundTo( 1, MEAN - STDDEV * 3 ), "below", { color: PINK } ); graph.zLabel[ 3 ] = label( [ MEAN + STDDEV * 3, 0 ], roundTo( 1, MEAN + STDDEV * 3 ), "below", { color: PINK } );

Three standard deviations below the mean is `roundTo( 1, MEAN - STDDEV * 3 )` years and three standard deviations above the mean is `roundTo( 1, MEAN + STDDEV * 3 )` years.

graph.zLine[ -3 ].attr({ stroke: "#bbb" }); graph.zLine[ 3 ].attr({ stroke: "#bbb" }); graph.zLabel[ -3 ].css({ color: "#bbb" }); graph.zLabel[ 3 ].css({ color: "#bbb" }); $( "#zm3Hint" ).removeClass("hint_pink"); $( "#zp3Hint" ).removeClass("hint_pink"); graph.zLine[ Z ].attr({ stroke: PINK }); graph.zLabel[ Z ].css({ color: PINK }); style({ stroke: PINK, fill: PINK, arrows: "->" }, function() { line( [ MEAN + STDDEV * Z, -1 ], [ MEAN + STDDEV * 3.5, -1 ] ); ellipse( [ MEAN + STDDEV * Z, -1 ], [ 3 / ( 600 / ( STDDEV * 7 ) ), 3 / 40 ] ); });

We are interested in the probability of a ANIMAL living longer than `roundTo( 1, MEAN + STDDEV * Z )` years.

var shape = []; shape.push([ MEAN - STDDEV * abs( Z ), 0 ]); var step = STDDEV / 50; for ( var x = MEAN - STDDEV * abs( Z ); x <= MEAN + STDDEV * abs( Z ); x += step ) { shape.push([ x, graph.pdf( x ) ]); } shape.push([ MEAN + STDDEV * abs( Z ), graph.pdf( MEAN + STDDEV * abs( Z ) ) ]); shape.push([ MEAN + STDDEV * abs( Z ), 0 ]); shape.push([ MEAN - STDDEV * abs( Z ), 0 ]); style({ stroke: null, fill: BLUE, opacity: 0.3 }, function() { path( shape ); }); label([ MEAN, graph.pdf( MEAN - STDDEV * Z ) -0.3 ], EMPIRICAL + "\\%", "above", { color: GREEN } ); style({ arrows: "->", stroke: GREEN }, function() { line([ MEAN, graph.pdf( MEAN - STDDEV * Z ) -0.1 ], [ MEAN + STDDEV * Z, graph.pdf( MEAN + STDDEV * Z ) -0.1 ]); line([ MEAN, graph.pdf( MEAN + STDDEV * Z ) -0.1 ], [ MEAN - STDDEV * Z, graph.pdf( MEAN - STDDEV * Z ) -0.1 ]); });

The empirical rule (or the `68-95-99.7\%` rule) tells us that `\green{EMPIRICAL\%}` of the ANIMALS will have lifespans within abs( Z ) standard deviation of the average lifespan.

The empirical rule (or the `68-95-99.7\%` rule) tells us that `\green{EMPIRICAL\%}` of the ANIMALS will have lifespans within abs( Z ) standard deviations of the average lifespan.

style({ arrows: "->", stroke: GREEN }, function() { path([ [ MEAN - STDDEV * abs( Z ), graph.pdf( MEAN - STDDEV * Z ) + 0.2 ], [ MEAN - STDDEV * abs( Z ), graph.pdf( MEAN - STDDEV * Z ) + 0.4 ], [ MEAN - STDDEV * 3.5, graph.pdf( MEAN - STDDEV * Z ) + 0.4 ] ]); }); label( [ MEAN - STDDEV * ( ( abs( Z ) + 3.5 ) / 2 ), graph.pdf( MEAN - STDDEV * Z ) + 0.3 ], roundTo( 2, ( 100 - EMPIRICAL ) / 2 ) + "\\%", "above", { color: GREEN } ); style({ arrows: "->", stroke: GREEN }, function() { path([ [ MEAN + STDDEV * abs( Z ), graph.pdf( MEAN + STDDEV * Z ) + 0.2 ], [ MEAN + STDDEV * abs( Z ), graph.pdf( MEAN + STDDEV * Z ) + 0.4 ], [ MEAN + STDDEV * 3.5, graph.pdf( MEAN + STDDEV * Z ) + 0.4 ] ]); }); label( [ MEAN + STDDEV * ( ( abs( Z ) + 3.5 ) / 2 ), graph.pdf( MEAN + STDDEV * Z ) + 0.3 ], roundTo( 2, ( 100 - EMPIRICAL ) / 2 ) + "\\%", "above", { color: GREEN } );

The remaining `roundTo( 2, 100 - EMPIRICAL )\%` of the ANIMALS will have lifespans that fall outside the shaded area. Because the normal distribution is symmetrical, half `(\green{roundTo( 2, ( 100 - EMPIRICAL ) / 2 )\%})` will live less than `roundTo( 2, MEAN - STDDEV * abs( Z ) )` years and the other half `(\green{roundTo( 2, ( 100 - EMPIRICAL ) / 2 )\%})` will live longer than `roundTo( 2, MEAN + STDDEV * abs( Z ) )` years.

The probability of a particular ANIMAL living longer than `roundTo( 1, MEAN + STDDEV * Z )` years is `\green{EMPIRICAL\%} + \green{roundTo( 2, ( 100 - EMPIRICAL ) / 2 )\%}`, or `ANSWER\%`.

The probability of a particular ANIMAL living longer than `roundTo( 1, MEAN + STDDEV * Z )` years is `\green{ANSWER\%}`.

{ "3": 99.85, "2": 97.5, "1": 84, "-1": 16, "-2": 2.5, "-3": 0.15 }[ Z ]

Use the empirical rule `(68-95-99.7\%)` to estimate the probability of a ANIMAL living less than `roundTo( 1, MEAN + STDDEV * Z )` years.

graph.zLine[ -3 ].attr({ stroke: "#bbb" }); graph.zLine[ 3 ].attr({ stroke: "#bbb" }); graph.zLabel[ -3 ].css({ color: "#bbb" }); graph.zLabel[ 3 ].css({ color: "#bbb" }); $( "#zm3Hint" ).removeClass("hint_pink"); $( "#zp3Hint" ).removeClass("hint_pink"); graph.zLine[ Z ].attr({ stroke: PINK }); graph.zLabel[ Z ].css({ color: PINK }); style({ stroke: PINK, fill: PINK, arrows: "->" }, function() { line( [ MEAN + STDDEV * Z, -1 ], [ MEAN + STDDEV * -3.5, -1 ] ); ellipse( [ MEAN + STDDEV * Z, -1 ], [ 3 / ( 600 / ( STDDEV * 7 ) ), 3 / 40 ] ); });

We are interested in the probability of a ANIMAL living less than `roundTo( 1, MEAN + STDDEV * Z )` years.

The probability of a particular ANIMAL living less than `roundTo( 1, MEAN + STDDEV * Z )` years is `\green{EMPIRICAL\%} + \green{roundTo( 2, ( 100 - EMPIRICAL ) / 2 )\%}`, or `ANSWER\%`.

The probability of a particular ANIMAL living less than `roundTo( 1, MEAN + STDDEV * Z )` years is `\green{ANSWER\%}`.

randRangeNonZero( -3, 2 ) randRangeNonZero( Z1 + 1, 3 ) max( abs( Z1 ), abs( Z2 ) ) min( abs( Z1 ), abs( Z2 ) ) { "-3": 99.7, "-2": 95, "-1": 68, "1": 68, "2": 95, "3": 99.7 }[ Z_MAX ] { "-3": 99.7, "-2": 95, "-1": 68, "1": 68, "2": 95, "3": 99.7 }[ Z_MIN ] { "3": 99.85, "2": 97.5, "1": 84, "-1": 16, "-2": 2.5, "-3": 0.15 }[ Z1 ] { "3": 99.85, "2": 97.5, "1": 84, "-1": 16, "-2": 2.5, "-3": 0.15 }[ Z2 ] TOTAL2 - TOTAL1

Use the empirical rule `(68-95-99.7\%)` to estimate the probability of a ANIMAL living between `roundTo( 1, MEAN + STDDEV * Z1 )` and `roundTo( 1, MEAN + STDDEV * Z2 )` years.

AREA / 100
graph.zLine[ -3 ].attr({ stroke: "#bbb" }); graph.zLine[ 3 ].attr({ stroke: "#bbb" }); graph.zLabel[ -3 ].css({ color: "#bbb" }); graph.zLabel[ 3 ].css({ color: "#bbb" }); $( "#zm3Hint" ).removeClass("hint_pink"); $( "#zp3Hint" ).removeClass("hint_pink"); graph.zLine[ Z1 ].attr({ stroke: PINK }); graph.zLabel[ Z1 ].css({ color: PINK }); graph.zLine[ Z2 ].attr({ stroke: PINK }); graph.zLabel[ Z2 ].css({ color: PINK }); style({ stroke: PINK, fill: PINK, arrows: "" }, function() { line( [ MEAN + STDDEV * Z2, -1 ], [ MEAN + STDDEV * Z1, -1 ] ); ellipse( [ MEAN + STDDEV * Z2, -1 ], [ 3 / ( 600 / ( STDDEV * 7 ) ), 3 / 40 ] ); ellipse( [ MEAN + STDDEV * Z1, -1 ], [ 3 / ( 600 / ( STDDEV * 7 ) ), 3 / 40 ] ); });

We are interested in the probability of a ANIMAL living between `roundTo( 1, MEAN + STDDEV * Z1 )` and `roundTo( 1, MEAN + STDDEV * Z2 )` years.

var shape = []; shape.push([ MEAN - STDDEV * abs( Z_MAX ), 0 ]); var step = STDDEV / 50; for ( var x = MEAN - STDDEV * abs( Z_MAX ); x <= MEAN + STDDEV * abs( Z_MAX ); x += step ) { shape.push([ x, graph.pdf( x ) ]); } shape.push([ MEAN + STDDEV * abs( Z_MAX ), graph.pdf( MEAN + STDDEV * abs( Z_MAX ) ) ]); shape.push([ MEAN + STDDEV * abs( Z_MAX ), 0 ]); shape.push([ MEAN - STDDEV * abs( Z_MAX ), 0 ]); style({ stroke: null, fill: BLUE, opacity: 0.3 }, function() { path( shape ); }); label([ MEAN, graph.pdf( MEAN - STDDEV * Z_MAX ) -0.3 ], EMPIRICAL1 + "\\%", "above", { color: GREEN } ); style({ arrows: "->", stroke: GREEN }, function() { line([ MEAN, graph.pdf( MEAN - STDDEV * Z_MAX ) -0.1 ], [ MEAN + STDDEV * Z_MAX, graph.pdf( MEAN + STDDEV * Z_MAX ) -0.1 ]); line([ MEAN, graph.pdf( MEAN + STDDEV * Z_MAX ) -0.1 ], [ MEAN - STDDEV * Z_MAX, graph.pdf( MEAN - STDDEV * Z_MAX ) -0.1 ]); });

The empirical rule (or the `68-95-99.7\%` rule) tells us that `\green{EMPIRICAL1\%}` of the ANIMALS will have lifespans within abs( Z_MAX ) standard deviation of the average lifespan.

The empirical rule (or the `68-95-99.7\%` rule) tells us that `\green{EMPIRICAL1\%}` of the ANIMALS will have lifespans within abs( Z_MAX ) standard deviations of the average lifespan.

label([ MEAN, graph.pdf( MEAN - STDDEV * Z_MIN ) -0.3 ], EMPIRICAL2 + "\\%", "above", { color: GREEN } ); style({ arrows: "->", stroke: GREEN }, function() { line([ MEAN, graph.pdf( MEAN - STDDEV * Z_MIN ) -0.1 ], [ MEAN + STDDEV * Z_MIN, graph.pdf( MEAN + STDDEV * Z_MIN ) -0.1 ]); line([ MEAN, graph.pdf( MEAN + STDDEV * Z_MIN ) -0.1 ], [ MEAN - STDDEV * Z_MIN, graph.pdf( MEAN - STDDEV * Z_MIN ) -0.1 ]); }); label([ MEAN + STDDEV * ( ( Z_MIN + Z_MAX ) / 2 ), graph.pdf( MEAN - STDDEV * Z_MIN ) -0.3 ], roundTo( 2, ( ( EMPIRICAL1 - EMPIRICAL2 ) / 2 ) ) + "\\%", "above", { color: RED } ); label([ MEAN - STDDEV * ( ( Z_MIN + Z_MAX ) / 2 ), graph.pdf( MEAN - STDDEV * Z_MIN ) -0.3 ], roundTo( 2, ( ( EMPIRICAL1 - EMPIRICAL2 ) / 2 ) ) + "\\%", "above", { color: RED } ); style({ arrows: "->", stroke: RED }, function() { line([ MEAN + STDDEV * ( ( Z_MIN + Z_MAX ) / 2 ), graph.pdf( MEAN - STDDEV * Z_MIN ) -0.1 ], [ MEAN + STDDEV * Z_MIN, graph.pdf( MEAN + STDDEV * Z_MIN ) -0.1 ]); line([ MEAN + STDDEV * ( ( Z_MIN + Z_MAX ) / 2 ), graph.pdf( MEAN - STDDEV * Z_MIN ) -0.1 ], [ MEAN + STDDEV * Z_MAX, graph.pdf( MEAN + STDDEV * Z_MIN ) -0.1 ]); line([ MEAN - STDDEV * ( ( Z_MIN + Z_MAX ) / 2 ), graph.pdf( MEAN + STDDEV * Z_MIN ) -0.1 ], [ MEAN - STDDEV * Z_MIN, graph.pdf( MEAN - STDDEV * Z_MIN ) -0.1 ]); line([ MEAN - STDDEV * ( ( Z_MIN + Z_MAX ) / 2 ), graph.pdf( MEAN + STDDEV * Z_MIN ) -0.1 ], [ MEAN - STDDEV * Z_MAX, graph.pdf( MEAN - STDDEV * Z_MIN ) -0.1 ]); });

It also tells us that `\green{EMPIRICAL2\%}` of the ANIMALS will have lifespans within `Z_MIN` standard deviation of the mean. It also tells us that `\green{EMPIRICAL2\%}` of the ANIMALS will have lifespans within `Z_MIN` standard deviations of the mean. That leaves `EMPIRICAL1\% - EMPIRICAL2\% = roundTo(2, EMPIRICAL1 - EMPIRICAL2)\%` of ANIMALS between `Z_MIN` and `Z_MAX` standard deviation of the mean, or `\red{roundTo(2, (EMPIRICAL1 - EMPIRICAL2) / 2)\%}` on either side of the distribution. That leaves `EMPIRICAL1\% - EMPIRICAL2\% = roundTo(2, EMPIRICAL1 - EMPIRICAL2)\%` of ANIMALS between `Z_MIN` and `Z_MAX` standard deviations of the mean, or `\red{roundTo(2, (EMPIRICAL1 - EMPIRICAL2) / 2)\%}` on either side of the distribution.

The probability of a particular ANIMAL living between `roundTo( 1, MEAN + STDDEV * Z1 )` and `roundTo( 1, MEAN + STDDEV * Z2 )` years is `\red{roundTo( 2, ( EMPIRICAL1 - EMPIRICAL2 ) / 2 )\%}`. `\red{roundTo( 2, ( EMPIRICAL1 - EMPIRICAL2 ) / 2 )\%} + \green{EMPIRICAL2\%}`, or `roundTo( 2, AREA )\%`.

The probability of a particular ANIMAL living between `roundTo( 1, MEAN + STDDEV * Z1 )` and `roundTo( 1, MEAN + STDDEV * Z2 )` years is `\red{roundTo( 2, ( EMPIRICAL1 - EMPIRICAL2 ) / 2 )\%}`. `\green{EMPIRICAL2\%} + \red{roundTo( 2, ( EMPIRICAL1 - EMPIRICAL2 ) / 2 )\%}`, or `roundTo( 2, AREA )\%`.

The probability of a particular ANIMAL living between `roundTo( 1, MEAN + STDDEV * Z1 )` and `roundTo( 1, MEAN + STDDEV * Z2 )` years is `\green{roundTo( 2, AREA )\%}`.