Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Is there a way to solve a general recurrence relation of the form
a(n)=a(n-1) * a(n-2)....
I mean I can use the matrix method to solve a relation of the form
F(n)=a1*F(n-1) + a2*F(n-2).......+ ak*F(n-k)
but what to do when there is a '*' sign instead of '+'
Use logarithms:
a(n) = a(n-1) * a(n-2) * a(n-3) * ....
Take log of both sides:
log(a(n)) = log(a(n-1) * a(n-2) * a(n-3) * ...)
Use the fact that log(a * b) = log(a) + log(b) to split up the factors:
log(a(n)) = log(a(n-1)) + log(a(n-2)) + log(a(n-3)) + ...
Now, if you just say that F(n) = log(a(n)) then this equation looks just like your second equation. Use the matrix method to solve for log(a(n)):
log(a(n)) = X
Which leaves:
a(n) = e ^ X
(Assuming you take natural logarithms)
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 months ago.
Improve this question
I've been trying to solve this problem but I am stuck at the last bit and my University lecturer doesn't really want to help me :)
T(1) = 1
T(n) = n*T(n/2)
T(n/2) = n/2 * T(n/4);
T(n/4) = n/4 * T(n/8);
T(n/8) = n/8 * T(n/16);
The four forms:
1) T(n) = n * T(n/2); k = 1
2) T(n) = (n^2)/2 * T(n/4); k = 2
3) T(n) = (n^3)/8 * T(n/8); k = 3
4) T(n) = (n^3)/64 * T(n/16); k = 4
T(n) = (n^k)/??? * T(n/k^2)
I can see the relationship, but I don't quite know what the ??? equals, nor how to continue. Honestly, any help would be greatly appreciated. Thank you!
Well my first guess would be that the "???" equals
2^(k-1),
because then the sequence would be like, 2^1-1=1, 2^2-1=2 and so on...
Then you would have the recurrence relation as follows:
T(n)=(n^k)/(2^(k-1)) * T(n/k^2)
Then you can prove by induction that this holds for any n. And I assume that since this an algorithm-related question, this would give you a bound for the running time.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
For example, I try to solve for x: 12*exp(-2x/4)=0.5, or x^2+3x^4+9x^5=10, is there any method in R to solve such equations?
Try with uniroot function
r1 <- uniroot(function(x) 12*exp(-x/2) - 0.5, c(-1000, 1000))
r2 <- uniroot(function(x) x^2 + 3*x^4 + 9*x^5 - 10, c(-1000, 1000))
r1$root
[1] 6.356108
r2$root
[1] 0.943561
You have to define:
a function of the type f(x) = 0 (and remove the second member of equality)
an interval within which to search for the solution
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 3 years ago.
Improve this question
Given the equation (depth = log(c * p + 1) / log(c * 1000 + 1) * p)
How can I find p?
I wanted to get an equation with p = sqrt(exp(... or something like this
The isn't an analytical solution to problems like this because they contain the variable both inside and outside a transcendental function like log().
With some quick algebra, you can simplify the expression to
p*log(1 + c*p) = b
where b=depth*log(1+1000*c) is a constant.
I propose using a single point iteration, to get a numeric result.
Start with some guess of p=1 or something and then do a loop until you converge to a value of (c# shown below).
b = depth*log(1+1000*c);
p = 1;
do
{
p_old = p;
p = b/log(1+c*p);
}
while( abs(p-p_old)> 1e-6);
and hope it converges soon.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
the question is:
x dy/dx = 2y ; y(0)=0
because when i solve this problem the integration constant 'c' gets zero... and i have to find its value in order to calculate a solution to given IVP
Unless I'm mistaken, this question gives c = 0 for y(0) = 0
x*dy/dx = 2y
x*dy = 2y*dx
dy / 2y = dx / x
ln(2y) = ln(x) + c
e^(ln(2y)) = e^(ln(x) + c) = e^ln(x)*e(c)
2y = x + c
solving for y(0) = 0 gives c = 0, as you stated.
Why do you think c must not be 0?
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this question
∫▒fdf/√(f(f^3 a+6bf+3c))
a, b, c are constant
The program is:
Integrate[x/Sqrt[x (x^3 a + 6 b x + 3 c )], x]
As per Mathematica output:
(2*(EllipticF[ArcSin[Sqrt[(x*(-R[1] + R[3]))/((x - R[1])*R[3])]],
((R[1] - R[2])*R[3])/(R[2]*(R[1] - R[3]))] -
EllipticPi[R[3]/(-R[1] + R[3]),
ArcSin[Sqrt[(x*(-R[1] + R[3]))/((x - R[1])*R[3])]],
((R[1] - R[2])*R[3])/(R[2]*(R[1] - R[3]))])*(x - R[1])^2*
Sqrt[(R[1]*(x - R[2]))/((x - R[1])*R[2])]*R[3]*
Sqrt[x*R[1]*(x - R[3])*(-R[1] + R[3]^2)])/
(Sqrt[x*(3*c + 6*b*x + a*x^3)]* (R[1] - R[3]))
Where:
Root[n]
Is the n root of the polynomial
p[u]=3 c + 6 b u + a u^3
Additionally, you may try this in Wolfram Alpha to get the indefinite integral, or definite ones. But I really think that if you are solving one important differential equation in general relativity and don't tried Mathematica and/or Wolfram Alpha, you may be a) Trolling or b) In great trouble