SlideShare une entreprise Scribd logo
1  sur  78
Télécharger pour lire hors ligne
Overview



           www.tudorgirba.com
computation



information                 information
              computer
Computer science is the systematic study of
information and computation.
Boolean algebra                Predicate logic
        1, 0, ∧, ∨, ¬                     ∃, ∀



            Sets                       Relations
     U, ∅, ∈, ∪, ∩, , ⊆                AxB, aRb



            Trees                       Graphs
  node, edge, path, binary       node, edge, cycle, path



         Complexity               Program verification
      O(g), Ω(g), θ(g)             {P} S {Q}, wp(S,Q)



   Models and languages          Programming languages
model, meta, syntax, semantics   programming = modeling
Boolean algebra                Predicate logic
        1, 0, ∧, ∨, ¬                     ∃, ∀



            Sets                       Relations
     U, ∅, ∈, ∪, ∩, , ⊆                AxB, aRb



            Trees                       Graphs
  node, edge, path, binary       node, edge, cycle, path



         Complexity               Program verification
      O(g), Ω(g), θ(g)             {P} S {Q}, wp(S,Q)



   Models and languages          Programming languages
model, meta, syntax, semantics   programming = modeling
+           +

    a = 0       a = 1


    y = 0       y = 1
Conjunction (AND)   Disjunction (OR)   Negation (NOT)
 a ∧ b    =   y     a ∨ b     =   y     ¬ a =      y
0     0       0     0     0       0        0       1
0     1       0     0     1       1        1       0
1     0       0     1     0       1
1     1       1     1     1       1
Neutral elements   Commutativity
a ∧ 1 = a          a ∨ b = b ∨ a
a ∨ 0 = a          a ∧ b = b ∧ a

Zero elements      Associativity
a ∧ 0 = 0          a ∧ (b ∧ c) = (a ∧ b) ∧ c
a ∨ 1 = 1          a ∨ (b ∨ c) = (a ∨ b) ∨ c


Idempotence        Distributivity
a ∧ a = a          a ∧ (b ∨ c) = (a ∧ b) ∨ (a ∧ c)
a ∨ a = a          a ∨ (b ∧ c) = (a ∨ b) ∧ (a ∨ c)


Negation           DeMorgan’s
a ∧ ¬ a = 0        ¬ (a ∧ b) = (¬ a) ∨ (¬ b)
a ∨ ¬ a = 1        ¬ (a ∨ b) = (¬ a) ∧ (¬ b)
Boolean algebra                               Propositional logic
0, 1                                          True, False

boolean variables: a∈{0, 1}                   atomic formulas: p∈{True,False}

boolean operators: ¬ ∧ ∨                      logical connectives: ¬ ∧ ∨

boolean functions:                            propositional formulas (propositions):

   0, 1                                          True and False

   boolean variables                             atomic formulas

   if a is a boolean function, then ¬a is a      if a is a propositional formula, then ¬a
   boolean function                              is a propositional formula

   if a and b are boolean functions, then        if a and b are propositional formulas,
   a∧b, a∨b, a b, a b are boolean                then a∧b, a∨b, a b, a b are
   functions                                     propositional formulas

truth value of a boolean function (truth      truth value of a propositional formula (truth
tables)                                       tables)
Boolean algebra                               Propositional logic
0, 1                                          True, False

boolean variables: a∈{0, 1}                   atomic formulas: p∈{True,False}

boolean operators: ¬ ∧ ∨                      logical connectives: ¬ ∧ ∨

boolean functions:                            propositional formulas (propositions):

   0, 1                                          True and False

   boolean variables                             atomic formulas

   if a is a boolean function, then ¬a is a      if a is a propositional formula, then ¬a
   boolean function                              is a propositional formula

   if a and b are boolean functions, then        if a and b are propositional formulas,
   a∧b, a∨b, a b, a b are boolean                then a∧b, a∨b, a b, a b are
   functions                                     propositional formulas

truth value of a boolean function (truth      truth value of a propositional formula (truth
tables)                                       tables)
Boolean algebra                Predicate logic
        1, 0, ∧, ∨, ¬                     ∃, ∀



            Sets                       Relations
     U, ∅, ∈, ∪, ∩, , ⊆                AxB, aRb



            Trees                       Graphs
  node, edge, path, binary       node, edge, cycle, path



         Complexity               Program verification
      O(g), Ω(g), θ(g)             {P} S {Q}, wp(S,Q)



   Models and languages          Programming languages
model, meta, syntax, semantics   programming = modeling
Universal quantifier ∀ :      Existential quantifiers ∃ :

∀x: U(x): F(x)               ∃x: U(x): F(x)




∀x:x∈N:x>5                   ∃x:x∈N:x>5
for all natural numbers x,   for some natural numbers x,
x is greater than 5          x is greater than 5
∀ i: 0≤i<N: ai=0                               ∃ i: 0≤i<N: ai ≠ 0
all elements ai of array a (of length N) are   at least one element of array a (of length N) is
zero                                           not zero


∀ i: 1≤i<N: ai-1 ≤ ai                          ∃ i: 1≤i<N: ai-1 > ai
elements of array a are monotonically          elements of array a are not monotonically
increasing                                     increasing


∀ i,j: 0≤i<j<N: ai ≤ aj                        ∃ i,j: 0≤i<j<N: ai > aj
elements of array a are monotonically          elements of array a are not monotonically
increasing                                     increasing


∀ i,j: 0≤i,j<N: ai = aj                        ∃ i,j: 0≤i<j<N: ai ≠ aj
all elements of array a are equal              not all elements of array a are equal


∀ i: 0<i<N: ai ≤ a0                            ∃ i: 0<i<N: ai > a0
a0 is the greatest element of array a          a0 is not the greatest element of array a

                                                                              s
                                                                     E xample
De Morgan’s Axiom ¬∃ :
¬(∃ x: U(x): F(x))       ∀ x: U(x): ¬ F(x)


De Morgan’s Axiom ¬∀ :
¬(∀ x: U(x): F(x))       ∃ x: U(x): ¬ F(x)
ambiguous

      All elements of an array a of length N are either zero or one

(1)   ∀i: 0≤i<N: ( ai=0 ∨ ai=1 )


(2)   (∀i: 0≤i<N: ai=0) ∨ (∀i: 0≤i<N: ai=1)




                                                     Example
Boolean algebra                Predicate logic
        1, 0, ∧, ∨, ¬                     ∃, ∀



            Sets                       Relations
     U, ∅, ∈, ∪, ∩, , ⊆                AxB, aRb



            Trees                       Graphs
  node, edge, path, binary       node, edge, cycle, path



         Complexity               Program verification
      O(g), Ω(g), θ(g)             {P} S {Q}, wp(S,Q)



   Models and languages          Programming languages
model, meta, syntax, semantics   programming = modeling
Neutral elements   Commutativity
A ∩ U = A          A ∪ B = B ∪ A
A ∪ ∅ = A          A ∩ B = B ∩ A

Zero elements      Associativity
A ∩ ∅ = ∅          A ∩ (B ∩ C) = (A ∩ B) ∩ C
A ∪ U = U          A ∪ (B ∪ C) = (A ∪ B) ∪ C


