Stochastic pattern computing