Can someone confirm these English to predicate logic problems for me?

In summary, a student receives a grade for every course in which he or she registers. To formalize this, suitable predicates and functions were defined and combined into the statement (\forall s|: (\forall c | isReg(s,c) : getsGrade(s, c))). In translating the statement "Adding two odd integers yields an even number. Use only addition and multiplication; do not use division, mod, or predicates even(x) and odd(x)", the formal statement (\forall x,y:Z|(\exists n:Z|:(2n+1) = x) \wedge (\exists n:Z|:(2n+1) = y):(\exists n:Z|:(2n) = (x + y)))
  • #1
Ownaginatious
38
0

Homework Statement



I actually have to problems I would just like someone to confirm for me. I have several other problems similar to these, and I don't want to waste time in case I do not understand the fundamentals. Anyway:

a) Define suitable predicates and functions and then formalize the following sentence : A student receives a grade for every course in which he or she registers:

b) Translate the following English statements into predicate logic : Adding two odd integers yields an even number. Use only addition and multiplication; do not use division, mod, or predicates even(x) and odd(x).

2. Attempt at a solution

Now here is my attempt:

a) I defined the variables:
- c = courses
- s = students

And the functions:
- isReg(s, c)
- getGrades(s, c)

And then combined them into the following formal statement:

[tex](\forall s|: (\forall c | isReg(s,c) : getsGrade(s, c)))[/tex]

b) Now for this I simply derived the following:

[tex](\forall x,y:Z|(\exists n:Z|:(2n+1) = x) \wedge (\exists n:Z|:(2n+1) = y):(\exists n:Z|:(2n) = (x + y)))[/tex]

If I've gone wrong, any help at getting back onto the right track would be much appreciated.

Thanks :)
 
Physics news on Phys.org
  • #2
(a) is probably right... but English can be ambiguous. When the sentence says "a student..." it could also be taken to mean that "there is a student..." which would be a quite different meaning.

But I suspect you've given what was intended.

I wonder a bit about your syntax for the restricted quantifiers (using "|" to restrict the range of a variable) in part a, where you have the "|" without the preceding domain. Is there a clearly defined syntax you are using?
 
  • #3
Ya, I was wondering that exact same thing sylas. My textbook talks a lot about how English is so ambiguous, so I'm going to assume that whether this applies to one student or all students is open to my interpretation ;).
 
  • #4
sylas said:
I wonder a bit about your syntax for the restricted quantifiers (using "|" to restrict the range of a variable) in part a, where you have the "|" without the preceding domain. Is there a clearly defined syntax you are using?

Oh I was led to believe that that's the equivalent to saying "over the whole domain", which is the equivalent to just putting "true" there.
 
  • #5
Ownaginatious said:
Oh I was led to believe that that's the equivalent to saying "over the whole domain", which is the equivalent to just putting "true" there.

It depends on what rules you've been given for syntax. Your syntax uses ":" for two different roles, which is ok. I've seen it done before. I'll use "•" for the start of the statement to which the quantified applies, just for clarity. Here's a possible grammar:
Code:
    statement ::= quantifier variable ":" range "•" statement
    range ::= setvariable
            | setvariable "|" statement
Basically, a grammar like this requires a range for a variable, to be either just named set, or perhaps a named set with an additional constraint or restriction. That's how I have usually seen "|" used. It can be read "such that".

The "•" can be replaced with another ":" without ambiguity, unless the first ":" becomes optional. If the first ":" is optional you might have the following rule as well:
Code:
    statement ::= quantifier variable "•" statement
In this case there has to be some understood domain that is being used.

What I have not seen is "|" by itself, without the first ":". It makes sense, if understood has having a ":X" implied before hand, where X is the understood domain.

I'm just asking in case... have you been given a syntax you are expected to use? What you have is still quite comprehensible, but it you have a required syntax you might want to check.

Cheers -- sylas
 
  • #6
Well, as given in our book, the syntax they want us to use is the following:

(*x | R : P)

R = Range, P = Body, * = operator/function, x = variable(s). The ':' is also used to represent type (i.e. x : Z = x of type integer).

In class my professor just left out R or made it "true" when he wanted to use the whole domain.

Here is an example he did:

"Some integer is larger than 23" formally is [tex](\exists x:Z|:x > 23)[/tex] or [tex](\exists x:Z|true:x > 23)[/tex]

Sorry if I've misunderstood your question. This is all new to me.
 
  • #7
Ownaginatious said:
Well, as given in our book, the syntax they want us to use is the following:

(*x | R : P)

R = Range, P = Body, * = operator/function, x = variable(s). The ':' is also used to represent type (i.e. x : Z = x of type integer).

In class my professor just left out R or made it "true" when he wanted to use the whole domain.

Here is an example he did:

"Some integer is larger than 23" formally is [tex](\exists x:Z|:x > 23)[/tex] or [tex](\exists x:Z|true:x > 23)[/tex]

Sorry if I've misunderstood your question. This is all new to me.

You've understood fine, and your answers seem fine and consistent with the syntax you've provided. I just wondered about the syntax, and you've explained it well.

Cheers -- sylas
 
  • #8
sylas said:
You've understood fine, and your answers seem fine and consistent with the syntax you've provided. I just wondered about the syntax, and you've explained it well.

Cheers -- sylas

Oh awesome :) Thank you very much for you help!
 

Related to Can someone confirm these English to predicate logic problems for me?

1. What is predicate logic?

Predicate logic is a formal system used to represent and reason about relationships between objects or individuals. It involves using predicates, which are statements that describe properties or relations, and quantifiers, which specify the extent or scope of the predicates.

2. Why is predicate logic important?

Predicate logic is important because it allows us to accurately represent and reason about complex relationships between objects or individuals. It is also the basis for many mathematical and computer science concepts, such as set theory and programming languages.

3. How do you translate English sentences into predicate logic?

To translate an English sentence into predicate logic, you first identify the predicates and their arguments (the objects or individuals being described). Then, you use quantifiers to specify the scope of the predicates and logical connectives (such as "and", "or", "not") to combine multiple predicates into a single statement.

4. Can you give an example of translating an English sentence into predicate logic?

Sure, for the sentence "All cats are mammals", we would use the predicate "cat" with the quantifier "all" to indicate that the statement applies to all cats, and the predicate "mammal" to describe their relationship. This could be represented as ∀x(cat(x) → mammal(x)) in predicate logic.

5. Is there a specific format for writing predicate logic statements?

Yes, there are various notations and formats for writing predicate logic statements, such as first-order logic and higher-order logic. These formats have specific rules and symbols for representing predicates, quantifiers, and logical connectives. It is important to use a consistent and clear format when writing predicate logic statements to avoid ambiguity.

Similar threads

  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
9
Views
1K
  • Calculus and Beyond Homework Help
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
578
  • Calculus and Beyond Homework Help
Replies
3
Views
857
  • Calculus and Beyond Homework Help
2
Replies
35
Views
4K
  • Calculus and Beyond Homework Help
2
Replies
43
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Back
Top