Idempotence        Distributivity
A ∩ A = A          A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
A ∪ A = A          A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)


Complement         DeMorgan’s
A ∩ A’ = ∅         (A ∩ B)’ = (A’) ∪ (B’)
A ∪ A’ = U         (A ∪ B)’ = (A’) ∩ (B’)
Reflexivity
A ⊆ A.



Anti-symmetry
A ⊆ B ∧ B ⊆ A   A = B.



Transitivity
A ⊆ B ∧ B ⊆ C   A ⊆ C
Boolean algebra                Predicate logic
        1, 0, ∧, ∨, ¬                     ∃, ∀



            Sets                       Relations
     U, ∅, ∈, ∪, ∩, , ⊆                AxB, aRb



            Trees                       Graphs
  node, edge, path, binary       node, edge, cycle, path



         Complexity               Program verification
      O(g), Ω(g), θ(g)             {P} S {Q}, wp(S,Q)



   Models and languages          Programming languages
model, meta, syntax, semantics   programming = modeling
Cartesian product AxB



AxB={ (a,b) | a∈A and b∈B }



A × ∅ = ∅.
A × (B ∪ C) = (A × B) ∪ (A × C).
(A ∪ B) × C = (A × C) ∪ (B × C).
N-ary Relation

A1, A2, ..., An
R ⊆ A1 x A2 x...x An




Binary Relation

A 1, A 2
R ⊆ A1 x A2

(a,b) ∈ R
aRb
Reflexive relation
                      every element x of A is in relation R with itself
                      ∀x: x∈A: xRx
Equivalent relation




                      Symmetric relation
                      if there is a relation between x and y, then there is a relation between y and x
                      ∀x,y: x,y∈A: xRy                        yRx


                      Transitive relation
                      ...
                      ∀x,y,z: x,y,z∈A: (xRy ∧ yRz)                                  xRz
Irreflexive relation
no element x of A is in relation R with itself
∀x: x∈A: ¬(xRx)

Antisymmetric relation
if there is a relation between x and y and one between y and x, then x equals y
∀x,y: x,y∈A: (xRy ∧ yRx)                             x=y

Asymmetric relation
xRy and yRx cannot hold at the same time
∀x,y: x,y∈A: xRy                        ¬(yRx)

Non-symmetric relation
a relation that is not symmetric
∀x,y: x,y∈A: (xRy) ∧ ¬(yRx)

Total relation
R is defined on the entire A.
∀x,y: x,y∈A: xRy ∨ yRx
Acyclic relation
there are no elements with transitive closure to themselves
∀n: n∈N:
( ¬(∃x1, x2, ...,xn:
    x1, x2, ...,xn∈A:
    x1Rx2 ∧ x2Rx3 ∧ ... ∧ xn-1Rxn ∧ xnRx1 ) )
R ⊆ AxA
{(a,b), (b,c), (c,d)}      a        b         c        d




Transitive closure
R1 = R;
∀i:i>1:Ri = Ri-1 ∪ {(a,b) | ∃c:: (a,c)∈Ri-1 ∧ (c,b)∈Ri-1}.
Rt = ∪i≥1Ri = R1 ∪ R2 ∪ R3 ∪ ...
Boolean algebra                Predicate logic
        1, 0, ∧, ∨, ¬                     ∃, ∀



            Sets                       Relations
     U, ∅, ∈, ∪, ∩, , ⊆                AxB, aRb



            Trees                       Graphs
  node, edge, path, binary       node, edge, cycle, path



         Complexity               Program verification
      O(g), Ω(g), θ(g)             {P} S {Q}, wp(S,Q)



   Models and languages          Programming languages
model, meta, syntax, semantics   programming = modeling
n1
               n10
     n2


                     n9
n3


                     n8
n4



     n5        n7
          n6
n1
               n10
     n2


                     n9
n3


                     n8
n4



     n5        n7
          n6
n1



     n2         n3        n4



n5        n6         n7   n8   n9



          n10
not a binary tree                  binary tree

                n1                                n1


     n2                       n3        n2                  n3


n4         n5                 n6   n4        n5        n6




                                        complete binary tree

                                                  n1


                                        n2                  n3


                                   n4        n5        n6        n7
breadth-first traversal



                              1

                              n1

               2                        3

              n2                        n3

     4                   5         6

     n4                  n5        n6
preorder(node)
visit(node).
preorder(node.left).
preorder(node.right).        1

                             n1

                 2                     5

              n2                       n3

     3                  4         6

     n4                 n5        n6
inorder(node)
inorder(node.left).
visit(node).
inorder(node.right).        4

                            n1

                2                     6

                n2                    n3

     1                 3         5

     n4                n5        n6
postorder (node)
postorder(node.left).
postorder(node.right).
visit(node).                  6

                              n1

              3                         5

              n2                        n3

     1                   2         4

     n4                  n5        n6
Boolean algebra                Predicate logic
        1, 0, ∧, ∨, ¬                     ∃, ∀



            Sets                       Relations
     U, ∅, ∈, ∪, ∩, , ⊆                AxB, aRb



            Trees                       Graphs
  node, edge, path, binary       node, edge, cycle, path



         Complexity               Program verification
      O(g), Ω(g), θ(g)             {P} S {Q}, wp(S,Q)



   Models and languages          Programming languages
model, meta, syntax, semantics   programming = modeling
G = (V, E)
E = { {u,v} | u,v ∈ V}



 a                       e




           c         d       g



 b                       f
Path                       Cycle

     a                         e

             c        d                 g

     b                         f



Path: (b, a, c); Length (b, a, c) = 2
Path: (b, d, f)
Cycle: (f, g, e, d, f); Length (f, g, e, d, f) = 4
Hamiltonian path           Eulerian path


a                  e       a                   e

     c      d          g       c     d             g

b                  f       b                   f
Boolean algebra                Predicate logic
        1, 0, ∧, ∨, ¬                     ∃, ∀



            Sets                       Relations
     U, ∅, ∈, ∪, ∩, , ⊆                AxB, aRb



            Trees                       Graphs
  node, edge, path, binary       node, edge, cycle, path



         Complexity               Program verification
      O(g), Ω(g), θ(g)             {P} S {Q}, wp(S,Q)



   Models and languages          Programming languages
model, meta, syntax, semantics   programming = modeling
1 public long factorial (int n) {

2 	 long factorial = 1;

3 	 int i = 1;

4 	 while ( i ≤ n ) {

5 	 	 factorial = factorial * i;

6 	 	 i = i + 1;

7 	 }

8 	 return factorial

9 }
1 public long factorial (int n) {

2 	 long factorial = 1;             1

3 	 int i = 1;                      1

4 	 while ( i ≤ n ) {               4

5 	 	 factorial = factorial * i;    4

6 	 	 i = i + 1;                    3

7 	 }

8 	 return factorial                1

9 }
1 public long factorial (int n) {

2 	 long factorial = 1;             1   1

3 	 int i = 1;                      1   1

4 	 while ( i ≤ n ) {               4   n

5 	 	 factorial = factorial * i;    4   n

6 	 	 i = i + 1;                    3   n

7 	 }

8 	 return factorial                1   1

9 }
1 public long factorial (int n) {

2 	 long factorial = 1;                 1       1

3 	 int i = 1;                          1       1

4 	 while ( i ≤ n ) {                   4       n

5 	 	 factorial = factorial * i;        4       n

6 	 	 i = i + 1;                        3       n

7 	 }

8 	 return factorial                    1       1

9 }


                   f(n) = 1+1+4*n+4*n+3*n+1 = 11*n+3
