Algebraic algorithms for sampling from conditional distributions | Synapse