Let's say I have a segment of pipe of length $X$ that I want to test the integrity of by way of a hydrostatic pressure test. That is, I isolate the ends of the pipe and pump water into it until it a very high pressure is attained and hold that pressure on the line for an amount of time. If the pipe does not burst, leak, etc. during the test, then I say the pipe passed. Else the pipe failed. Let $Y$ = {pass, fail} = {1, 0}. Thus $Y$ is a discrete, binary, random variable.
However I don't want to test the whole line. I only want to test a sample interval of the line. Let $Z$ = the length of the interval sampled, $Z < X$.
Assuming the sample interval of pipe passes the hydrostatic pressure test, how large must $Z$ be so that I can assume the entire line of length $X$ would pass a hydrostatic pressure test with 95% confidence? Do I need to give a confidence interval? If so, let's say +/-5%.
Assume the probability of failure is uniform along the entire length, $X$. Also, by 95% confidence, I mean my confidence level is 95%. My degree of belief is 95%. And by +/-5% confidence interval, I mean the margin of error is +/-5%. Please forgive me if I am using these terms incorrectly. Please feel free to educate me. Thanks for your help.