Canalizing functions have important applications in physics and biology. For
example, they represent a mechanism capable of stabilizing chaotic behavior in
Boolean network models of discrete dynamical systems. When comparing the class
of canalizing functions to other classes of functions with respect to their
evolutionary plausibility as emergent control rules in genetic regulatory
systems, it is informative to know the number of canalizing functions with a
given number of input variables. This is also important in the context of using
the class of canalizing functions as a constraint during the inference of
genetic networks from gene expression data. To this end, we derive an exact
formula for the number of canalizing Boolean functions of n variables. We also
derive a formula for the probability that a random Boolean function is
canalizing for any given bias p of taking the value 1. In addition, we consider
the number and probability of Boolean functions that are canalizing for exactly
k variables. Finally, we provide an algorithm for randomly generating
canalizing functions with a given bias p and any number of variables, which is
needed for Monte Carlo simulations of Boolean networks