Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
511 views
in Composition and Decomposition by (49.1k points)
closed by

Write a note on case analysis.

1 Answer

+1 vote
by (54.8k points)
selected by
 
Best answer

Alternative statement analyses the problem into two cases. Case analysis statement generalizes it to multiple cases. Case analysis splits the problem into an exhaustive set of disjoint cases. For each case, the problem is solved independently. If Cl, C2, and C3 are conditions, and S1, S2, S3 and S4 are statements, a 4 – case analysis statement has the form,

1. case C1 

2. S1 

3. case C2 

4. S2 

5. case C3 

6. S3 

7. else 

8. S4

The conditions C1, C2, and C3 are evaluated in turn. For the first condition that evaluates to true, the corresponding sttement is executed, and the case analysis statement ends. If none of the conditions evaluates to true, then the default case S4 is executed.

1. The cases are exhaustive: at least one of the cases is true. If all conditions are false, the default case is true.

2. The cases are disjoint: only one of the cases is true. Though it is possible for more than one condition to be true, the case analysis always executes only one case, the first one that is true. If the three conditions are disjoint, then the four cases are (1) C1, (2) C2, (3) C3, (4) (not C1) and (not C2) and (not C3).

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

...