Antonio_S

259 Reputation

4 Badges

17 years, 91 days

MaplePrimes Activity


These are answers submitted by Antonio_S

Hi, If I add arithmetical operations to the number of assignments, will I get the following? (1) a:=1, b:=1 2 (2) for i =1 to n do n+1 (3) a:= (a*y)/i n [once each iteration] + 2*n for 2 arithmetical operations ( * and / ) (4) b:=b+a n [once each iteration] + n for 1 arithmetical operation (+) (5) end do (6) output: b Will the end result be as follows: 2+(n + 2*n) + (n +n) + 1 (to terminate the loop). So, I get the total: 5*n + 3. Will this be correct? many thanx.
Thank you!
a small amendment: the above algorithm needs to be expressed as a number of assignments in terms of n and the time complexity function has to be deduced... Not sure how to do it. An example of a similar type will be most appreciated. thanx in advance.
Thank you!
thank you very much!
Many thanks!
Thanx a lot! I had to check the expression df/dx=(exp(-a)/2*r) * (r*df/dr + df/da) I seem to have lost 2 in the denominator. When I did it manually, I could only get df/dx=(exp(-a)/r) * (r*df/dr + df/da). Not quite sure where I went wrong...
Many thanks! Antonio.
Thank you! I got the same answer, but the answer in our handouts was y(x) = +/- (sqrt(2*e^x) + 2*c + 4)) - 2. I realised a bit later that I had to simplify the Maple solution in order to get this. Many thanks for your help!
Thanks!
Or you could just use op(1, [...]) as the positive root is 1st one in the output... e := evalf(solve(x^2-5 = 0, x)); 2.236067977, -2.236067977 op(1, [e]); print(2.236067977); 2.236067977 or if you need the negative root, you pick up the 2nd number in the output: op(2, [e]); print(-2.236067977); -2.236067977 Regards, Antonio
Thanks a lot!
Sorry, one more question. How do I add mod(d*e) to each of the solutions in the output? UCS(2,11); {0 (mod22), 1(mod22), 2(mod22), 3(mod22) etc...} Thanx in advance!
Many thanks!
Thanks a lot!
1 2 3 Page 2 of 3