Filter löschen
Filter löschen

Probability HW Need help

1 Ansicht (letzte 30 Tage)
Khadija Sulail
Khadija Sulail am 26 Jan. 2021
Beantwortet: David Hill am 26 Jan. 2021
Hello,
Can someone help mw with homework? How do I start ? What should I use ? Do I need conditional statements or not ? What kind of variables do I need to do ?
  1 Kommentar
James Tursa
James Tursa am 26 Jan. 2021
Have you written any code yet? Do you have any specific questions about that code? E.g., to simulate a single fair coin flip where 0=tails and 1=heads you could do this:
coinflip = rand < 0.5;

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

David Hill
David Hill am 26 Jan. 2021
head=1, tails=0. This should give you a good start.
a=randi(2,5,10)-1;
results=sum(a);
b=randi(2,5,1000)-1;
results2=sum(b);
histogram(results2);

Weitere Antworten (0)

Kategorien

Mehr zu Random Number Generation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by