Simple model question

The model is capturing the true values of the process, so it seems like there is something right with the model rather than wrong!

If I understand correctly, you want do update the prior step by step, with one piece of data at a time, and plot how the posterior evolves as the data comes in? Since it’s just a simple binomial process, you could start with a Beta(0.5, 0.5) distribution (uniform over 0,1) and use the fact that beta and binomial are conjugate to get closed form solutions for the updates. The Wikipedia article on conjugate priors spells out how to do it for exactly this example.

But you don’t estimate N in this setting, because you are sitting there watching the coin flip and trying to judge the probability of heads, so you know N. In your setting, you have some one batch of fixed data and you don’t know N or p, so there’s no iterative process to go through to get from the prior to the posterior.