magistraleinformatica:mod:start:pretest
Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
Entrambe le parti precedenti la revisioneRevisione precedenteProssima revisione | Revisione precedente | ||
magistraleinformatica:mod:start:pretest [20/07/2015 alle 16:44 (10 anni fa)] – Roberto Bruni | magistraleinformatica:mod:start:pretest [01/03/2016 alle 23:11 (9 anni fa)] (versione attuale) – Roberto Bruni | ||
---|---|---|---|
Linea 1: | Linea 1: | ||
==== Preliminary test for the course on Models of Computation ==== | ==== Preliminary test for the course on Models of Computation ==== | ||
- | There are no prerequisistes | + | There are no prerequisites |
- | We encourage the students to use the following exercises to self-assess their level of knowledge for the above arguments. | + | We encourage the students to use the following |
=== Exercise 1 === | === Exercise 1 === | ||
Linea 11: | Linea 11: | ||
=== Exercise 2 === | === Exercise 2 === | ||
- | Are the formulas "(forall | + | Are the formulas "(∀x. P(x)) ⇒ Q" and "∀x. (P(x) ⇒ Q)" equivalent? |
=== Exercise 3 === | === Exercise 3 === | ||
- | Prove that for any natural number n we have that n*n + n is even. | + | Let 7< |
=== Exercise 4 === | === Exercise 4 === | ||
- | Consider the strings (i.e., finite sequences) of symbols {0,1}. Let #0(s) and #1(s) denote the number of occurrences of 0 and 1 in the string s, respectively, | + | Consider the strings (i.e., finite sequences) of symbols {0,1}. Let #<sub>0</ |
- | - the set of all and only strings s such that #1(s) is odd. | + | - The set of all and only strings s such that #<sub>1</ |
- | - the set of all and only strings s such that #0(s) = #1(s). | + | - The set of all and only strings s such that #<sub>0</ |
- | - the set of all and only strings s such that s = (01)^n for some natural number n. | + | - The set of all and only strings s such that s = (01)<sup>n</ |
- | - the set of all and only strings s such that s = 0^n 1^n for some natural number n. | + | - The set of all and only strings s such that s = 0<sup>n</ |
=== Exercise 5 === | === Exercise 5 === | ||
- | Let us consider the program | + | Let us consider the imperative code fragment |
- | while (x!=0 and y!=0) do { x:=x-1 ; y:=y-1 } | + | < |
+ | | ||
+ | | ||
+ | }</ | ||
+ | where x and y are two integer variables. | ||
For which initial values of x and y does the execution of the above program terminate? | For which initial values of x and y does the execution of the above program terminate? | ||
magistraleinformatica/mod/start/pretest.1437410651.txt.gz · Ultima modifica: 20/07/2015 alle 16:44 (10 anni fa) da Roberto Bruni