Big O Notation

f: N -> N
g: N -> N

f ∈ O(g)
	 ∃ c, n0 :
	 (c,n0∈N) ∧ (c>0) :
	 (∀n : n∈N ∧ n>n0 : f(n) ≤ c*g(n))
O(1) ∈ O(log n) ∈ O(n) ∈ O(n2) ∈ O(nk) ∈ O(2n)

                        !"#$%$&'()("'*$+ ,'-.$/'--
O(1)      Constant


O(log n) Logarithmic


O(n)      Linear


O(n2)     Quadratic


O(nk)     Polynomial


O(kn)     Exponential
Best case estimation

f: N -> N
g: N -> N

f ∈ Ω(g)
	 ∃ c, n0 :
	 (c,n0∈N) ∧ (c>0) :
	 (∀n : n∈N ∧ n>n0 : f(n) ≥ c*g(n))
Average case estimation

f: N -> N
g: N -> N

f ∈ θ(g)
	 ∃ c 1, c 2, n 0 :
	 (c1,c2,n0∈N) ∧ (c1>0) ∧ (c2>0):
	 (∀n : n∈N ∧ n≥n0 : c1*g(n) ≤ f(n) ≤ c2*g(n))
solvable
 in O(nk)   P ⊂ NP   verifiable
                     in O(nk)
solvable
 in O(nk)   P = NP
              ?      verifiable
                     in O(nk)
NP-complete
 NP, and one cannot do better
Boolean algebra                Predicate logic
        1, 0, ∧, ∨, ¬                     ∃, ∀



            Sets                       Relations
     U, ∅, ∈, ∪, ∩, , ⊆                AxB, aRb



            Trees                       Graphs
  node, edge, path, binary       node, edge, cycle, path



         Complexity               Program verification
      O(g), Ω(g), θ(g)             {P} S {Q}, wp(S,Q)



   Models and languages          Programming languages
model, meta, syntax, semantics   programming = modeling
program
                  S



    {P}                      {Q}

precondition             postcondition
Weakest Precondition wp(S, Q)

∀ {P} S {Q} :: P           wp(S,Q)




Verification of {P} S {Q}

1. Compute wp(S, Q)

2. Prove P         wp(S, Q)
Assignment
wp(x:=A, Q) = Qx←A


Sequencing
wp(S1; S2, Q)	 wp(S1, wp(S2, Q))
             =	



Conditional
wp(if (B) then S1 else S2, Q)	 =
              (B     wp(S1, Q)) ∧ (¬B   wp(S2, Q))
While loop
L = while (B) do S end
wp(L,Q)	 I ∧
        =
                      ∀y, ((B ∧ I)          wp(S, I ∧       x < y))

                      ∀y, ((¬B ∧ I)           Q)



Loop verification

I = property which stays true before and after every loop

0. P     I;
1. I∧B        wp(s, I);
2. I∧¬B        Q.
Boolean algebra                Predicate logic
        1, 0, ∧, ∨, ¬                     ∃, ∀



            Sets                       Relations
     U, ∅, ∈, ∪, ∩, , ⊆                AxB, aRb



            Trees                       Graphs
  node, edge, path, binary       node, edge, cycle, path



         Complexity               Program verification
      O(g), Ω(g), θ(g)             {P} S {Q}, wp(S,Q)



   Models and languages          Programming languages
model, meta, syntax, semantics   programming = modeling
meta-meta-model

         instanceOf


  meta-model

         instanceOf


    model

         representedBy


    subject
A language is a set of sequences of symbols that
we interpret to attribute meaning.
-         digit        .        digit




part 	 	 	 = {digit}                           x	 	
                                                         Nonter
decimal_part 	 “.” part
             =                                "x"	 	             mi
                                                        Termin nal
number 	 	 = [-] part [decimal_part]         x y 		             al
                                                        Sequen
                                             x|y	                ce
                                                       Alterna
                                            { x }		            tiv
                                                      Iteratio e
                                           ( x )	 	           n
                                                      Binding
                                          [ x ]	 	
                                                     Option
                                          y = x.	
                                                     Definiti
                                                             on
Please, stand up by sitting down!
       Syntactically correct sentences
      do not necessarily have a meaning
Boolean algebra                Predicate logic
        1, 0, ∧, ∨, ¬                     ∃, ∀



            Sets                       Relations
     U, ∅, ∈, ∪, ∩, , ⊆                AxB, aRb



            Trees                       Graphs
  node, edge, path, binary       node, edge, cycle, path



         Complexity               Program verification
      O(g), Ω(g), θ(g)             {P} S {Q}, wp(S,Q)



   Models and languages          Programming languages
model, meta, syntax, semantics   programming = modeling
A programming language is a a language for
communicating software designs.
in g, 1937
Alan Tur
Imperative           Functional
data + algorithms    stateless + pure functions




Object-oriented      Logic
objects + messages   facts + rules
comments    functions



             # Compute factorials       variables
             def fact(n)
               if n == 0
                                          literals
                 1
               else
control          n * fact(n-1)         expression
constructs     end
             end


statements   puts fact(ARGV[0].to_i)
programming = modeling
Boolean algebra                Predicate logic
        1, 0, ∧, ∨, ¬                     ∃, ∀



            Sets                       Relations
     U, ∅, ∈, ∪, ∩, , ⊆                AxB, aRb



            Trees                       Graphs
  node, edge, path, binary       node, edge, cycle, path



         Complexity               Program verification
      O(g), Ω(g), θ(g)             {P} S {Q}, wp(S,Q)



   Models and languages          Programming languages
model, meta, syntax, semantics   programming = modeling
computation



information                 information
              computer
computational thinking
              computation



information                 information
              computer
Reflection
Class aClass = Class.forName(“java.lang.Object”);
Method m[] aClass.getDeclaredMethods();
Class aClass = Class.forName(“java.lang.Object”);
Method m[] aClass.getDeclaredMethods();


protected void java.lang.Object.finalize() throws java.lang.Throwable
public final void java.lang.Object.wait() throws java.lang.InterruptedException
public final native void java.lang.Object.wait(long) throws
java.lang.InterruptedException
public final void java.lang.Object.wait(long,int) throws
java.lang.InterruptedException
public boolean java.lang.Object.equals(java.lang.Object)
public java.lang.String java.lang.Object.toString()
public native int java.lang.Object.hashCode()
public final native java.lang.Class java.lang.Object.getClass()
protected native java.lang.Object java.lang.Object.clone() throws
java.lang.CloneNotSupportedException
private static native void java.lang.Object.registerNatives()
public final native void java.lang.Object.notify()
public final native void java.lang.Object.notifyAll()
computational thinking
              computation



information                 information
              computer
Tudor Gîrba
        www.tudorgirba.com




creativecommons.org/licenses/by/3.0/

Contenu connexe

Tendances

