CPSC 322, Lecture 30Slide 1 Reasoning Under Uncertainty: Variable elimination Computer Science cpsc322, Lecture 30 (Textbook Chpt 6.4) March, 23, 2009.

Slides:



Advertisements
Similar presentations
Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Advertisements

Decision Theory: Sequential Decisions Computer Science cpsc322, Lecture 34 (Textbook Chpt 9.3) Nov, 28, 2012.
Department of Computer Science Undergraduate Events More
CPSC 322, Lecture 2Slide 1 Representational Dimensions Computer Science cpsc322, Lecture 2 (Textbook Chpt1) Sept, 6, 2013.
Decision Making Under Uncertainty Jim Little Decision 1 Nov
CPSC 502, Lecture 11Slide 1 Introduction to Artificial Intelligence (AI) Computer Science cpsc502, Lecture 11 Oct, 18, 2011.
CPSC 322, Lecture 26Slide 1 Reasoning Under Uncertainty: Belief Networks Computer Science cpsc322, Lecture 27 (Textbook Chpt 6.3) March, 16, 2009.
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
CPSC 322, Lecture 19Slide 1 Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt ) February, 23, 2009.
Decision Theory: Single Stage Decisions Computer Science cpsc322, Lecture 33 (Textbook Chpt 9.2) March, 30, 2009.
CPSC 322, Lecture 37Slide 1 Finish Markov Decision Processes Last Class Computer Science cpsc322, Lecture 37 (Textbook Chpt 9.5) April, 8, 2009.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) January, 12, 2009.
CPSC 322, Lecture 18Slide 1 Planning: Heuristics and CSP Planning Computer Science cpsc322, Lecture 18 (Textbook Chpt 8) February, 12, 2010.
CPSC 322, Lecture 10Slide 1 Finish Search Computer Science cpsc322, Lecture 10 (Textbook Chpt 3.6) January, 25, 2010.
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
CPSC 322, Lecture 17Slide 1 Planning: Representation and Forward Search Computer Science cpsc322, Lecture 17 (Textbook Chpt 8.1 (Skip )- 8.2) February,
CPSC 322, Lecture 28Slide 1 Reasoning Under Uncertainty: More on BNets structure and construction Computer Science cpsc322, Lecture 28 (Textbook Chpt 6.3)
CPSC 322, Lecture 17Slide 1 Planning: Representation and Forward Search Computer Science cpsc322, Lecture 17 (Textbook Chpt 8.1 (Skip )- 8.2) February,
CPSC 322, Lecture 31Slide 1 Probability and Time: Markov Models Computer Science cpsc322, Lecture 31 (Textbook Chpt 6.5) March, 25, 2009.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) March, 8, 2010.
CPSC 322, Lecture 32Slide 1 Probability and Time: Hidden Markov Models (HMMs) Computer Science cpsc322, Lecture 32 (Textbook Chpt 6.5) March, 27, 2009.
CPSC 422, Lecture 18Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 18 Feb, 25, 2015 Slide Sources Raymond J. Mooney University of.
CPSC 322, Lecture 29Slide 1 Reasoning Under Uncertainty: Bnet Inference (Variable elimination) Computer Science cpsc322, Lecture 29 (Textbook Chpt 6.4)
CPSC 322, Lecture 35Slide 1 Value of Information and Control Computer Science cpsc322, Lecture 35 (Textbook Chpt 9.4) April, 14, 2010.
CPSC 322, Lecture 24Slide 1 Reasoning under Uncertainty: Intro to Probability Computer Science cpsc322, Lecture 24 (Textbook Chpt 6.1, 6.1.1) March, 15,
CPSC 322, Lecture 24Slide 1 Finish Logics… Reasoning under Uncertainty: Intro to Probability Computer Science cpsc322, Lecture 24 (Textbook Chpt 6.1, 6.1.1)
Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Jim Little UBC CS 322 – CSP October 22, 2014.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) Oct, 26, 2010.
Department of Computer Science Undergraduate Events More
CPSC 322, Lecture 32Slide 1 Probability and Time: Hidden Markov Models (HMMs) Computer Science cpsc322, Lecture 32 (Textbook Chpt 6.5.2) Nov, 25, 2013.
Reasoning Under Uncertainty: Conditioning, Bayes Rule & the Chain Rule Jim Little Uncertainty 2 Nov 3, 2014 Textbook §6.1.3.
Lecture 33, Bayesian Networks Wrap Up Intro to Decision Theory Slide 1.
CPSC 422, Lecture 11Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11 Oct, 2, 2015.
Computer Science CPSC 502 Lecture 9 (up-to Ch )
CPSC 322, Lecture 19Slide 1 (finish Planning) Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt – 5.2) Oct,
Arc Consistency CPSC 322 – CSP 3 Textbook § 4.5 February 2, 2011.
CPSC 422, Lecture 17Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 17 Oct, 19, 2015 Slide Sources D. Koller, Stanford CS - Probabilistic.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) Sept, 12, 2012.
Reasoning Under Uncertainty: Independence and Inference CPSC 322 – Uncertainty 5 Textbook §6.3.1 (and for HMMs) March 25, 2011.
CPSC 322, Lecture 2Slide 1 Representational Dimensions Computer Science cpsc322, Lecture 2 (Textbook Chpt1) Sept, 7, 2012.
Domain Splitting, Local Search CPSC 322 – CSP 4 Textbook §4.6, §4.8 February 4, 2011.
CPSC 322, Lecture 26Slide 1 Reasoning Under Uncertainty: Belief Networks Computer Science cpsc322, Lecture 27 (Textbook Chpt 6.3) Nov, 13, 2013.
Uncertainty: Wrap up & Decision Theory: Intro Alan Mackworth UBC CS 322 – Decision Theory 1 March 25, 2013 Textbook §6.4.1 & §9.2.
Reasoning Under Uncertainty: Variable Elimination for Bayes Nets Jim Little Uncertainty 6 Nov Textbook §6.4,
Reasoning Under Uncertainty: Variable Elimination CPSC 322 – Uncertainty 6 Textbook §6.4.1 March 28, 2011.
Lecture 21, Bayesian Networks Wrap Up Intro to Decision Theory Slide 1.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) Oct, 30, 2013.
Probability and Time: Hidden Markov Models (HMMs)
Reasoning Under Uncertainty: Belief Networks
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Reasoning Under Uncertainty: Conditioning, Bayes Rule & Chain Rule
& Decision Theory: Intro
Decision Theory: Single Stage Decisions
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11
Probability and Time: Markov Models
Reasoning Under Uncertainty: Bnet Inference
Probability and Time: Markov Models
Planning: Heuristics and CSP Planning
Decision Theory: Sequential Decisions
Reasoning Under Uncertainty: Bnet Inference
Decision Theory: Single Stage Decisions
Probability and Time: Markov Models
Reasoning Under Uncertainty: Bnet Inference
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11
Logic: Domain Modeling /Proofs + Computer Science cpsc322, Lecture 22
Probability and Time: Markov Models
Reasoning Under Uncertainty: Variable elimination
Presentation transcript:

