0
votes

Well, this sounds ridiculous but its now more than ten times I am trying to see what I am doing wrong in this example. I have seen the tutorial on the web, and the example is shown below:

enter image description here

At stage 3: Are we not supposed to decrement Yi to 9? I am saying this because the decision variable Pi=13 satisfying the condition that if Pi>=0, Yi +1=Yi-1 as shown below:enter image description here

Question: Where am I going wrong? Please, someone explain this to me.

PS: I appreciate even more worked examples, thanks.

1
When having troubles in understanding iterations, it's useful to 1) write the iterations by hand and 2) to write the iterations with the values. ( ` if p0 < 0 then { y1 = y0; p1 = p0 + 4*x0 + 6 ; } else if p0 >=0 { y1 = y0 -1; p1 = ... .... ` ) Write until you get it !!! :-)GameAlchemist
Thanks, it is what I been doing but was lost as to which Pi determines which coordinates.CN1002

1 Answers

1
votes

No, We are not supposed to decrement value of Yi to 9 at 3rd Stage. Let me elaborate you where you are going wrong,

  • Consider you are at 3rd Stage.
  • Now you are checking value of Pi based on previous value of itself that is from 2nd stage.
  • Here you will do, Pi = -1 + 4(2) + 6
  • The value 13 will be obtained after performing this operation at this stage.
  • After this value is obtained, at 4th stage, you'll check value of Pi from 3rd stage.
  • Now Pi will be greater than 0 and hence Yi will decrement to 9.

Hope this helps.