Skip to main content
Challenges Linear regression: finding m and b
Artificial Intelligence Medium Linear regression Solves: 7

Linear regression: finding m and b

Author: CyberSamSU
Points
35

Linear regression is the simplest machine learning model that finds the line of best fit through data points: y = m*x + b, where m is the slope, and b is the intercept.

In the general case (ordinary least squares — OLS), m and b are found using the following formulas:

m = (n*sum(x*y) - sum(x)*sum(y)) / (n*sum(x^2) - sum(x)^2)
b = (sum(y) - m*sum(x)) / n

The following 5 points lie on a single straight line (error-free measurement):

xy
-536
10
2-6
3-12
5-24

Find the m and b coefficients of this line.

Write the answer in the format m,b, with a comma, without spaces (for example 3,-2).

Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −3 pts Log in
Hint 2 −7 pts Log in
Hint 3 −10 pts Log in
To submit a flag, log in.

First solvers

1. BlackCipher 03.10.2026
2. Лазиз 04.10.2026
3. 11111tttt 09.10.2026
4. Абдул 09.10.2026
5. Mirjaxon Qaxxarov 26.10.2026
6. Odam 05.11.2026
7. arcanum 11.11.2026