Hello LovingAngel!
To find the slope, you can use the formulas [tex] \frac{rise}{run} [/tex] as well as [tex] \frac{y^2-y^1}{x^2 - x^1} [/tex]. I am using the latter to calculate and ensuring my answer with the former.
[Note: (x,y) is the format for ordered pairs]
First pair: value 1:(1,5) and value 2:(2,8)
[tex] \frac{y^2-y^1}{x^2 - x^1} [/tex] -> [tex] \frac{8 - 5}{2 - 1} [/tex] -> [tex] \frac{3}{1} [/tex] or 3.
The slope for (1,5) and (2,8) is 3(/1).
Second pair: value 1: (3,1) value 2 (3,-1)
[tex] \frac{y^2-y^1}{x^2 - x^1} [/tex] -> [tex] \frac{-1 - 1}{3 - 3} [/tex] -> [tex] \frac{-2}{0} [/tex]
Slope for the second pair is -2/0
Checking work with [tex] \frac{rise}{run} [/tex]
1. Slope: 3/1, meaning rise (y) +3 and run (x) +1. (1,5) -> (1+1,5 + 3) -> (2,8) ✔
2. Slope: -2/0, meaning rise (y) -2/drop (y) 2 and run 0. (3,1) -> (3 + 0, 1 + -2) -> (3,-1) ✔