quiz حل الأسئلة الجامعية manage_search الأرشيف

تم الحل ✓
categoryبرمجة وتطوير البرمجيات schoolبكالوريوس event_available2026-07-13

السؤال

Transcribed Image Text:

Quality of presentation (formatting, organization) is worth 2 points 80 These are individual projects and absolutely no collaboration is permitted Chapter 2 possible 25 Write a script file that employs any combination of the flow control commands to generate the given matrix. 1 1 0 0 0 0 0 -2 2 0 0 0 -1 0 3 3 0 0 B= 0 1 0 -4 4 0 0 0 -1 0 5 5 0 0010-6] 2 Write a user-defined function with function call [opt, k]-opt_finder (fp, x0, kmax, tol) where fp is the derivative (as an inline function) of a given function f, xo is a specified value, kmax is the maximum number of iterations, and tol is a specified tolerance. The function sets x₁ =xo, calculates |fp (x1), and if it is less than the tolerance, then x approximates the critical point opt at which the derivative is near zero. If not, it will increment x, by 0.1 to obtain x2, repeat the procedure, and so on. The process terminates as soon as fp(x)<tol for some k. The outputs are the approximate optimal point and the number of iterations it took to find it. Execute the function for f(x)=x+(x-2)², x =1, kmax = 50 tol=102. Chanton ?

check_circle الجواب — حل مفصل خطوة بخطوة

hourglass_top