Your code is giving error because the variable 'probability' is a set. You need to use a list as a parameter to the hist() function. So, just type cast 'set' to 'list' and it will work.
>> import matplotlib.pyplot as plt
>>> probability = {0.3609, 0.4975, 0.3686, 0.3708, 0.3251, 0.4163, 0.4124, 0.3993, 0.4162, 0.34, 0.3941, 0.31308, 0.35575}
>>> plt.hist(list(probability))
(array([2., 1., 2., 2., 2., 3., 0., 0., 0., 1.]), array([0.31308 , 0.331522, 0.349964, 0.368406, 0.386848, 0.40529 ,
0.423732, 0.442174, 0.460616, 0.479058, 0.4975 ]), <a list of 10 Patch objects>)
>>> plt.show()