OUTLINE
In this part of the assignment, you will be simulating flipping a coin to get either heads or tails.
This requires using the statistical program R. Please go to https://www.r-project.org/ and follow the instructions for downloading and installing R.
This also requires an understanding of the probabilities for coin flipping. If you flip a fair coin one time, there are two possible outcomes: heads or tails. This can also be looked at as 1 head or 0 heads. The probability of 1 head is 50%. The probability of 0 heads is 50%. The binomial distribution with p=0.5 describes this coin flipping.
If you flip a fair coin three times, there are eight possible outcomes: HHH, HHT, HTH, HTT, THH, THT, TTH, or TTT. This can also be looked at as 0 heads, 1 head, 2 heads, or 3 heads. These can be presented as a probability table: (table shown above)
Number of Heads | Probability |
0 | |
1 | |
2 | |
3 |
1-1) Give the probability table for the number of heads for four flips of a fair coin.
1-2) In R, develop code that will flip a coin four times and count how many times heads occurs. Then, add a loop to the code so that this process is repeated 100 times, storing whether there were 0, 1, 2, 3, or 4 heads for each of 100 trials. There are multiple ways to do this, and it is okay if you use R code that you find shared from other sources. It is likely that you will need the stats package downloaded to your computer and loaded in R (https://www.rdocumentation.org/packages/stats), as this provides the functionality for Binomial and other simulations.
1-3) If a coin was flipped 10 times, what is the expected probability of getting:
1-4) Develop R code to do 10,000 trials in which a fair coin is flipped 10 times in each trial tallying the number of heads for each trial. Record how many of the trials met each of the following conditions:
1-5) Compare your results for the 10,000 simulated trials with your expected values for 10 flips in the two previous questions. Discuss.
1-6) Use R to create a histogram for the total number of heads in each of the 10,000 trials for 10 flips of a fair coin.
1-7) Use R to create three additional histograms for 10,000 trials for each of these cases:
1-8) Describe how the distribution in the histogram changes for 4 flips to 10 flips to 25 flips to 100 flips. Consider a shared x-axis representing the probability of getting heads rather than total counts to facilitate this comparison. Include the Central Limit Theorem in your explanation for these changes.
1-9) The binomial distribution also applies to other event probabilities. An online store offers a coupon that is used by 10% of customers. Produce histograms for the number of coupons used by 4 customers, by 10 customers, by 25 customers, and by 100 customers. Compare these histograms including the central limit theorem in your discussion, and compare with your previous histograms where the probability was 50% including the central tendency in your discussion.
In this part of the assignment, you will be working with Boolean variables from the OJ data set in the ISLR package (https://cran.r-project.org/web/packages/ISLR). You will also be using the stats package (https://www.rdocumentation.org/packages/stats) and the irr package (https://cran.r-project.org/web/packages/irr).
The OJ data set provides information similar to what might be available to any distributor regarding product performance at various retail locations. The purchases of Citrus Hill and Minute Maid are tracked along with information on prices, sales, store, and other factors. This assignment explores Boolean aspects of this data to answer questions about the performance of Citrus Hill.
2-1) Transform the variable Purchase, which lists either CH for Citrus Hill or MM for Minute Maid, into a new indicator variable for which the value is 1 if Citrus Hill is purchased and 0 if it is not. Provide your R code for the transformation.
2-2) Characterize the purchase rate of Citrus Hill by calculating each of the following and explaining what the result tells you about Citrus Hill purchasing:
2-3) Choose one of the following questions from the options below. Use the listed statistical techniques for analysis, and describe result. In your results, you should describe the statistical technique, explain how it relates to the question including aligned hypotheses, and give a statistically supported answer to the question.
Sources to be used for citation and reference: Sources to be used for citation and reference:
Package ‘ISLR’. (2017). Retrieved from https://cran.r-project.org/web/packages/ISLR/ISLR.pdf
Package ‘irr’. (2015). Retrieved from https://cran.r-project.org/web/packages/irr/irr.pdf
Verzani, J. (2001). simpleR – Using R for introductory statistics.
Kabacoff, R. I. (2017). R tutorial. Retrieved from https://www.statmethods.net/r-tutorial/index.html
Grading Rubric:
Mastery Criteria 3.2 (8%) points
Student provides an accurately constructed probability table for the number of heads for four flips of a fair coin. There are no errors.
Exceptional Criteria 2.98 (7.44%) points
Student provides a probability table for the number of heads for four flips of a fair coin. There is a minor error in the calculation that results in the wrong probability percentage, but student uses the correct formula format.
Competent Criteria 2.72 (6.8%) points
Student provides a probability table for the number of heads for four flips of a fair coin. There is an error in the calculation that results in the wrong probability percentage due to a step missing in the calculations and/or the formula being applied incorrectly.
Developing Criteria 2.4 (6%) points
Student provides an incomplete probability table that does not demonstrate an understanding of how to apply the formula to determine the probability for the number of heads for four flips of a fair coin.
Unacceptable Criteria 1.6 (4%) points
Student provided an incomplete or cursory explanation that does not directly address this element and/or meet minimal requirements.
Not Submitted 0 (0%) points
Student did not submit this element.
Mastery Criteria 3.2 (8%) points
Student provides an accurate R code used for the coin flip trials, correctly identifying how many of the 100 trials had 0 heads, 1 head, 2 heads, 3 heads, and 4 heads; and provides a thorough and detailed explanation of how these results compared to his/her theoretical table for flipping a coin four times. There are no errors/details missing.
Exceptional Criteria 2.98 (7.44%) points
Student provides an accurate R code used for the coin flip trials, correctly identifying how many of the 100 trials had 0 heads, 1 head, 2 heads, 3 heads, and 4 heads; and provides a detailed explanation of how these results compared to his/her theoretical table for flipping a coin four times. There are one or two minor errors/details missing.
Competent Criteria 2.72 (6.8%) points
Student provides the R code used for the coin flip trials, identifying how many of the 100 trials had 0 heads, 1 head, 2 heads, 3 heads, and 4 heads; and provides an explanation of how these results compared to his/her theoretical table for flipping a coin four times. Some details are missing and/or lack clarity.
Developing Criteria 2.4 (6%) points
Student provides the R code used for the coin flip trials, incorrectly identifying how many of the 100 trials had 0 heads, 1 head, 2 heads, 3 heads, and 4 heads and/or provides a cursory or incomplete explanation with vague or missing details of how these results compared to his/her theoretical table for flipping a coin four times.
Unacceptable Criteria 1.6 (4%) points
Student provided an incomplete or cursory explanation that does not directly address this element and/or meet minimal requirements.
Not Submitted 0 (0%) points
Student did not submit this element.
Mastery Criteria 3.2 (8%) points
Student accurately identifies the expected probability of getting exactly 7 heads, 7 or fewer heads, fewer than 7 heads, 7 or more heads, and more than 7 heads. There are no errors.
Exceptional Criteria 2.98 (7.44%) points
Student accurately identifies the expected probability of getting exactly 7 heads, 7 or fewer heads, fewer than 7 heads, 7 or more heads, and more than 7 heads. There are one or two minor errors.
Competent Criteria 2.72 (6.8%) points
Student identifies the expected probability of getting exactly 7 heads, 7 or fewer heads, fewer than 7 heads, 7 or more heads, and more than 7 heads. There are some errors.
Developing Criteria 2.4 (6%) points
Student identifies the expected probability of getting exactly 7 heads, 7 or fewer heads, fewer than 7 heads, 7 or more heads, and more than 7 heads. There are many errors.
Unacceptable Criteria 1.6 (4%) points
Student provided an incomplete or cursory assessment that does not directly address this element and/or meet minimal requirements.
Not Submitted 0 (0%) points
Student did not submit this element.
Mastery Criteria 3.2 (8%) points
Student accurately identifies how many of the trials met each of the following conditions: exactly 7 heads, 7 or fewer heads, fewer than 7 heads, 7 or more heads, and more than 7 heads. There are no errors.
Exceptional Criteria 2.98 (7.44%) points
Student accurately identifies how many of the trials met each of the following conditions: exactly 7 heads, 7 or fewer heads, fewer than 7 heads, 7 or more heads, and more than 7 heads. There are one or two minor errors.
Competent Criteria 2.72 (6.8%) points
Student identifies how many of the trials met each of the following conditions: exactly 7 heads, 7 or fewer heads, fewer than 7 heads, 7 or more heads, and more than 7 heads. There are some errors.
Developing Criteria 2.4 (6%) points
Student identifies how many of the trials met each of the following conditions: exactly 7 heads, 7 or fewer heads, fewer than 7 heads, 7 or more heads, and more than 7 heads. There are many errors.
Unacceptable Criteria 1.6 (4%) points
Student provided an incomplete or cursory assessment that does not directly address this element and/or meet minimal requirements.
Not Submitted 0 (0%) points
Student did not submit this element.
Mastery Criteria 3.2 (8%) points
Student provides a thorough and detailed comparison of his/her results for the 10,000 simulated trials with his/her expected values for 10 flips in the Element 3 and 4.
Exceptional Criteria 2.98 (7.44%) points
Student provides a detailed comparison of his/her results for the 10,000 simulated trials with his/her expected values for 10 flips in the Element 3 and 4. There are one or two minor details missing.
Competent Criteria 2.72 (6.8%) points
Student provides a comparison with some details of his/her results for the 10,000 simulated trials with his/her expected values for 10 flips in the Element 3 and 4. Some details are missing and/or lack clarity.
Developing Criteria 2.4 (6%) points
Student provides a cursory or incomplete comparison with vague or missing details of his/her results for the 10,000 simulated trials with his/her expected values for 10 flips in the Element 3 and 4. Most details are missing.
Unacceptable Criteria 1.6 (4%) points
Student provided an incomplete or cursory explanation that does not directly address this element and/or meet minimal requirements.
Not Submitted 0 (0%) points
Student did not submit this element.
Mastery Criteria 3.2 (8%) points
Student accurately uses R to construct a histogram for the total number of heads in each of the 10,000 trials for 10 flips of a fair coin. There are no errors.
Exceptional Criteria 2.98 (7.44%) points
Student accurately uses R to construct a histogram for the total number of heads in each of the 10,000 trials for 10 flips of a fair coin. There are one or two minor errors.
Competent Criteria 2.72 (6.8%) points
Student uses R to construct a histogram for the total number of heads in each of the 10,000 trials for 10 flips of a fair coin. There are some errors.
Developing Criteria 2.4 (6%) points
Student incorrectly uses R to construct a histogram for the total number of heads in each of the 10,000 trials for 10 flips of a fair coin. There are many errors.
Unacceptable Criteria 1.6 (4%) points
Student provided an incomplete or cursory assessment that does not directly address this element and/or meet minimal requirements.
Not Submitted 0 (0%) points
Student did not submit this element.
Mastery Criteria 3.2 (8%) points
Student accurately uses R to construct a histogram for 10,000 trials for each of the following cases: 4 slips of a fair coin, 25 flips of a fair coin, and 100 flips of a fair coin. There are no errors.
Exceptional Criteria 2.98 (7.44%) points
Student accurately uses R to construct a histogram for 10,000 trials for each of the following cases: 4 slips of a fair coin, 25 flips of a fair coin, and 100 flips of a fair coin. There are one or two minor errors.
Competent Criteria 2.72 (6.8%) points
Student uses R to construct a histogram for 10,000 trials for each of the following cases: 4 slips of a fair coin, 25 flips of a fair coin, and 100 flips of a fair coin. There are some errors.
Developing Criteria 2.4 (6%) points
Student incorrectly uses R to construct a histogram for 10,000 trials for each of the following cases: 4 slips of a fair coin, 25 flips of a fair coin, and 100 flips of a fair coin. There are many errors.
Unacceptable Criteria 1.6 (4%) points
Student provided an incomplete or cursory assessment that does not directly address this element and/or meet minimal requirements.
Not Submitted 0 (0%) points
Student did not submit this element.
Mastery Criteria 3.2 (8%) points
Student provides a thorough and detailed explanation describing how the distribution in the histogram changes for 4 flips to 10 flips to 25 flips to 100 flips and includes the Central Limit Theorem in his/her explanation for the changes.
Exceptional Criteria 2.98 (7.44%) points
Student provides a detailed explanation describing how the distribution in the histogram changes for 4 flips to 10 flips to 25 flips to 100 flips and includes the Central Limit Theorem in his/her explanation for the changes. There are one or two minor details missing.
Competent Criteria 2.72 (6.8%) points
Student provides an explanation describing how the distribution in the histogram changes for 4 flips to 10 flips to 25 flips to 100 flips and includes the Central Limit Theorem in his/her explanation for the changes. Some details are missing and/or lack clarity.
Developing Criteria 2.4 (6%) points
Student provides a cursory or incomplete explanation with vague or missing details describing how the distribution in the histogram changes for 4 flips to 10 flips to 25 flips to 100 flips and/or does not include the Central Limit Theorem in his/her explanation for the changes. Most details are missing.
Unacceptable Criteria 1.6 (4%) points
Student provided an incomplete or cursory explanation that does not directly address this element and/or meet minimal requirements.
Not Submitted 0 (0%) points
Student did not submit this element.
Mastery Criteria 3.2 (8%) points
Student accurately creates histograms for the number of coupons used by 4 customers, 10 customers, 25 customers, and 100 customers; and compares these histograms including the Central Limit Theorem and compares his/her previous histograms where the probability was 50% including the central tendency. There are no errors/details missing.
Exceptional Criteria 2.98 (7.44%) points
Student accurately creates histograms for the number of coupons used by 4 customers, 10 customers, 25 customers, and 100 customers; and compares these histograms including the Central Limit Theorem and compares his/her previous histograms where the probability was 50% including the central tendency. There are one or two minor details missing.
Competent Criteria 2.72 (6.8%) points
Student creates histograms for the number of coupons used by 4 customers, 10 customers, 25 customers, and 100 customers; and compares with some details these histograms including the Central Limit Theorem and compares with some details his/her previous histograms where the probability was 50% including the central tendency. There are some errors/details missing and/or details lack clarity.
Developing Criteria 2.4 (6%) points
Student incorrectly creates histograms for the number of coupons used by 4 customers, 10 customers, 25 customers, and 100 customers; and/or vaguely compares these histograms including the Central Limit Theorem and/or vaguely compares his/her previous histograms where the probability was 50% including the central tendency. Most details are missing.
Unacceptable Criteria 1.6 (4%) points
Student provided an incomplete or cursory explanation that does not directly address this element and/or meet minimal requirements.
Not Submitted 0 (0%) points
Student did not submit this element.
Mastery Criteria 3.2 (8%) points
Student uses R code to accurately transform the variable Purchase into a new indicator for which the value is 1 if Citrus Hill is purchased and 0 if it is not. There are no errors.
Exceptional Criteria 2.98 (7.44%) points
Student uses R code to accurately transform the variable Purchase into a new indicator for which the value is 1 if Citrus Hill is purchased and 0 if it is not. There are one or two minor errors.
Competent Criteria 2.72 (6.8%) points
Student uses R code to transform the variable Purchase into a new indicator for which the value is 1 if Citrus Hill is purchased and 0 if it is not. There are some errors.
Developing Criteria 2.4 (6%) points
Student uses R code to transform the variable Purchase into a new indicator for which the value is 1 if Citrus Hill is purchased and 0 if it is not. There are many errors.
Unacceptable Criteria 1.6 (4%) points
Student provided an incomplete or cursory explanation that does not directly address this element and/or meet minimal requirements.
Not Submitted 0 (0%) points
Student did not submit this element.
Mastery Criteria 3.2 (8%) points
Student accurately calculates the purchase rate of Citrus Hill with a 95% confidence interval for the mean, odds, and logodds; and provides a thorough and detailed explanation of what the results tells him/her about Citrus Hill purchasing. There are no errors.
Exceptional Criteria 2.98 (7.44%) points
Student did not submit this element.Student accurately calculates the purchase rate of Citrus Hill with a 95% confidence interval for the mean, odds, and logodds; and provides a detailed explanation of what the results tells him/her about Citrus Hill purchasing. There are one or two minor errors.
Competent Criteria 2.72 (6.8%) points
Student calculates the purchase rate of Citrus Hill with a 95% confidence interval for the mean, odds, and logodds; and provides an explanation with some details of what the results tells him/her about Citrus Hill purchasing. There are some errors/details missing and/or details lack clarity.
Developing Criteria 2.4 (6%) points
Student inaccurately calculates the purchase rate of Citrus Hill with a 95% confidence interval for the mean, odds, and logodds; and/or provides a cursory or incomplete explanation with vague or missing details of what the results tells him/her about Citrus Hill purchasing. There are many errors.
Unacceptable Criteria 1.6 (4%) points
Student provided an incomplete or cursory explanation that does not directly address this element and/or meet minimal requirements.
Not Submitted 0 (0%) points
Student did not submit this element.
Mastery Criteria 4.8 (12%) points
Student provides a thorough and detailed explanation of one of the questions describing the statistical technique, explaining how it relates to the question including aligned hypotheses, and gives a statistically supported answer to the question. There are no errors/details missing.
Exceptional Criteria 4.46 (11.16%) points
Student provides a detailed explanation of one of the questions describing the statistical technique, explaining how it relates to the question including aligned hypotheses, and gives a statistically supported answer to the question. There are one or two minor errors/details missing.
Competent Criteria 4.08 (10.2%) points
Student provides an explanation of one of the questions describing the statistical technique, explaining how it relates to the question including aligned hypotheses, and gives a statistically supported answer to the question. There are some errors/details missing and/or details lack clarity.
Developing Criteria 3.6 (9%) points
Student provides a cursory or incomplete explanation of one of the question vaguely describing the statistical technique, explaining with few details how it relates to the question including aligned hypotheses, and gives a statistically supported answer to the question. There are many errors and/or details missing.
Unacceptable Criteria 2.4 (6%) points
Student provided an incomplete or cursory explanation that does not directly address this element and/or meet minimal requirements.
Not Submitted 0 (0%) points
Student did not submit this element.
Why should I choose Homework Writings Pro as my essay writing service?
We Follow Instructions and Give Quality Papers
We are strict in following paper instructions. You are welcome to provide directions to your writer, who will follow it as a law in customizing your paper. Quality is guaranteed! Every paper is carefully checked before delivery. Our writers are professionals and always deliver the highest quality work.
Professional and Experienced Academic Writers
We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.
Reasonable Prices and Free Unlimited Revisions
Typical student budget? No problem. Affordable rates, generous discounts - the more you order, the more you save. We reward loyalty and welcome new customers. Furthermore, if you think we missed something, please send your order for a free review. You can do this yourself by logging into your personal account or by contacting our support..
Essay Delivered On Time and 100% Money-Back-Guarantee
Your essay will arrive on time, or even before your deadline – even if you request your paper within hours. You won’t be kept waiting, so relax and work on other tasks.We also guatantee a refund in case you decide to cancel your order.
100% Original Essay and Confidentiality
Anti-plagiarism policy. The authenticity of each essay is carefully checked, resulting in truly unique works. Our collaboration is a secret kept safe with us. We only need your email address to send you a unique username and password. We never share personal customer information.
24/7 Customer Support
We recognize that people around the world use our services in different time zones, so we have a support team that is happy to help you use our service. Our writing service has a 24/7 support policy. Contact us and discover all the details that may interest you!
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
Our reputation for excellence in providing professional tailor-made essay writing services to students of different academic levels is the best proof of our reliability and quality of service we offer.
Essays
When using our academic writing services, you can get help with different types of work including college essays, research articles, writing, essay writing, various academic reports, book reports and so on. Whatever your task, homeworkwritingspro.com has experienced specialists qualified enough to handle it professionally.
Admissions
Admission Essays & Business Writing Help
An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.
Reviews
Editing Support
Our professional editor will check your grammar to make sure it is free from errors. You can rest assured that we will do our best to provide you with a piece of dignified academic writing. Homeworkwritingpro experts can manage any assignment in any academic field.
Reviews
Revision Support
If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.