Answer on Question #43230 – Math – Other
Both P and NP are closed under operation
a) union
b) intersection
c) concatenation
d) Kleene
Solution. Both sets are closed under all four operations. First we will show that is closed under all four operations.
Assume that . This means that there are nondeterministic deciders and such that decides in nondeterministic time and deciders in nondeterministic time .
Intersection:
"On input :
1. Run on . If rejected then reject.
2. Else run on . If rejected then reject.
3. Else accept."
The longest branch in any computation tree on input of length is . So is a poly-time nondeterministic decider for .
Union:
"On input :
1. Run on . If accepted then accept.
2. Else run on . If accepted then accept.
3. Else reject."
The longest branch in any computation tree on input of length is . So is a poly-time nondeterministic decider for .
Concatenation:
"On input :
1. Nondeterministically split into such that .
2. Run on . If rejected then reject.
3. Else run on . If rejected then reject.
4. Else accept."
The longest branch in any computation tree on input of length is . So is a poly-time nondeterministic decider for .
Kleene star:
"On input :
1. If then accept.
2. Nondeterministically select a number such that .
3. Nondeterministically split into pieces such that .
4. For all , : run on . If rejected then reject.
5. Else ( accepted all , ), accept."
The total running time is . This means that is a poly-time nondeterministic decider for .
The same construction can be used to prove that is closed under all four operations.
Answer: Both sets are closed under all four operations.
www.AssignmentExpert.com