recategorized by
23,379 views
61 61 votes

Consider a selection of the form $\sigma_{A\leq 100} (r)$, where $r$ is a relation with $1000$ tuples. Assume that the attribute values for $A$ among the tuples are uniformly distributed in the interval $[0, 500].$ Which one of the following options is the best estimate of the number of tuples returned by the given selection query ?

  1. $50$
  2. $100$
  3. $150$
  4. $200$

6 Answers

Best answer
62 62 votes
$\sigma_{A \leq 100}(r)$
 $r$ has $1000$ tuples

Values for A among the tuples are uniformly distributed in the interval $[0, 500].$ This can be split to $5$ mutually exclusive (non-overlapping) and exhaustive (no other intervals) intervals of same width of $100$ $([0-100], [101-200], [201-300], [301-400], [401-500],$ $0$ makes the first interval larger - this must be a typo in question) and we can assume all of them have same number of values due to Uniform distribution. So, number of tuples with A value in first interval should be

$\frac{\text{Total no. of tuples}}{5} = 1000/5 = 200$

Correct Answer: $D$
edited by
34 34 votes

option D

total numbers are 1000 and they have said that it is uniformly distrubuted between [0,500] it means every number is 2 times thats the only way we can distribute it uniformaly and as per our condition A<=100 at max 100 tuples can be there and and every one can be repeated 2 times so it sums up to 200 hence it is answer

3 3 votes
There must be typo in question. As clearly 1000 tuples written in question. And values of A are uniformly distributed.

By taking (0 500] , A values can be 0.5, 1,1.5.... 100, 100.5....499, 499.5, 500

Total 1000 values.

By which values <=100 are 200.
0 0 votes
My thought process:-

Since nothing is given about the schema, assume the schema is R(a,b,c,d),

now possible values of ‘a’:- 0,0,1,1,2,2,3,3,4,4,5,5………..499,499 ( not sure why 500 is included in the question if the distribution is uniform, but if we try to bring the distribution to almost be uniform, then i guess we can assume possible values of ‘a’ is 0,1,2,3,4,5….498,499,500,0,1,2,3,4,5,6,……..498.  Either approach should give me the correct answer since we’re dealing with values of ‘a’ less than 200 )

now the query only applies a condition on ‘a’, it does not project the ‘a’ field, therefore thinking about unique ‘a’ values would be wrong as the result will give us 202 tuples, this is where our assumption of the schema being not R(a) only comes into picture.

Hopefully, this should summarise the entire scenario, we have played it safe by assuming the schema to be general.
Answer:
Position:
Show:

Related questions

98 98 votes
6 answers 6 answers
38.1k
38.1k views
Ishrat Jahan asked Oct 30, 2014
38,068 views
A demand paging system takes $100$ time units to service a page fault and $300$ time units to replace a dirty page. Memory access time is $1$ time unit. The probability o...
75 75 votes
4 answers 4 answers
17.0k
17.0k views
Ishrat Jahan asked Oct 30, 2014
16,971 views
In a multi-user operating system on an average, $20$ requests are made to use a particular resource per hour. The arrival of requests follows a Poisson distribution. The ...
102 102 votes
13 answers 13 answers
46.6k
46.6k views
Ishrat Jahan asked Oct 29, 2014
46,563 views
Consider a hash function that distributes keys uniformly. The hash table size is $20$. After hashing of how many keys will the probability that any new key hashed collide...
29 29 votes
5 answers 5 answers
8.7k
8.7k views
Ishrat Jahan asked Oct 29, 2014
8,681 views
Suppose there are two coins. The first coin gives heads with probability $\dfrac{5}{8}$ when tossed, while the second coin gives heads with probability $\dfrac{1}{4}.$ On...