COS 280 - Discrete Math Labs

Aug 30 - Lab 1: Lab 1 is an introductory foray into Python programming, offering a foundational understanding of essential concepts. In this lab, you will explore key programming elements, such as loops, lists, and conditional statements. These fundamental building blocks are crucial for aspiring programmers, forming the backbone of algorithmic problem-solving.

To put your newfound Python knowledge into practice, this lab concludes with six exercise problems that revolve around the concept of prime numbers. By engaging in these exercises, you will gain proficiency in Python's syntax and structure and apply your skills to solve practical mathematical challenges related to prime numbers. This lab sets the stage for your journey into the world of programming, arming you with the tools to tackle more complex problems and projects in the future. Solutions are provided.

Sep 6 - Lab 2: In Lab 6, you will further develop your programming skills, focusing on essential constructs like if and for statements. This lab is designed to help you:

Solutions provided.

Sep 13 - Lab 3 : In this lab, you will explore conjectures and code (in any language) to solve mathematical problems such as finding the smallest prime factor of a given number or determining the digital sum of a positive integer. During this lab, create a file called primes.py in a text editor and place all the prime functions you've written in past labs and this lab. In future labs, you will upload to Colab and then import primes to use the functionality. Solutions provided.

Sep 20 - Lab 4 - Lab 4 is a hands-on exploration of prime numbers, divisibility, and summation through programming code. The central focus of this lab is the use of operators like div and mod, which provide the quotient and remainder when dividing numbers. These operators play a critical role in solving various problems related to prime numbers and divisibility.

By actively engaging with the exercises in this lab, you will reinforce your understanding of prime numbers, gain insights into divisibility testing, and develop your skills in calculating summations. This lab is an excellent opportunity to apply mathematical concepts in a programming context, allowing you to solidify your knowledge and enhance your problem-solving abilities. Solutions provided.

Sep 27 - Lab 5 - Lab 5 centers on the foundational concept of the Principle of Mathematical Induction, a powerful technique for substantiating universal statements in mathematics. This lab will provide a solid understanding of this principle and its practical applications.

Throughout the lab, you will work towards achieving the following learning objectives:

In summary, Lab 5 offers a deep dive into the Principle of Mathematical Induction and related mathematical concepts, empowering you to work with sequences, verify summation formulas, and provide evidence to support the truth of mathematical statements. This lab is a significant step in your journey to becoming a proficient problem solver in mathematics and beyond.

Hints provided.

Oct 04 - Lab 6 - Lab 6 will demonstrate and substantiate various mathematical formulas and properties. While the textbook exercises may rely on mathematical induction, this lab will focus on generating concrete evidence to support the validity of these formulas and properties. To accomplish this, you must employ for loops or recursive functions for each problem, ensuring that you provide practical and computational evidence. Through this lab, you will gain hands-on experience in applying mathematical concepts and sharpen your problem-solving skills, paving the way for a deeper understanding of mathematical principles and their real-world applications.

Oct 11 - Lab 7 - Lab 7 will address sets (in Python). In particular, you will perform operations on sets, test for membership, and determine whether one set is a subset of another, a crucial concept for set theory and mathematical analysis. This skill is particularly valuable in fields such as data science, where understanding relationships between data sets is essential. Students will be working with dictionaries, a versatile data structure in Python. This knowledge is highly relevant in computer science and data management, as dictionaries are commonly used for efficient data retrieval and storage. Hints provided.

Oct 18 - Lab 8 - Lab 8 is a concentrated exploration of sets and their related operations and functions. The primary focus of this lab is to provide you with a comprehensive understanding of sets and how to work with them effectively (in Python).

Throughout the lab, you will engage with the following learning objectives:

Oct 25 - Lab 9 - In this lab, students can reinforce their understanding of set properties discussed in the previous lecture. Building on the knowledge gained in the previous lab, participants will utilize critical functions, including issubset() and complement(), to verify and explore these set properties. Hints and guidance will be provided to support students in exploring and applying these concepts. This hands-on experience will further solidify their comprehension of set theory and its practical applications, making it a valuable exercise for those looking to deepen their grasp of this fundamental mathematical concept.

Nov 1 - Lab 10 - In this discrete math lab, students delve into the fundamental world of graphs, a cornerstone concept in computer science that models various real-world situations, including computer networks, transportation systems, and social connections. The lab explores various learning objectives, such as reviewing Python dictionaries, representing graphs in Python, and determining the order and size of a graph represented as a dictionary. Students also learn to find vertices adjacent to a given vertex, calculate the degree of each vertex in a graph, and write functions to discover walks between two specified vertices within a graph. This lab equips students with valuable skills and knowledge for understanding and manipulating graph structures in computer science and related fields.

Nov 8 - Lab 11 - Lab 11 delves into the fascinating world of matrix representation of graphs, primarily focusing on adjacency matrices. In this lab, you explore the fundamental concepts of matrix multiplication, non-commutativity, matrix transposition, and the calculation of walks between vertices in a graph. Here's a breakdown of the key learning objectives and questions addressed in this lab:

This lab equips you with a solid understanding of the adjacency matrix representation for graphs and the tools to analyze various graph properties. From matrix operations to path calculations, you gain essential skills that can be applied to complex graph-related problems in computer science, mathematics, and beyond.

Nov 15 - Lab 12 - Trees in computer science serve as a foundational structure, providing an essential framework for organizing and managing data efficiently. They are integral in facilitating operations like searching, sorting, indexing, and hierarchical representation, serving as the backbone for diverse algorithms and data storage paradigms in computational problem-solving. You will revisit trees in COS285, COS360, and COS485.

Nov 29 - Lab 13 - This lab is designed to deepen your understanding of time complexity by exploring the performance of different algorithms on various input scenarios. We will focus on sorting algorithms and other basic algorithms, analyzing their behavior on nearly sorted and reverse-sorted lists. The lab also uses Python's timeit module to measure the execution time of algorithms. For example, the following code times the summation of a list of the first 1000 positive integers with 100 trials.

Dec 06 - Lab 14 - Regular expressions (regex), a concise and expressive notation for pattern matching, are pivotal in text processing, parsing, and search operations. Regular expressions can be used to validate data; examples include checking

Last modified Sun Nov 25, 2023 08:22:18 AM EST COS 280 Discrete Math II