CPSC 322, Lecture 30Slide 1 Reasoning Under Uncertainty: Variable elimination Computer Science cpsc322, Lecture 30 (Textbook Chpt 6.4) March, 23, 2009

CPSC 322, Lecture 30Slide 2 Lecture Overview Recap Intro Variable Elimination Variable Elimination Simplifications Example Independence Where are we?

CPSC 322, Lecture 29Slide 3 Bnet Inference: General Suppose the variables of the belief network are X 1,…,X n. Z is the query variable Y 1 =v 1, …, Y j =v j are the observed variables (with their values) Z 1, …,Z k are the remaining variables What we want to compute: We can actually compute:

CPSC 322, Lecture 29Slide 4 Inference with Factors We can compute P(Z, Y 1 =v 1, …,Y j =v j ) by expressing the joint as a factor, f (Z, Y 1 …,Y j, Z 1 …,Z j ) assigning Y 1 =v 1, …, Y j =v j and summing out the variables Z 1, …,Z k

CPSC 322, Lecture 29Slide 5 Variable Elimination Intro (1) We can express the joint factor as a product of factors Using the chain rule and the definition of a Bnet, we can write P(X 1, …, X n ) as f(Z, Y 1 …,Y j, Z 1 …,Z j )

CPSC 322, Lecture 29Slide 6 Variable Elimination Intro (2) 1.Construct a factor for each conditional probability. 2.In each factor assign the observed variables to their observed values. 3.Multiply the factors 4.For each of the other variables Z i ∈ {Z 1, …, Z k }, sum out Z i Inference in belief networks thus reduces to computing “the sums of products….”

