I'm on lec 3/4, am I meant to understand the 'maths' totally by now? I can read and follow the code, and the maths there with no problem, but I can't say why, for example, some of the while loops are formed as they are. If someone said 'make a program to find the square root of x' I doubt I'd come up with what's given in the lectures.
reading code is just a matter of applying logic ... teaching the computer how to respond to a variety of inputs.
post the code, or the parts that you are having an issue with.
Even, am having a similar problem... I can understand the logic behind the code , but am not able to apply a similar logic or come up with a logic when i am asked to solve a problem. How to improve myself in regards with this??? Are there any set of exercises that can help me ? I guess install is also going through a similar issue.
break the logic into smaller bits: if (this condition is true) {do this} if (that condition is true) {do something else} my learning was all trial and error. test/debug
But to answer your question directly, yes you are meant to understand the math (or rather the logic at this stage). And no, you are not meant to come up with an identical code by yourself, there are always multiple ways of writing a code, as long as it works it's fine!
Thanks Nit. I think that's helpful. I do understand the logic as I go through the code, but it seems if someone asked me to get the same result I wouldn't perhaps have gotten the same code. Cheers. I'll look over it more and see how that works anyway.
I suppose if someone could go through 'while abs(ans**2 - x) >= epsilon and ans <= x' in a very simplistic manner that'd help. I've not done anything like this for ages, so meh.
And since I can't edit. What's most confusing for me is the alleged 'decrementing' section. Running it through without it seems to work fine.
Join our real-time social learning platform and learn together with your friends!