1
$\begingroup$

Assume $G$ be an undirected graph. Let $P(x,y)$ mean that there is a path from vertex $x$ to vertex $y$ .

How to translate the given English statements into Predicate logic ?

  • $G$ has atleast $3$ connected components.
  • $G$ has exactly $3$ connected components.
  • $G$ has atmost $3$ connected components.

My Try:

  • $G$ has atleast $3$ connected components.

This can be written as $∃x∃y∃z(P'(x,y)∧P'(y,z)∧P'(x,z))$

  • $G$ has atmost $3$ connected components.

The first one was like saying "There are atleast $3$ $P$'s" and to get "There are atmost $3$ $P$'s" is to by denying the fact that "There are atleast $4$ $P$'s"

I can write this as $¬∃x∃y∃z∃t(P'(x,y)∧P'(y,z)∧P'(z,t)∧P'(t,x))$

  • $G$ has exactly $3$ connected components is the intersection of $1$st one and $2$nd one.

These are my thoughts for this question. Let me know if I am wrong somewhere ?

  • 0
    Your "at most" part is not correct as the formula after the quantifiers can be satisfied already with two connected components: Take $x$ and $z$ from one component, and $y$ and $t$ from the other. Therefore your formula is a complicated way to say "$G$ is connected", instead of the desired "has at most 3 connected components".2017-01-28
  • 0
    @celtschk If possible, Can you please answer ?2017-01-28

1 Answers 1

2

I'll do the first one for you:

If $G=(V,E)$ has at least $3$ connected components, then there exists vertices $u,v,w$ such that there is no path between $u$ and $ v$, $u$ and $w$, and $v$ and $ w$, i.e., $$ \exists u,v,w \in V\; |\; \bar{P}(u,v),\bar{P}(u,w),\bar{P}(v,w) $$ where $\bar{P}$ is the negative of $P$.

  • 0
    Can you elaborate a bit this one, So that I am able to do others.I mean can i say like this "There exists some u,v,w such that there are $3$ disconnected components". So, is the word "there exists some " is implying here "atleast" ? Some explaination for this please ?2017-01-25
  • 1
    Yes, if you say $\exists v \in V$, this means there is at least one vertex that... if you want unicity, you can write $\exists !\, v \in V$2017-01-25
  • 0
    Okk !! So, for "exactly", I guess I can write unicity , right ? But, how to show "atmost" . Is it by "for all" ?2017-01-25