oldoc63 / learningDS

Learning DS with Codecademy and Books
0 stars 0 forks source link

Transforming and storing numbers with algebra #438

Open oldoc63 opened 1 year ago

oldoc63 commented 1 year ago

Solving First-Degree Equations

-One way to solve a simple equation like 2x+5 = 13 with programming is by using brute force.

oldoc63 commented 1 year ago

Finding the formula for first-degree equations

$$ ax + b = cx + d $$

$$ ax - cx = d - b $$

$$ x(a - c) = d - b $$

$$ x = \frac {d - b} {a - c} $$

oldoc63 commented 1 year ago

Writing the equation() function

oldoc63 commented 1 year ago

Solving higher-degree equations

$$ x = \frac{-b\sqrt{b²-4ac}}{2a} $$

oldoc63 commented 1 year ago

Using quad() to solve quadratic equations

oldoc63 commented 1 year ago
oldoc63 commented 1 year ago

Using plug() to solve a cubic equation

oldoc63 commented 1 year ago