B1703 - Introduction to Programming (LM)

Academic Year 2025/2026

  • Docente: Silvio Peroni
  • Credits: 12
  • SSD: INF/01
  • Language: Italian
  • Moduli: Silvio Peroni (Modulo 1) Michele Corazza (Modulo 2)
  • Teaching Mode: Traditional lectures (Modulo 1) Traditional lectures (Modulo 2)
  • Campus: Bologna
  • Corso: Second cycle degree programme (LM) in Data, Methods and Theoretical Models For Linguistics (cod. 6725)

Learning outcomes

At the end of the course, the student has the necessary IT background and an appropriate knowledge of programming languages. He can use the acquired knowledge to autonomously design algorithms and data structures. He knows how to work independently, but also to be part of a work group.

Course contents

The course is organised in two blocks.

The first block (module 1) is organised in a series of lectures. Each lecture introduces a specific topic, includes mentions to some related historical facts and to people (indicated between squared brackets) who have provided interesting insights on the subject. The lectures are accompanied by several laboratory sessions, to be held with a computer, for learning the primary constructs of the programming language that will be used for implementing and running the various algorithms proposed.

The second block (module 2) is organised in a series of practical hands-on sessions. In particular, each hands-on session will be held with a computer and includes laboratory activities based on existing tools that enable the experimentation with the topics introduced in the lectures in the first block.

List of lectures

First block (module 1, February-March)

  • Introduction to Computational Thinking [Chomsky]
    - What is a computer?
    - Comparing natural languages and programming languages
    - Abstraction: the main tool of Computational Thinking
  • Algorithms [Lovelace]
    - What is an algorithm?
    - First machines and programmers
    - How to develop an algorithm: flowcharts
    - Our first algorithm: input, process, decision, output
  • Laboratory: installing Python
  • Programming Languages [Hopper]
    - History of programming languages
    - Python
    - Writing our first algorithm in Python: variables, assignments, and conditional statements
  • Organising information: ordered structures [Knuth]
    - What is a data structure?
    - List
    - Tuple
  • Brute-force algorithms [Holberton]
    - Iterations: for and while constructs
    - Linear search
  • Laboratory: Python basic constructs
  • Organising information: unordered structures [Borges]
    - Can data structures be infinite?
    - Set
    - Dictionary
  • Recursion [Hofstadter]
    - An intuition: the Little Harmonic Labyrinth
    - Recursive approaches in Linguistics and Physics
    - Recursive algorithms
  • Laboratory: using lists and tuples
  • Divide and conquer algorithms [von Neumann and Fibonacci]
    - Ordering billions of books
    - Fibonacci sequence
  • Laboratory: using sets and dictionaries
  • Organising information: trees and graphs [Garcia Marquez and Euler]
    - Genealogy and document markup
    - Tree
    - The city of Königsberg
    - Graph
  • Laboratory: reading and processing CSV and JSON files

Second block (module 2, April-May)

  • Strings: from basic constructs to advanced features
  • Introducing regular expressions
  • Arrays and matrixes with numpy
  • Data manipulation with Pandas
  • Data visualisation

The dates and times of all the lectures above are available in the section "Calendario" of the GitHub repository of the course.

Students with specific learning disorders (SLD) or temporary/permanent disabilities should contact the appropriate University office immediately and agree with the teachers the most effective strategies for attending the lectures and preparing for the exam.

Readings/Bibliography

Lecture notes will be made freely available to students in the GitHub repository of the course before the beginning of the course. Slides and any additional material will be made also available a few days before each lecture in the same repository.

The following suggested readings could be helpful to students as background material, in order to practice basic terminologies of the course:

Teaching methods

Face-to-face classes for 60 hours.

Assessment methods

The exam consists of:

  1. a written examination (duration: one hour and an half) held after the first block of the course, for assessing the overall competences and analytical skills acquired by the students on all the topics of the first block of the course - maximum score: 33 points; minimum score for being sufficient: 18 points.
  2. the implementation of a group project to be submitted after the second block of the course, where students are mandatorily asked to organise themself in groups of 3-4 people; the theme of the project will be decided with the professor or selected by the student from a list of proposals, and it will be discussed during an oral colloquium with the professor - maximum score: 33 points; minimum score for being sufficient: 18 points.

If both the scores for points (1) and (2) are sufficient, the final score of the student is the sum of the scores gained for each of the aforementioned points divided by 2, approximated to the closest higher integer value in case of a decimal number. Any final score greater than 30 will be registered as 30 cum laude. In particular:

  • excellent evaluation (final score greater than 26): reaching an in-depth view of all the course topics, and active involvement in the development of the project following all the theoretical principles and practical guidelines provided to the student during the lectures and the hands-on sessions;
  • sufficient evaluation (final score between 18 and 26): reaching a partial view of the course topics, providing a minor contribution to the development of the project;
  • insufficient evaluation (final score lesser than 18): not reaching an inappropriate view of the course topics, and not providing any contribution to the project.

It is strongly suggested to attend the course in person since it would enable collegial discussions with the professors and the other students. Indeed, these discussions are extremely important since they simplify a lot the study of the course topics and the implementation of the project. However, even if discouraged, it is possible to follow the course as non-attender. The material to study for the final written examination is the same for both attenders and non-attenders. Instead, for non attenders, the topic of the project should be discussed with the professors in advance.

Students with specific learning disorders (SLD) or temporary/permanent disabilities should contact the appropriate University office in advance. The office will be responsible for proposing adaptations to interested students. Such adaptations must be submitted to the teachers for approval at least 15 days before the exam session. The teachers will also evaluate the adaptations regarding the training objectives of teaching.

Teaching tools

Classes are held in a classroom equipped with personal computers connected to the Intranet and Internet.

Theory lessons will always be accompanied by practical parts, which will be reinforced during several hands-on sessions. All the material of the course - including lecture notes and slides - will be made available in the GitHub repository of the course. A group in a free messaging application will be set up so as to allow all the students of the course to communicate directly with each other and with the professors.

Links to further information

https://github.com/intro-prog/2025-2026/

Office hours

See the website of Silvio Peroni

See the website of Michele Corazza

SDGs

Quality education

This teaching activity contributes to the achievement of the Sustainable Development Goals of the UN 2030 Agenda.