forked from saundersg/BYUI_M221_Book_R
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lesson01_Campus.Rmd
637 lines (416 loc) · 35.6 KB
/
Lesson01_Campus.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
---
title: 'Lesson 1: (On Campus) Course Intro & Probability'
output:
html_document:
theme: cerulean
toc: true
toc_float: false
---
<script type="text/javascript">
function showhide(id) {
var e = document.getElementById(id);
e.style.display = (e.style.display == 'block') ? 'none' : 'block';
}
</script>
## Lesson 1 Outcomes
<a href="javascript:showhide('oc')"><span style="font-size:8pt;">Show/Hide Outcomes</span></a>
<div id="oc" style="display:none;">
By the end of this lesson, you should be able to:
* Understand and explain the course policies
* Access course resources (course outline, lesson schedule, preparation activities, reading quizzes, homework assignments, assessments, Zoom, etc.)
* Communicate with your instructor
* Obtain access to software tools for statistical analysis
* Discuss ways in which you will apply gospel principles to your work in this class
* Apply the three rules of probability for different probability scenarios
</div>
<br>
## Welcome to the Course!
In this course, you will explore important connections between the academic discipline of Statistics and the world around us. By pondering these ideas, your understanding of statistics will increase, as will your knowledge and testimony of the restored Gospel of Jesus Christ. In addition, that which you learn in this course will increase your ability to serve others as a disciple of Jesus Christ and help build Zion.
This course has been designed to help you slowly build up a knowledge base of ideas and skills. Not all of these ideas and skills will come easily. It takes a lot of work and practice before some things will even start to make sense, so you should not be surprised to find that it may take you a little time to comprehend these ideas. Just be patient. Once you're far enough into the course, the ideas will start to come together, and you will see how much progress you have really made. You will understand what this course is all about, and you will be glad you persisted in your efforts to learn.
<br>
## Course Description
This course covers the following topics as they are applied to Statistics: graphical representations of data, measures of center and spread; elementary probability; sampling distributions; correlation and regression; statistical inference involving means, proportions, and contingency tables.
<br>
### Course Learning Outcomes
In this course, we will:
1. Summarize data numerically and graphically using spreadsheets
2. Make decisions regarding situations with inherent randomness
3. Apply probability distributions to investigate questions
4. Employ confidence intervals in various situations
5. Implement tests of diverse hypotheses
6. Communicate the results of statistical analyses to relevant audiences
<br>
### How the Outcomes will Be Assessed
While you may not be tested on everything you learn in this course, the instructor will be assessing your mastery of the **Course Learning Outcomes**. The general types of assessments used to measure these outcomes may include selected response tests such as multiple-choice, true-false, matching, and fill-in-the-blank questions. You may also be asked to complete essays or other writing assignments. At times, the instructor may assess your performance of a skill, or the instructor may assess products you create using particular skills. In addition, the instructor may engage in personal communication with you to determine how well you understand the course content.
<br>
### Keys to Success
#### Five Principles of the Learning Model
You will experience much deeper learning if you follow the Five Principles of the
[BYU-Idaho Learning Model](http://www.byui.edu/LearningModel){target="_blank"}
- **Exercise Faith**: Exercise faith in the Lord Jesus Christ as a principle of action and power.
- **Learn by the Holy Ghost**: Understand that true teaching is done by and with the Holy Ghost.
- **Lay Hold on the Word of God**: Lay hold of the word of God.
- **Act for Themselves**: Act for yourself and accept responsibility for learning and teaching.
- **Love, Serve, and Teach One Another**: Love, serve, and teach other students in your classes.
#### Three Process Steps of the Learning Model
You will learn more in less time if you follow the Three Process Steps of the
[BYU-Idaho Learning Model](http://www.byui.edu/LearningModel){target="_blank"}
- **Prepare**: This involves (a) spiritual preparation, (b) individual preparation, and (c) group preparation.
- **Teach One Another**: You should (a) be on time, (b) pray together, and (c) actively engage with other students.
- **Ponder/Prove**: You should (a) ponder what you have learned, (b) record your learning, and (c) pursue unanswered questions and discuss what you learn with others.
If you feel confused or have questions about anything in the lesson, take immediate action (Exercise Faith; Act for Themselves) and talk with your classmates, the teaching assistant, or the instructor (Love, Serve, and Teach One Another).
**Teach One Another**
At BYU-Idaho, an "A" student will demonstrate "diligent application of Learning Model principles, including initiative in serving other students" (BYU-Idaho Catalog). In this class, you will have the opportunity to work with other students.
Doctrine and Covenants 84:106 states, "And if any man among you be strong in the Spirit, let him take with him him that is weak, that he may be edified in all meekness, that he may become strong also." In the spirit of this revelation, you will have the opportunity to help others in the class when you have developed an understanding of a principle. Likewise, you will be able to receive help from others (peers, tutors, TA, and your instructor) when you are still working to understand concepts.
In a spirit of love and service, please reach out to others. You are not graded on a curve. If someone else does well, it does not affect you adversely. Research has shown that students who help other students to understand the material gain a much deeper grasp on the concepts of the course. Please take opportunities to help your peers succeed.
<br>
## Course Structure
This course consists of 24 lessons. They are presented in a topical order in which concepts and skills learned in the earlier lessons provide the requisite knowledge to succeed in later lessons. If the general order of the lessons doesn’t make sense at first, don’t worry. It will all come together in the end, and you’ll see the reasoning behind why the lessons have been presented in this particular order.
Your main goal as a student will be to complete all of the learning activities within each lesson by their due dates every week. These activities follow a consistent weekly schedule, and it will be up to you to make sure that you keep on pace with all your assignments. These weekly activities may include the following:
- Reading assigned texts or viewing presentations.
- Taking quizzes.
- Participating in group discussions and assignments with other class members.
- Writing papers and/or developing presentations.
- Participating in meetings with the instructor, teaching assistants, and other students.
For many of these activities, the due dates will fall on the same time each week. This will make it easier for you to plan out your weekly study schedule. However, there may be a need to make adjustments to the schedule from time to time. If in doubt, refer to the due dates your instructor has posted in I-learn.
You should create a study schedule that will keep you on pace throughout the semester. This is a rigorous course with a lot of subject matter to cover, and it can be extremely difficult to recover if you fall too far behind in your work. So, please make every effort to study on a regular basis and get your work turned in on time.
The lessons in this course have a similar structure and contain similar basic elements. A typical week consists of two lessons. Each lesson will consist of a reading assignment, a reading/preparation quiz, and a homework quiz.
The structure of this course fully integrates the BYU-Idaho Learning model with a mixture of preparation activities, teach-one-another activities, and ponder-and-prove activities.
## Course Materials
This course has been designed with the student in mind. Every effort has been made to provide a high quality experience at the lowest possible cost.
**Textbook**
To keep costs as low as possible for students and their families, no physical textbook is required for this class. The readings for this course are provided on this website and will continue to be available to you after the course is completed. Please report any problems with the textbook (links not working, loading slowly, inability to view images, etc.) to your instructor. A link to the textbook is found in the Quick Links module. It is highly recommended you bookmark the textbook so that you can easily reference each lesson's reading.
**Computer Equipment**
You will need:
- A laptop
- Access to Microsoft Excel 2016 or later
## Course Resources
**Peer Support**
Your experience in this course will be enhanced as you work with other students to learn and grow together.
**Help Desk**
The BYU-Idaho Help Desk has been established to help students with technological problems related to approved course software. You can access the Help Desk at any time in three ways:
- Walk-in: The Help Desk is located in room 322 of the McKay Library
- Call in: 208-496-1411 (toll free)
- Email: helpdesk@byui.edu
Additional information is available at the Help Desk web page: http://www.byui.edu/helpdesk/
When you have technical problems with I-Learn, you should first try contacting the Help Desk before you contact your instructor. They are connected with the IT support staff who can resolve problems with I-Learn. Please take a moment now to look at the [Help Desk web page](http://www.byui.edu/helpdesk/). That way, if a problem does arise later on in the course, you will know where to go for help.
**Tutoring Center**
The BYU-Idaho Study Skills/Tutoring Center is a powerful resource for students who would like a little extra help with a course. The Tutoring Center is located in the McKay Library in room 272. This is in the east wing of the second floor.
The Tutoring Center provides many services to help students succeed:
- Individual tutors
- Walk-in tutoring in the Math Study Center (McKay 266 & 270)
- Virtual tutoring
<<<<<<< HEAD
Please take 5 minutes to explore the [Study Skills/Tutoring Center web site](https://www.byui.edu/academic-support-centers/math/math-help-for-on-campus-students).
=======
Please take a moment to explore the [Study Skills/Tutoring Center web site](https://www.byui.edu/academic-support-centers/math/math-help-for-on-campus-students).
**TA Support**
In addition to the faculty who teach this course, specially trained teaching assistants (TAs) will help you through the course. The Guided Practice sessions will be led by TAs, under the direction of the faculty. The TAs will work with you on specific discovery activities in the Guided Practice sessions.
**Faculty Support**
Your instructor is committed to your success. If you have any needs or concerns, please contact your instructor for help. If you feel yourself getting behind or struggling, talk to your teacher right away. If caught in time, a small problem can be addressed quickly before it grows.
With all of that said, let's begin looking at a foundational idea of statistics: probability.
<br>
## Probability
Probability is a way of numerically quantifying how likely an event is to happen or not happen. The following historical account demonstrates this idea and shows how fractions (like 1/2 or 3/4) or percentages (like 50% or 75%) can be used to represent probabilities.
### Christopher Columbus' First Voyage
<img src="./Images/Columbus_taking_possession_of_the_new_country.jpg">
On August 3, 1492, Columbus set sail from Spain for his intended destination: the Indies (Caso, Adolph 1990). He was on the Santa Maria, which had a crew of approximately 41 men ("Cristobal colon" 1991; "Christopher Columbus"). Several other men were aboard the Nina and the Pinta ("Cristobal colon" 1991). On October 12, he landed on an island in the Bahamas he called San Salvador.
The return trip was not without challenges. The Santa Maria ran aground on Christmas Day, 1492, and was abandoned on the island we now call Hispaniola (home to Haiti and the Dominican Republic). Following this incident, Columbus sailed for Spain. Severe storms made the journey difficult. A particularly bad storm on February 14, 1493 made the crew fear for their lives. By morning, the storm was even worse!
Recognizing his dependence upon God, Columbus ordered that a pilgrimage should be made to a particular shrine upon their safe arrival in Spain. He decided that they would use random chance to determine who would make the pilgrimage. They took one chick pea for each man on board. A knife was used to mark one of the chick peas with a cross. The chick peas were placed in a hat and shaken up. Each man was to draw a chick pea, and the one who had the cross would make the pilgrimage.
"The first who put in his hand was [Columbus,] and he drew out the bean with a cross, so the lot fell on him; and he was bound to go on the pilgrimage and fulfil the vow" (Caso, Adolph 1990).
<div class="QuestionsHeading">Answer the following questions:</div>
<div class="Questions">
1. Remember, there were 41 men aboard his ship. What is the probability that Columbus would draw out the marked chick pea? Express your answer as a fraction, and then convert it to a decimal.
<a href="javascript:showhide('Q1')"><span style="font-size:8pt;">Show/Hide Solution</span></a>
<div id="Q1" style="display:none;">
* There is only one marked chick pea in the hat, out of 41 chick peas total. *Out of* is expressed arithmetically by division. The probability is $\frac{1}{41} = 0.0244$. (Note: this is about 2%.)
</div>
</br>
2. Based on your answer to the previous question, how likely is it that Columbus would draw out the marked chick pea?
<a href="javascript:showhide('Q2')"><span style="font-size:8pt;">Show/Hide Solution</span></a>
<div id="Q2" style="display:none;">
* There is only about a 2% chance that Columbus will draw out the marked Chick Pea. This is not very likely.
</div>
</div>
</br>
**A Second Drawing**<br>
Columbus' promise to make the pilgrimage did not stop the storm. It was determined that there should be a pilgrimage to another site they held sacred. Again, chick peas representing each member of the crew were placed in a hat and shaken up. The lot fell on a sailor...named Pedro de Villa (Caso, Adolph 1990).
<div class="QuestionsHeading">Answer the following questions:</div>
<div class="Questions">
3. What is the probability that Columbus would not draw out the marked chick pea? Express your answer as a fraction, and then covert it to a decimal?
<a href="javascript:showhide('Q3')"><span style="font-size:8pt;">Show/Hide Solution</span></a>
<div id="Q3" style="display:none;">
* There are 40 other men on board plus Columbus. So, the probability that Columbus would not draw out the marked chick pea is: $\frac{40}{41} = 0.9756$. (Note: this is almost 98%.)
</div>
</br>
4. Based on your answer to the previous question, how likely is it that Columbus would not draw out the marked chick pea?
<a href="javascript:showhide('Q4')"><span style="font-size:8pt;">Show/Hide Solution</span></a>
<div id="Q4" style="display:none;">
* It is very likely that Columbus would not draw out the marked chick pea. This result is not surprising.
</div>
</br>
5. In this second drawing, either Columbus would draw out the marked chick pea, or he would not. Add the probability that Columbus would draw out the marked chick pea and the probability that he would not draw out the marked chick pea. What is the value of this sum?
<a href="javascript:showhide('Q5')"><span style="font-size:8pt;">Show/Hide Solution</span></a>
<div id="Q5" style="display:none;">
* The sum of the probabilities is 1:
$$
\frac{1}{41} + \frac{40}{41} = \frac{41}{41} = 1
$$
</div>
</div>
</br>
**Additional Drawings**<br>
After the drawing in which Pedro de Villa was chosen to make a pilgrimage, two additional drawings were held. In both cases, Columbus drew out the marked chick pea (Caso, Adolph 1990). In all, Christopher Columbus drew the marked chick pea in three of the four drawings. It can be shown that the probability that this would occur due to chance is very small: 0.0000566. <a href="javascript:showhide('bonusprobabilitycalc')"><span style="font-size:8pt;">(Show/Hide Solution)</span></a>
<div id="bonusprobabilitycalc" style="display:none;padding-left:50px;padding-right:50px;border:solid 1pt;border-color:orange;color:gray;">
**Bonus material. Read only if you are interested.**
This calculation is more involved than the calculations you will be required to make in this course this semester. But if you are still interested, read on.
In each individual drawing, there was a 1/41 chance of Columbus getting the marked chick pea. Similarly, there was a 40/41 chance of not getting it. Since there were four drawings total, and the goal is to measure the probability of "three of those drawings" resulting in Columbus getting the marked chick pea, it becomes important to think about all of the orders in which Columbus could have gotten 3 out of 4.
| Possible Outcome | First Drawing | Second Drawing | Third Drawing | Fourth Drawing |
|------------------|---------------|----------------|----------------|----------------|
| What actually happened... | Got it. | Didn't get it. | Got it. | Got it. |
| But he could have... | Got it. | Got it. | Didn't get it. | Got it. |
| Or he could have... | Got it. | Got it. | Got it. | Didn't get it. |
| Or he could have... | Didn't get it. | Got it. | Got it. | Got it. |
In each of the above cases, notice that Columbus *would have* gotten the marked chick pea a total of 3 out of 4 times. So, this tells us there are four diffent ways to get the chick pea 3 out of 4 times.
The probability of what actually happened to Columbus *in the order in which it happened* would be computed by multiplying the individual probabilities of each drawing together.
$$
\frac{1}{41} \cdot \frac{40}{41} \cdot \frac{1}{41} \cdot \frac{1}{41} \approx 0.00001415548
$$
But then, we must also add to this the other "possible" scenarios that would also lead to getting the chick pea 3 out of 4 times, but as shown below, because multiplication is commutative (the order doesn't matter) these "different" situations result in the same probability as the first.
$$
\frac{1}{41} \cdot \frac{1}{41} \cdot \frac{40}{41} \cdot \frac{1}{41} \approx 0.00001415548
$$
$$
\frac{1}{41} \cdot \frac{1}{41} \cdot \frac{1}{41} \cdot \frac{40}{41} \approx 0.00001415548
$$
$$
\frac{40}{41} \cdot \frac{1}{41} \cdot \frac{1}{41} \cdot \frac{1}{41} \approx 0.00001415548
$$
Thus, all that is needed is to multiply the first probability of roughly 0.00001415548 by 4 to get $0.00001415548 \cdot 4 = 0.00005662192$.
**End of Bonus Material.**
</div>
To put some perspective on this, a high school athlete in the United States is over 26 times more likely to play professional sports than Columbus was to draw the three marked peas! (Fields, Mike 2008) Consider how you might explain the occurrence of this extremely unlikely event. (While no response is required of you right now, this kind of question will be very important later, so take a little time to ponder it.) In fact, it is worth restating the question, "How might you explain the occurrence of this extremely unlikely event?"
Now, take a moment to practice what you have read by answering the following questions.
<div class="QuestionsHeading">Answer the following questions:</div>
<div class="Questions">
6. If a fair, six-sided die* is rolled, what is the probability of rolling a 6?
<a href="javascript:showhide('Q6')"><span style="font-size:8pt;">Show/Hide Solution</span></a>
<div id="Q6" style="display:none;">
* The probability of rolling a 6 on a die is $\displaystyle{ \frac{1}{6}} = 0.1667$. This is because a six-sided die has 6 sides total and only 1 side that has a "6" on it. Thus, 1/6 represents the chance of getting a "six" divided by the "total number of possibilities on the die" in the denominator (6).
</div>
</br>
7. If a fair, six-sided die is rolled, what is the probability of not rolling a 6?
<a href="javascript:showhide('Q7')"><span style="font-size:8pt;">Show/Hide Solution</span></a>
<div id="Q7" style="display:none;">
* The probability of not rolling a 6 on a die is $\displaystyle{\frac{5}{6}} = 0.8333.$
This is because there are five sides on the die that are "not a 6" (the sides representing 1, 2, 3, 4, and 5) and six total sides, so 5 out of 6 sides will yield something other than a "six."
</div>
</br>
8. When a die is rolled, what is the sum of the probability of rolling a 6 and the probability of not rolling a six?
<a href="javascript:showhide('Q8')"><span style="font-size:8pt;">Show/Hide Solution</span></a>
<div id="Q8" style="display:none;">
* The probability of rolling a six is $\displaystyle{\frac{1}{6}}$ and the probability of not rolling a six is $\displaystyle{\frac{5}{6}}$. These things cannot happen at the same time, so the probability of either rolling a six or not rolling a six is
$$ \frac{1}{6} + \frac{5}{6} = \frac{6}{6} = 1 $$
*The only possible outcomes in this case are that you either roll a six or that you do not roll a six. The probability that one of these will happen is 1. If we list all the possible outcomes, the probability that at least one of them will occur is 1.
</div>
</br>
9. In general, if we know the probability that a particular outcome will occur, how could we calculate the probability that it will not occur?
<a href="javascript:showhide('Q9')"><span style="font-size:8pt;">Show/Hide Solution</span></a>
<div id="Q9" style="display:none;">
* If we know the probability that an event will occur, we can subtract this probability from 1 to find the probability that the event will not occur. This is because the sum of the probabilities that the event will occur and that the event will not occur must be 1.
</div>
</br>
$*$*Note: The word "die" is the singular form of the word "dice." When we refer to a die, we are talking about a fair, six-sided die.*
</div>
</br>
### Probability Notation
You may already have a good understanding of the basics of probability. It is worth noting that there is a special notation used to denote probabilities. The probability that an event, $x$, will occur is written $P(x)$ and pronounced as "probability-of-event-x." As an example, the probability that you will roll a 6 on a fair six-sided die can be written as
$$
P\text{(Roll a "six" on a fair six-sided die)}= \frac{1}{6} = \frac{\text{number of sides that show a "six"}}{\text{total number of sides on the die}}
$$
### Rules of Probability
Probabilities follow patterns, called **probability distributions,** or just *distributions*, for short. There are three rules that a probability distribution must follow. Answer the following questions to explore what these three rules might be.
<div class="QuestionsHeading">Answer the following questions:</div>
<div class="Questions">
10. As an answer to a homework problem, a student reported, The probability of finding life on Mars is -0.35. What is wrong with this statement?
<a href="javascript:showhide('Q10')"><span style="font-size:8pt;">Show/Hide Solution</span></a>
<div id="Q10" style="display:none;">
* Probabilities cannot be negative because they represent the "number of ways something specific can happen" (like how many planets that are "just like" Mars and do have life on them) divided by "the total number of possibilities" (in this case, the total number of planets that exist that are "just like" Mars). The fewest planets there could be that are "just like" Mars and have life on them is zero. So the lowest a probability can go is zero.
</div>
</br>
11. A student in an introductory statistics class wrote the following statement on an exam: The probability that the event will occur is 1.25 (i.e. 125%). What is wrong with this statement?
<a href="javascript:showhide('Q11')"><span style="font-size:8pt;">Show/Hide Solution</span></a>
<div id="Q11" style="display:none;">
* Probabilities cannot be larger than 1 (or 100%). This is because probabilities represent frequencies of occurrence, and the most something can happen is "all the time" or 100% of the time.
</div>
</br>
12. A student estimated that the probability that he would finish his homework is 0.45 (i.e., 45%), and the probability that he would not finish his homework is 0.35 (i.e., 35%). What is wrong with this student's statement?
<a href="javascript:showhide('Q12')"><span style="font-size:8pt;">Show/Hide Solution</span></a>
<div id="Q12" style="display:none;">
This can be viewed as one of two problems:
</br>
1. The probabilities for all the events do not add up to 1 (or 100%.)
2. The probability that he does not finish his homework is actually 1 minus the probability that he will finish his homework or 0.55 (i.e., 55%).
</div>
</div>
</br>
In this course we are interested in experiments where the outcomes of the experiment are uncertain, yet they follow a pattern or *probabilitiy distribution.* As you read in the above questions and answers, these probability distributions follow three rules.
<div class="Emphasis">
**The three rules of probability are:**
- **Rule 1**: The probability of an event $X$ is a number between 0 and 1.
$$0 \leq P(X) \leq 1$$
- **Rule 2**: If you list all the outcomes of an experiment (such as rolling a die) the probability that one of these outcomes will occur is 1. In other words, the sum of the probabilities of all the possible outcomes of any experiment is 1.
$$\sum P(X) = 1$$
- **Rule 3**: (Complement Rule) The probability that an event $X$ will not occur is 1 minus the probability that it will occur.
$$P(\text{not}~X) = 1 - P(X)$$
You may have noticed that the Complement Rule is just a combination of the first two rules.
</div>
<br>
<div class="QuestionsHeading">Answer the following questions:</div>
<div class="Questions">
13. Which of the probability rules was violated by the statement in Question 10?
<a href="javascript:showhide('Q13')"><span style="font-size:8pt;">Show/Hide Solution</span></a>
<div id="Q13" style="display:none;">
* Rule 1
</div>
</br>
14. Which of the probability rules was violated by the statement in Question 11?
<a href="javascript:showhide('Q14')"><span style="font-size:8pt;">Show/Hide Solution</span></a>
<div id="Q14" style="display:none;">
* Rule 1
</div>
</br>
15. Which of the probability rules was violated by the statement in Question 12?
<a href="javascript:showhide('Q15')"><span style="font-size:8pt;">Show/Hide Solution</span></a>
<div id="Q15" style="display:none;">
* Rule 2 or Rule 3
</div>
</div>
</br>
Informally, a distribution can be thought of as being "all the possible outcomes of an experiment and how often they occur."
### Randomness
A BYU-Idaho student was overhead saying, "I went shopping and bought some *random* items." Did the person actually take a random sample of the items at the store? Did they write all the items down and randomly select the items for purchase? Of course not!
What did the student mean? That the items they bought seemed unrelated. When we consciously or subconsciously choose a sample, it is not random.
So, what does it mean to be random? When something is random, it is not just haphazard, with no pattern. A random process follows a very distinct pattern over time---the distribution of its outcomes. For example, if you roll a die thousands of times, about one-sixth of the time you will roll a four. This is a very clear pattern, or part of a pattern. The entire pattern (or, the entire distribution) is that each number on the die is rolled about one-sixth of the time.
But there's something different about the patterns followed by random processes than other kinds of patterns. Other kinds of patterns can be very predictable, such as a color pattern of the red, yellow, blue, red, yellow, blue, and so on. If you're following this pattern and happen to see yellow, you know the next color will be blue. By contrast, you never know what you will get on the next roll of a six-sided die. You *do* know that in the long run you will roll fours about one-sixth of the time.
When something is random, we can be sure that it follows a long-term pattern. This long-term pattern is called its *probability distribution*. However, what makes "randomness" interesting is that despite knowing the long-term pattern, or how often something will occur over time, we still never know what the outcome of the *next* experiment will be.
<br>
## Installing R and RStudio {.tabset .tabset-fade}
In this course, we will use R and RStudio to perform necessary calculations. This will allow us to focus on the statistical principles.
If you have not already installed R and RStudio on your computer, please follow these instructions to do so.
### Quick Instructions
<table align="left">
<tr>
<td style="padding:5px;">
**First**, install:
</td><td style="padding:5px;">
<img src="./Images/R_logo.jpeg" alt="R_logo.jpg" width="64" height="49" /> (<a href="https://cran.r-project.org/bin/macosx/base/R-4.1.0.pkg" target="_blank">Mac OS X</a> | <a href="https://cran.r-project.org/bin/windows/base/release.html" target="_blank">Windows</a>),
</td>
</tr><tr>
<td style="padding:5px;">
**Second**, install:
</td><td style="padding:5px;">
<img src="./Images/RStudio_logo.png" alt="RStudio_logo.png" width="106" height="37" /> (<a href="https://download1.rstudio.org/desktop/macos/RStudio-1.4.1106.dmg" target="_blank">Mac OS X</a> | <a href="https://download1.rstudio.org/desktop/windows/RStudio-1.4.1106.exe" target="_blank">Windows</a>).
</td>
</tr>
</table>
<div class="note">
If you are using a <span style="color: #ff6600;">Chromebook</span> or <span style="color: #ff6600;">other "web browsing only" type computer</span> that will not allow you to install software, then set up an account at <a href="https://rstudio.cloud/">RStudio Cloud</a> instead of installing R and RStudio as shown here.
</div>
<div style="clear:both;"></div>
<br/>
Just accept all of the default options when installing.
----
<br/>
<br/>
### Detailed Instructions
To install the statistical analysis program **RStudio** you will first need to install a piece of software called **R**. Funny name, right? (There was originally a software called "S" for statistics, and then "R" was invented later on. Part of the reason they used "R" was to claim that "R" was a "leap ahead" of "S.")
<table align="left">
<tr>
<td style="padding:5px;">
Install the R Software by clicking here:
</td><td style="padding:5px;">
<img src="./Images/R_logo.jpeg" alt="R_logo.jpg" width="64" height="49" /> (<a href="https://cran.r-project.org/bin/macosx/R-4.0.5.pkg" target="_blank">Mac OS X</a> | <a href="https://cran.r-project.org/bin/windows/base/release.html" target="_blank">Windows</a>),
</td>
</tr>
</table>
<div style="clear:both;"></div>
<br/>
Once that download finishes, open the resulting file. It should look something like this:
<img src="./Images/installingR_step1.png" width="500">
Click "Continue" or "Okay" or "Accept" for all of the several various windows that will appear. Once the installation is complete you should get a window like this:
<img src="./Images/installingR_step8.png" width="500">
Now that R is properly installed on your computer, we need to install RStudio. RStudio is an app that runs R inside of it and provides you with many other tools that go way beyond what R can do. This is why R must be installed first, so that RStudio can use it. You will never need to open R yourself. Just use RStudio. But without R, RStudio won't work properly.
<table align="left">
<tr>
<td style="padding:5px;">
Install the RStudio app by clicking here:
</td><td style="padding:5px;">
<img src="./Images/RStudio_logo.png" alt="RStudio_logo.png" width="106" height="37" /> (<a href="https://download1.rstudio.org/desktop/macos/RStudio-1.4.1106.dmg" target="_blank">Mac OS X</a> | <a href="https://download1.rstudio.org/desktop/windows/RStudio-1.4.1106.exe" target="_blank">Windows</a>).
</td>
</tr>
</table>
<div style="clear:both;"></div>
<br/>
Once the RStudio installer downloads, open the resulting file. A window like this should appear:
<img src="./Images/rstudio_setup.png" width="500">
Again, work through the installation process, agreeing with all the defaults and terms of conditions.
Once the installation finishes you can use your computer's search bar to search for "RStudio" in your apps. It will have an icon like this: <img src="./Images/RStudio_logo.png" width="30">.
Once you have successfully opened RStudio it should look like this:
<img src="./Images/rstudio_open.png" width="500">
<br/>
<br/>
## Verify R and RStudio are Properly Installed
<div class="SoftwareHeading">R Instructions</div>
<div class="Software" style="padding:10px;">
<a href="javascript:showhide('r_instr_2_mean')"><span style="font-size:8pt;">Show/Hide R Instructions</span></a>
<div id="r_instr_2_mean"> <!-- style="display:none;" -->
<br>
**Check R and RStudio have been installed correctly** by calculating the average of some data values. To do this, follow these steps:
<br />
1. Open RStudio.
2. Copy and paste the following text into the lower left corner of the RStudio screen next to the `>` symbol. You will find this symbol below the word Console.
```{}
mydata <- c(1, 1, 2, 3, 5, 8)
mean(mydata)
```
3. Then press Return. The first line of code stores the six numbers in a variable called `mydata`. The second line tells R to compute the average (or mean) of the numbers (1, 1, 2, 3, 5, 8). You should see the following result:
```{r, echo=FALSE}
mydata <- c(1, 1, 2, 3, 5, 8)
mean(mydata)
```
In RStudio this looks like:
<img src="./Images/rstudio_demo_mean.png" width="500">
</div> <!-- End of R instructions for measures of center -->
</div>
<br />
<br>
## Conclusion
As with all the classes you take at BYU-Idaho, it is up to you to decide what you want to get out of this class. If you choose to approach the things you study in class with an open mind, if you prepare diligently and work hard to complete all the learning activities, and if you humbly seek the Lord’s help to understand the intellectual and spiritual truths discussed in this course and in other courses, you will have an outstanding educational experience that will be a blessing to you throughout your life. May you enjoy the journey this semester into statistics!
<br>
## Summary
<div class="SummaryHeading">Remember...</div>
<div class="Summary">
- In this class you will use the online textbook that has been written for you by your statistics teachers. All of the assignments and quizzes will be based on the readings, so study it well.
- Most weeks will cover two lessons
- By doing the work, staying on schedule, and living the Honor Code you *will* succeed in this class!
- The three **rules of probability** are:
1. A probability is a number between 0 and 1.
$$0 \leq P(X) \leq 1$$
2. If you list all the outcomes of a probability experiment (such as rolling a die) the probability that one of these outcomes will occur is 1. In other words, the sum of the probabilities in any probability is 1.
$$\sum P(X) = 1$$
3. The probability that an outcome will not occur is 1 minus the probability that it will occur.
$$P(\text{not}~X) = 1 - P(X)$$
<br>
</div>
<br>
## Navigation
<center>
| **This Reading** | **Next Reading** |
| :----------------------------: | :--------------------------------------------------------------------: |
| Lesson 1: <br> (On Campus) Course Intro & Probability | [Lesson 2: <br> The Statistical Process & Design of Studies](Lesson02.html) |
</center>