I need help with this Bayesian inference problem: Basketball team players are shooting balls in a game with the statistics of X = {(ki, ni)}. ki is the number of successful shots out of ni shots for each player. ki|ni,pi ~ Bin(ni,pi). The probabilities for score pi follows the connection pi ~ beta(a,b) (a,b are given).

Let's say I have calculated all pi expected value for all (ki,ni) using MCMC algorithm. I want to calculate the expectation of success in the next shot in the game which could come from any of the players. How do I calculate the conditional expectation value E[y|X] (y is a Bernoulli term)?