Programming and Algorithms I

You are here

Credits
6
Types
Compulsory
Requirements
This subject has not requirements, but it has got previous capacities
Department
CS
This course is the introduction to programming for new students of the AI degree. The course will revolve around the concept of Abstraction, emphasizing the process by which one is able to solve problems using either function-based abstraction or data-based abstraction.

Teachers

Person in charge

  • Jordi Delgado Pin ( )

Others

  • Jose Luis Balcázar Navarro ( )

Weekly hours

Theory
2
Problems
0
Laboratory
2
Guided learning
0.4
Autonomous learning
4

Competences

Transversal Competences

Transversals

  • CT4 [Avaluable] - Teamwork. Be able to work as a member of an interdisciplinary team, either as a member or conducting management tasks, with the aim of contributing to develop projects with pragmatism and a sense of responsibility, taking commitments taking into account available resources.
  • CT6 [Avaluable] - Autonomous Learning. Detect deficiencies in one's own knowledge and overcome them through critical reflection and the choice of the best action to extend this knowledge.

Technical Competences

Especifics

  • CE02 - To master the basic concepts of discrete mathematics, logic, algorithmic and computational complexity, and its application to the automatic processing of information through computer systems . To be able to apply all these for solving problems.
  • CE03 - To identify and apply the basic algorithmic procedures of computer technologies to design solutions to problems by analyzing the suitability and complexity of the proposed algorithms.
  • CE04 - To design and use efficiently the most appropriate data types and structures to solve a problem.
  • CE10 - To analyze, design, build and maintain applications in a robust, secure and efficient way, choosing the most appropriate paradigm and programming languages.
  • CE12 - To master the fundamental principles and models of computing and to know how to apply them in order to interpret, select, assess, model, and create new concepts, theories, uses and technological developments related to artificial intelligence.
  • CE13 - To evaluate the computational complexity of a problem, identify algorithmic strategies that can lead to its resolution and recommend, develop and implement the one that guarantees the best performance in accordance with the established requirements.

Generic Technical Competences

Generic

  • CG2 - To use the fundamental knowledge and solid work methodologies acquired during the studies to adapt to the new technological scenarios of the future.
  • CG4 - Reasoning, analyzing reality and designing algorithms and formulations that model it. To identify problems and construct valid algorithmic or mathematical solutions, eventually new, integrating the necessary multidisciplinary knowledge, evaluating different alternatives with a critical spirit, justifying the decisions taken, interpreting and synthesizing the results in the context of the application domain and establishing methodological generalizations based on specific applications.
  • CG8 - Perform an ethical exercise of the profession in all its facets, applying ethical criteria in the design of systems, algorithms, experiments, use of data, in accordance with the ethical systems recommended by national and international organizations, with special emphasis on security, robustness , privacy, transparency, traceability, prevention of bias (race, gender, religion, territory, etc.) and respect for human rights.

Objectives

  1. Learn the most basic concepts of programming with functions (simple and high-order) and their use as tools to adapt a programming language to the domain of the problem to be solved
    Related competences: CG2, CT6, CE03, CE10, CE12,
  2. Learn the concept of recursion and how to distinguish iterative and recursive processes defined with recursive functions
    Related competences: CG4, CT6, CE03, CE10, CE12,
  3. Initiate the student in the understanding of the concept of software design
    Related competences: CG4, CT6, CE03, CE10,
  4. Being able to deal with the idea of an error in a program and using exceptions to cope with these errors
    Related competences: CG4, CE10,
  5. Learn the concept of container and the situations in which it is relevant to use them. Know the cost of its use (informally)
    Related competences: CG4, CT6, CE02, CE04,
  6. Learn the concept of class and introduce the student to the use of objects and inheritance
    Related competences: CG2, CG4, CT6, CE04, CE10,
  7. Introduce the student to the computation of the complexity of algorithms
    Related competences: CE13,
  8. Involve the student in the design and implementation of a simple problem collaborating with other students
    Related competences: CG2, CG4, CG8, CT4, CE03, CE10,

