Computer Programming 1
Grado en Matemáticas Aplicadas / Bachelor in Applied Mathematics BAM
Course Information
Course Code: CP1-AM.1.M.A
Degree: Bachelor in Applied Mathematics (BAM)
Level: First Year
Semester: 1st
Credits: 6.0 ECTS
Category: BASIC
Language: English
Professor
Name: Daniel Precioso Garcelán
Email: dprecioso@faculty.ie.edu
Office: T-5.20
Office Hours: On request (contact via email)
Daniel Precioso is a data scientist, researcher, and teacher with a PhD in machine learning and more than 7 years of experience across academia and industry. He works on predictive models, optimization, and decision support systems, with projects spanning healthcare, logistics, energy, maritime transport, and climate risk.
Course Description
Computer programming is the art and science of writing software programs that instruct computers to perform various tasks. It is a skill that is essential in today’s world and is used in almost every aspect of our lives, from mobile applications to scientific research. In the field of Mathematics, programming is a powerful tool for modeling, simulating, and solving complex problems.
This course is designed as an introduction to programming for students who have never programmed before, with a focus on applications in Mathematics. Students will learn the fundamental concepts and skills necessary to develop software programs in the Python programming language. They will also learn to develop efficient and scalable programs by employing best practices in programming.
Throughout this course, students will be provided with hands-on programming exercises that apply programming concepts to real-world problems in Mathematics and other related subjects. They will learn to design and implement algorithms to solve problems and to write efficient and readable code using common software engineering practices.
The course covers a comprehensive introduction to the basic concepts of programming, including variables, data types, and control structures (if/else statements, loops). Additionally, students will learn fundamental algorithms and data structures, such as arrays, lists, tuples, and dictionaries, and modular programming and functions, including parameter passing. The subject also emphasizes debugging techniques to help students identify and solve software bugs.
Learning Objectives
By the end of the course, students should be able to:
- Write simple programs using the Python programming language to solve mathematical problems
- Understand the basic concepts of programming such as variables, data types, control structures, and functions
- Develop algorithms and implement data structures such as arrays, lists, tuples, and dictionaries to solve complex problems
- Apply best practices in programming to write efficient, scalable, and maintainable code
- Debug programs using common techniques to identify and fix errors in code
- Analyze real-world problems and design programs to automate tasks and perform computations
- Gain exposure to other programming tools used in software development
- Familiarize with core GenAI tools, access methods, and effective utilization, including API and open-source options
Generic Skills
Additionally, the course will focus on the acquisition or reinforcement of generic skills:
- The ability to summarize and present information in a clear and concise manner
- The ability to identify patterns and abstract models to solve real-world problems
- The ability to work collaboratively in teams to develop software applications
- The ability to adapt to new technologies as they emerge
Requirements
- Laptop: Mandatory to all sessions for coding in Python
- Google Account: Mandatory for Google Drive and Collab notebooks (used regularly during sessions)
- VSCode: Will be installed as part of the course (installation covered in Module 4)
- Python IDE Configuration: Must use English as the working language to facilitate student and faculty collaboration
- Libraries: Some activities require installation of secure open-source libraries for Python
Course Structure
The course is organized into four comprehensive modules across 31 sessions:
Module 1: FUNDAMENTALS (Sessions 1-5, plus review)
Core concepts of Python programming: - Variables and data types (numeric and string) - Operations with numeric and string variables - Flow control (if/else statements) - Logical operators (and, or, not) - Looping (for and while loops, break, continue) - Basic built-in functions - User-defined functions with parameters and return values - Keyword arguments and default values - Generator functions and yield - Docstrings and type hints - Python scope (global and local namespaces)
Module 2: BASIC DATA STRUCTURES (Sessions 6-9, plus review)
Python’s built-in data structures: - Lists and tuples (iterables, indexing, initialization) - List comprehension - Sets (mathematical operations: union, intersection, subtraction) - Dictionaries (key-value pairs, accessing, adding, removing elements) - Converting between data structures - Effects of mutability on functions
Module 3: VECTOR PROGRAMMING (Sessions 10-22)
Numerical computing with NumPy: - Introduction to NumPy and array creation - Array indexing and slicing - Arithmetic operations on arrays - Broadcasting - NumPy built-in methods and functions - Reshaping and resizing arrays - Joining and splitting arrays - Loading and saving arrays to file - Advanced indexing concepts - Generating random numbers - Descriptive statistics (mean, median, standard deviation) - Correlation and covariance - Hypothesis testing - Simulating statistical distributions - Random walks and Monte Carlo simulations - Matrix multiplication and dot products - Solving linear systems of equations - Eigenvectors and eigenvalues - Vectorization and efficient NumPy code
Module 4: THE PYTHON ECOSYSTEM (Sessions 23-26)
Professional development environment: - Introduction to Python IDEs (PyCharm, Spyder, VSCode) - Downloading and installing VSCode - Using Jupyter notebooks in VSCode - Writing and running Python scripts - Code reusability and importing functions - Reading and storing files (text, json, data structures) - Understanding libraries (standard library example: random) - Python environments and package management - Installing libraries with Pip and Conda
Bibliography
- Bill Lubanovic. (2019). Introducing Python: Modern Computing in Simple Packages. 5th ed. O’Reilly Media. ISBN 9781492051343
- Svein Linge, Hans Petter Langtangen. (2019). A gentle introduction to numerical simulations with Python 3.6. 2nd Edition. Springer. ISBN 9783030168766
- Eric Matthes. (2023). Python Crash Course: A Hands-On, Project-Based Introduction to Programming. 3rd ed. No Starch Press. ISBN 9781718502703
- Travis E. Oliphant. (2015). Guide to NumPy. 2nd Edition. ISBN 9781517300074