2018-03-07

Mar 7 In-Class Exercise.

Post your solutions to the Mar 7 In-Class Exercise to this thread.
Best,
Chris
(Edited: 2018-03-07)
Post your solutions to the Mar 7 In-Class Exercise to this thread. Best, Chris

-- Mar 7 In-Class Exercise
T(S) = `sigma_{mbox{eye_color != red}} (PERSON)`
    T(S) = 5 T(R)/6
    roughly  5/6s of the 100million people  (83,333,333 people) would have an eye color that is not red
2. T(S) = `sigma_{mbox{eye_color = green}} (PERSON)`
     T(S) = T(R)/6
    roughly 1/6 people of the 100 million people (16,666,666 people) would have green eyes
3. T(S) = `sigma_{mbox{annual_income > 50,000}} (PERSON)`
     T(S) = T(R)/3 
     Based on the assumption that queries want to narrow the T(R) down to less than a half.
(Edited: 2018-03-07)
T(S) = @BT@sigma_{mbox{eye_color != red}} (PERSON)@BT@ T(S) = 5 T(R)/6 roughly 5/6s of the 100million people (83,333,333 people) would have an eye color that is not red 2. T(S) = @BT@sigma_{mbox{eye_color = green}} (PERSON)@BT@ T(S) = T(R)/6 roughly 1/6 people of the 100 million people (16,666,666 people) would have green eyes 3. T(S) = @BT@sigma_{mbox{annual_income > 50,000}} (PERSON)@BT@ T(S) = T(R)/3 Based on the assumption that queries want to narrow the T(R) down to less than a half.

-- Mar 7 In-Class Exercise
 1. σ EYE_COLOR ≠ RED (PERSON)
 T(S) = T(R) (V(R,a) - 1 / V(R, a)) =100 million * (6-1 / 6) = 83.3 million
 
 2. σ EYE_COLOR = GREEN (PERSON)
 T(S) = T(R) / V(R, a) = 100 million / 6 = 16.7 million
 
 3. σ ANNUAL_INCOME > 50000 (PERSON)
 T(S) = T(R) / 3 = 100 million / 3 = 33.3 million
(Edited: 2018-03-07)
1. σ EYE_COLOR ≠ RED (PERSON) T(S) = T(R) (V(R,a) - 1 / V(R, a)) =100 million * (6-1 / 6) = 83.3 million 2. σ EYE_COLOR = GREEN (PERSON) T(S) = T(R) / V(R, a) = 100 million / 6 = 16.7 million 3. σ ANNUAL_INCOME > 50000 (PERSON) T(S) = T(R) / 3 = 100 million / 3 = 33.3 million

-- Mar 7 In-Class Exercise
  1. NotRed = `sigma_{mbox{EYE_COLOR != red}}(PERSON)`
    Likely to return 100 million `cdot` (5/6) = 83.33 million
  2. GEye = σEYE_COLOR == green (PERSON)
    Likely to return 100 mil - 83.33 mil = 16.67 million
  3. Rich = σANNUAL_INCOME > 50000 (PERSON)
    Likely to return < 50 million tuples
(Edited: 2018-03-07)
# NotRed = @BT@sigma_{mbox{EYE_COLOR != red}}(PERSON)@BT@<br> Likely to return 100 million @BT@cdot@BT@ (5/6) = 83.33 million # GEye = σEYE_COLOR == green (PERSON)<br> Likely to return 100 mil - 83.33 mil = 16.67 million # Rich = σANNUAL_INCOME > 50000 (PERSON)<br> Likely to return < 50 million tuples

-- Mar 7 In-Class Exercise
1. S = σ(EYE_COLOR <> RED) , T(S) = T(R)  -> 100 milliion rows 
 
2. S = σ(EYE_COLOR == GREEN), T(S) = T(R)/ V(R/A) -> 100million/ 6 = 16 million
 
3. S = σ(ANNUAL_INCOME > 5000), T(S) = T(R)/3 -> 33 million rows
(Edited: 2018-03-07)
<pre> 1. S = σ(EYE_COLOR <> RED) , T(S) = T(R) -> 100 milliion rows 2. S = σ(EYE_COLOR == GREEN), T(S) = T(R)/ V(R/A) -> 100million/ 6 = 16 million 3. S = σ(ANNUAL_INCOME > 5000), T(S) = T(R)/3 -> 33 million rows </pre>

