Firstorder logic : repesenting graphs
How can we write a sentence in firstorder logic that says that a graph has exactly 6 edges? i.e. G= (V,E) (logically implies) iff E=6 :eek:

Start simple. Replace 6 with 0. Can you figure out how?
Replace 6 with 1. Can you figure out how? Replace 6 with 2. Can you figure out how? 
Actually no. I'm having trouble to represent the number of edges. I can express that there is an edge in a graph:
There_Exists_x There_exists_y edge(x,y). but how can I express that there are n edges in the graph. Any ideas ? 
Hrm. Your variables, then, must range over the vertices of the graph, and you assume that there is exactly one edge between a given pair of vertices?
Anyways, so you've managed to solve (the complement of) my first problem: how to express that a graph has no edges. So let's move onto the next: how to express that a graph has a single edge... have you ever expressed before the notion that there is one (and only one) object that satisfies a given property? 
Im sorry. I dont know how to. I'm not so good at this.Any hints?

You've never had to express something like:
"This equation has a unique solution"? 
Ok... So, what does this have to do with that?

You want to say "This graph has a unique edge". :tongue2:

Ok. But a certain number of edges. I'm sorry if Im not getting what u mean. I'm not a mathematician by any means. Can u give me a simple sentence ?just to help me start and I will build up on it.

I'm saying that you should fully tackle the question of expressing the statement "This graph has exactly one edge" before moving on to the tougher statement "This graph has exactly six edges".
You've already given a sample statement: You encoded: "This graph has at least one edge" as: Ex Ey: edge(x, y) Maybe you should explicitly write out the solution to my first exercise before moving onto the next: how can you encode: "This graph has zero edges"? 
Ex Ey: ~edge(x,y)
Is this what u mean ? 
That's not correct. For example, take this graph:
A BC This graph has three vertices and one edge. Your statement "Ex Ey: ~edge(x, y)" is true for this graph  for example, I can select x=A and y=B, and then "~edge(A, B)" is a true statement. However, the graph obviously does not have zero edges! In English, your statement says: "There exists a pair of vertices that don't have an edge between them". Do you see why? 
Yes I do. Maybe i can use
ForAll_x ForAll_y : ~edge(x, y) ????? 
Yes, that one's exactly right. It says "For any pair of vertices, there does not exist an edge between them."
Now onto exactly one edge... You already know how to say "This graph has at least one edge". I suggested considering the statement "This equation has a unique solution" because the expression of this statement in logic involves a useful trick that applies directly here... Another way to think about it is this: can you say "This graph does not have two distinct edges"? Or what about it's complement? "This graph has at least two distinct edges" 
I have no clue. :cry: Do u have any hints on how to express that it has 2 distinct edges ?

Okay, suppose you know that your graph has only one edge.
I take two sheets of paper. On the first sheet of paper, I write down the name of an edge in your graph. On the second sheet of paper, I write down the name of an edge in your graph. What can you tell me about the two sheets of paper? 
they contain the same edge, since my graph has only one edge
Ex Ey edge(x,y) , x=y ???? 
Quote:
In other words, if we've written down the names of two edges, the names should be the same. 
All times are GMT 5. The time now is 03:57 PM. 
Powered by vBulletin Copyright ©2000  2014, Jelsoft Enterprises Ltd.
© 2014 Physics Forums