POLYNOMIAL ENCODING OF DISCRETE PROBABILITY USING GROBNER BASES