Probability of Precipitation Events
Summary
Summary
This MATLAB-based activity introduces students to fundamental probability concepts through the analysis of daily precipitation observations from three SNOTEL stations in Utah: Brighton, Ben Lomond Peak, and Snowbird. Students use real environmental data to explore probability laws, unions and intersections of events, complements, conditional probability, the law of total probability, and Bayes' theorem. Using MATLAB, students construct logical expressions to identify precipitation events, calculate empirical probabilities, verify mathematical relationships, and interpret the results in a scientific context. The activity emphasizes a build-it-yourself computational approach, encouraging students to implement probability calculations directly rather than relying on specialized statistical functions. By completing the assignment, students develop computational thinking, quantitative reasoning, data analysis, and scientific interpretation skills while gaining practical experience using MATLAB to investigate environmental processes.
Keywords: MATLAB, environmental statistics, probability, SNOTEL, precipitation, conditional probability, De Morgan's laws, Bayes' theorem, law of total probability, logical indexing, environmental data analysis, computational thinking.
Context
This activity is designed for EES 3000, an undergraduate Earth and Environmental Sciences course, and is appropriate for students developing foundational skills in quantitative environmental data analysis and MATLAB programming. It can be implemented as a laboratory activity or take-home assignment, with approximately one to two class periods for introducing the concepts and MATLAB techniques, followed by independent work.
Students should have basic familiarity with MATLAB, including importing datasets, working with vectors and matrices, using logical indexing, performing arithmetic operations, and writing simple scripts. Prior exposure to elementary probability and set notation is helpful, although the relevant concepts can be introduced during the activity. No advanced programming experience or specialized MATLAB toolboxes are required.
The activity follows a progressive learning structure. Students begin by defining precipitation events using logical conditions, then calculate simple and compound probabilities, compare conditional probabilities between stations, and apply more advanced probability relationships. The final exercises connect these calculations to environmental interpretation and forecast reliability.
Students are provided with a SNOTEL precipitation dataset, a student assignment handout, and a MATLAB starter script. An instructor guide, assessment rubric, and completed MATLAB solution script support implementation and evaluation. Students submit their MATLAB code, numerical results, and written explanations of the scientific meaning of their findings.
Although developed for an Earth and Environmental Sciences course, the activity can be readily adapted to other undergraduate STEM courses. Instructors can substitute different environmental or scientific datasets while retaining the same probability concepts and computational structure.
Learning Goals
Goals of the Activity or Assignment
The primary goal of this activity is to help students develop a conceptual and computational understanding of probability through the analysis of real environmental data. Using daily precipitation observations from three SNOTEL stations, students learn to define events, calculate empirical probabilities, and apply fundamental probability principles, including unions, intersections, complements, De Morgan's laws, conditional probability, the law of total probability, and Bayes' theorem. Students also learn to interpret probability relationships in the context of precipitation occurrence and environmental forecasting.
MATLAB serves as both a computational and learning tool. Students import precipitation data, construct logical arrays to identify events, and calculate probabilities using basic mathematical and logical operations. Rather than relying on specialized statistical functions, students implement probability calculations directly and verify their results using alternative mathematical expressions. This build-it-yourself approach helps students connect abstract probability concepts with computational operations and observable environmental phenomena.
The activity develops higher-order thinking skills, including computational thinking, quantitative reasoning, data analysis, critical evaluation, and scientific interpretation. Students compare conditional probabilities between precipitation stations, evaluate relationships among events, verify probability identities, and explain the physical meaning of their findings. The Bayes' theorem exercise further encourages students to consider how event frequency and false alarms influence forecast reliability.
Students also develop scientific communication and reproducible programming skills by organizing and documenting MATLAB scripts, presenting numerical results, explaining their calculations, and writing scientifically meaningful interpretations. By the end of the activity, students should be able to translate probability expressions into MATLAB code, validate their calculations, and use probability-based reasoning to investigate and communicate environmental relationships.
Context for Use
This activity is designed for EES 3000, an undergraduate Earth and Environmental Sciences course, and is appropriate for students learning fundamental probability concepts and computational methods for environmental data analysis. It can be implemented as a laboratory exercise or take-home assignment, with approximately one to two class periods devoted to introducing the concepts and MATLAB techniques, followed by independent work. The activity is suitable for small or large classes and can be completed individually or with opportunities for collaborative discussion.
Students should have basic MATLAB programming experience, including importing data, working with vectors and matrices, indexing arrays, performing arithmetic and logical operations, and writing simple scripts. Familiarity with relational operators (>, <, ==) and logical operators (&, |, ~) is particularly helpful because students use these operations to identify precipitation events and calculate empirical probabilities. No advanced programming skills or specialized MATLAB toolboxes are required.
Students should have a basic understanding of algebra and introductory probability concepts, including events, fractions, and set notation. More advanced concepts, such as conditional probability, De Morgan's laws, the law of total probability, and Bayes' theorem, are introduced and reinforced through the exercises.
The activity is organized as a progressive sequence of seven problems using daily precipitation observations from three SNOTEL stations in Utah. Students begin by defining precipitation events and calculating compound probabilities, then investigate conditional relationships between stations, apply probability laws to more complex events, and interpret the results in an environmental context. MATLAB serves as the primary computational tool, allowing students to connect mathematical probability expressions with logical operations and calculations using real data.
The activity includes a student handout, a SNOTEL dataset, a MATLAB starter script, an instructor guide with an assessment rubric, and a completed MATLAB solution script. These materials support both independent student work and instructor-led implementation. The activity can be readily adapted to other environmental science, geoscience, or introductory statistics courses by replacing the precipitation dataset with other observations while retaining the same probability concepts and computational approach.
Description and Teaching Materials
This activity introduces students to fundamental probability concepts through a sequence of seven MATLAB-based exercises using daily precipitation observations from three SNOTEL stations in Utah: Brighton, Ben Lomond Peak, and Snowbird. The dataset contains 3,287 daily observations from October 2006 through September 2015, including precipitation measurements in millimeters. Students use these observations to investigate precipitation occurrence, relationships between stations, and the interpretation of probability in environmental science.
The activity follows a progressive, build-it-yourself computational approach. Students first import the SNOTEL dataset into MATLAB and use logical operations to identify days with and without precipitation at each station. They then calculate probabilities involving unions, intersections, and complements, and verify their results using probability identities and De Morgan's laws. Subsequent exercises introduce compound events involving three stations, conditional probabilities, the additive law of probability, and the law of total probability. Students also explore Bayes' theorem through an environmental forecasting example, examining how event frequency, detection probability, and false alarms influence forecast reliability. The final exercise asks students to formulate and explain a scientifically interesting observation using probability concepts.
MATLAB is used throughout the activity to import and organize data, construct logical arrays, perform probability calculations, and verify mathematical relationships. Students are encouraged to implement calculations directly using basic operations rather than relying on specialized statistical functions. This approach helps them understand how mathematical probability expressions translate into computational procedures. Although the activity could also be implemented in Python, R, or another programming environment, MATLAB was selected because its matrix-based structure, logical indexing capabilities, and straightforward numerical operations allow students to focus on the connection between probability theory and environmental data analysis.
The activity can be introduced during a class or laboratory session, followed by independent student work. Students are expected to submit their completed MATLAB scripts, numerical probability results, and written explanations interpreting their findings. Instructors can assess both computational correctness and students' ability to explain the scientific meaning of the results.
Teaching materials include:
EES3000_Module1_Student.pdf — Student-facing assignment containing learning objectives, dataset information, seven probability exercises, and submission requirements.
snotel.csv — Daily precipitation observations from the three SNOTEL stations used for probability calculations and environmental interpretation.
EES3000_Module1_Starter.m — MATLAB starter script providing data-import commands, precipitation-event definitions, and guided sections for students to complete.
EES3000_Module1_Instructor.pdf — Instructor guide containing the teaching sequence, implementation suggestions, common student difficulties, expected results, and a 100-point assessment rubric.
EES3000_Module1_Solutions.m — Completed MATLAB script with probability calculations, verification checks, and example scientific interpretations for instructors.
The student assignment and instructor guide are provided as PDFs for convenient distribution, while the MATLAB scripts are editable to support modification and reuse. The activity is modular and can be adapted to other environmental datasets or undergraduate courses covering introductory probability and computational data analysis.
Additional background on the SNOTEL monitoring network is available from the USDA Natural Resources Conservation Service: https://www.nrcs.usda.gov/resources/education-and-teaching-materials/water-and-climate-data-collection-and-stewardship. MATLAB documentation and examples are available at https://www.mathworks.com/help/matlab/.
The original provenance and redistribution permissions of the supplied SNOTEL dataset should be confirmed before the materials are publicly distributed.
INSTRUCTOR GUIDE AND RUBRIC (Acrobat (PDF) 231kB Oct27 26)
STUDENT ASSIGNMENT (Acrobat (PDF) 228kB Oct27 26)
code starter (Matlab File 3kB Oct27 26)
data (Comma Separated Values 63kB Oct27 26)
Teaching Notes and Tips
This activity works best when students have been introduced to basic probability concepts and MATLAB logical operations before beginning the assignment. Instructors may start with a short demonstration showing how precipitation observations can be converted into logical arrays using relational operators such as > 0 and how &, |, and ~ represent intersections, unions, and complements. Students should then complete the probability calculations independently using the provided MATLAB starter script.
A key teaching objective is to connect mathematical probability expressions with their computational implementation. Encourage students to write the probability equation before translating it into MATLAB code. For example, students can calculate the probability of precipitation at either Brighton or Ben Lomond Peak directly using a logical OR operation and then verify the result using the additive law of probability. This reinforces the mathematical meaning of the calculation while introducing computational verification.
Several concepts may require additional attention:
Logical operations and event definitions: Students sometimes confuse unions with intersections or incorrectly apply complements. Simple truth tables or small examples can help them understand compound events before working with the full dataset.
Conditional probability: Students may confuse P(R|L) with P(L|R). Emphasize that the denominator determines the population of days being considered and that reversing the conditioning event changes the interpretation.
Compound events and De Morgan's laws: Encourage students to verify equivalent probability expressions using independent calculations. This helps identify logical errors and reinforces the relationship between mathematical notation and MATLAB syntax.
Law of total probability: Students should first identify mutually exclusive and collectively exhaustive events before calculating the contributions to the total probability.
Bayes' theorem: Students may confuse the probability of an event given a positive forecast with the probability of a positive forecast given the event. Discuss how false alarms and the underlying frequency of an event influence forecast reliability.
Data handling: Students should check the dataset structure and identify missing values before defining precipitation events. A precipitation value of zero represents no recorded precipitation and should not be confused with missing data.
The build-it-yourself approach is an important feature of this activity. Students should calculate empirical probabilities using logical indexing, counting, and basic arithmetic rather than relying on specialized statistical functions. Instructors can encourage students to compare results obtained using different mathematical identities as a way to verify their calculations.
For assessment, students submit their completed MATLAB scripts, numerical results, and written interpretations. The instructor solution script provides reference calculations, while the instructor guide includes a 100-point rubric. Particular attention should be given to students' explanations of conditional probabilities and their ability to connect numerical results to precipitation patterns and forecast reliability.
A brief discussion after the assignment can help students compare their findings and reflect on the difference between mathematical correctness and scientific interpretation. Instructors may also ask students to consider how the results could change with different precipitation thresholds, observation periods, or station locations. These extensions encourage critical thinking and demonstrate how probability concepts can be applied to other environmental datasets.
Assessment
Students are assessed through their completed MATLAB scripts, numerical probability calculations, and written scientific interpretations. The assignment uses a 100-point rubric covering seven exercises that progressively evaluate students' understanding of probability concepts and their ability to implement these concepts computationally.
Assessment focuses on three areas: mathematical correctness, computational implementation, and scientific interpretation. Students must correctly define precipitation events, apply probability laws, calculate empirical probabilities using logical operations, and verify results using equivalent mathematical expressions. They must also interpret conditional probabilities, explain relationships between precipitation events at different stations, and apply Bayes' theorem to an environmental forecasting problem.
The seven exercises are weighted as follows:
- Compound probabilities and De Morgan's laws (15 points)
- Three-station compound events (15 points)
- Conditional probabilities and interpretation (15 points)
- Additive law of probability (15 points)
- Law of total probability (15 points)
- Bayes' theorem and forecast reliability (15 points)
- Independent scientific observation and interpretation (10 points)
The instructor guide provides assessment criteria, and the completed MATLAB solution script provides reference calculations for verifying student results. Students demonstrate successful achievement of the learning goals when they can translate probability expressions into working MATLAB code, obtain and verify correct results, and explain the environmental significance of their findings. Particular emphasis is placed on clear reasoning and reproducible calculations rather than numerical answers alone.
References and Resources
The following resources provide background information on the SNOTEL precipitation observations, probability concepts, and MATLAB operations used in this activity.
1. USDA Natural Resources Conservation Service (NRCS) — SNOTEL Network and Data Collection
https://www.nrcs.usda.gov/resources/education-and-teaching-materials/water-and-climate-data-collection-and-stewardship
Describes the SNOTEL monitoring network, including its collection of precipitation, snowpack, and other environmental measurements. This resource helps students understand the origin and scientific applications of the observations analyzed in the assignment.
2. USDA NRCS — Snow and Water Interactive Map
https://www.nrcs.usda.gov/resources/data-and-reports/snow-and-water-interactive-map
Provides access to SNOTEL station locations and historical snow and climate information. Instructors can use this resource to introduce the geographic setting of the precipitation stations or identify alternative datasets for adapting the activity.
3. MathWorks — Logical (Boolean) Operations in MATLAB
https://www.mathworks.com/help/matlab/logical-operations.html
Explains MATLAB logical operators, including AND (&), OR (|), and NOT (~). These operations are central to defining precipitation events and implementing unions, intersections, and complements.
4. MathWorks — Importing Data with readmatrix
https://www.mathworks.com/help/matlab/ref/readmatrix.html
Provides documentation and examples for importing numerical data from CSV files into MATLAB. Students use this function to load and organize the SNOTEL observations before calculating empirical probabilities.
5. NIST/SEMATECH — Engineering Statistics Handbook
https://www.nist.gov/programs-projects/nistsematech-engineering-statistics-handbook
Provides background on statistical reasoning, quantitative analysis, and the interpretation of statistical results. It is a supplementary reference for instructors and students who want to strengthen their understanding of statistical methods and their applications to scientific data.