 So in this example, we have already observed some binomial data. We've observed why successes in n trials. We want to get the predictive distribution for new data that we're denoting y new, and that will be how many successes in a possible m trials that may or may not be the same as n. We're not constraining it. We have previously used a conjugate beta prior, so that this would be the prior distribution is used, and note that this BAB is the beta function, and it's a gamma function, so gamma of A times gamma B over a gamma of A plus B. So the resulting posterior distribution, the derivation of which is in other videos on this channel is is, so g of tau given y, n, a, and b is a beta, a plus y, b plus n minus y distribution. So that's equal to tau to the a plus y minus 1, 1 minus tau to the b plus n minus y minus 1 over the beta function of a plus y b plus n minus y. So that's our posterior distribution. We of course have our usual types of constraints, the tau is between 0 and 1, that a plus y has to be greater than 0, b plus n minus y also has to be greater than 0, and y has to be less than or equal to n. So our new observation, our predictive density for our new observation, f of y, new, given our previously observed number of successes, our previously observed number of trials, and the number of trials we want to deal with here, is the integral from 0 to 1, because that's a relevant range of tau. And then this y comes from a binomial distribution, so we'll use m, choose y, new, tau to the y, new, 1 minus tau to the m minus y, new, and all this times our posterior distribution, tau to the a plus y minus 1, 1 minus tau to the b plus n minus y minus 1, detail, and this is all over a constant with respect to tau at least, which is the beta function as given here. So I could start by bringing out what doesn't depend on tau outside the integral, so that's equal to m, choose y, new, 1 over the beta function here, and the integral of tau, and I group all my terms in terms of tau, a plus y plus y, new minus 1, 1 minus tau to the b plus n minus y plus m minus y, new minus 1, detail. I note that this is the same functional form of tau to the something minus 1, 1 minus tau to the something else, minus 1, as a beta distribution. I recall that the integral from 0 to 1 of tau to the a minus 1, 1 minus tau to the b minus 1 over the beta function of a, b integrated with respect to tau is equal to 1, so the integral from 0 to 1 of tau to the a minus 1, 1 minus tau to the b minus 1, detail is equal to the beta function of a, b, and hence I can just replace the appropriate terms here to get that this f, y, new given y, n, and m is equal to m, choose y, new, and then my numerator is going to be my beta function of the term in here, a plus y plus y, new, and the second term is going to be b plus n minus y plus m minus y, new over the b, the simpler beta function here, a plus y, b plus n minus y, and that's actually the answer. This is what's known as a beta binomial distribution, also known as a polyad distribution, and if a and b are both integers so that a plus y and b plus n minus y are integers, this is the negative hyper geometric distribution.