There are Y tests in total and you can either pass or fail

I have data on all of the X students but so far not every student has taken every test - some have taken all Y, some have taken y-1, some y-2, etc. down to 1.

I want to know how I’d calculate

1.) the probability that a future student passes all Y tests

2.) the expected total number of fails for a future student

To work it out I thought about just treating each exam as an independent event and using a flat probability of passing each exam (total passes / total attempts) for any student. However, that doesn’t capture the fact that some students are better than others / 1 fail increases likelihood of another (which is what the data shows)