Faulty sensor readings and outliers

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Faulty sensor readings and outliers

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A classroom temperature sensor logs 21, 22, 22, 23, then -999. What should you do with the -999?
A Keep it and include it in the average
B Check it first, because it is impossible and may be a sensor fault
2. Which reading is most likely an outlier in this list of room temperatures: 20, 21, 21, 22, 85?
A 21
B 85
3. A temperature sensor is placed next to a heater and reads much higher than the other sensors. What could this mean?
A The sensor may be in the wrong place
B The whole school is that hot
4. A sensor logs a reading every minute, but nothing is recorded from 10:05 to 10:20. What is the best explanation to check first?
A The sensor may have stopped working for a while
B The temperature disappeared for 15 minutes
5. Which statement about outliers is correct?
A An outlier may be a fault, so check it before you use it
B An outlier is always correct, so never question it

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1-999 A=MAX(B2:B50)
2=IF(OR(B2<-10,B2>50),"Check","OK") BThe sensor is in the wrong place, so its reading is far from the true air temperature and cannot be trusted
3A sensor stops working for a while, leaving gaps in the log where readings should be CThe -999 reading is impossible and was not checked, so it will drag the average far too low
4Find the highest reading to spot a value that is far from the rest D=COUNTBLANK(B2:B50)
5Average temperature = 18, 19, -999, 20 -> use all four readings as they are EAn impossible temperature reading that usually means the sensor has failed, so check it before use
6A temperature sensor sits in direct sunlight on a hot car roof, so 58 is taken as the air temperature FFlags a temperature reading that is impossible or far outside the expected range for checking

Definitions

outlier

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
=___(B2:B30)
2.
=IF(B2=____,"Check","OK")
3.
=IF(__(B2<-10,B2>50),"Check","OK")
4.
=__________(B2:B30)
5.
=___(B2:B30)

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A let temp = input.temperature()
B if (temp = -999) {
C console.log("Check sensor")
D }
Question 2
A let temp = input.temperature
B if (temp < -50 || temp > 60) {
C console.log("Faulty")
D }
Question 3
A let r = [21, 22, -999, 23]
B let good = []
C for (let x of r {
D if (x > -999) good.push(x)
E }
Question 4
A let avg = 21
B let reading = 95
C let diff = reading + avg
D let isOutlier = diff > 20
Question 5
A Lowest: =MIN(B2:B20)
B Highest: =MAX(B2:B20)
C Average: =AVERAGE(B2:B20)
D Gaps: =COUNT(B2:B20)

Answer Key

Faulty sensor readings and outliers
Section A: Quick Questions
Q1
B — Check it first, because it is impossible and may be a sensor fault
Q2
B — 85
Q3
A — The sensor may be in the wrong place
Q4
A — The sensor may have stopped working for a while
Q5
A — An outlier may be a fault, so check it before you use it
Section B: Match the Pairs
Q1
-999 → An impossible temperature reading that usually means the sensor has failed, so check it before use
Q2
=IF(OR(B2<-10,B2>50),"Check","OK") → Flags a temperature reading that is impossible or far outside the expected range for checking
Q3
A sensor stops working for a while, leaving gaps in the log where readings should be → =COUNTBLANK(B2:B50)
Q4
Find the highest reading to spot a value that is far from the rest → =MAX(B2:B50)
Q5
Average temperature = 18, 19, -999, 20 -> use all four readings as they are → The -999 reading is impossible and was not checked, so it will drag the average far too low
Q6
A temperature sensor sits in direct sunlight on a hot car roof, so 58 is taken as the air temperature → The sensor is in the wrong place, so its reading is far from the true air temperature and cannot be trusted
Section C: Definitions
Q1
outlier — A reading far from the rest or impossible, like -999. It may mean the sensor is faulty or in the wrong place, so check it before you use it.
Section D: Fill in the Blanks
Q1
=MIN(B2:B30)
Q2
=IF(B2=-999,"Check","OK")
Q3
=IF(OR(B2<-10,B2>50),"Check","OK")
Q4
=COUNTBLANK(B2:B30)
Q5
=MAX(B2:B30)
Section E: Spot the Error
Q1
B — A single = assigns a value instead of comparing. To test for the impossible -999 reading, use == (or ===): if (temp == -999).
Q2
A — input.temperature is a function, so it needs brackets to run and give a reading. It should be input.temperature().
Q3
C — The closing bracket is missing from the for loop heading. It should be for (let x of r) { so the loop keeps only readings that are not the -999 fault value.
Q4
C — To see how far a reading is from the rest, subtract the average from it. Adding them gives a meaningless number. It should be reading - avg.
Q5
D — COUNT only counts cells that hold numbers, so it misses the gaps made when a sensor stops. COUNTBLANK counts the empty cells.