CPSC 322, Lecture 30Slide 7 Lecture Overview Recap Intro Variable Elimination Variable Elimination Simplifications Example Independence Where are we?

CPSC 322, Lecture 30Slide 8 How to simplify the Computation? Assume we have turned the CPTs into factors and performed the assignments Let’s focus on the basic case, for instance…

CPSC 322, Lecture 30Slide 9 How to simplify: basic case Let’s focus on the basic case. How can we compute efficiently? Factor out those terms that don't involve Z 1 !

CPSC 322, Lecture 30Slide 10 General case: Summing out variables efficiently Now to sum out a variable Z 2 from a product f 1 ×… ×f i × f’ of factors, again partition the factors into two sets F: those that

CPSC 322, Lecture 30Slide 11 Analogy with “Computing sums of products” This simplification is similar to what you can do in basic algebra with multiplication and addition It takes 14 multiplications or additions to evaluate the expression a b + a c + a d + a e h + a f h + a g h. This expression be evaluated more efficiently….

CPSC 322, Lecture 30Slide 12 Variable elimination ordering P(G,D=t) =  A,B,C, f(A,G) f(B,A) f(C,G) f(B,C) P(G,D=t) =  A f(A,G)  B f(B,A)  C f(C,G) f(B,C) P(G,D=t) =  A f(A,G)  C f(C,G)  B f(B,C) f(B,A) Is there only one way to simplify?

CPSC 322, Lecture 30Slide 13 Variable elimination algorithm: Summary To compute P(Z| Y 1 =v 1,…,Y j =v j ) : 1.Construct a factor for each conditional probability. 2.Set the observed variables to their observed values. 3.Given an elimination ordering, simplify/decompose sum of products 4.Perform products and sum out Z i 5.Multiply the remaining factors (all in ? ) 6.Normalize: divide the resulting factor f(Z) by  Z f(Z). P(Z, Y 1 …,Y j, Z 1 …,Z j )

CPSC 322, Lecture 30Slide 14 Lecture Overview Recap Intro Variable Elimination Variable Elimination Simplifications Example Independence Where are we?

CPSC 322, Lecture 30Slide 15 Variable elimination example Compute P(G | H=h 1 ). P(G,H) =  A,B,C,D,E,F,I P(A,B,C,D,E,F,G,H,I)

CPSC 322, Lecture 30Slide 16 Variable elimination example Compute P(G | H=h 1 ). P(G,H) =  A,B,C,D,E,F,I P(A,B,C,D,E,F,G,H,I) Chain Rule + Conditional Independence: P(G,H) =  A,B,C,D,E,F,I P(A)P(B|A)P(C)P(D|B,C)P(E|C)P(F|D)P(G|F,E)P(H|G)P(I|G)

CPSC 322, Lecture 30Slide 17 Variable elimination example (step1) Compute P(G | H=h 1 ). P(G,H) =  A,B,C,D,E,F,I P(A)P(B|A)P(C)P(D|B,C)P(E|C)P(F|D)P(G|F,E)P(H|G)P(I|G) Factorized Representation: P(G,H) =  A,B,C,D,E,F,I f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 7 (H,G) f 8 (I,G) f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 7 (H,G) f 8 (I,G)

CPSC 322, Lecture 30Slide 18 Variable elimination example (step 2) Compute P(G | H=h 1 ). Previous state: P(G,H) =  A,B,C,D,E,F,I f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 7 (H,G) f 8 (I,G) Observe H : P(G,H=h 1 ) =  A,B,C,D,E,F,I f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 9 (G) f 8 (I,G) f 9 (G) f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 7 (H,G) f 8 (I,G)

