Probability of disease given multiple samples of a single test Someone either has disease X or they are healthy.
A test is used which is 90% sensitive and 80% specific (81.81% precise).
The test is performed 8 times with different samples from the same person.
1) What is the rule to calculate the probability that someone has the disease given that 5 out of 8 tests came back positive? 
2) More generally: that N out of M samples were positive.
3) Is there a way of calculating the confidence?
Kind regards
 A: You need the disease prevalence in order to calculate this probability.
Let $T$ be the indicator variable with $T=1$ denoting the event of a positive test. Similarly let $D$ be the indicator of the disease. You have $P(T=1|D=1)=0.9$ and $P(T=0|D=0)=0.8$. Define $A$ to be the event of N positive result from M tests. Then
$$P(A|D=1)=\binom{M}{N}0.9^N 0.1^{M-N}$$
What you want is $P(D=1|A)$. Using Bayes' rule 
$$P(D=1|A)= \frac{P(A|D=1)P(D=1)}{P(A)}=\frac{P(A|D=1)P(D=1)}{P(A|D=1)P(D=1) +P(A|D=0)P(D=0)}$$
A: You can use the information to calculate the base rate fo the disease:
accuracy: $A$
sensitivity: $s^+$
specificity: $s^-$
base rate: $p$
positive test result: $T^+$
disease: $D$
$A=p\cdot s^++(1-p)\cdot s^-$
$0.8181= p\cdot0.9+ (1-p)\cdot 0.8$
$0.0181= 0.1p$
$p=.181$
For one test positive out of one:
using Bayes' theorem:
$P(D|T^+)=\frac{p \cdot s^+}{p \cdot s^+ + (1-p) \cdot (1-s^-)}$
$P(D|T^+)=\frac{.181 \cdot .9}{.181 \cdot .9 + (1-.181) \cdot (1-0.8)}$
$P(D|T^+)=\frac{.1629}{.1629 + .1638}=.4986$
now for k tests out of m:
as in Peter's answer, the probabilities are now drawn from a binomial to generate likelihoods:
$L^+$~$B(n,s^+)$ and $L^-$~$B(n,s^-)$ with inverted number of successes for the second.
You can probably calculate confidence intervals based on the knwon properties (variance) of bionomial distributions...
