Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,167,175 members, 7,867,398 topics. Date: Friday, 21 June 2024 at 03:23 PM |
Nairaland Forum / Science/Technology / Programming / Simple Factorial Challenge (4289 Views)
Factorial Design Of Experiments (d.o.e) (2) (3) (4)
Simple Factorial Challenge by Slyr0x: 10:26pm On May 15, 2016 |
Bola discovered a mysterious piece of paper, containing a mysterious formula: x^2 + (5/3)x^3 + (23/12)x^4 + (119/60)x^5 ... + (2*[5000!-1]/[5000!])x^5000 Bola was curious, and so decided to evaluate the expression for x=0.7893 What number was returned, to the nearest 20 decimal places? |
Re: Simple Factorial Challenge by Slyr0x: 3:30pm On May 17, 2016 |
bump |
Re: Simple Factorial Challenge by larisoft: 8:27am On May 18, 2016 |
@OP... your questions are real brain heaters. I love them! But would you please provide the solutions after each of them has been unsolved for hours?. Many of us attempt them for hours and it will be nice to finally know the solution after trying so hard! |
Re: Simple Factorial Challenge by Nobody: 9:07am On May 18, 2016 |
DIS LAND IS 4 SALE NOT. here is my incomplete solution.
|
Re: Simple Factorial Challenge by Nobody: 2:54pm On May 18, 2016 |
Nice one crotonite (0.7893)^(500)×(0.7893)^(10) = ( 0.7893)^5000 (5000!-1)÷(5000!) is estimated as 0.99 something removing one has no much effect . damm infinitedecimal , I can't get the exact value manually . I didn't solve for the all the sum to the 499 th term . only the first to the 5th series was solved with high level of manipulation . |
Re: Simple Factorial Challenge by kosytedy(m): 3:26pm On May 18, 2016 |
crotonite: @crotonite, your code contains some errors, I can't start typing all of them. But the fact() function is wrong as it should contain a loop. Factorial of 4 (4!) is = 4 x 3 x 2 x 1 = 24 Programmatically, the loop will have to start right at 5000 (value passed into the function) and decrease by one with each decrement multiplied by the already gotten result till it stops looping, then the final answer is given. Please review your codes again. Nice try, keep it up. 1 Like |
Re: Simple Factorial Challenge by Slyr0x: 3:34pm On May 18, 2016 |
larisoft: I sure will. Thanks |
Re: Simple Factorial Challenge by jacob05(m): 4:15pm On May 18, 2016 |
@Slyr0x An Attempt
|
Re: Simple Factorial Challenge by abumeinben(m): 5:23pm On May 18, 2016 |
crotonite: Me wan sabi this .java |
Re: Simple Factorial Challenge by Nobody: 8:13pm On May 18, 2016 |
Slyr0x:I have an answer with proxy20 infinite decimal equation . My aim was to solve it partially . |
Re: Simple Factorial Challenge by jacob05(m): 8:16pm On May 18, 2016 |
proxy20:Hmmm. Interesting. 1 Like |
Re: Simple Factorial Challenge by Nobody: 8:18pm On May 18, 2016 |
jacob05: |
Re: Simple Factorial Challenge by Lyphiard: 2:40am On May 19, 2016 |
Please do not answer this problem. The OP has taken this question from a competition and is attempting to cheat. |
Re: Simple Factorial Challenge by mojeed4(m): 8:24am On May 20, 2016 |
kosytedy: Lol. I guess you have not heard of a recursion method. Try running the fact() function and you will see that it will run perfectly well. Although using a for loop will also do the job, but I believe the recursion method does the job finer and cleaner. (My opinion though). |
Re: Simple Factorial Challenge by Slyr0x: 3:43pm On May 20, 2016 |
Lyphiard: Calm your tits. I solved the challenges before posting here, and the answer for this is 5.08xxxxxxxxxxxxxxxxxx. I will release the write up later . Cheers Kiddo, R. |
Re: Simple Factorial Challenge by jacob05(m): 4:34pm On May 20, 2016 |
Slyr0x: Guess my solution is correct then. |
Re: Simple Factorial Challenge by Nobody: 9:26pm On May 20, 2016 |
mojeed4: i saw his comment and i was like WTF! 1 Like |
Re: Simple Factorial Challenge by thedummy: 8:05am On May 21, 2016 |
Slyr0x: Hey Slyr0x, how did you do it I've been reading this thread and I tried to solve this for almost 6-8 hours. Please Share |
Re: Simple Factorial Challenge by olyjosh(m): 7:40am On May 23, 2016 |
Please guys, do submit your computation time and memory usage for these solutions. Anybody could have solve it, but let's see how effective is your solution in term of space and time. You can log ur codes here https://ideone.com/ or on your machine(please do state the machine processor and memory configuration). Thanks |
Re: Simple Factorial Challenge by jacob05(m): 8:03am On May 23, 2016 |
olyjosh: https://ideone.com/DSusUY |
Re: Simple Factorial Challenge by olyjosh(m): 8:29am On May 23, 2016 |
jacob05:Nice one Boss. Your solution runs for 0.22s 11640KB |
Re: Simple Factorial Challenge by Slyr0x: 11:51am On May 23, 2016 |
Great job Jacob05. Your solution is more efficient. Solution below as solved by someone on my team bcscale(25); |
Re: Simple Factorial Challenge by jacob05(m): 11:56am On May 23, 2016 |
Slyr0x: Thanks |
Re: Simple Factorial Challenge by Yemoll: 2:42pm On May 23, 2016 |
Slyr0x: @slyrox if you run both scripts @jacob05's python and the php you uploaded, they are not providing the same output. So there is something wrong somewhere. |
Re: Simple Factorial Challenge by Slyr0x: 2:51pm On May 23, 2016 |
^^I will check that in a bit. Updated Lol, Jacob05 , you've got the wrong answer. I ran your code, saw the first 5.088459******* and then assumed you got it right. |
Re: Simple Factorial Challenge by jacob05(m): 3:25pm On May 23, 2016 |
cc: Yemoll Slyr0x: I think your solution or your friend's isn't quite it... Firstly, using a factorial finding function to solve this problem is wrong and naive. e.g I believe $yyy increases linearly with loop and its factorial gets calculated as the $ii increase to 5000.. try finding the factorial of 5000.. without //bcscale(25); Lastly, bcscale(25) ; , makes the solution very likely to be inaccurate as the result of all bc functions are trimmed or scaled to 25. I'm not saying mine is correct or is not ... ... You judge... I'm just making my point.. |
Re: Simple Factorial Challenge by olyjosh(m): 8:02pm On May 23, 2016 |
I tried not to post this solution because it breaks the 5secs limit on ideone but I have gat no other improvement on it for now
Ans = 5.08845978368001258389 However this run for about 1825millisec on my 2.5 GHz Intel Core i5 |
Re: Simple Factorial Challenge by dozies1: 5:39pm On May 26, 2016 |
jacob05:here is my solution: . Please, would you mind telling me why mine is much more slower than yours. |
Re: Simple Factorial Challenge by jacob05(m): 6:07pm On May 26, 2016 |
dozies1:Because you're finding and summing the factorial of numbers from 1 to 5000 : which is quite computation intensive. |
Re: Simple Factorial Challenge by dozies1: 12:37am On May 27, 2016 |
jacob05:Ok. What is the principle behind making it go faster. |
Re: Simple Factorial Challenge by jacob05(m): 7:20am On May 27, 2016 |
dozies1:Don't use factorial.. Simple |
Re: Simple Factorial Challenge by dozies1: 9:33am On May 27, 2016 |
jacob05:OK. Thank yo |
Processing Games And Tangible User Interface / Let's Develop A Content Management System (CMS) / Catch The Thief - Nigeria's First 3D Game On Android
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 116 |