Generate binomial matrix and column-normalize | Google SQL Question