Presentation is loading. Please wait.

Presentation is loading. Please wait.

Inclusion-Exclusion Principle. 3 sets A,B,C A B C |A ˘ B ˘ C| = |A| + |B| + |C| -|A*B|-|A*C|-|B*C| +|A*B*C| *: intersection A*B A*C B*C |A ˘ B ˘ C| =

Similar presentations


Presentation on theme: "Inclusion-Exclusion Principle. 3 sets A,B,C A B C |A ˘ B ˘ C| = |A| + |B| + |C| -|A*B|-|A*C|-|B*C| +|A*B*C| *: intersection A*B A*C B*C |A ˘ B ˘ C| ="— Presentation transcript:

1 Inclusion-Exclusion Principle

2 3 sets A,B,C A B C |A ˘ B ˘ C| = |A| + |B| + |C| -|A*B|-|A*C|-|B*C| +|A*B*C| *: intersection A*B A*C B*C |A ˘ B ˘ C| = +3 |A| + |B| + |C| -3 -|A*B|-|A*C|-|B*C| +1 +|A*B*C| -- 1 |A ˘ B ˘ C| = +2 |A| + |B| + |C| -1 -|A*B|-|A*C|-|B*C| +|A*B*C| -- 1

3 Your Programming Assignments Input f in F satisfying precondition Output g in G satisfying postcondition Claims about your program p: F -> G: – Correctness – Resource consumption Time: 100. Space: <= 10 Energy – Quality of G: 0.6

4 Programming Assignments Further claims about your program p: F -> G: – Well designed Follows well accepted design guidelines

5 Evaluating Programming Assignments Run them on a benchmark provided by the teaching assistant / professor. Run them on all test cases provided by other students. Reward students whose test cases find bugs in programs of other students. Good idea! Increases interaction. What about checking resource consumption and quality claims? Require that they are stated explicitly as part of the submission.

6 Hypotheses I claim that my program p:F->G is correct for all inputs satisfying the precondition and it operates with resource consumption R and achieves quality Q. I claim that my sorting program is correct for all inputs of size n < 10^6 and it makes at most n*log(log(n)) comparisons.


Download ppt "Inclusion-Exclusion Principle. 3 sets A,B,C A B C |A ˘ B ˘ C| = |A| + |B| + |C| -|A*B|-|A*C|-|B*C| +|A*B*C| *: intersection A*B A*C B*C |A ˘ B ˘ C| ="

Similar presentations


Ads by Google