Answer: 819 : 820 ; 205 : 205
To find the estimated number of tuples in the output of the selection query σ(A>10)∨(B=18)(r), we assume a uniform and independent distribution of values for attributes A and B.
1. Probability of A>10:
- The attribute A has integer values ranging from 6 to 20.
- Total number of distinct values of A=20−6+1=15.
- The values satisfying A>10 are {11,12,…,20}, which gives 20−11+1=10 values.
- P(A>10)=1510=32.
2. Probability of B=18:
- The attribute B has integer values ranging from 1 to 20.
- Total number of distinct values of B=20−1+1=20.
- The only value satisfying B=18 is {18}, which is 1 value.
- P(B=18)=201.
3. Combined Probability for the ∨ (OR) condition:
Since A and B are independently distributed:
P((A>10)∨(B=18))=P(A>10)+P(B=18)−P(A>10)⋅P(B=18)=32+201−(32×201)=6040+3−2=6041
4. Estimated Number of Tuples:
- For 1200 tuples: Estimated Tuples=1200×6041=820
- For 300 tuples (alternative paper version): Estimated Tuples=300×6041=205