## 1. There are 540 identical plastic chips numbered 1 through 540 in a box.  
## What is the probability of reaching into the box and randomly drawing the chip numbered 505?  
## Express your answer as a fraction or a decimal number rounded to four decimal places.

p <- round((1/540), digits = 4)
p
## [1] 0.0019
## 2. Write out the sample space for the given experiment.  Separate your answers using commas.  
## When deciding what you want to put into a salad for dinner at a restaurant, 
##you will choose one of the following extra toppings: asparagus, cheese.  
## Also, you will add one of following meats: eggs, turkey.  
## Lastly, you will decide on one of the following dressings: French, vinaigrette.  
##(Note: Use the following letters to indicate each choice: 
## A for asparagus, C for cheese, E for eggs, T for turkey, F for French, and V for vinaigrette.)

combs <- 2*2*2
combs
## [1] 8
## {AEF,AEV,ATF,ATV,CEF,CEV,CTF,CTV}

## 3. A card is drawn from a standard deck of 52 playing cards.  
## What is the probability that the card will be a heart and not a face card?  
## Write your answer as a fraction or a decimal number rounded to four decimal places. 

## Out of 13 cards of hearts, 10 are non-face cards
P_AB <- round((10/52), digits = 4)
#or
## P(A) = P(Heart) = 13/52
## P(B) = P(NotFace) = 40/52
P_AB <- round((13/52)*(40/52), digits = 4)
P_AB 
## [1] 0.1923
## 4. A standard pair of six-sided dice is rolled.  
## What is the probability of rolling a sum less than 6?  
## Write your answer as a fraction or a decimal number rounded to four decimal places. 

P_lessthan6 = round((10/36), digits = 4)
P_lessthan6
## [1] 0.2778
## 5. What is the probability that a customer is male?  
## Write your answer as a fraction or a decimal number rounded to four decimal places.

P_Male <- round((233+159+102+220+250)/2001, digits = 4)
P_Male
## [1] 0.4818
## 6. Three cards are drawn with replacement from a standard deck.   
## What is the probability that the first card will be a club, the second card will be a black card, 
## and the third card will be a face card?  
## Write your answer as a fraction or a decimal number rounded to four decimal places.

P_club_blk_face <- round((13/52)*(26/52)*(12/52), digits = 4)
P_club_blk_face
## [1] 0.0288
## 7. Two cards are drawn without replacement from a standard deck of 52 playing cards.  
## What is the probability of choosing a spade for the second card drawn, 
## if the first card, drawn without replacement, was a heart?  
## Write your answer as a fraction or a decimal number rounded to four decimal places. 

## P_2ndSpade_and_1stHeart = P_1stHeart * P_2ndSpade_if_1stHeart
P_2ndSpade_and_1stHeart <- round((13/52)*(13/51), digits = 4)
P_2ndSpade_and_1stHeart
## [1] 0.0637
## 8. Two cards are drawn without replacement from a standard deck of 52 playing cards.  
## What is the probability of choosing a heart and then, without replacement, a red card?  
## Write your answer as a fraction or a decimal number rounded to four decimal places.

## P_1stHeart_and_Red2nd = P_1stHeart * P_Red2nd|P_1stHeart
P_1stHeart_and_Red2nd <- round((13/52)*(25/52), digits = 4)
P_1stHeart_and_Red2nd
## [1] 0.1202
## 9. What is the probability that a junior female and then a freshmen male are chosen at random?  
## Write your answer as a fraction or a decimal number rounded to four decimal places.
P_JunFemale_and_FreshMale <- round((4/85)*(12/84), digits = 4)
P_JunFemale_and_FreshMale
## [1] 0.0067
## 10. Out of 300 applicants for a job, 141 are male and 52 are male and have a graduate degree. 
## Step 1. What is the probability that a randomly chosen applicant has a graduate degree, given that they are male?  
## Enter your answer as a fraction or a decimal rounded to four decimal places.  
P_GradGivenMale <- round(52/141, digits = 4)
P_GradGivenMale
## [1] 0.3688
## Step 2. If 102 of the applicants have graduate degrees, 
## what is the probability that a randomly chosen applicant is male, given that the applicant has a graduate degree?  
## Enter your answer as a fraction or a decimal rounded to four decimal places.  
P_MaleGivenGrad <- round(52/102, digits = 4)
P_MaleGivenGrad
## [1] 0.5098
## 11. A value meal package at Ron's Subs consists of a drink, a sandwich, and a bag of chips.  
##There are 6 types of drinks to choose from, 5 types of sandwiches, and 3 types of chips.  
## How many different value meal packages are possible? 
MealPackages <- 6*5*3
MealPackages
## [1] 90
## 12. A doctor visits her patients during morning rounds.  
## In how many ways can the doctor visit 5 patients during the morning rounds?
DrVisits <- factorial(5)
## DrVisits 120

## A coordinator will select 5 songs from a list of 8 songs to compose an event's musical entertainment lineup.  
## How many different lineups are possible?
Combinations <- choose(8,5)
Combinations
## [1] 56