Contents

  1. Building Abstractions with Functions: Functions (simple and high-order). Environments. Execution flow control.
    The student is introduced to the main problem-solving mechanism, from a bottom-up point of view, of designing functions that bring the programming language closer to the domain of the problem. The mechanisms of function definition, parameter passing, environment and scope, and the main control structures of the execution flow (conditional, iterative) are studied.
  2. Building Abstractions with Functions: Recursion and examples.
    The fact that a function is able to call itself is introduced, and how this leads to recursion as a conceptual mechanism for solving problems, and the idea of process. Recursive functions may define iterative and recursive processes.
  3. Building Abstractions with Functions: Design. Error handling with exceptions.
    The concept of designing a program to solve a problem is introduced. The idea of error in a program and how to deal with them by means of the exception mechanism is introduced.
  4. Building Abstraccions with Functions: Examples of solving problems
    The concepts introduced so far are reinforced with numerous problems of low and medium difficulty.
  5. Building Abstractions with Data: Data Abstraction
    The concept of Data Abstraction is introduced using simple types (pairs, rational numbers), to illustrate the notion of abstraction barrier. The first simple container data structures are introduced.
  6. Building Abstractions with Data: Containers
    We start working with containers provided by the programming language: Sequences, Lists, Dictionaries and others implemented within the course, such as Matrices or Trees.
  7. Building Abstractions with Data: Mutability. Iterators and Generators.
    The concept of mutability is first seen in relation to lists, and the advantages and disadvantages of having immutable data structures are discussed. Iterators and generators are introduced as new control structures.
  8. Building Abstractions with Data:Objects, Classes, Inheritance, Composition
    The first steps are taken towards object orientation through the concept of object and that of class. The concepts of inheritance and composition are also introduced.
  9. Algorithm Complexity
    A short introduction is made to asymptotic notation and to the complexity in the worst case of some notable algorithms seen during the course.

Activities

Activity Evaluation act


Theory
12h
Problems
0h
Laboratory
12h
Guided learning
0h
Autonomous learning
24h

Building Abstractions with Data

The student should pay attention to the lecture and he/she should work through the exercises suggested by the lecturer.
Objectives: 5 6 8
Contents:
Theory
14h
Problems
0h
Laboratory
14h
Guided learning
0h
Autonomous learning
28h

Algorithm Complexity

The student should pay attention to the lecture and he/she should work through the exercises suggested by the lecturer.
Objectives: 7
Contents:
Theory
4h
Problems
0h
Laboratory
4h
Guided learning
0h
Autonomous learning
8h

Midterm Exam


Objectives: 1 2 3 4
Week: 7
Type: theory exam
Theory
2h
Problems
0h
Laboratory
0h
Guided learning
0h
Autonomous learning
4h

Final Exam


Objectives: 5 6 7 8
Week: 17
Type: final exam
Theory
3h
Problems
0h
Laboratory
0h
Guided learning
0h
Autonomous learning
6h

Teaching methodology

Teaching the course is structured in lectures and laboratory sessions.

Teachers will use lectures to introduce the essential contents of the course. In the laboratory sessions the contents of the course will be brought to the computer by carrying out practical problems. The laboratory classes will be a continuation of the lectures, where new concepts will be implemented as they appear in lectures.

Evaluation methodology

Grading the course will consist of two theoretical tests (T1 and T2), one mid-course and the other at the end, and one medium-sized practical work (Practice).

Then, the evaluation method would be:
0.6 * Theory + 0.4*Practice
where:
Theory: 0.5 * T1 + 0.5 * T2

Teamwork:

Evaluated using a simple rubric that each group tutor group uses
to rank different aspects of teamwork of every member of the group.

Bibliography

Basic:

Web links

  • Aquest és el text PRINCIPAL de l'assignatura, la font d'informació primària per a tot allò que expliquem a classe. http://composingprograms.com/
  • Aquest és el curs CS 61A: Structure and Interpretation of Computer Programs, de l'Universitat de Berkeley, en el que aquest curs està basat https://cs61a.org/
  • La principal referència del llenguatge de programació que fem servir: Python. No és un lloc on aprendre a programar, és un lloc on consultar detalls de les construccions i llibreries del llenguatge https://docs.python.org/3/reference/index.html

Previous capacities

Students are expected to have acquired the knowledge and skills defined for the scientific-technical branch of upper secondary school education or equivalent.

Addendum

Contents

Cap modificació respecte a la Guia Docent

Teaching methodology

Cap canvi respecte a la Guia Docent, donat que les condicions ara mateix i el plà de vacunació (juny 2021) fan pensar en un desenvolupament normal/presencial del curs el proper setembre de 2021. En cas de que les circumstàncies així ho requereixin, les classes, tant de teoria com laboratoris, es farien de manera no presencial.

Evaluation methodology

Cap modificació respecte a la Guia Docent. Les avaluacions serien no presencials només en circumstàncies molt extremes. Fins i tot si les classes són no presencials, s'intentaria que l'avaluació fos presencial.

Contingency plan

Cap, donat que les condicions ara mateix i el plà de vacunació (juny 2021) fan pensar en un desenvolupament normal/presencial del curs el proper setembre de 2021. Si no fos possible dur a terme activitats presencials, es farien tant les classses de teoria, com de problemes de forma no presencial amb Meet, així com tots els actes d'avaluació de forma no presencial utilitzant Meet