Estimate bias of a coin Consider a coin with probability $p$ of landing on head.  You can estimate the prob by tossing it lots of times and looking at the proportion of heads one gets.  In my problem I just want to know if $p<0.01$ and tossing coins is very expensive so I  want to do as few as possible.
To do this I will toss the coin and stop as soon as either I get a head or I have tossed it $100$ times.  
How confident can I be that $p\geq 0.01$ if I stop because I get a head?
 A: Revised per OP comments
Your hypothesis test appears to be $H_0: p\leq 0.01$ vs. $H_a:p> 0.01$
There are two general outcomes:


*

*You run out the test without getting a head. I.e., you get M tails (T), for some $M=$ max number of trials.

*You get a head (H) on the $n^{th}$ toss $(X_n)$.


Under (1) $P(X_1=T,X_2=T...X_M=T|p> 0.01) \leq P(X_1=T,X_2=T...X_M=T|p=0.01) = 0.99^{M}$ Thus, you will not have much power to differentiate your hypotheses if you run out the test, but it is a result that is highly consistent with $p\leq 0.01$. Specifically, there is at least a $37\%$ chance of getting this result if $p\leq 0.01$, but at most a $37\%$ chance if $P>0.01$. Thus, you cannot reject $p\leq 0.01$, but the results are equivocal.
Under the more likely scenario (2), you will have stopped at some number $s\leq M$. We can bound the $p$-value as follows:
$p_s=\sum\limits_{i=1}^s P(X_1=T...X_{i-1}=T,X_i=H|p\leq0.01 ) \leq \sum\limits_{i=1}^s(0.99)^{i-1}(0.01)\equiv\gamma_s$, thus your level of confidence that $p>0.01$ will be at least $1-\gamma_s$ 
A: probability of tossing a head = p
Expected Number of trials = average number of trials till you get the first head
E = $p(1+2q+3q^2+4q^3+....)$
S = $(1+2q+3q^2+4q^3+....)$
qS = $q+2q^2+3q^3+....)$
S-qS = $1+q+q^2+q^3+\cdots$
S(1-q) = $\frac{1}{(1-q)}$
S = $\frac{1}{(1-q)^2}$
E =$\frac{p}{(1-q)^2}$
E = $\frac{1}{p}$
E = $\frac{1}{.01} = 100$
Expected number of trials you need to toss = $100$
Other way of looking at the problem is to find the minimum n
Probability that you will flip  a first head within n tosses = $p(1+q+q^2+q^3+....+ q^{n-1})$
$1-\alpha  = 1-q^{n}$
n = $\frac{log(\alpha)}{log(q)}$=$\frac{log(.38)}{log(.99)} = 97 times$
You can be $62\text{%} (1-\alpha)$ confident that if you flip the coin 97 times, the probability of the biased coin is going to be 0.01.
A: If $p=\frac1{100}$, you do not  stop because of head with $(1-p)^{100}\approx \frac1e$, so even with $p$ slightly below $0.01$, you may stop because of head most of the time.
A: Another method (@satish's) for computing the expected number of turns before a head.
Let $E(N)$ be the expected length of time $N$ for the first head to occur with probability p. Then I can write
$$
E(N) = p + (1-p)\left(1+E(N)\right),\tag{1}
$$
here I could get the head on the first go (the first term in Eq. (1)) or I could lose a turn getting a tails i.e. 1 in the second term, but then I start with the same expected number of heads i.e. E(N).
rearranging leads to
$$
pE(N) = 1\implies E(N) = \dfrac{1}{p}
$$
