Quantcast Difficult set Text - Physics Forums Library

PDA

View Full Version : Difficult set


porums
Aug14-08, 11:18 PM
Set A={1,2,3} B={5,6,7}
an if clause is created,
if C1
___then
_______if C2 then
_________AUB
else
___AUB

Someone could please help me simplify the if-then-else in one if-then clause ? :LOL:
Thanks

CompuChip
Aug15-08, 03:13 AM
First, you'd have to tell us whether you mean
if C1 then {
if C2 then {
AUB
}
} else {
AUB
}

which is implied by your spacing, or
if C1 then {
if C2 then {
AUB
} else {
AUB
}
}

which is what any C++ like compiler would execute given your (pseudo)code.

It's really not too hard to see, but if you can't figure it out by looking at the expression, you might want to make a "truth table":

| C1 false | C1 false | ...
| C2 false | C2 true | ...
------------------------------------
do: | nothing | AUB | ...

and try to find a simpler expression involving C1 and C2 which gives the same result.