Blog of Andrés Aravena

Intro to Computer Science: Keywords for Midterm Exam

30 October 2017

This course is an introduction to scientific computing using the Unix command line. The midterm exam will measure the learning of the first part of the course, mostly definitions. In this post you can see all the concepts that have been defined in the course. They are written as questions, so the students can evaluate their own learning and have a guide on how to improve.

The midterm exam will be held in the Computer Lab. You should have your student account enabled so you can log into the computers. Your answers should be in a text file that you will email to me during the exam. Please verify that you can send emails from the computer lab.

The course has one hour of theory and two hours of practice every week. We teach new concepts in both sessions. Here you find the summary of both parts.

Theory

Practical

Regular expressions

  • Please write the regular expressions that will match the following lines of text:

    • lines starting with a upper case letter
    • lines containing a Name and Surname: an upper-case letter followed by one or more lower case letters, followed by a “space”, followed by an upper-case letter followed by one or more lower case letters
    • lines containing only “space”
    • empty lines
    • lines containing a date in the format 2017-12-27
  • Please describe the set of texts that will match each of the following regular expressions

    • abcd
    • [abcd]
    • [ab][cd]
    • [a-c][^d]
    • ^[ab][cd]
    • ^ab[cd]$
    • ^a[bc][^d]*$
    • ab*c*d
    • ab?c?d
    • a..d
  • Please draw the finite state machine (a.k.a. deterministic finite automaton) equivalent to the previous regular expressions

  • Please write the transition matrix for the previous finite state machines

Other resources