# How can I calculate this PDF

I'm trying to reproduce the results of a ray tracing paper which uses reinforcement learning. I asked my question in the computer graphics community of this site, but I think my problem can easily be solved by asking my question here.

I have an imaginary unit hemisphere around a given point. I'm trying to divide a hemisphere into equally-sized patches, for example n patches. The patches receive different amounts of light from light sources (which shows how much light is coming from different directions towards the point).

At first, each patch has the same value as each other. The values corresponding to each patch are updated. And every time I want to update them, I generate a discrete random variable which results from normalizing the values of each patch.

For example I have have 4 patches on hemisphere, and their values are 6, 4, 8, 2. After normalizing I have a weighting sequence of 0.3, 0.2, 0.4, 0.1 and I choose one of the patches randomly according to this values. And inside this chosen patch I consider a uniform random point.

After choosing this point I update the values of patches, for example if the patch with the value 6 is chosen and it's update and it's new value is 7 then I do the above iterations again.

For sampling by monte carlo method, the PDF of uniform hemisphere sampling is $$1/2\pi$$. What is the PDF of hemisphere sampling in this case?

In my example, What is the PDF of choosing points? I need a very detailed answer, including the proof. Thank you.

EDIT: It think it is $$1/2\pi$$. if it isn't, it means that I need to use the values of patches which are updated when I run the algorithm. These values are changing each time I choose a point on one of patches. Does using $$1/2\pi$$ result in an unbiased estimator?

EDIT 2: I explained it in the below link, which includes the algorithm. https://computergraphics.stackexchange.com/questions/9307/what-is-the-pdf-for-path-tracing-in-the-paper-learning-the-light-transport-the

EDIT 3: Sorry for my bad explanation but I made a mistake. The update is added to patch value using moving average two values.

• Do these 4 (or, generally, n) patches cover the entire hemisphere? – Itamar Mushkin Nov 6 '19 at 9:40
• Yes, they do. They all have the same size. – bitWise Nov 6 '19 at 10:11
• This is a Polya urn model. It is a stochastic process, not a fixed distribution on the hemisphere. A full answer would have to describe the evolution of the PDF from one step to another. Frankly, this is a strange model of illumination, because it proposes that as a patch grows brighter its chances of becoming even more brighter increase, as if bright areas somehow attracted rays. – whuber Nov 6 '19 at 14:01