SubjectsSubjects(version: 953)
Course, academic year 2023/2024
   Login via CAS
Programming 1 - NMIN111
Title: Programování 1
Guaranteed by: Department of Software and Computer Science Education (32-KSVI)
Faculty: Faculty of Mathematics and Physics
Actual: from 2022
Semester: winter
E-Credits: 3
Hours per week, examination: winter s.:0/2, C [HT]
Capacity: unlimited
Min. number of students: unlimited
4EU+: no
Virtual mobility / capacity: no
State of the course: taught
Language: Czech
Teaching methods: full-time
Teaching methods: full-time
Additional information:
Guarantor: doc. RNDr. Pavel Töpfer, CSc.
Class: M Bc. FM
M Bc. FM > Povinné
M Bc. FM > 1. ročník
M Bc. MMIB > Povinné
M Bc. MMIB > 1. ročník
M Bc. MMIT > Povinné
M Bc. OM
M Bc. OM > Povinné
M Bc. OM > 1. ročník
Classification: Informatics > Programming
Incompatibility : NMTD103, NPRG030
Interchangeability : NPRG030
Is co-requisite for: NMIN112
Is incompatible with: NPRG030, NMTD103
Is interchangeable with: NMIN101, NMTD103
Annotation -
A basic course of programming for first-year students of mathematics. The course covers programming in Python, basic algorithms and data structures and practical program design and debugging.
Last update: Töpfer Pavel, doc. RNDr., CSc. (25.09.2019)
Course completion requirements -

Students will receive a credit for this course by active participation in the practice sessions in the computer lab. Generally this means that students must complete the assigned programming exercises, either during the lab session or later on at home.

Due to the nature of this requirement, a failed attempt cannot be repeated as is possible for exams. The instructor may establish conditions whereby a student can make up for missing homework assignments.

Last update: Töpfer Pavel, doc. RNDr., CSc. (30.08.2019)
Literature -

John V. Guttag, Introduction to Computation and Programming Using Python: With Application to Understanding Data, 2nd ed.,, MIT Press, Cambridge, MA 2016

Allen B. Downey, Think Python: How to Think Like a Computer Scientist, 2nd ed., O'Reilly Media, Sebastopol, CA 2015

Last update: Töpfer Pavel, doc. RNDr., CSc. (29.10.2019)
Syllabus -
Python programming language
  • Python as a calculator
  • integers
  • float numbers and accuracy problems
  • operators and their priorities
  • assignment
  • conditions and cycles (while)
  • program structure: comments, indentation
  • basic input() and print()
  • program debugging, using the development environment (IDLE/PyCharm)
  • for loop, range()
  • break, continue
  • lists used as fields
  • the list assignment assigns only the link
  • function definition and function call
  • optional parameters
  • abstraction and modularity of programs
  • local identifiers and their visibility
  • recursion principle
  • functions passing to other functions
  • lists and their operations
  • queue and stack
  • iterating over a list
  • cuts
  • list comprehension
  • strings
  • use of libraries, import
  • graphs drawing using matplotlib
  • details of type system
  • tuples
  • dictionaries and operations with them
  • exceptions and their catching
  • classes and objects
  • description of reality using objects
  • type derivation, inheritance
  • working with files
  • standard library

Basic algorithms

  • time complexity
  • decomposition of numbers into digits
  • Euclidean algorithm
  • prime numbers calculated by dividing till the square root
  • factorization
  • evaluation of polynomials (Horner's scheme)
  • the k’th smallest element computed in time k*n
  • Eratosthenes sieve
  • matrix multiplication
  • Gauss elimination
  • elementary sorting algorithms
  • binary search
  • finding the roots of functions: halving the interval, linear interpolation
  • merging sorted sequences
Last update: Töpfer Pavel, doc. RNDr., CSc. (10.07.2022)
Charles University | Information system of Charles University |