CPSC 322, Lecture 30Slide 19 Variable elimination example (steps 3-4) Compute P(G | H=h 1 ). Previous state: P(G,H) =  A,B,C,D,E,F,I f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 9 (G) f 8 (I,G) Elimination ordering A, C, E, I, B, D, F : P(G,H=h 1 ) = f 9 (G)  F  D f 5 (F, D)  B  I f 8 (I,G)  E f 6 (G,F,E)  C f 2 (C) f 3 (D,B,C) f 4 (E,C)  A f 0 (A) f 1 (B,A) f 9 (G) f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 7 (H,G) f 8 (I,G)

CPSC 322, Lecture 30Slide 20 Variable elimination example(steps 3-4) Compute P(G | H=h 1 ). Elimination ordering A, C, E, I, B, D, F. Previous state: P(G,H=h 1 ) = f 9 (G)  F  D f 5 (F, D)  B  I f 8 (I,G)  E f 6 (G,F,E)  C f 2 (C) f 3 (D,B,C) f 4 (E,C)  A f 0 (A) f 1 (B,A) Eliminate A: P(G,H=h 1 ) = f 9 (G)  F  D f 5 (F, D)  B f 10 (B)  I f 8 (I,G)  E f 6 (G,F,E)  C f 2 (C) f 3 (D,B,C) f 4 (E,C) f 9 (G) f 10 (B) f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 7 (H,G) f 8 (I,G)

CPSC 322, Lecture 30Slide 21 Variable elimination example(steps 3-4) Compute P(G | H=h 1 ). Elimination ordering A, C, E, I, B, D, F. Previous state: P(G,H=h 1 ) = f 9 (G)  F  D f 5 (F, D)  B f 10 (B)  I f 8 (I,G)  E f 6 (G,F,E)  C f 2 (C) f 3 (D,B,C) f 4 (E,C) Eliminate C: P(G,H=h 1 ) = f 9 (G)  F  D f 5 (F, D)  B f 10 (B)  I f 8 (I,G)  E f 6 (G,F,E) f 12 (B,D,E) f 9 (G) f 10 (B) f 12 (B,D,E) f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 7 (H,G) f 8 (I,G)

CPSC 322, Lecture 30Slide 22 Variable elimination example(steps 3-4) Compute P(G | H=h 1 ). Elimination ordering A, C, E, I, B, D, F. Previous state: P(G,H=h 1 ) = f 9 (G)  F  D f 5 (F, D)  B f 10 (B)  I f 8 (I,G)  E f 6 (G,F,E) f 12 (B,D,E) Eliminate E: P(G,H=h 1 ) =f 9 (G)  F  D f 5 (F, D)  B f 10 (B) f 13 (B,D,F,G)  I f 8 (I,G) f 9 (G) f 10 (B) f 12 (B,D,E) f 13 (B,D,F,G) f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 7 (H,G) f 8 (I,G)

CPSC 322, Lecture 30Slide 23 Variable elimination example(steps 3-4) Compute P(G | H=h 1 ). Elimination ordering A, C, E, I, B, D, F. Previous state: P(G,H=h 1 ) = f 9 (G)  F  D f 5 (F, D)  B f 10 (B) f 13 (B,D,F,G)  I f 8 (I,G) Eliminate I: P(G,H=h 1 ) =f 9 (G) f 14 (G)  F  D f 5 (F, D)  B f 10 (B) f 13 (B,D,F,G) f 9 (G) f 10 (B) f 12 (B,D,E) f 13 (B,D,F,G) f 14 (G) f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 7 (H,G) f 8 (I,G)

CPSC 322, Lecture 30Slide 24 Variable elimination example(steps 3-4) Compute P(G | H=h 1 ). Elimination ordering A, C, E, I, B, D, F. Previous state: P(G,H=h 1 ) = f 9 (G) f 14 (G)  F  D f 5 (F, D)  B f 10 (B) f 13 (B,D,F,G) Eliminate B: P(G,H=h 1 ) = f 9 (G) f 14 (G)  F  D f 5 (F, D) f 15 (D,F,G) f 9 (G) f 10 (B) f 12 (B,D,E) f 13 (B,D,F,G) f 14 (G) f 15 (D,F,G) f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 7 (H,G) f 8 (I,G)

