Forums Register Login

Aaah, the beauty, the elegance...

+Pie Number of slices to send: Send
... of a recursive solution!
Solve for a1 to an, given b1 to bn, and c1 to cn:
anb1 = c1
an-1b1 + anb2 = c2
an-2b1 + an-1b2 + anb3 = c3
:
:
a1b1 + a2b2 + a3b3 + ... + anbn = cn

[This message has been edited by Manku Thimma (edited July 21, 2001).]
+Pie Number of slices to send: Send
Do we get any more information?
As it is...
3 variables, 1 equation then...
5 variables, 2 equations
7 variables, 3 equations...and so forth.
Don't we need to know how the b variables relate to each other or how the b variables relate to the c variables?
Or something like that?
Paul R
+Pie Number of slices to send: Send
The answer is:
8
+Pie Number of slices to send: Send
or was it -4958390.328947234121?
+Pie Number of slices to send: Send
I believe the canonical answer to this is:
42
+Pie Number of slices to send: Send
Where are all these numbers popping up from?
You are given three arrays a, b, and c, with n elements each. Using the above set of equations, write a recursive function to fill in the elements 1 to n of array a, given the values in elements 1 to n in arrays b and c.
So, using the equations, an = c1/b1. And now, using an, we get an-1 = (c2 - anb2) / b1. And so on... to get a1. Enjoy!

[This message has been edited by Manku Thimma (edited July 23, 2001).]
+Pie Number of slices to send: Send
Do you guys have life? For god's sakes, why are you posting recursive functions on the net? Go out and do something social for crying out loud.
+Pie Number of slices to send: Send
what are you doing here? why are you worried about our tension breakers? do you not have anything better to do?
sorry, i just needed to vent my frustration.
+Pie Number of slices to send: Send
> Do you guys have life?
Sorry Ronnie - not everyone has such sophisticated forms of entertainment as you enjoy.
+Pie Number of slices to send: Send
busted!
did you notice that your ip is showing "onlooker"... i think jim just exposed you.
+Pie Number of slices to send: Send
Woah, guys, chill out, I did not post this, some girl named Neha at a camp i was just at saw me on the forum, and posted it, not I I happen to like mathematical puzzels, as for the Greg, you just look like a moron now, "Oh no!, They exposed me now!" I bet if you look at my IP now, you can find some more cool stuff on me, say for instance IT IS NOT THE SAME ONE. Greg, get a brain.

[This message has been edited by Ronnie Johnson (edited July 31, 2001).]
+Pie Number of slices to send: Send
sorry, ronnie, i guess i need to go see the wizard and ask to have my brain back... follow the yellow brick road, follow the yellow brick road, follow, follow, follow, follow, follow the yellow brick road... we're off to see the wizard, the wonderful wizard of oz!
(sorry, i removed the pic of the scarecrow)...
[This message has been edited by Greg Harris (edited August 14, 2001).]
+Pie Number of slices to send: Send
hehe
Did Steve tell you that? Fuh - Steve. Just look at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 885 times.
Similar Threads
How does this actually solve Towers of Hanoi?
Textboox problem.
Recursion
ABC's isn't always the correct order
Tower of hanoi
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 03:44:58.