Bayesian hybrid variable selection under generalized linear models
Bayesian hybrid variable selection under generalized linear modelsBayesian hybrid variable selection under generalized linear models
Bayesian hybrid variable selection under generalized linear modelsCaleb (Shiqiang) Jin
 
Learning with Nets and Meshes
Learning with Nets and MeshesLearning with Nets and Meshes
Learning with Nets and MeshesDon Sheehy
 
Linear Programming
Linear ProgrammingLinear Programming
Linear Programmingknspavan
 
Montpellier Math Colloquium
Montpellier Math ColloquiumMontpellier Math Colloquium
Montpellier Math ColloquiumChristian Robert
 
Signal Processing Course : Inverse Problems Regularization
Signal Processing Course : Inverse Problems RegularizationSignal Processing Course : Inverse Problems Regularization
Signal Processing Course : Inverse Problems RegularizationGabriel Peyré
 
CVPR2010: higher order models in computer vision: Part 1, 2
CVPR2010: higher order models in computer vision: Part 1, 2CVPR2010: higher order models in computer vision: Part 1, 2
CVPR2010: higher order models in computer vision: Part 1, 2zukun
 
Signal Processing Course : Sparse Regularization of Inverse Problems
Signal Processing Course : Sparse Regularization of Inverse ProblemsSignal Processing Course : Sparse Regularization of Inverse Problems
Signal Processing Course : Sparse Regularization of Inverse ProblemsGabriel Peyré
 
Masters Thesis Defense
Masters Thesis DefenseMasters Thesis Defense
Masters Thesis Defensessj4mathgenius
 
Maximum likelihood estimation of regularisation parameters in inverse problem...
Maximum likelihood estimation of regularisation parameters in inverse problem...Maximum likelihood estimation of regularisation parameters in inverse problem...
Maximum likelihood estimation of regularisation parameters in inverse problem...Valentin De Bortoli
 
Recent developments in control, power electronics and renewable energy by Dr ...
Recent developments in control, power electronics and renewable energy by Dr ...Recent developments in control, power electronics and renewable energy by Dr ...
Recent developments in control, power electronics and renewable energy by Dr ...Qing-Chang Zhong
 
Bregman divergences from comparative convexity
Bregman divergences from comparative convexityBregman divergences from comparative convexity
Bregman divergences from comparative convexityFrank Nielsen
 
Learning Sparse Representation
Learning Sparse RepresentationLearning Sparse Representation
Learning Sparse RepresentationGabriel Peyré
 
Topological Inference via Meshing
Topological Inference via MeshingTopological Inference via Meshing
Topological Inference via MeshingDon Sheehy
 
Low Complexity Regularization of Inverse Problems
Low Complexity Regularization of Inverse ProblemsLow Complexity Regularization of Inverse Problems
Low Complexity Regularization of Inverse ProblemsGabriel Peyré
 
Convergence of ABC methods
Convergence of ABC methodsConvergence of ABC methods
Convergence of ABC methodsChristian Robert
 

Tendances (20)

Bayesian hybrid variable selection under generalized linear models
Bayesian hybrid variable selection under generalized linear modelsBayesian hybrid variable selection under generalized linear models
Bayesian hybrid variable selection under generalized linear models
 
Learning with Nets and Meshes
Learning with Nets and MeshesLearning with Nets and Meshes
Learning with Nets and Meshes
 
Linear Programming
Linear ProgrammingLinear Programming
Linear Programming
 
Iwsmbvs
IwsmbvsIwsmbvs
Iwsmbvs
 
Montpellier Math Colloquium
Montpellier Math ColloquiumMontpellier Math Colloquium
Montpellier Math Colloquium
 
Signal Processing Course : Inverse Problems Regularization
Signal Processing Course : Inverse Problems RegularizationSignal Processing Course : Inverse Problems Regularization
Signal Processing Course : Inverse Problems Regularization
 
CVPR2010: higher order models in computer vision: Part 1, 2
CVPR2010: higher order models in computer vision: Part 1, 2CVPR2010: higher order models in computer vision: Part 1, 2
CVPR2010: higher order models in computer vision: Part 1, 2
 
Signal Processing Course : Sparse Regularization of Inverse Problems
Signal Processing Course : Sparse Regularization of Inverse ProblemsSignal Processing Course : Sparse Regularization of Inverse Problems
Signal Processing Course : Sparse Regularization of Inverse Problems
 
Masters Thesis Defense
Masters Thesis DefenseMasters Thesis Defense
Masters Thesis Defense
 
Maximum likelihood estimation of regularisation parameters in inverse problem...
Maximum likelihood estimation of regularisation parameters in inverse problem...Maximum likelihood estimation of regularisation parameters in inverse problem...
Maximum likelihood estimation of regularisation parameters in inverse problem...
 
Predicate Logic
Predicate LogicPredicate Logic
Predicate Logic
 
Recent developments in control, power electronics and renewable energy by Dr ...
Recent developments in control, power electronics and renewable energy by Dr ...Recent developments in control, power electronics and renewable energy by Dr ...
Recent developments in control, power electronics and renewable energy by Dr ...
 
Bregman divergences from comparative convexity
Bregman divergences from comparative convexityBregman divergences from comparative convexity
Bregman divergences from comparative convexity
 
Learning Sparse Representation
Learning Sparse RepresentationLearning Sparse Representation
Learning Sparse Representation
 
Madrid easy
Madrid easyMadrid easy
Madrid easy
 
Topological Inference via Meshing
Topological Inference via MeshingTopological Inference via Meshing
Topological Inference via Meshing
 
Low Complexity Regularization of Inverse Problems
Low Complexity Regularization of Inverse ProblemsLow Complexity Regularization of Inverse Problems
Low Complexity Regularization of Inverse Problems
 
ma112011id535
ma112011id535ma112011id535
ma112011id535
 
1
11
1
 
Convergence of ABC methods
Convergence of ABC methodsConvergence of ABC methods
Convergence of ABC methods
 

Similaire à 12 - Overview

AlgoPerm2012 - 08 Jean Cardinal
AlgoPerm2012 - 08 Jean CardinalAlgoPerm2012 - 08 Jean Cardinal
AlgoPerm2012 - 08 Jean CardinalAlgoPerm 2012
 
Jam 2006 Test Papers Mathematical Statistics
Jam 2006 Test Papers Mathematical StatisticsJam 2006 Test Papers Mathematical Statistics
Jam 2006 Test Papers Mathematical Statisticsashu29
 
Algorithmic foundations.docx
Algorithmic foundations.docxAlgorithmic foundations.docx
Algorithmic foundations.docxedwin orege
 
Probability Arunesh Chand Mankotia 2005
Probability   Arunesh Chand Mankotia 2005Probability   Arunesh Chand Mankotia 2005
Probability Arunesh Chand Mankotia 2005Consultonmic
 
Top school in india
Top school in indiaTop school in india
Top school in indiaEdhole.com
 
Functional Programming in C++
Functional Programming in C++Functional Programming in C++
Functional Programming in C++sankeld
 
Deep learning .pdf
Deep learning .pdfDeep learning .pdf
Deep learning .pdfAlHayyan
 
Boolean Programs and Quantified Propositional Proof System -
Boolean Programs and Quantified Propositional Proof System - Boolean Programs and Quantified Propositional Proof System -
Boolean Programs and Quantified Propositional Proof System - Michael Soltys
 
