calculating conditional probability in Matlab

7 次查看(过去 30 天)
Q:
Rust Rider cars are produced in four factories. The first factory produces 380 cars per day, the second 260, the third 150, while the fourth 710. The refuse ratios for the factories are 4%; 9%; 8% and 9%, respectively.
1-What is the probability that we find a junk car?
2-We bought a Rust Rider and we found it perfect. What is the probability that it had been produced in the second factory?
is it possible to calculate such a probability questions in Matlab? if yes how can i do so?

回答(1 个)

Torsten
Torsten 2022-10-16
编辑:Torsten 2022-10-16
These questions aim at exact results for the probabilities. So you must know the formulae how to calculate these probabilities. If you know them, you can use MATLAB for evaluation - but a usual table calculator will also do for this purpose.
If you were only interested in approximate values for the probabilities, you could use Monte-Carlo simulation as you did in your first question. But if you can deduce the design of the Monte-Carlo simulations, you can straight away give the exact answer for the probabilities.
So summarizing: MATLAB can be used, but is inappropriate for this application.

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by