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:
Demonstrate Programming Proficiency: You will showcase your mastery of programming constructs, especially 'if' and 'for' statements, which are fundamental to coding.
Utilize Functions for Boolean and Integer Values: You will work with functions that return both boolean and integer values, honing your ability to use functions effectively in your code.
Solve Discrete Mathematics Problems: This lab presents coding exercises that draw from discrete mathematics, allowing you to apply your programming skills to solve mathematical problems.
Recall Key Concepts: Throughout the lab, you'll revisit important concepts like factorial and binomial coefficients, which you encountered in Discrete Mathematics I. This reinforcement enhances your understanding and retention of these foundational mathematical ideas.
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:
Sequence Generation: You will learn how to generate terms of a sequence, an essential skill for exploring patterns and relationships within mathematical structures.
Summation Formula Verification: This lab will guide you in verifying summation formulas, allowing you to confidently assess and confirm mathematical expressions.
Evidence for Statement Truth: You will engage in exercises that require compelling evidence of the validity of specific mathematical statements, bolstering your ability to analyze and prove mathematical assertions.
Conjecture and Hypothesis: You will be encouraged to formulate conjectures and hypotheses based on your observations, fostering your analytical and problem-solving abilities.
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:
Building Sets: You will learn how to create sets, a fundamental data structure in mathematics and computer science. This knowledge is valuable for various applications, including data analysis and manipulation.
Subset Verification: You will become skilled at determining whether one set is a subset of another, a crucial concept for set theory and understanding relationships between data sets.
Set Partition: This lab will guide you in creating partitions of a set, which is a fundamental concept in set theory and combinatorics. Understanding set partitions is valuable for solving problems related to combinations and permutations.
Working with Subsets: You will learn how to effectively work with subsets, a valuable skill in data analysis and mathematical problem-solving. In summary, Lab 8 is designed to equip you with the knowledge and skills to work with sets and their operations, offering a practical foundation for various mathematical and computational applications.
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:
Matrix Multiplication Function: You begin by implementing a matrix multiplication function. This function is designed to handle non-square matrices, showcasing its versatility in handling various matrix operations.
Non-commutative Matrix Multiplication: You provide an example illustrating matrix multiplication's non-commutative property and explain its reasons. This is an essential concept in linear algebra and graph theory.
Matrix Transposition: The lab introduces a function to transpose a matrix. Matrix transposition is a crucial operation for various mathematical and computational tasks. Transposing the Matrix: You apply the matrix transposition function to the result of matrix multiplication, further reinforcing your understanding of matrix operations.
Calculating Walks in Graphs: You write a function to calculate the number of walks of a given length between two vertices in a graph. This skill is invaluable for analyzing graph structures and patterns.
Finding Walks of Length 3: Using the adjacency matrix from a previous question, you determine the number of walks of length three from one vertex to another. This exercise showcases the practical application of adjacency matrices in graph theory.
Walks of Length 2: You calculate the number of walks of length two from one vertex to another, emphasizing the importance of adjacency matrices in measuring connectivity within graphs. Checking for Walks of Length k: A function is introduced to verify the existence of a walk of a specified length between two vertices. This function can be used to explore different path lengths within graphs.
Checking a Walk of Length 4: Using the adjacency matrix from a previous question, you investigate whether a walk of length 4 exists from one vertex to itself. This illustrates the utility of adjacency matrices in detecting specific graph patterns.
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