-- Mar 7 In-Class Exercise
S=σ(EYE_COLOR≠red) , so T(S) = 5/6 = 83.33 million
S=σ(EYE_COLOR=green), so T(S) = 1/6 = 16.67 million
S=σ(ANNUAL_INCOME>50000), so T(S) = 1/3 = 33.33 million
-Casey Reyes
(Edited: 2018-03-07)
S=σ(EYE_COLOR≠red) , so T(S) = 5/6 = 83.33 million S=σ(EYE_COLOR=green), so T(S) = 1/6 = 16.67 million S=σ(ANNUAL_INCOME>50000), so T(S) = 1/3 = 33.33 million -Casey Reyes

-- Mar 7 In-Class Exercise
Total # rows: 100000000

1) σEYE_COLOR <> "Red" (PERSON)
(100000000)(5/6) = approximately 83333333 rows returned.

2) σEYE_COLOR = "Green" (PERSON)
100000000/6 = approximately 16666667 rows returned.

3) σANNUAL_INCOME > 50000 (PERSON)
100000000/3 = 33333333 rows returned.
(Edited: 2018-03-07)
Total # rows: 100000000<br /><br /> 1) σEYE_COLOR <> "Red" (PERSON)<br /> (100000000)(5/6) = approximately 83333333 rows returned.<br /><br /> 2) σEYE_COLOR = "Green" (PERSON)<br /> 100000000/6 = approximately 16666667 rows returned.<br /><br /> 3) σANNUAL_INCOME > 50000 (PERSON)<br /> 100000000/3 = 33333333 rows returned.<br />

-- Mar 7 In-Class Exercise
1. S = σ EYE_COLOR != 'Red'(PERSON) 100,000,000 * (5/6) = 83.33million
2. S = σ EYE_COLOR = 'Green'(PERSON) 100,000,000 / 6 = 16.67million
3. S = σ ANNUAL_INCOME > 50000 (PERSON) 100,000,000/3 = 33.33 million
(Edited: 2018-03-07)
1. S = σ EYE_COLOR != 'Red'(PERSON) 100,000,000 * (5/6) = 83.33million 2. S = σ EYE_COLOR = 'Green'(PERSON) 100,000,000 / 6 = 16.67million 3. S = σ ANNUAL_INCOME > 50000 (PERSON) 100,000,000/3 = 33.33 million

-- Mar 7 In-Class Exercise
1. σ(eye_color != red) Person T(S) = 100mil * 5/6 = 83.333mil 2. σ(eye_color = green) Person T(S) = 100mil/6 = 16.7 mil 3. σ(income>50000) Person T(S) = 100mil/3 = 33.333mil
1. σ(eye_color != red) Person T(S) = 100mil * 5/6 = 83.333mil 2. σ(eye_color = green) Person T(S) = 100mil/6 = 16.7 mil 3. σ(income>50000) Person T(S) = 100mil/3 = 33.333mil

User Icon
-- Mar 7 In-Class Exercise
1. PROJECTION eye_color != red on pperson. Since there are 6 eye_color values, we estimate 5/6 of the original table. (5/6)*10,000,000 = 83,333,333
2. PROJECTION eye_color = green on pperson. Since there are 6 eye_color values, we estimate 1/6 of the original table. (1/6)*10,000,000 = 16,666,666
3. PROJECTION annual_income > 50,000 on pperson. We estimate 1/3 of the original table. (1/3)*10,000,000 = 33,000,000
1. PROJECTION eye_color != red on pperson. Since there are 6 eye_color values, we estimate 5/6 of the original table. (5/6)*10,000,000 = 83,333,333 2. PROJECTION eye_color = green on pperson. Since there are 6 eye_color values, we estimate 1/6 of the original table. (1/6)*10,000,000 = 16,666,666 3. PROJECTION annual_income > 50,000 on pperson. We estimate 1/3 of the original table. (1/3)*10,000,000 = 33,000,000
[ Next ]
X