Discrete math - predicate logic

66 Views Asked by At

Assuming $D$ is the set of all dogs, $H$ is the set of all homes, and $\text{BT}(d,h)$ means that the dog $d$ is in home $h$

  1. Let's say I have a group of dogs and I want to say that every dog is in exactly one home. How would I represent that using predicate logic? So far I got, For all d in D, There exists a h in H, belongs to (d,H) AND....
3

There are 3 best solutions below

0
On
  1. $$\forall d\in D \ \ \exists h\in H \ \ s.t \ \ (d < h) \ \wedge\ (\forall h'\in H\ \ ((h'\neq h)\implies (d\not < h')) $$ where $d<h$ is like saying BelongTo$(d,h)$.

    1. $$\forall d_1,d_2,d_3\in D\ \ \ ((d_1\neq d_2\neq d_3\neq d_1)\implies \\ (\exists h\in H\ \ s.t\ \ ((d_1 < h) \ \wedge\ (d_2<h)\wedge\ (d_3\not < h)))$$
0
On

Let $D$ be the set of dogs and $H$ the set of homes. Also , let $B(d,h)=$ BelongsTo$(d,h)$.

1) $\forall d \in D \exists h \in H: B(d,h) \land (\forall h^{*} \in H: B(d,h^{*}) \to h=h^{*})$

2) $\forall h \in H \exists d_{1}, d_{2} \in D: d_{1} \neq d_{2} \land B(d_{1},h) \land B(d_{2},h) \land (\forall d^{*} \in D: B(d^{*},h) \to (d^{*}=d_{1} \lor d^{*}=d_{2}))$

0
On

Let

  • D = A set of dogs
  • H = A set of homes
  • BT(d, h): "d is in h", where d $\in$ D, h $\in$ H

Then we have

$(\forall d \in D, \exists h\in H, BT(d, h)) \wedge (\forall d_{1} \in D, \forall h_{1}, h_{2} \in H, BT(d_{1}, h_{1}) \wedge BT(d_{1}, h_{2})\implies h_{1} = h_{2})$

To explain my answer

  • $(\forall d \in D, \exists h\in H, BT(d, h))$ reads "Every dog is in at least one home"
  • $(\forall d_{1} \in D, \forall h_{1}, h_{2} \in H, BT(d_{1}, h_{1}) \wedge BT(d_{1}, h_{2})\implies h_{1} = h_{2})$ reads "If every dog is in homes then those homes are the same homes"

Since we said every dog is in at least one home and if they are in two homes those two homes are the same homes, joining these two clauses would result in a two-prolonged if-statement which is equivalent to "Every dog is in exactly one home".