Content deleted Content added
include Venn diagrams |
|||
Line 5:
The following is a Boolean function on the three variables ''x'', ''y'', ''z'':
{| style="text-align: center; border: 1px solid darkgray;"
: <math>f(x,y,z) = (x \wedge y) \vee (\urcorner x \wedge z) \, </math>▼
|-
|<math>~=~</math>
|<math>~(x \and y)~</math>
|<math>~\or~</math>
|<math>~(\neg x \and z)~</math>
|-
|[[File:Venn 0001 1011.svg|50px]]
|<math>~=~</math>
|[[File:Venn 0001 0001.svg|50px]]
|<math>~\or~</math>
|[[File:Venn 0000 1010.svg|50px]]
|}
(where <math>
This function is not evasive, because there is a decision tree that solves it by checking exactly two variables: The algorithm first checks the value of ''x''. If ''x'' is true, the algorithm checks the value of ''y'' and returns it.
:( <math>
If ''x'' is false, the algorithm checks the value of ''z'' and returns it.
Line 19 ⟶ 32:
Consider this simple "and" function on three variables:
{| style="text-align: center; border: 1px solid darkgray;"
▲: <math>f(x,y,z) = (x \wedge y \wedge z)</math>
|-
|<math>~f(x,y,z)~</math>
|-
|[[File:Venn 0000 0001.svg|50px]]
|
|}
A worst-case input (for every algorithm) is 1, 1, 1. In every order we choose to check the variables, we have to check all of them. (note that there could be a different worst-case input for every decision tree algorithm). Hence the functions: "and", "or" (on ''n'' variables) are evasive.
|