Home
Page
Math
Videos
Math
Lessons
Deductive
Reasoning
Symbolic
Reasoning
Science
Applications
Math and
Money
All Math
Applications
How Math
Helped Me

Mathematics And Computer Programming

Here is a comparison of a solution of a quadratic-form equation using substitution as compared to the code in PHP needed to set up a formula for solving a quadratic formula. Notice the similarities.  Clearly the same type of symbolic reasoning used in Algebra is used in computer programming.

ALGEBRA

Solve a quadratic form equation using substitution

Solve 2x4 + 4x2 + 1 = 0

Let u=x2

Then u2 = x4

Replace x2 with u
Replace x4 with u2

Resulting equation is
2u2 + 4u + 1 = 0

Solve for u.

u = (-b +/- sqrt(b2 - 4ac)/(2a)
u = (-4 + sqrt(42 - 4*2*1))/(2*1)
u = (-4 - sqrt(42 - 4*2*1))/(2*1)

u=(-4+sqrt(8))/2
u=(-4-sqrt(8))/2

x=+/-sqrt(u)
x=sqrt((-4+sqrt(8))/2)
x=sqrt((-4-sqrt(8))/2)
x=-sqrt((-4+sqrt(8))/2)
x=-sqrt((-4-sqrt(8))/2)

PHP COMPUTER PROGRAMMING

Solve a quadratic equation with a computer program.

<?php
$a = 1;
$b = 2;
$c = 1;
$e = sqrt($b*$b-4*$a*$c);
$f = ((-1)*$b - $e)/(2*$a);
$d = ((-1)*$b + $e)/(2*$a);
print "<br>";
print "The Coefficients are<br>";
print "a = ".$a."<br>";
print "b = ".$b."<br>";
print "c = ".$c."<br>";
print "<br>";
print "The equation is ".$a."x^2 + (".$b."x) + (".$c.")= 0<br>";
print "The Solutions Are Given Below<br>";
print "The first solution is " . $d . "<br>";
print "The second solution is " . $f . "<br>";

$a = 10;
$b = 200;
$c = 1;
$e = sqrt($b*$b-4*$a*$c);
$f = ((-1)*$b - $e)/(2*$a);
$d = ((-1)*$b + $e)/(2*$a);
print "<br>";
print "The Coefficients are<br>";
print "a = ".$a."<br>";
print "b = ".$b."<br>";
print "c = ".$c."<br>";
print "<br>";
print "The equation is ".$a."x^2 + (".$b."x) + (".$c.")= 0<br>";
print "The Solutions Are Given Below<br>";
print "The first solution is " . $d . "<br>";
print "The second solution is " . $f . "<br>";
?>

PHP programming is used to create database-driven ecommerce sites as mentioned here.

 

 

 

 

 

 

Copyright 2012, Michael Sakowski and His Licensors
News on My Blog! Share Your Ideas! Copyright Info Suggested Uses Links Contact FAQs