CPSC 322, Lecture 30Slide 25 Variable elimination example(steps 3-4) Compute P(G | H=h 1 ). Elimination ordering A, C, E, I, B, D, F. Previous state: P(G,H=h 1 ) = f 9 (G) f 14 (G)  F  D f 5 (F, D) f 15 (D,F,G) Eliminate D: P(G,H=h 1 ) =f 9 (G) f 14 (G)  F f 16 (F, G) f 9 (G) f 10 (B) f 12 (B,D,E) f 13 (B,D,F,G) f 14 (G) f 15 (D,F,G) f 16 (F, G) f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 7 (H,G) f 8 (I,G)

CPSC 322, Lecture 30Slide 26 Variable elimination example(steps 3-4) Compute P(G | H=h 1 ). Elimination ordering A, C, E, I, B, D, F. Previous state: P(G,H=h 1 ) = f 9 (G) f 14 (G)  F f 16 (F, G) Eliminate F: P(G,H=h 1 ) = f 9 (G) f 14 (G) f 17 (G) f 9 (G) f 10 (B) f 12 (B,D,E) f 13 (B,D,F,G) f 14 (G) f 15 (D,F,G) f 16 (F, G) f 17 (G) f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 7 (H,G) f 8 (I,G)

CPSC 322, Lecture 30Slide 27 Variable elimination example (step 5) Compute P(G | H=h 1 ). Elimination ordering A, C, E, I, B, D, F. Previous state: P(G,H=h 1 ) = f 9 (G) f 14 (G) f 17 (G ) Multiply remaining factors: P(G,H=h 1 ) = f 18 (G ) f 9 (G) f 10 (B) f 12 (B,D,E) f 13 (B,D,F,G) f 14 (G) f 15 (D,F,G) f 16 (F, G ) f 17 (G ) f 18 (G ) f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 7 (H,G) f 8 (I,G)

CPSC 322, Lecture 30Slide 28 Variable elimination example (step 6) Compute P(G | H=h 1 ). Elimination ordering A, C, E, I, B, D, F. Previous state: P(G,H=h 1 ) = f 18 (G) Normalize: P(G | H=h 1 ) = f 18 (G) /  g ∈ dom(G) f 18 (G) f 9 (G) f 10 (B) f 12 (B,D,E) f 13 (B,D,F,G) f 14 (G) f 15 (D,F,G) f 16 (F, G ) f 17 (G ) f 18 (G ) f 0 (A) f 1 (B,A) f 2 (C) f 3 (D,B,C) f 4 (E,C) f 5 (F, D) f 6 (G,F,E) f 7 (H,G) f 8 (I,G)

CPSC 322, Lecture 30Slide 29 Lecture Overview Recap Intro Variable Elimination Variable Elimination Simplifications Example Independence Where are we?

CPSC 322, Lecture 30Slide 30 Variable elimination and conditional independence Variable Elimination looks incredibly painful for large graphs? We used conditional independence….. Can we use it to make variable elimination simpler? Yes, all the variables from which the query is conditional independent given the observations can be pruned from the Bnet

CPSC 322, Lecture 30Slide 31 VE and conditional independence: Example All the variables from which the query is conditional independent given the observations can be pruned from the Bnet e.g., P(G | H=v 1, F= v 2, C=v 3 ).

CPSC 322, Lecture 4Slide 32 Learning Goals for today’s class You can: Carry out variable elimination by using factor representation and using the factor operations. Use techniques to simplify variable elimination.

CPSC 322, Lecture 2Slide 33 Big Picture: R&R systems Environment Problem Query Planning Deterministic Stochastic Search Arc Consistency Search Value Iteration Var. Elimination Constraint Satisfaction Logics STRIPS Belief Nets Vars + Constraints Decision Nets Markov Processes Var. Elimination Static Sequential Representation Reasoning Technique SLS

CPSC 322, Lecture 18Slide 34 Answering Query under Uncertainty Static Belief Network & Variable Elimination Dynamic Bayesian Network Probability Theory Hidden Markov Models spam filters Diagnostic Systems (e.g., medicine) Natural Language Processing Student Tracing in tutoring Systems Monitoring (e.g credit cards) BioInformatics

CPSC 322, Lecture 29Slide 35 Next Class Probability and Time (TextBook 6.5) Two Practice Exercises on Bnet available. Assignment 4 will be available on Wednesday and due on Apr the 8 th (last class). Course Elements