# Mathematical Logic and venn diagrams

Okay so I'm pretty confused about how to sketch a venn diagram for this operator: ifte(a,b,c) (or this can be written a?b:c)

given a, b, c truth table and a?b:c

$$\begin{array}{c|c|c||c} a & b & c & a?b:c\\ \hline F & F & F & F\\ \hline F & F & T & T\\ \hline F & T & F & F\\ \hline F & T & T & T\\ \hline T & F & F & F\\ \hline T & F & T & F\\ \hline T & T & F & T\\ \hline T & T & T & T \end{array}$$

I hope this truth table is clear enough. Okay so I'm asked to draw a venn diagram for this. So I can see that if 'a' is true 'b' is true but 'b' can be true while 'c' is true without 'a' being true and 'c' can be true by itself. But what does this mean for a venn diagram? :/

ifte is "if-then-else"

-
I've added a picture explaining what's going on here. Hope it helps. –  Rick Decker Oct 24 '12 at 16:09

## 2 Answers

A Venn diagram with three sets $A,B,C$ divides the universe into 8 distinct regions, as you can see in the picture below.

For example, the $A$ circle contains 4 regions: the upper region with an arrow pointing to it represents $A=true, B=false,\text{ and }C=false$, since that region is contained in $A$ but not in $B\text{ or }C$ For your function, the truth table already identifies the truth values of the points in each of the 8 regions. For each of these, place a marker in those regions where your truth table says the function evaluates to $true$, as I did in the other region pointed to by an arrow. Your function is $true$ in four cases; I've put a dot in each. (Your conventions for marking regions might differ from mine: you might want to shade them rather than placing a dot.)

-
That is awesome! Thanks! Missed it in my assignment but will surely help with the exam! :) –  Fred Dec 1 '12 at 0:06

A venn diagram is not usefull in this case because a?b:c is a short notation for if-the-else in algorithm programming and the truth value only depend of a, regardless if b or c are true or not because b and c represent operations and no conditionals, if a is true then the algorithm choose b and if a is false the algorithm choose c.

-
But I've been asked to sketch a venn diagram for the operator? For now I have the venn diagram for a implies b but I'm not sure if this covers the whole operator. It's a confusing question. –  Fred Oct 23 '12 at 23:20
Also I'm not doing programming. This is just a question from a course in mathematical logic. But I understand what you are saying. –  Fred Oct 23 '12 at 23:21