Error in 114 Gradient Descent for SLE

Back to Problem Solutions forum

go_coder     2015-03-13 00:17:34

The example input shows incorrect answer. It should be:

90 106 168 265

It would also be helpful if the example showing output of steps also included the last several steps.

Edit: Oh, and the algorithm has

IF (YNEW < YN)

that should be

IF (YNEW < Y)
OldProgrammer     2015-06-15 22:44:46

I agree that the answer should be 90 106 168 265.

Is it possible to fix this as the example answer is outside the acceptable error range ?

WakeMeAtThree     2018-01-07 12:50:03
User avatar

Thanks for mentioning this. I wasted time trying to troubleshoot my code before realizing that the example was wrong. I wish if there was some different kind of checker like OldProgrammer suggested a while back. There are better ways of writing the algorithm than the one mentioned in the task description which might get different counts/iterations.

johnnycake     2019-04-30 21:52:56

I agree with the others that the answers to the example are wrong. I also got 90 106 168 265. I have a problem with the checker too. It judges my answers wrong because the wrong number of values were submitted even though I have clearly submitted the correct number.

johnnycake     2019-04-30 22:19:21

Update on checker problem: I had 2 spaces between values in my answer. That's why it was judged wrong. It seems to me that the checker sometimes accepts multiple spaces, but I might be delirious.

Rodion (admin)     2019-05-01 06:15:59
User avatar

Hi and thanks for bringing this up!

It looks that for some reason I've missed this topic completely. :o

I don't remember the problem :) so let me some time to check what is wrong...

I had 2 spaces between values in my answer.

Checker scripts for different problems are usually independent. But typically only leading and trailing spaces are removed, the internals of the line are not disturbed (for the sake of the problems with text processing).

I don't feel ready to change this behavior, but probably the reporting of error could be made more clear for such cases... I'll try to figure out if here is some easy improvement...

P.S. johnnycake, it seems we still haven't added certificate to your profile... If you just tell the name to be written upon it, this will be amended at once.

P.P.S. Sorry for delay, the fixes are applied (I've plugged the test inputs to the checker and it produced suggested values - looks like mistake while copying, sorry).

johnnycake     2019-05-01 20:19:45

Hi Rodion, The issue with the checker was really my bad. The programming language I'm using (qb64) inserts an extra space when printing a list of positive numbers and I did know this. More importantly, thanks for correcting the answers for the example. It is frustrating when your answers don't match the book.

The certificate is not important to me. I'm retired and over 70 years of age so I don't feel a need for validation and I certainly won't be going to any job interviews! (Maybe you have an award for the oldest monk in the abbey?)

Rodion (admin)     2019-05-01 20:36:11
User avatar

Johnny, Hi again :)

Thanks for sharing about qb64 - I was a kind of fan of old good QB which came along with ms-dos :)

I'm retired and over 70 years of age so I don't feel a need for validation

Honestly I don't believe these "certificates" have any meaning in the eyes of recruiters. I invented them mainly for fun :)

Maybe you have an award for the oldest monk in the abbey

Not sure about "the oldest" :) I know there are very interesting persons of very decent age. But the idea is curious, thank you :)

Really we can introduce something like this... In the form of special diploma type or perhaps souvenir mug (or better both).

How do you suppose we should call it (without competing about "the oldest")? "Old Wise Guru" or "Old Wise Brother"?

Also some suitable graphics is needed... I think I shall try consulting my wife first :)

johnnycake     2019-05-02 01:36:28

I realize that the certificates were created mostly for fun. The irony is that anyone who manages to solve upward of 150 problems on your site is probably a pretty good programmer and deserving of some serious recognition. There are a lot of thought provoking exercises here and you have my complements and admiration for creating and maintaining the abbey.

I wasn't really serious about the oldest getting a special award, but it might be a good idea for the youngest. On the other hand, how would you know how old anybody is? You can't ask them for their birth certificate. Maybe better to drop the whole idea.

Please login and solve 5 problems to be able to post at forum