Re: [LIU Comp Sci] Need tutoring on Relational Calculus

From: Ruben Safir <mrbrklyn_at_panix.com>
Date: Sun, 21 Dec 2014 02:23:54 +0000 (UTC)
Message-ID: <m75avq$rkg$1_at_reader1.panix.com>


Eric <eric_at_deptj.eu> wrote:
> On 2014-12-18, ruben safir <ruben_at_mrbrklyn.com> wrote:
>> I'm pouring over the HW assignment
>
> What are you pouring over the assignment? Syrup? No wonder you can't
> understand it.
>
> Sorry about that, the word you want is "poring".
>
>> and the explanation and notes from the text is not adequate to explain
>> relational calculus.
>
> Not unlikely. Have they really said some equivalent of "There's this
> other thing called Relational Calculus, so for homework read up on it
> here and try to apply it to the examples we've already used."? If so,
> are they assuming some course pre-requisite that you do not possess?
> If not, surely there was something about it in class first.
>
>> The book is actually in shambles.
>
> Probably not. It may be meant for people starting from somewhere other
> than where you are.
>
>> This is a very advanced mathamtical topic and there is no way to learn
>> this in a single lesson, although you might be able to bluff you way
>> through it.
>
> Yes, though I wouldn't try the "bluff" thing if I were you.
>
>> Does anyone understand this?
>
> Undoubtedly.
>
>> It makes little sense as it is presented, and I'm not in any way certain
>> of the meaning of the syntax.
>>
>> I have no idea what this whole section of 6.6.63 is out of the text.
>
> I hope you have understood the bit before this which (presumably)
> explains exactly what the book means by "formula".
>
>> Quote:
>>
>> In addition, two special symbols called quantifiers can appear in
>> formulas; these are the universal quantifier (?) and the existential
>> quantifier (?). Truth values for formulas with quantifiers are described
>> in Rules 3 and 4 below;
>
> So, there are these two symbols which will be explained shortly.
>
>> *first, however, we need to define the concepts of free and bound tuple
>> variables in a formula.***
>> ENDQUOTE
>>
>> *Here is a question, Why does it matter if Tuple Variables are Free
>> or Bound?****
>>
>> Why do we make them Free or Bound? ****
>
> Why are you asking these questions at this point when the definition of
> the concepts should provide at least a first part of the answer?
>
>> QUOTE
>> Informally, a tuple variable t is bound if it is quantified, meaning
>> that it appears in an (?t) or (?t) clause; otherwise, it is free.
>> ENDQUOTE
>>
>> ??????
>
> Actually I might question the book's use of "Informally" here, but I
> suppose it's relative, since the whole subject is very much a formal
> system. Or did that bit not really come before the following bits?

the book is incomprehensable by the students for whom it was assigned, and its intended audience. This book seemingly wants to sidestep the details of the mathmatical foundations for database instruction, while at the same time covering them since they are part of a precieved standard faire for a database program.

It is a failure. Like many of comp-sci books, it is just not rigerous enough in its explanations and doesn't really care if you understand the mathmatical logic anyway.

Compare this, to say, a book on diferential equations, or calculus. There you find first the theory and theroms being discussed. Then the arithmatic models for the formulas. Then the practicle and theoretical applications of the theorums, And finally, practical problems, exercized with detailed discussion of syntax and problem solving skills discussion.

Here, they just want to take ashort cut, and it is very fustrating.

Despite that, thank you verymuch for taking the time to clarify some of these ideas. Looking at this chapter, the subject itself should be a semeters woth of work centered on Cobbs theories and model.

>
>> QUOTE
>> Formally, we define a tuple variable in a formula as free or bound
>> according to the following rules:
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
>>
>> Stop this author doesn't know the material.
>
> Wrong.
>
>> Either that or he doesn't know how to explain it.
>
> An explanation has to be at an appropriate level for its audience. Maybe
> you are not this author's audience.
>
>> You can't LEARN math by memorizing rules inside rule inside rule.
>> You have to lay out the theory and show practical models.
>
> That depends on the sort of maths you are dealing with.

No it doesn't It depends on if care what you learn. When I was a fellow at the Pharmacy School, going for my PhD, I had a student multiply something by 4 digits and 3 digits and return a value with three digits.

I zeroed the entire examination. A student in the 4th year of a doctoral program can't just do a rote calcuationand not understand that they are degree of 100 fold off the mark.

You need to understand what you are doing,

In this case, I'm not convinced that the author believes that understanding and using database principles, as layed out by Cobb and others, is directly pertanent to understanding, designing and using databases. This is the core problem and it shows itself up and down the comp-sci food chain. If understanding Relational Calculus is not essential to designing and using databases, then maybe there is something wrong with Cobbs theories, or the way we do databases. There has been some discussion on this matter in the literature. One thing I m certain of though, is that this text and the method of teaching this program is not adequate to allow me to evaluate the value of these theories. I need to learn more.

> There may not be
> any practical models. There are pieces of pure mathematics that didn't
> have a practical use until 300 years after they were published.

and even until today...that is not the point though.

>
>> You have to understand why rules are used and developed
>
> That would be nice - if there was enough time.
>
>> and there is no effort to even attempt an explanation.
>
> Well actually, all these things you are quoting are an attempt at an
> explanation.
>
>> QUOTE
>> An occurrence of a tuple variable in a formula F that is an atom is free
>> in F.
>
> Assuming you have the book's definitions of tuple variable and formula
> and atom, here is the heart of your earlier question. If a tuple
> variable is an atom, it is all by itself, and there is nothing to tell
> it what values it can take.