Introduction to Artificial Intelligence
Introduction to Artificial IntelligenceIntroduction to Artificial Intelligence
Introduction to Artificial IntelligenceManoj Harsule
 
Introduction of predicate logics
Introduction of predicate  logicsIntroduction of predicate  logics
Introduction of predicate logicschauhankapil
 
Probabilistic information retrieval models & systems
Probabilistic information retrieval models & systemsProbabilistic information retrieval models & systems
Probabilistic information retrieval models & systemsSelman Bozkır
 

Similaire à 12 - Overview (20)

AlgoPerm2012 - 08 Jean Cardinal
AlgoPerm2012 - 08 Jean CardinalAlgoPerm2012 - 08 Jean Cardinal
AlgoPerm2012 - 08 Jean Cardinal
 
05 - Relations
05 - Relations05 - Relations
05 - Relations
 
Jam 2006 Test Papers Mathematical Statistics
Jam 2006 Test Papers Mathematical StatisticsJam 2006 Test Papers Mathematical Statistics
Jam 2006 Test Papers Mathematical Statistics
 
Algorithmic foundations.docx
Algorithmic foundations.docxAlgorithmic foundations.docx
Algorithmic foundations.docx
 
Discrete mathematics notes
Discrete mathematics notesDiscrete mathematics notes
Discrete mathematics notes
 
C2.0 propositional logic
C2.0 propositional logicC2.0 propositional logic
C2.0 propositional logic
 
Probability Arunesh Chand Mankotia 2005
Probability   Arunesh Chand Mankotia 2005Probability   Arunesh Chand Mankotia 2005
Probability Arunesh Chand Mankotia 2005
 
Top school in india
Top school in indiaTop school in india
Top school in india
 
Functional Programming in C++
Functional Programming in C++Functional Programming in C++
Functional Programming in C++
 
Deep learning .pdf
Deep learning .pdfDeep learning .pdf
Deep learning .pdf
 
Probability Cheatsheet.pdf
Probability Cheatsheet.pdfProbability Cheatsheet.pdf
Probability Cheatsheet.pdf
 
Algorithm Assignment Help
Algorithm Assignment HelpAlgorithm Assignment Help
Algorithm Assignment Help
 
Boolean Programs and Quantified Propositional Proof System -
Boolean Programs and Quantified Propositional Proof System - Boolean Programs and Quantified Propositional Proof System -
Boolean Programs and Quantified Propositional Proof System -
 
Introduction to Artificial Intelligence
Introduction to Artificial IntelligenceIntroduction to Artificial Intelligence
Introduction to Artificial Intelligence
 
Introduction of predicate logics
Introduction of predicate  logicsIntroduction of predicate  logics
Introduction of predicate logics
 
Volume computation and applications
Volume computation and applications Volume computation and applications
Volume computation and applications
 
Boolean Algebra DLD
Boolean Algebra DLDBoolean Algebra DLD
Boolean Algebra DLD
 
ABC-Gibbs
ABC-GibbsABC-Gibbs
ABC-Gibbs
 
Probabilistic information retrieval models & systems
Probabilistic information retrieval models & systemsProbabilistic information retrieval models & systems
Probabilistic information retrieval models & systems
 
Ch01
Ch01Ch01
Ch01
 

Plus de Tudor Girba

Beyond software evolution: Software environmentalism
Beyond software evolution: Software environmentalismBeyond software evolution: Software environmentalism
Beyond software evolution: Software environmentalismTudor Girba
 
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...Software craftsmanship meetup (Zurich 2015) on solving real problems without ...
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...Tudor Girba
 
Don't demo facts. Demo stories! (handouts)
Don't demo facts. Demo stories! (handouts)Don't demo facts. Demo stories! (handouts)
Don't demo facts. Demo stories! (handouts)Tudor Girba
 
Don't demo facts. Demo stories!
Don't demo facts. Demo stories!Don't demo facts. Demo stories!
Don't demo facts. Demo stories!Tudor Girba
 
Humane assessment on cards
Humane assessment on cardsHumane assessment on cards
Humane assessment on cardsTudor Girba
 
Underneath Scrum: Reflective Thinking
Underneath Scrum: Reflective ThinkingUnderneath Scrum: Reflective Thinking
Underneath Scrum: Reflective ThinkingTudor Girba
 
1800+ TED talks later
1800+ TED talks later1800+ TED talks later
1800+ TED talks laterTudor Girba
 
Software assessment by example (lecture at the University of Bern)
Software assessment by example (lecture at the University of Bern)Software assessment by example (lecture at the University of Bern)
Software assessment by example (lecture at the University of Bern)Tudor Girba
 
Humane assessment: Taming the elephant from the development room
Humane assessment: Taming the elephant from the development roomHumane assessment: Taming the elephant from the development room
Humane assessment: Taming the elephant from the development roomTudor Girba
 
Moose: how to solve real problems without reading code
Moose: how to solve real problems without reading codeMoose: how to solve real problems without reading code
Moose: how to solve real problems without reading codeTudor Girba
 
Software Environmentalism (ECOOP 2014 Keynote)
Software Environmentalism (ECOOP 2014 Keynote)Software Environmentalism (ECOOP 2014 Keynote)
Software Environmentalism (ECOOP 2014 Keynote)Tudor Girba
 
The emergent nature of software systems
The emergent nature of software systemsThe emergent nature of software systems
The emergent nature of software systemsTudor Girba
 
Presenting is storytelling at Uni Zurich - slides (2014-03-05)
Presenting is storytelling at Uni Zurich - slides (2014-03-05)Presenting is storytelling at Uni Zurich - slides (2014-03-05)
Presenting is storytelling at Uni Zurich - slides (2014-03-05)Tudor Girba
 
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)Presenting is storytelling at Uni Zurich - handouts (2014-03-05)
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)Tudor Girba
 
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)Tudor Girba
 
Demo-driven innovation teaser
Demo-driven innovation teaserDemo-driven innovation teaser
Demo-driven innovation teaserTudor Girba
 
Software assessment essentials (lecture at the University of Bern 2013)
Software assessment essentials (lecture at the University of Bern 2013)Software assessment essentials (lecture at the University of Bern 2013)
Software assessment essentials (lecture at the University of Bern 2013)Tudor Girba
 
Demo-driven innovation (University of Zurich, June 2013)
Demo-driven innovation (University of Zurich, June 2013)Demo-driven innovation (University of Zurich, June 2013)
Demo-driven innovation (University of Zurich, June 2013)Tudor Girba
 
Humane assessment with Moose at GOTO Aarhus 2011
Humane assessment with Moose at GOTO Aarhus 2011Humane assessment with Moose at GOTO Aarhus 2011
Humane assessment with Moose at GOTO Aarhus 2011Tudor Girba
 

Plus de Tudor Girba (20)

Beyond software evolution: Software environmentalism
Beyond software evolution: Software environmentalismBeyond software evolution: Software environmentalism
Beyond software evolution: Software environmentalism
 
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...Software craftsmanship meetup (Zurich 2015) on solving real problems without ...
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...
 
GT Spotter
GT SpotterGT Spotter
GT Spotter
 
