Problem 203
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
In particular don't post any code fragments or results.
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
-
ParadiceCity9
- Posts: 15
- Joined: Sat Dec 17, 2011 7:15 pm
- Location: Charlottesville, Virginia
Problem 203
I've been working on Problem 203 (Problem 203 (View Problem)) and all seem good and well when my code worked just fine for the example they gave us (the first eight rows). I then ran my code for all 51 lines and alas, my answer was incorrect. Any idea what I could be missing? I'm using doubles for everything except the sum itself (for which I am using BigDecimal) so I feel like I should have enough bytes.
Last edited by ParadiceCity9 on Sun Mar 04, 2012 4:37 pm, edited 1 time in total.
- jaap
- Posts: 588
- Joined: Tue Mar 25, 2008 3:57 pm
- Contact:
Re: Problem 203
Your feeling is wrong. The largest binomial coefficient in the triangle is 50C25 which has 15 digits, and fits into a 64 bit long integer, but not into a double without loss of precision.ParadiceCity9 wrote:I've been working on Problem 203 (Problem 203 (View Problem)) and all seem good and well when my code worked good and well for the example they gave us (the first eight rows). I then ran my code for all 51 lines and alas, my answer was incorrect. Any idea what I could be missing? I'm using doubles for everything except the sum itself (for which I am using BigDecimal) so I feel like I should have enough bytes.
-
ParadiceCity9
- Posts: 15
- Joined: Sat Dec 17, 2011 7:15 pm
- Location: Charlottesville, Virginia
Re: Problem 203
Ahh, you were right. I got it, thanks!jaap wrote:Your feeling is wrong. The largest binomial coefficient in the triangle is 50C25 which has 15 digits, and fits into a 64 bit long integer, but not into a double without loss of precision.ParadiceCity9 wrote:I've been working on Problem 203 (Problem 203 (View Problem)) and all seem good and well when my code worked good and well for the example they gave us (the first eight rows). I then ran my code for all 51 lines and alas, my answer was incorrect. Any idea what I could be missing? I'm using doubles for everything except the sum itself (for which I am using BigDecimal) so I feel like I should have enough bytes.
- jake223
- Posts: 61
- Joined: Mon Apr 25, 2011 5:15 am
- Location: USA
- Contact:
Re: Problem 203
Can anybody tell me where these figures start to go wrong? I get the right answer for the test case, and I am using BigIntegers, but the answer I get is wrong.
row 1 has 1. sum=1
row 2 has 1. sum=1
row 3 has 2. sum=3
row 4 has 3. sum=6
row 5 has 4. sum=12
row 6 has 6. sum=27
row 7 has 7. sum=42
row 8 has 10. sum=105
row 9 has 1*. sum=175
row 10 has 1*. sum=189
row 11 has 1*. sum=399
row 12 has 1*. sum=*422
row 13 has 2*. sum=*719
row 14 has 2*. sum=*383
row 15 has 3*. sum=*480
row 16 has 3*. sum=**410
row 17 has 3*. sum=**113
row 18 has 4*. sum=**098
row 19 has 4*. sum=**147
EDITED to remove (asterisked) results for rows 20-51
row 1 has 1. sum=1
row 2 has 1. sum=1
row 3 has 2. sum=3
row 4 has 3. sum=6
row 5 has 4. sum=12
row 6 has 6. sum=27
row 7 has 7. sum=42
row 8 has 10. sum=105
row 9 has 1*. sum=175
row 10 has 1*. sum=189
row 11 has 1*. sum=399
row 12 has 1*. sum=*422
row 13 has 2*. sum=*719
row 14 has 2*. sum=*383
row 15 has 3*. sum=*480
row 16 has 3*. sum=**410
row 17 has 3*. sum=**113
row 18 has 4*. sum=**098
row 19 has 4*. sum=**147
EDITED to remove (asterisked) results for rows 20-51
Last edited by jake223 on Fri Jun 29, 2012 2:12 am, edited 2 times in total.

- rayfil
- Administrator
- Posts: 1412
- Joined: Sun Mar 26, 2006 5:30 am
- Location: Quebec, Canada
- Contact:
Re: Problem 203
... don't post any code fragments or results ...
I think you are pushing it a bit too far jake223.
I think you are pushing it a bit too far jake223.
When you assume something, you risk being wrong half the time.
-
Xtensor
- Posts: 2
- Joined: Wed Sep 02, 2020 5:51 am
Problem 203
I can't figure out what is wrong. At first glance, this problem is 5% difficult, but quickly one realizes that there is a "little matter" that makes the sums coincide up to a certain value, but from that value on, the sums do not coincide. Can someone give me a hint?
- RobertStanforth
- Administrator
- Posts: 2666
- Joined: Mon Dec 30, 2013 11:25 pm
Re: Problem 203
The red banner text at the top of this page specifically asks you not to ask for hints.
-
Xtensor
- Posts: 2
- Joined: Wed Sep 02, 2020 5:51 am
Re: Problem 203
I wasn't exactly asking for the solution, but for an indication of what is happening. But jaap gave me more or less the key point. Next time I'll ask the question in another way. Thank you.RobertStanforth wrote: Sat Jan 29, 2022 6:38 pmThe red banner text at the top of this page specifically asks you not to ask for hints.
- hk
- Administrator
- Posts: 12831
- Joined: Sun Mar 26, 2006 10:34 am
- Location: Haren, Netherlands
Re: Problem 203
The lesson you can take from this is to read the entire thread carefully because there might be a significant hint in it.

War ruins the life and health of untold numbers of innocent children.
