calculating conditional probability in Matlab

7 vues (au cours des 30 derniers jours)
SSBGH
SSBGH le 16 Oct 2022
Modifié(e) : Torsten le 16 Oct 2022
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?

Réponses (1)

Torsten
Torsten le 16 Oct 2022
Modifié(e) : Torsten le 16 Oct 2022
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.

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by