Boolean Algebra (logic) - Diagrammatic Representations - Venn Diagrams

Venn Diagrams

A Venn diagram is a representation of a Boolean operation using shaded overlapping regions. There is one region for each variable, all circular in the examples here. The interior and exterior of region x corresponds respectively to the values 1 (true) and 0 (false) for variable x. The shading indicates the value of the operation for each combination of regions, with dark denoting 1 and light 0 (some authors use the opposite convention).

The three Venn diagrams in the figure below represent respectively conjunction xy, disjunction xy, and complement ¬x.

For conjunction, the region inside both circles is shaded to indicate that xy is 1 when both variables are 1. The other regions are left unshaded to indicate that xy is 0 for the other three combinations.

The second diagram represents disjunction xy by shading those regions that lie inside either or both circles. The third diagram represents complement ¬x by shading the region not inside the circle.

While we have not shown the Venn diagrams for the constants 0 and 1, they are trivial, being respectively a white box and a dark box, neither one containing a circle. However we could put a circle for x in those boxes, in which case each would denote a function of one argument, x, which returns the same value independently of x, called a constant function. As far as their outputs are concerned, constants and constant functions are indistinguishable; the difference is that a constant takes no arguments, called a zeroary or nullary operation, while a constant function takes one argument, which it ignores, and is a unary operation.

Venn diagrams are helpful in visualizing laws. The commutativity laws for ∧ and ∨ can be seen from the symmetry of the diagrams: a binary operation that was not commutative would not have a symmetric diagram because interchanging x and y would have the effect of reflecting the diagram horizontally and any failure of commutativity would then appear as a failure of symmetry.

Idempotence of ∧ and ∨ can be visualized by sliding the two circles together and noting that the shaded area then becomes the whole circle, for both ∧ and ∨.

To see the first absorption law, x∧(xy) = x, start with the diagram in the middle for xy and note that the portion of the shaded area in common with the x circle is the whole of the x circle. For the second absorption law, x∨(xy) = x, start with the left diagram for xy and note that shading the whole of the x circle results in just the x circle being shaded, since the previous shading was inside the x circle.

The double negation law can be seen by complementing the shading in the third diagram for ¬x, which shades the x circle.

To visualize the first De Morgan's law, (¬x)∧(¬y) = ¬(xy), start with the middle diagram for xy and complement its shading so that only the region outside both circles is shaded, which is what the right hand side of the law describes. The result is the same as if we shaded that region which is both outside the x circle and outside the y circle, i.e. the conjunction of their exteriors, which is what the left hand side of the law describes.

The second De Morgan's law, (¬x)∨(¬y) = ¬(xy), works the same way with the two diagrams interchanged.

The first complement law, x∧¬x = 0, says that the interior and exterior of the x circle have no overlap. The second complement law, x∨¬x = 1, says that everything is either inside or outside the x circle.

Read more about this topic:  Boolean Algebra (logic), Diagrammatic Representations

Famous quotes containing the word diagrams:

    Professors could silence me then; they had figures, diagrams, maps, books.... I was learning that books and diagrams can be evil things if they deaden the mind of man and make him blind or cynical before subjection of any kind.
    Agnes Smedley (1890–1950)