Calling yourself dumb is dumb.Thankyou for the reply, but I am a bit dumb. I need to know what this mathematical expression is. Is it formulas, or a divisional expression? How do I break this down to its basic elements? Ich weise nicht!
The expression is called a finite continued fraction, though the name doesn't help you do what you want to do.Thankyou for the reply, but I am a bit dumb. I need to know what this mathematical expression is. Is it formulas, or a divisional expression? How do I break this down to its basic elements? Ich weise nicht!
Since your are talking about coding, one possibility is that you are meant to use a recursive algorithm.Hello,
I need to identify and work out what this expression means as I have to convert this into Python code:
Scenario
Your task is to complete the code in order to evaluate the following expression:
Thankyou
Since your are talking about coding, one possibility is that you are meant to use a recursive algorithm.
Hi,
Can you illustrate what a recursive algorithm is please?
No, that doesn't work.Thanks for your help...I got
y =(1/(x+1)/(x+1)/(x+1)/x)
What you wrote means y=1x+1x+1x+1xy=1x+1x+1x+1xy =(((1/(x+1))/(x+1))/(x+1))/x.
It should be clear that that is wrong. You want it to look like this instead: y=1x+1x+1x+1xy=1x+1x+1x+1xy =1/(x+1/(x+1/(x+1/x).
Yes, the results are incorrect because it MEANS the wrong thing!Thanks, I see what you did here, but it has to be set out to confirm to Python arithmetic rules and position of parenthesis.
For this to work in Python the expression would have to look like this: 1/(x+1)/(x+1)/(x+1)/x. This works under python, but the computational results are incorrect, which highlights that I have not got a grasp on the actual expression which will give the correct results.
Hi Dr Peterson,Yes, the results are incorrect because it MEANS the wrong thing!
The expression I wanted you to use is 1/(x+1/(x+1/(x+1/x))). Try using that in Python and see if you get the right results. I see now that what you quoted is missing the last two parentheses; I don't know how that got dropped, but the typesetter here apparently doesn't require matching parentheses, so it didn't notice. That must be what you meant by implying that it didn't work; presumably Python gave you an error. I apologize.
Your 1/(x+1)/(x+1)/(x+1)/x means "first divide 1 by x+1; then divide the result by x+1; then divide that result by x+1 again; and finally divide by x." That's wrong.
My 1/(x+1/(x+1/(x+1/x))) means just what the given expression means: Start in the innermost parentheses, adding x and 1/x; then in the next level of parentheses, add x and 1 divided by what you previously found; and so on.
All this should be things you learned in algebra about writing expressions; Python, on the whole, is no different.