Week 02 - September 23¶
Class Description¶
This week we explore data structures and iteration patterns in programming, along with the mathematical foundations of set theory. We'll learn about strings, lists, and loops in Python while also diving into fundamental set operations and mathematical proof techniques.
Before Class¶
Flipped Classroom Reminder¶
Remember: Watch the videos before class so we can spend our time together on active learning and problem-solving!
Videos to Watch Before Class¶
Please watch the following videos before our class meeting:
CS 5001 - Week 2: Strings, Lists, and For Loops¶
- Introduction [Text]
- Lesson 4.1: String Review & Notation [10:56]
- Lesson 4.2: Immutable Objects [4:57]
- Lesson 4.3: String as an Object [6:21]
- Lesson 4.4: How to Read Method Documentation [10:33]
- Lesson 4.5: General Sequences [5:27]
- Lesson 4.6: Mutable Objects [Text]
- Lesson 4.7: List of Lists [8:18]
- Lesson 4.8: Count-Controlled Loops [10:17]
- Lesson 4.9: Iterating over a List [9:39]
- Lesson 4.10: Range over a List [7:17]
CS 5002 - Module 3: Collection Representation¶
- Introduction [Text]
- Lesson 1: Set Representation
- Lesson 2: Common Sets and Set Builder Notation
- Lesson 3: Subsets
- Lesson 4: Power Sets
- Lesson 5: Set Operations
Practice Math Problems¶
Before class, you are encouraged to work on the practice problems in your notebook (the practice problems are posted on Slack).
Class Materials¶
📋 Handouts¶
- Strings, Sequences & Sets Handout - Comprehensive reference covering Python strings, lists, and mathematical set theory
💻 Code Examples¶
Interactive Python examples to explore during and after class:
String Operations¶
- String Indexing - Working with string indices and slicing
- String Immutability - Understanding why strings can't be changed
- Strings to Sets - Converting strings to character sets
List Operations¶
- List Mutability vs Sets - Comparing mutable lists with immutable sets
- Lists vs Sets - Performance and behavior differences
Set Theory & Operations¶
- Python Sets Basic Operations - Union, intersection, difference
- Set Operations - Mathematical set operations in Python
- Set Builder Notation - Translating mathematical notation to code
- Set Equality & Order - Understanding set properties
- Subset Relationships - Working with subsets and supersets
- Standard Sets in Python - Common mathematical sets
- Complex Set Operations - Advanced set manipulations
Power Sets¶
- Basic Power Sets - Understanding power set concepts
- Binary Power Sets - Generating power sets with binary representation
Real-World Applications¶
- Data Processing - Using sets for data cleaning and analysis
- Database Operations - Set operations in database contexts
- Text Analysis - Analyzing text using string and set operations
- NLP Analysis - Natural language processing with sets
💡 Tip: Click on any example above to view the code directly in your browser, then copy and run it in your Python environment!