# 29227 - Foundations of Informatics T

## Learning outcomes

The aim of the course is to give the student a general overview about  computers and scientific computing. After this introductory part, the course is focused on the C++ language and on numerical methods  both at an elementary level.

## Course contents

I. The Linux operating system:

• preliminary notions: shell use; basic commands; filesystem and partitions; operating system installation;

II. Introduction to C++

•  Fundamentals: variable and arithmetic expressions; for loops; if statements; constants: input and output; arrays; functions; passing arguments by reference; external variables and scope.
• Pointers and arrays: pointers and addresses; pointers and function arguments; address arithmetic; pointers and arrays; dynamic memory allocation; pointer arrays; pointers to pointers; multidimensional arrays; command line arguments;function pointers; void pointers.
• Classes: basics of classes; operator overloading; self referential classes.
• Header files and libraries: header files; conditional inclusion; compiling multiple files; the Makefile.
• Toward numerical applications: sources of errors: absolute, relative and percentage errors; numerical cancellation and error propagation;
machine precision and significant digits.

III. Introduction to numerical methods

•  Function approximation: Lagrangian interpolation, Taylor polynomial and series.
• Finite difference methods: approximation of the first, second and n-th derivative with backward and forward finite differences, with first and second order truncation error; approximation of the first, second and n-th derivative with centered finite differences. ODE of the second order.
• Root-finding algorithms: solution of linear system with Gauss method. Non linear equation:   bisection and Newton-Raphson's (tangent) method. The secant method and Regula Falsi method.
• Numerical integration: rectangle rule, trapezoidal rule, Simpson's formula. Gauss quadrature. Local and global truncation error and order of convergence.

Instructor lecture notes and lab tutorial (on AMS campus)

Bellini, Guidi. Linguaggio C. McGraw-Hill
Kelley, Pohl. C-Didattica e programmazione. Pearson
Ceri, Mandrioli, Sbattella. Informatica: arte e mestiere.  McGraw-Hill
Monegato. Fondamenti di calcolo numerico. Levrotto & Bella
Epperson. Introduzione all'analisi numerica. McGraw-Hil

## Teaching methods

Class lectures and laboratory tutorials with Personal Computers.

Tutor assistance

## Assessment methods

Two written examinations.

The grade is distributed as follows:

• 1. Programming written C++ language  test in lab with linux operating system: score 0-16 ( sufficient if test score> 9)
• 2.  Programming written numerical analysis test in  lab with linux operating system: score 0-16 (sufficient if test score> 9)

The total sum of the scores that are sufficient forms the final grade. Laude is given if one exceeds the score of 30.

## Teaching tools

Class lectures and computing laboratory tutorials

## Office hours

See the website of Sandro Manservisi

See the website of Francesco Teodori