Combinatorial and learning properties of threshold and related functions