Don't demo facts. Demo stories! (handouts)
Don't demo facts. Demo stories! (handouts)Don't demo facts. Demo stories! (handouts)
Don't demo facts. Demo stories! (handouts)
 
Don't demo facts. Demo stories!
Don't demo facts. Demo stories!Don't demo facts. Demo stories!
Don't demo facts. Demo stories!
 
Humane assessment on cards
Humane assessment on cardsHumane assessment on cards
Humane assessment on cards
 
Underneath Scrum: Reflective Thinking
Underneath Scrum: Reflective ThinkingUnderneath Scrum: Reflective Thinking
Underneath Scrum: Reflective Thinking
 
1800+ TED talks later
1800+ TED talks later1800+ TED talks later
1800+ TED talks later
 
Software assessment by example (lecture at the University of Bern)
Software assessment by example (lecture at the University of Bern)Software assessment by example (lecture at the University of Bern)
Software assessment by example (lecture at the University of Bern)
 
Humane assessment: Taming the elephant from the development room
Humane assessment: Taming the elephant from the development roomHumane assessment: Taming the elephant from the development room
Humane assessment: Taming the elephant from the development room
 
Moose: how to solve real problems without reading code
Moose: how to solve real problems without reading codeMoose: how to solve real problems without reading code
Moose: how to solve real problems without reading code
 
Software Environmentalism (ECOOP 2014 Keynote)
Software Environmentalism (ECOOP 2014 Keynote)Software Environmentalism (ECOOP 2014 Keynote)
Software Environmentalism (ECOOP 2014 Keynote)
 
The emergent nature of software systems
The emergent nature of software systemsThe emergent nature of software systems
The emergent nature of software systems
 
Presenting is storytelling at Uni Zurich - slides (2014-03-05)
Presenting is storytelling at Uni Zurich - slides (2014-03-05)Presenting is storytelling at Uni Zurich - slides (2014-03-05)
Presenting is storytelling at Uni Zurich - slides (2014-03-05)
 
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)Presenting is storytelling at Uni Zurich - handouts (2014-03-05)
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)
 
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)
 
Demo-driven innovation teaser
Demo-driven innovation teaserDemo-driven innovation teaser
Demo-driven innovation teaser
 
Software assessment essentials (lecture at the University of Bern 2013)
Software assessment essentials (lecture at the University of Bern 2013)Software assessment essentials (lecture at the University of Bern 2013)
Software assessment essentials (lecture at the University of Bern 2013)
 
Demo-driven innovation (University of Zurich, June 2013)
Demo-driven innovation (University of Zurich, June 2013)Demo-driven innovation (University of Zurich, June 2013)
Demo-driven innovation (University of Zurich, June 2013)
 
Humane assessment with Moose at GOTO Aarhus 2011
Humane assessment with Moose at GOTO Aarhus 2011Humane assessment with Moose at GOTO Aarhus 2011
Humane assessment with Moose at GOTO Aarhus 2011
 