It then includes the entire universe? Star Dust and Dark matter included, if I understand the theory correctly.

> It is free (note that word - "FREE") to take
> any value at all.
>
> To paraphrase part of the "Formally" quote above, if a tuple variable
> is not free...
>
> ...it is bound!
>

But it still has degrees of freedom. Everything is bound to something. Everything is free within its bounds of degrees of freedom.

and that is where my confusion starts.  

>> An occurrence of a tuple variable t is free or bound in a formula
>> made up of logical connectives?(F 1 AND F2), (F1 OR F2 ), NOT(F1 ),
>> and NOT(F2 )? depending on whether it is free or bound in F1 or F2
>> (if it occurs in either).

that sentence bytes.

>>
>> Notice that in a formula of the form F = (F1 AND F2) or F = (F1 OR F2),
>> a tuple variable may be free in F1 and bound in F2, or vice versa; in
>> this case, one occurrence of the tuple variable is bound and the other
>> is free in F.
>
> OK, if you start combining formulae to make another formula, it gets
> more complicated. Who's surprised?
>
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Why does it matter?
>
> It matters because this sort of formula will end up representing a
> relational query, whose result is a set of actual values of a tuple
> variable. Before you construct the actual query (or formula) the tuple
> variable is free to have any value - you don't know what the answer
> will be. Afterwards, because of what you put in the formula, the tuple
> variable will be bound - to the answer you need!
>

That is good! You should write the book.

>> QUOTE:
>>
>> All free occurrences of a tuple variable t in F are bound in a formula
>> F^B of the form F^B= (? t)(F) or F^B = (?t)(F).
>>
>> UNQUOTE
>>
>> I have no idea what he is talking about here.
>
> I assume that F^B is actually F with B as a superscript, and is just the
> name of another formula, indicating that tuple variables in it are bound.

No that is a UTF translation problem

All free occurrences of a tuple variable t in F are bound in a formula F' of the form F'= (?Exists: t)(F) or F' = (?Univ: t)(F). The tuple variable is bound to the quantifier specified in F. For example, consider the following formulas:

>
>> He just said above that any ? t or ?t means that t is BOUND. Now it
>> is free?
>
> It is free in F. When you create F^B by adding a quantifier to F, it is
> bound in F^B. Simples.

Let me think on this. I I think he is saying the tuple variable is bound to the quantiers definition. That would apear to be simple but why chose only these two quantifiers. I think Universal is really throwning me off.

>>
>> QUOTE
>> The tuple variable is bound to the quantifier specified in F^B. For
>> example, consider the following formulas:
>> F1 : d.Dname=?Research?
>> F2 : (? t)(d.Dnumber=t.Dno)
>> F3 : (?d)(d.Mgr_ssn=?333445555?)
>> The tuple variable d is free in both F1 and F2, whereas it is bound to
>> the (?) quantifier in F3. Variable t is bound to the (?) quantifier
>> in F2. We can now give Rules 3 and 4 for the definition of a formula
>> we started earlier:
>
> So there's an actual example for you.
>

The example actually makes sence to me because it follwos the rules he layed out.  

> And now for the promised rules:
>
>> Rule 3: If F is a formula, then so is (?t)(F), where t is a tuple
>> variable. The formula (?t)(F) is TRUE if the formula F evaluates to
>> TRUE for some (at least one) tuple assigned to free occurrences of t in F;
>> otherwise, (?t)(F) is FALSE.
>>
>> Rule 4: If F is a formula, then so is (?t)(F), where t is a tuple
>> variable. The formula (?t)(F) is TRUE if the formula F evaluates to
>> TRUE for every tuple (in the universe) assigned to free occurrences of
>> t in F; otherwise, (?t)(F) is FALSE.
>>
>> The (?) quantifier is called an existential quantifier because a formula
>> (?t)(F) is TRUE if there exists some tuple that makes F TRUE.
>>
>> For the universal quantifier, (?t)(F) is TRUE if every possible tuple
>> that can be assigned to free occurrences of t in F is substituted for t,
>> and F is TRUE for every such substitution. It is called the universal
>> or for all quantifier because every tuple in the universe of tuples must
>> make F TRUE to make the quantified formula TRUE.
>
> I assume the book has more, but anyway...
>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> So then we have this homework and I'm doing it, barerly working through
>> this methodology and then you hit this:
>>
>> e) Retrieve the names of employees who work on every project:
>>
>> This question is insane with SQL and Relational Algebra (where we can
>> use a division)
>
> No, just potentially confusing, but it's the standard example for
> relational division.
>

No, it has been insane ever since it became the standard example for relational division, which in of itself might be insane. This stuff is not that old. I remember reading these original papers in the late 70;s in high school. We are not in any way one vetting these theories and models.  

>> but solving it with relational calculus?? Who can explain an answer this?
>
> You, when you have understood a bit more.
>

Thank you :)  

>> This is an image of the database scheme
>>
>> http://www.nylxs.com/images/database_3.3_company.png
>
> Nobody cares, unless they're going to do your homework for you instead
> of making a few potentially but not necessarily helpful remarks. Anyway
> it's a standard example schema.

Its not the homework itself I'm worried about, I knew that when I posted this, if I didn't edit it to be more appropriate for a general audience outside of the class mailing list, that I could be critisized.

But here I am. School is over. Finals finished. But I still want to understand this material better. I would do 100 problems if I thought it would shed some light.

Also, how are these solved? I can solve an sql problem and even describe it in set theory.

Ruben

>
> Eric
Received on Sun Dec 21 2014 - 03:23:54 CET

Original text of this message