ScholarMatic | 24/7 Homework Help

ScholarMatic Will Help You Write Your Essays and Term Papers

Answered » You can buy a ready-made answer or pick a professional tutor to order an original one.

Question: Problem 3 For this problem, we will use R to simulate the probability of getting a pair (i.e., tw…

by | Nov 30, 2023 | Posted Questions



Problem 3

For this problem, we will use R to simulate the probability of
getting a pair (i.e., two of the same card) when you draw two cards
from a deck without replacement. Create a function that inputs n,
the number of trials, and outputs the probability based on those n
trials that a pair was drawn. Calculate the probabilities using n =
100,1000,10000, and compare that to the true probability (which you
have to calculate). Set your seed to 1001 using set.seed(1001)
before running your function,i.e.

set.seed(1001) yourfunctionname(10) yourfunctionname(1000)
yourfunctionname(10000)

Problem 4

In this problem we will use R to simulate a biased coin ?ip. In
each trial, you select one of three colored coins (Blue, Red, and
Green) with equal probability, and then ?ip the coin. The Red coin
has a 40% chance of landing heads, the Blue coin has a 70% chance,
and the Green coin is a fair coin. Create a program which takes in
n, the number of trials, and outputs the following probabilities:
Let A be the event that the blue coin was selected. Let B be the
event that the coin ?ip resulted in a head.

(a) P(A)

(b) P(B) (c) P(A?B) (d) P(AC ?B) (e) P(A?B) (f) P(A|B) (g)
P(A|BC) Report each probability for n = 100, and 100000. Again set
your seed to 1001 before running this function. Hint: An outline of
your program could look like the following: Step 1: Record the
color of the coin selected for n trials. Step 2: For each of the n
trials, based on the color of the coin, assign the appropriate
probabilities and ?ip the coin. (You should now have 2 vectors, one
that has recorded color, and one which has recorded head/tail).
Step 3: Use logical arguments to calculate the probabilities above.
Step 4: Output the appropriate probabilities.

ScholarMatic: Explanation & Answer

Your ready answer from a verified tutor is just a click away for as little as $14.99


  

Click Order Now to get 100% Original Answer Customized to your instructions!

HOME TO CERTIFIED WRITERS

Why Place An Order With Us?

  • Certified Editors
  • 24/7 Customer Support
  • Profesional Research
  • Easy to Use System Interface
  • Student Friendly Pricing

Have a similar question?

PLAGIRAISM FREE PAPERS

All papers we provide are well-researched, properly formatted and cited.

TOP QUALITY

All papers we provide are well-researched, properly formatted and cited.

HIGHLY SECURED

All papers we provide are well-researched, properly formatted and cited.

ScholarMatic: Get Started

Assignment Writing Service

Feel safe and secure when placing an order on our portal!
Fruitful cooperation begins with solid guarantees, and we are professional enough to promise perfect results. Let’s get it started!