12 - Overview

  • 1. Overview www.tudorgirba.com
  • 2. computation information information computer
  • 3. Computer science is the systematic study of information and computation.
  • 4. Boolean algebra Predicate logic 1, 0, ∧, ∨, ¬ ∃, ∀ Sets Relations U, ∅, ∈, ∪, ∩, , ⊆ AxB, aRb Trees Graphs node, edge, path, binary node, edge, cycle, path Complexity Program verification O(g), Ω(g), θ(g) {P} S {Q}, wp(S,Q) Models and languages Programming languages model, meta, syntax, semantics programming = modeling
  • 5. Boolean algebra Predicate logic 1, 0, ∧, ∨, ¬ ∃, ∀ Sets Relations U, ∅, ∈, ∪, ∩, , ⊆ AxB, aRb Trees Graphs node, edge, path, binary node, edge, cycle, path Complexity Program verification O(g), Ω(g), θ(g) {P} S {Q}, wp(S,Q) Models and languages Programming languages model, meta, syntax, semantics programming = modeling
  • 6. + + a = 0 a = 1 y = 0 y = 1
  • 7. Conjunction (AND) Disjunction (OR) Negation (NOT) a ∧ b = y a ∨ b = y ¬ a = y 0 0 0 0 0 0 0 1 0 1 0 0 1 1 1 0 1 0 0 1 0 1 1 1 1 1 1 1
  • 8. Neutral elements Commutativity a ∧ 1 = a a ∨ b = b ∨ a a ∨ 0 = a a ∧ b = b ∧ a Zero elements Associativity a ∧ 0 = 0 a ∧ (b ∧ c) = (a ∧ b) ∧ c a ∨ 1 = 1 a ∨ (b ∨ c) = (a ∨ b) ∨ c Idempotence Distributivity a ∧ a = a a ∧ (b ∨ c) = (a ∧ b) ∨ (a ∧ c) a ∨ a = a a ∨ (b ∧ c) = (a ∨ b) ∧ (a ∨ c) Negation DeMorgan’s a ∧ ¬ a = 0 ¬ (a ∧ b) = (¬ a) ∨ (¬ b) a ∨ ¬ a = 1 ¬ (a ∨ b) = (¬ a) ∧ (¬ b)
  • 9. Boolean algebra Propositional logic 0, 1 True, False boolean variables: a∈{0, 1} atomic formulas: p∈{True,False} boolean operators: ¬ ∧ ∨ logical connectives: ¬ ∧ ∨ boolean functions: propositional formulas (propositions): 0, 1 True and False boolean variables atomic formulas if a is a boolean function, then ¬a is a if a is a propositional formula, then ¬a boolean function is a propositional formula if a and b are boolean functions, then if a and b are propositional formulas, a∧b, a∨b, a b, a b are boolean then a∧b, a∨b, a b, a b are functions propositional formulas truth value of a boolean function (truth truth value of a propositional formula (truth tables) tables)
  • 10. Boolean algebra Propositional logic 0, 1 True, False boolean variables: a∈{0, 1} atomic formulas: p∈{True,False} boolean operators: ¬ ∧ ∨ logical connectives: ¬ ∧ ∨ boolean functions: propositional formulas (propositions): 0, 1 True and False boolean variables atomic formulas if a is a boolean function, then ¬a is a if a is a propositional formula, then ¬a boolean function is a propositional formula if a and b are boolean functions, then if a and b are propositional formulas, a∧b, a∨b, a b, a b are boolean then a∧b, a∨b, a b, a b are functions propositional formulas truth value of a boolean function (truth truth value of a propositional formula (truth tables) tables)
  • 11. Boolean algebra Predicate logic 1, 0, ∧, ∨, ¬ ∃, ∀ Sets Relations U, ∅, ∈, ∪, ∩, , ⊆ AxB, aRb Trees Graphs node, edge, path, binary node, edge, cycle, path Complexity Program verification O(g), Ω(g), θ(g) {P} S {Q}, wp(S,Q) Models and languages Programming languages model, meta, syntax, semantics programming = modeling
  • 12. Universal quantifier ∀ : Existential quantifiers ∃ : ∀x: U(x): F(x) ∃x: U(x): F(x) ∀x:x∈N:x>5 ∃x:x∈N:x>5 for all natural numbers x, for some natural numbers x, x is greater than 5 x is greater than 5
  • 13. ∀ i: 0≤i<N: ai=0 ∃ i: 0≤i<N: ai ≠ 0 all elements ai of array a (of length N) are at least one element of array a (of length N) is zero not zero ∀ i: 1≤i<N: ai-1 ≤ ai ∃ i: 1≤i<N: ai-1 > ai elements of array a are monotonically elements of array a are not monotonically increasing increasing ∀ i,j: 0≤i<j<N: ai ≤ aj ∃ i,j: 0≤i<j<N: ai > aj elements of array a are monotonically elements of array a are not monotonically increasing increasing ∀ i,j: 0≤i,j<N: ai = aj ∃ i,j: 0≤i<j<N: ai ≠ aj all elements of array a are equal not all elements of array a are equal ∀ i: 0<i<N: ai ≤ a0 ∃ i: 0<i<N: ai > a0 a0 is the greatest element of array a a0 is not the greatest element of array a s E xample
  • 14. De Morgan’s Axiom ¬∃ : ¬(∃ x: U(x): F(x)) ∀ x: U(x): ¬ F(x) De Morgan’s Axiom ¬∀ : ¬(∀ x: U(x): F(x)) ∃ x: U(x): ¬ F(x)
  • 15. ambiguous All elements of an array a of length N are either zero or one (1) ∀i: 0≤i<N: ( ai=0 ∨ ai=1 ) (2) (∀i: 0≤i<N: ai=0) ∨ (∀i: 0≤i<N: ai=1) Example
  • 16. Boolean algebra Predicate logic 1, 0, ∧, ∨, ¬ ∃, ∀ Sets Relations U, ∅, ∈, ∪, ∩, , ⊆ AxB, aRb Trees Graphs node, edge, path, binary node, edge, cycle, path Complexity Program verification O(g), Ω(g), θ(g) {P} S {Q}, wp(S,Q) Models and languages Programming languages model, meta, syntax, semantics programming = modeling
  • 17. Neutral elements Commutativity A ∩ U = A A ∪ B = B ∪ A A ∪ ∅ = A A ∩ B = B ∩ A Zero elements Associativity A ∩ ∅ = ∅ A ∩ (B ∩ C) = (A ∩ B) ∩ C A ∪ U = U A ∪ (B ∪ C) = (A ∪ B) ∪ C Idempotence Distributivity A ∩ A = A A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) A ∪ A = A A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) Complement DeMorgan’s A ∩ A’ = ∅ (A ∩ B)’ = (A’) ∪ (B’) A ∪ A’ = U (A ∪ B)’ = (A’) ∩ (B’)
  • 18. Reflexivity A ⊆ A. Anti-symmetry A ⊆ B ∧ B ⊆ A A = B. Transitivity A ⊆ B ∧ B ⊆ C A ⊆ C
  • 19. Boolean algebra Predicate logic 1, 0, ∧, ∨, ¬ ∃, ∀ Sets Relations U, ∅, ∈, ∪, ∩, , ⊆ AxB, aRb Trees Graphs node, edge, path, binary node, edge, cycle, path Complexity Program verification O(g), Ω(g), θ(g) {P} S {Q}, wp(S,Q) Models and languages Programming languages model, meta, syntax, semantics programming = modeling
  • 20. Cartesian product AxB AxB={ (a,b) | a∈A and b∈B } A × ∅ = ∅. A × (B ∪ C) = (A × B) ∪ (A × C). (A ∪ B) × C = (A × C) ∪ (B × C).
  • 21. N-ary Relation A1, A2, ..., An R ⊆ A1 x A2 x...x An Binary Relation A 1, A 2 R ⊆ A1 x A2 (a,b) ∈ R aRb
  • 22. Reflexive relation every element x of A is in relation R with itself ∀x: x∈A: xRx Equivalent relation Symmetric relation if there is a relation between x and y, then there is a relation between y and x ∀x,y: x,y∈A: xRy yRx Transitive relation ... ∀x,y,z: x,y,z∈A: (xRy ∧ yRz) xRz
  • 23. Irreflexive relation no element x of A is in relation R with itself ∀x: x∈A: ¬(xRx) Antisymmetric relation if there is a relation between x and y and one between y and x, then x equals y ∀x,y: x,y∈A: (xRy ∧ yRx) x=y Asymmetric relation xRy and yRx cannot hold at the same time ∀x,y: x,y∈A: xRy ¬(yRx) Non-symmetric relation a relation that is not symmetric ∀x,y: x,y∈A: (xRy) ∧ ¬(yRx) Total relation R is defined on the entire A. ∀x,y: x,y∈A: xRy ∨ yRx
  • 24. Acyclic relation there are no elements with transitive closure to themselves ∀n: n∈N: ( ¬(∃x1, x2, ...,xn: x1, x2, ...,xn∈A: x1Rx2 ∧ x2Rx3 ∧ ... ∧ xn-1Rxn ∧ xnRx1 ) )
  • 25. R ⊆ AxA {(a,b), (b,c), (c,d)} a b c d Transitive closure R1 = R; ∀i:i>1:Ri = Ri-1 ∪ {(a,b) | ∃c:: (a,c)∈Ri-1 ∧ (c,b)∈Ri-1}. Rt = ∪i≥1Ri = R1 ∪ R2 ∪ R3 ∪ ...
  • 26. Boolean algebra Predicate logic 1, 0, ∧, ∨, ¬ ∃, ∀ Sets Relations U, ∅, ∈, ∪, ∩, , ⊆ AxB, aRb Trees Graphs node, edge, path, binary node, edge, cycle, path Complexity Program verification O(g), Ω(g), θ(g) {P} S {Q}, wp(S,Q) Models and languages Programming languages model, meta, syntax, semantics programming = modeling
  • 27. n1 n10 n2 n9 n3 n8 n4 n5 n7 n6
  • 28. n1 n10 n2 n9 n3 n8 n4 n5 n7 n6
  • 29. n1 n2 n3 n4 n5 n6 n7 n8 n9 n10
  • 30. not a binary tree binary tree n1 n1 n2 n3 n2 n3 n4 n5 n6 n4 n5 n6 complete binary tree n1 n2 n3 n4 n5 n6 n7
  • 31. breadth-first traversal 1 n1 2 3 n2 n3 4 5 6 n4 n5 n6
  • 35. Boolean algebra Predicate logic 1, 0, ∧, ∨, ¬ ∃, ∀ Sets Relations U, ∅, ∈, ∪, ∩, , ⊆ AxB, aRb Trees Graphs node, edge, path, binary node, edge, cycle, path Complexity Program verification O(g), Ω(g), θ(g) {P} S {Q}, wp(S,Q) Models and languages Programming languages model, meta, syntax, semantics programming = modeling
  • 36. G = (V, E) E = { {u,v} | u,v ∈ V} a e c d g b f
  • 37. Path Cycle a e c d g b f Path: (b, a, c); Length (b, a, c) = 2 Path: (b, d, f) Cycle: (f, g, e, d, f); Length (f, g, e, d, f) = 4
  • 38. Hamiltonian path Eulerian path a e a e c d g c d g b f b f
  • 39. Boolean algebra Predicate logic 1, 0, ∧, ∨, ¬ ∃, ∀ Sets Relations U, ∅, ∈, ∪, ∩, , ⊆ AxB, aRb Trees Graphs node, edge, path, binary node, edge, cycle, path Complexity Program verification O(g), Ω(g), θ(g) {P} S {Q}, wp(S,Q) Models and languages Programming languages model, meta, syntax, semantics programming = modeling
  • 40. 1 public long factorial (int n) { 2 long factorial = 1; 3 int i = 1; 4 while ( i ≤ n ) { 5 factorial = factorial * i; 6 i = i + 1; 7 } 8 return factorial 9 }
  • 41. 1 public long factorial (int n) { 2 long factorial = 1; 1 3 int i = 1; 1 4 while ( i ≤ n ) { 4 5 factorial = factorial * i; 4 6 i = i + 1; 3 7 } 8 return factorial 1 9 }
  • 42. 1 public long factorial (int n) { 2 long factorial = 1; 1 1 3 int i = 1; 1 1 4 while ( i ≤ n ) { 4 n 5 factorial = factorial * i; 4 n 6 i = i + 1; 3 n 7 } 8 return factorial 1 1 9 }
  • 43. 1 public long factorial (int n) { 2 long factorial = 1; 1 1 3 int i = 1; 1 1 4 while ( i ≤ n ) { 4 n 5 factorial = factorial * i; 4 n 6 i = i + 1; 3 n 7 } 8 return factorial 1 1 9 } f(n) = 1+1+4*n+4*n+3*n+1 = 11*n+3
  • 44. Big O Notation f: N -> N g: N -> N f ∈ O(g) ∃ c, n0 : (c,n0∈N) ∧ (c>0) : (∀n : n∈N ∧ n>n0 : f(n) ≤ c*g(n))
  • 45. O(1) ∈ O(log n) ∈ O(n) ∈ O(n2) ∈ O(nk) ∈ O(2n) !"#$%$&'()("'*$+ ,'-.$/'-- O(1) Constant O(log n) Logarithmic O(n) Linear O(n2) Quadratic O(nk) Polynomial O(kn) Exponential
  • 46. Best case estimation f: N -> N g: N -> N f ∈ Ω(g) ∃ c, n0 : (c,n0∈N) ∧ (c>0) : (∀n : n∈N ∧ n>n0 : f(n) ≥ c*g(n))
  • 47. Average case estimation f: N -> N g: N -> N f ∈ θ(g) ∃ c 1, c 2, n 0 : (c1,c2,n0∈N) ∧ (c1>0) ∧ (c2>0): (∀n : n∈N ∧ n≥n0 : c1*g(n) ≤ f(n) ≤ c2*g(n))
  • 48. solvable in O(nk) P ⊂ NP verifiable in O(nk)
  • 49. solvable in O(nk) P = NP ? verifiable in O(nk)
  • 50. NP-complete NP, and one cannot do better
  • 51. Boolean algebra Predicate logic 1, 0, ∧, ∨, ¬ ∃, ∀ Sets Relations U, ∅, ∈, ∪, ∩, , ⊆ AxB, aRb Trees Graphs node, edge, path, binary node, edge, cycle, path Complexity Program verification O(g), Ω(g), θ(g) {P} S {Q}, wp(S,Q) Models and languages Programming languages model, meta, syntax, semantics programming = modeling
  • 52. program S {P} {Q} precondition postcondition
  • 53. Weakest Precondition wp(S, Q) ∀ {P} S {Q} :: P wp(S,Q) Verification of {P} S {Q} 1. Compute wp(S, Q) 2. Prove P wp(S, Q)
  • 54. Assignment wp(x:=A, Q) = Qx←A Sequencing wp(S1; S2, Q) wp(S1, wp(S2, Q)) = Conditional wp(if (B) then S1 else S2, Q) = (B wp(S1, Q)) ∧ (¬B wp(S2, Q))
  • 55. While loop L = while (B) do S end wp(L,Q) I ∧ = ∀y, ((B ∧ I) wp(S, I ∧ x < y)) ∀y, ((¬B ∧ I) Q) Loop verification I = property which stays true before and after every loop 0. P I; 1. I∧B wp(s, I); 2. I∧¬B Q.
  • 56. Boolean algebra Predicate logic 1, 0, ∧, ∨, ¬ ∃, ∀ Sets Relations U, ∅, ∈, ∪, ∩, , ⊆ AxB, aRb Trees Graphs node, edge, path, binary node, edge, cycle, path Complexity Program verification O(g), Ω(g), θ(g) {P} S {Q}, wp(S,Q) Models and languages Programming languages model, meta, syntax, semantics programming = modeling
  • 57.
  • 58. meta-meta-model instanceOf meta-model instanceOf model representedBy subject
  • 59. A language is a set of sequences of symbols that we interpret to attribute meaning.
  • 60. - digit . digit part = {digit} x Nonter decimal_part “.” part = "x" mi Termin nal number = [-] part [decimal_part] x y al Sequen x|y ce Alterna { x } tiv Iteratio e ( x ) n Binding [ x ] Option y = x. Definiti on
  • 61. Please, stand up by sitting down! Syntactically correct sentences do not necessarily have a meaning
  • 62. Boolean algebra Predicate logic 1, 0, ∧, ∨, ¬ ∃, ∀ Sets Relations U, ∅, ∈, ∪, ∩, , ⊆ AxB, aRb Trees Graphs node, edge, path, binary node, edge, cycle, path Complexity Program verification O(g), Ω(g), θ(g) {P} S {Q}, wp(S,Q) Models and languages Programming languages model, meta, syntax, semantics programming = modeling
  • 63. A programming language is a a language for communicating software designs.
  • 65. Imperative Functional data + algorithms stateless + pure functions Object-oriented Logic objects + messages facts + rules
  • 66. comments functions # Compute factorials variables def fact(n) if n == 0 literals 1 else control n * fact(n-1) expression constructs end end statements puts fact(ARGV[0].to_i)
  • 67.
  • 69. Boolean algebra Predicate logic 1, 0, ∧, ∨, ¬ ∃, ∀ Sets Relations U, ∅, ∈, ∪, ∩, , ⊆ AxB, aRb Trees Graphs node, edge, path, binary node, edge, cycle, path Complexity Program verification O(g), Ω(g), θ(g) {P} S {Q}, wp(S,Q) Models and languages Programming languages model, meta, syntax, semantics programming = modeling
  • 70.
  • 71. computation information information computer
  • 72. computational thinking computation information information computer
  • 73.
  • 75. Class aClass = Class.forName(“java.lang.Object”); Method m[] aClass.getDeclaredMethods();
  • 76. Class aClass = Class.forName(“java.lang.Object”); Method m[] aClass.getDeclaredMethods(); protected void java.lang.Object.finalize() throws java.lang.Throwable public final void java.lang.Object.wait() throws java.lang.InterruptedException public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException public boolean java.lang.Object.equals(java.lang.Object) public java.lang.String java.lang.Object.toString() public native int java.lang.Object.hashCode() public final native java.lang.Class java.lang.Object.getClass() protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException private static native void java.lang.Object.registerNatives() public final native void java.lang.Object.notify() public final native void java.lang.Object.notifyAll()
  • 77. computational thinking computation information information computer
  • 78. Tudor Gîrba www.tudorgirba.com creativecommons.org/licenses/by/3.0/