Jump to content

solve the following mathematical problem either mathematically or using an algorithm


Recommended Posts

Posted (edited)
<script>
var equation= "(x²-1)² / (4*x*(x²+a*x+1))";
var a=0;
var b=10;
while(a<b)
{
var equation = equation.replace("x", "(x²-1)² / (4*x*(x²+a*x+1))");
a=a+1;
}
document.write(equation);
</script>

Where b is the specific new_x you are looking for so for new_x=10

 

(((((((((((x²-1)² / (4*x*(x²+a*x+1))²-1)² / (4*x*(x²+a*x+1))²-1)² / (4*x*(x²+a*x+1))²-1)² / (4*x*(x²+a*x+1))²-1)² / (4*x*(x²+a*x+1))²-1)² / (4*x*(x²+a*x+1))²-1)² / (4*x*(x²+a*x+1))²-1)² / (4*x*(x²+a*x+1))²-1)² / (4*x*(x²+a*x+1))²-1)² / (4*x*(x²+a*x+1))²-1)² / (4*x*(x²+a*x+1))

 

where x=9 if I was being less lazy I could calculate it as well

Edited by fiveworlds
Posted

You can run it yourself in a .html file just copy and paste it into notepad. Of course over 100000 is kinda slow on my computer so there are some limitations to it. If I was to have it calculated I would run the above script as php and then use that to generate the javascript code to give me an answer.

Posted

The original problem has been deleted so I can't comment on that. But ...

 

I would run the above script as php and then use that to generate the javascript code to give me an answer.

 

Why use PHP to generate Javascript? The PHP can generate whatever output the Javascript was going to.

 

Unless the deleted problem asked for a Javascript solution?

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.