Computer Programming 1
Computer Programming 1
Daniel Precioso
Daniel Precioso received his degree in Physics from the Universidad Complutense de Madrid,
Spain, and his Master's degree in Statistical and Computational Information Processing from the
Universidad Politécnica de Madrid, Spain. He moved to Cádiz to get his PhD in Machine Learning
and Data Science from Universidad de Cádiz publishing in reputed journals in the field and
spending time abroad visiting renowned universities in Canada. During his Phd years he also
participated in some international Data Science competitions, in collaboration with other
researchers. His recent research efforts focus mainly on applying Data Science to the Blue
Economy, mainly via the optimization of maritime shipping routes.
Education:
- Ph.D in Machine Learning and Data Science, Universidad de Cádiz.
- MSc in Statistical and Computational Information Processing, Universidad de Politécnica de
Madrid.
- Bs in Physics, Universidad Complutense de Madrid.
dprecioso@faculty.ie.edu
SUBJECT 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.
1
Edited by Documentation
13th July 2023
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, including the Python programming language, control
structures, data types, and algorithms. 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.
By the end of the course, students will have a strong foundation in
programming and software development, with a focus on its applications in
Mathematics. They will be able to write programs that can automate tasks,
process data, and perform complex computations. They will also have a
fundamental understanding of programming languages and the tools and
techniques used to develop software applications, which will be invaluable in
their future studies and careers in Mathematics, Data Science, and beyond.
LEARNING OBJECTIVES
The main objective of this course is to provide students with a strong foundation in computer
programming that can be applied to solve problems in various fields, including Mathematics,
Statistics, Engineering, and Science.
At 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.
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.
2
13th July 2023
TEACHING METHODOLOGY
All sessions for this course will be live-in sessions taken at the IE Segovia's campus. There will be
thirty 90 minutes classes distributed in the following way:
- 28 Teaching sessions
- 3 Exam review sessions
- 1 Midterm exam
- 1 Final exam
Each lecture will be based on a combination of theoretical explanations and several practical
exercises. Each computing concept will be followed immediately by one or more examples related
to the fields of interest of the students. Emphasis will be placed on applying the computing
knowledge gained from this course to tackle problems related to other subjects within the same
Bachelor degree. Student participation is considered very important to acquire the skills needed to
solve exercises. Problem sets and brief quizzes will be used along the course.
Problem sets are in-depth problems that will be uploaded to campus online. I strongly recommend
that you do the exercises given as homework during the course and not leave them for a date close
to the exam. Though you are strongly encouraged to work with others on understanding the lecture
material and attempting the regular assignments, the intention is that you work alone on the
Problem Sets, which are designed to give you feedback on how you are progressing.
Brief quizzes will be given throughout the semester. These quizzes are announced and will cover
previously taught material. These quizzes are meant to test your overall understanding of the
material and will help the professor assess the overall performance and evolution of the class.
Bringing your laptop is mandatory to all sessions, as it will be used to code in Python. A Google
account and access to Google Drive is also mandatory, to run the Collab notebooks that will be
used regularly during sessions. In addition, VSCode will need to be installed in the student's
laptops, however the installation will be covered as part of the course. Configuration of Python IDEs
in the student's laptops needs to be done selecting English as the working language to facilitate the
collaboration of students and faculty. Some activities will require the installation of secure open-
source libraries for Python into the student's laptops.
IE University teaching method is defined by its collaborative, active, and applied nature. Students
actively participate in the whole process to build their knowledge and sharpen their skills.
Professor’s main role is to lead and guide students to achieve the learning objectives of the course.
This is done by engaging in a diverse range of teaching techniques and different types of learning
activities such as the following:
3
13th July 2023
Disclaimer: The following description of the material covered is tentative. An attempt will be made
to cover all listed topics and to include other advanced topics that will help the student throughout
his/her career in mathematics. However, the pace of the classes will depend on group performance,
which may introduce some variations in the syllabus.
This course will serve as an introduction to computer programming on Python. In this context, the
course is divided into five modules, each module consisting of 3 to 6 live in-person sessions,
combining concepts and practice. The rest of the sessions are dedicated to two exams and three
exam review sessions.
- Module 1: FUNDAMENTALS
- Module 2: FUNCTIONS
- Module 3: BASIC DATA STRUCTURES
- Module 4: PYTHON ECOSYSTEM
- Module 5: VECTOR PROGRAMMING
When needed, extra materials will be published in the Campus Documentation Section to cover
specific topics.
PROGRAM
4
13th July 2023
Topics treated:
- Flow control: the if/else statement.
- Logical operators: and, or, not.
- Debugging in Python.
Pre and post-work:
- Work on selected exercises.
5
13th July 2023
SESSION 8 (LIVE IN-PERSON)
Module 2 / 5: Functions
Topics treated:
- Generator functions: the yield statement.
- Examples and applications of the concepts covered thus far, with a focus on their potential
applications to other subjects in Applied Mathematics.
6
13th July 2023
Module 3 / 5: Basic data structures
Topics treated:
- Dictionaries in Python. What are the key-value pairs?
- Working with dictionaries: how to update them and pop keys.
- How to create dictionaries from lists, tuples and sets.
7
13th July 2023
- Code reusability: how to import functions from other scripts.
8
13th July 2023
SESSION 22 (LIVE IN-PERSON)
Module 5 / 5: Vector programming
Topics treated:
- Reshaping and resizing arrays.
- Joining and splitting arrays.
- Changing array shapers and dimensions.
Pre and Post-work:
- Work on selected exercises.
9
13th July 2023
Pre and Post-work:
- Work on selected exercises.
EVALUATION CRITERIA
CLASS PARTICIPATION
Class participation will be worth 10% of the overall grade. This entails being present in class and on
time. Students are expected to participate actively during lectures with questions and remarks.
There may be a penalty if you create a disruption or talk excessively during class.
HOMEWORK
Each module has its own problem set including several exercises. The student is expected to work
on them and to turn in selected exercises that will be announced throughout the curse. Most
exercises are individual work but some might involve group work. Each problem set will be graded
after the deadline and your overall "Homework" grade is worth 30% of the final grade. The
“Homework” grade will be the arithmetic mean of all the problem sets' marks.
QUIZZES + MIDTERM EXAM
It is worth 30% of the final grade. We will have several small quizzes scattered throughout the
course. They will be based on exercises similar to the ones we will see in class.
FINAL-EXAM
It is worth 30% of the overall grade. You need to score at least 3.5 on the final exam to pass the
overall course, even if you have already passed the course through the other course assessments.
Information about the detailed characteristics of the final-exam will be given at the beginning of the
semester.
10
13th July 2023
criteria percentage Learning Comments
Objectives
Final Exam 30 %
Quizzes + Mid- 30 %
term exam
Individual Work 30 %
Class Participation 10 %
BIBLIOGRAPHY
Recommended
11
13th July 2023
- Bill Lubanovic. Introducing Python. ISBN 9781492051343 (Digital)
- Svein Linge, Hans Petter Langtangen. Programming for computations - Python: a
gentle introduction to numerical simulations with Python 3.. ISBN 9783319324
(Digital)
- Eric Matthes. Python Crash Course. ISBN 9781593277390 (Digital)
- Travis E. Oliphant. Guide to NumPy. ISBN 9781517300074 (Digital)
WHEN QUESTIONS ARISE OUT OF CLASS
Email: If you have a question(s) that was not answered in class, you are welcome to ask your
question(s) via email. I can be reached at: dprecioso@faculty.ie.edu
Although I will make every effort to respond to your question(s) as quickly and thoroughly as
possible, please recognize that I may not be available when you send an email. Thus, please allow
me up to 48 hours to respond before sending a follow-up email.
BEHAVIOR RULES
Please, check the University's Code of Conduct here. The Program Director may
provide further indications.
ATTENDANCE POLICY
Please, check the University's Attendance Policy here. The Program Director may
provide further indications.
ETHICAL POLICY
Please, check the University's Ethics Code here. The Program Director may
provide further indications.
12
13th July 2023