Math Fundamentals18 sections · 814 units
Open in Course

Substitution

Replacing variables with values

Substitution means replacing a variable with a number or another expression. If y=3x+2y = 3x + 2 and x=5x = 5, you substitute 55 for xx to get y=3(5)+2=17y = 3(5) + 2 = 17.

This is how you verify solutions. If you think x=4x = 4 solves 2x+1=92x + 1 = 9, substitute and check: 2(4)+1=8+1=92(4) + 1 = 8 + 1 = 9. It works.

In algorithm analysis, you substitute input size nn into time complexity formulas to estimate runtime. If T(n)=2n2+3nT(n) = 2n^2 + 3n, then T(100)=20000+300=20300T(100) = 20000 + 300 = 20300 operations.