Question

PLEASE WRITE A PROGRAM IN MATLAB FOR THE FOLLOWING:

Probability Practice Simulating the Horse Races Four horses (A, B, C, and D) have raced many ti mes. It is estimated that A w

0 0
Add a comment Improve this question Transcribed image text
Answer #1

SOLUTION

Awin=0;
Bwin=0;
Cwin=0;
Dwin=0;
ran=[10,100,1000];
for i=ran
Awin=[Awin;i*0.3];
Bwin=[Bwin;i*0.4];
Cwin=[Cwin;i*0.2];
Dwin=[Dwin;i*0.1];
endfor
ran=[0,ran]
plot (ran,Awin,ran,Bwin,ran,Cwin,ran,Dwin);
xlabel ("Total Races");
ylabel ("Won Races");
legend('Horse-1','Horse-2','Horse-3','Horse-4');
title ("HORSE-RACE PLOT");

HORSE-RACE PLOT 400 Horsa-1 -Horse-2 Horsa-3 -Horse-4 300 뜨 200 100 200 400 600 800 1000 Total Races

Here Awin , Bwin , Cwin & Dwin stores the number of winning races by respective horses (A,B,C & D).

Awin=[Awin;i*0.3] => since the winning of horse A is 30% therefore it can also be written as :

(Number of Matches x 30) /100 =Number of Wins of Horse A.

Therefore we can also right it as : (Number of Matches x 0.3) = Number of Wins of Horse A.

here in the loop number of matches is determined by i , this is how this statement calculates the winning matches.

Hope this helps. If you like the answer please rate it.

Thanks!

Add a comment
Know the answer?
Add Answer to:
Probability Practice Simulating the Horse Races Four horses (A, B, C, and D) have raced many ti m...
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
ADVERTISEMENT