☰ Year plan · Communication Technology

The straight-line model

Week 11 · Unit 2, Lesson 1 Prediction with an Artificial Intelligence Model (2) · 3 lessons
2

What w and b mean

ICT Prep 3 Term 1, Unit 2, Lesson 1: pp. 68–75
GoalFind b as the starting value and w as the change per step from a table, and calculate y.
New words
weight w · how much y changes for each step of x (the slope of the line)bias b · the value of y when x is 0 (the starting value)slope · another word for w: the steepness of the linestarting value · the value of y before any step is taken
Explanation

Two numbers describe a straight line. The bias b is the starting value: the value of y when x is 0. The weight w is the constant change: how much y changes when x grows by 1. Read them from the table of hours and marks: at x = 0 the mark is 40, so b = 40. From x = 0 to x = 1 the mark goes from 40 to 50, so w = 10 (50 minus 40). Some books call the constant step of 10 the bias, but that is wrong: the step is w, the starting value is b. Weights can be negative, too. With w = -2 and b = 20 the money left after x bus rides is y = -2x + 20, and the line goes down. With x = 5 rides: -2 × 5 + 20 = 10. The three models in the table are invented examples.

SituationwbMeaning
marks from study hours1040start 40, +10 per hour
a plant’s height in cm425start 25, +4 per day
money left after bus rides-220start 20, -2 per ride
Worked examples
ABCDE
1x (hours)0123
2y (marks)40506070
3change+10+10+10
In the hours-and-marks sheet, b is the y-value under x = 0, which is 40, and w is the change from one column to the next, which is +10.
ABCDE
1x (rides)0123
2y (money left)20181614
3change-2-2-2
The bus example has a negative weight. The change is -2 for every ride, so w = -2 and b = 20. After 5 rides: -2 × 5 + 20 = 10 is left.
Class activity

A plant is 25 cm tall at the start and grows 4 cm every day. Write w and b, write the model, and calculate the height after 5 days. Then invent a table where the weight is negative.

Practice
1
In the hours-and-marks table, what is b?
2
In the table x = 0, 1, 2 and y = 10, 14, 18, what is w?
3
Calculate y for w = 4, b = 25 and x = 5.
4
What does a negative weight mean for the line?