Question

3. Consider the following Matlab code. s-0; clear s.norm for i 1:10000 r-rand(1); % generate a uniform random, number on [0,1
0 0
Add a comment Improve this question Transcribed image text
Answer #1

IF YOU HAVE ANY DOUBTS COMMENT BELOW I WILL BE THERE TO HELP YOU ALL THE BEST

AS FOR GIVEN DATA,,

Consider the following Matlab code. clear s.norm for i-1:10000 r-rand(1); % generate a uniform random number on [0,1] s.norm(i)-s/i end plot( 1:10000,s.norm) % make a plot of s.norm(i) versus i (5 pts) What will the plot look like? (10 pts) Will the function/vector s.norm(n) converge to something as n gets large? If so, what? If not, why not? Justify your answer (5 pts) If we were to run this code multiple times - overlaying the plots on top of each other (with hold on, for example) - what will the plots look like?

EXPLANATION ::-

What will plot look like?

Initially plot will fluctuate between 3 to 4 and the gradually move towards 3.3333333

3.5 3.45 3.4 3.35 3.3 3.25 3.2 3.15 3.1 2000 4000 6000 8000 10000

Will function converge to something if n gets large?

Yes in each loop s is incremented by 3 in each loop and r is random is variable between 0 and 1, r*r is added in each loop

taking average value r*r = .3-3 0 = 1/3 - 0/3 = 1/3

So for any n s_norm(n) = 3 *n1/3*n = 3.333333333

Multiple runs how would plot look like?

3.9 3.8 3.7 3.6 3.5 3.4 3.2 1000 2000 4000 5000 6000 7000 8000 9000Function takes almost every value between 3 and 4 for n = 1 and gradually converge to 3.33333333 as number of iteration(n) increases.

I HOPE YOU UNDERSSTAND..

PLS ..RATE THUMBSUP IT HELPS ME ALOT

THANKS GOODLUCK

THANK YOU....!

Add a comment
Know the answer?
Add Answer to:
3. Consider the following Matlab code. s-0; clear s.norm for i 1:10000 r-rand(1); % generate a uniform random, numb...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT