Your the sovereign in a small kingdom. One of your jobs is to marry off the people in kingdom. There...
This presentation is the property of its rightful owner.
Sponsored Links
1 / 35

Marriage Problem PowerPoint PPT Presentation


  • 35 Views
  • Uploaded on
  • Presentation posted in: General

Your the sovereign in a small kingdom. One of your jobs is to marry off the people in kingdom. There are three rules that apply. Marriage Problem.

Download Presentation

Marriage Problem

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Marriage problem

Your the sovereign in a small kingdom. One of your jobs is to marry off the people in kingdom. There are three rules that apply.

Marriage Problem


Marriage rule

Only a male and female with corresponding names, e.g., Robert and Roberta, may marry. (Assume a one-to-one correspondence of male/female names). Marriages are between two families. The married couple leaves (town) and the remaining members of the two families are joined into big, new family. Example: Marrying {Robert, Sam, Josephine} to {Roberta, John, Jack} yields {Sam, Josephine, John, Jack}.

Marriage Rule


Clone rule

You may clone a family at any time. This creates an identical copy of the family (in case the family is used in a later marriage, a copy is kept intact).

Clone Rule


Murder rule

The night before a wedding, one person in a family with the same name as some one else in that family may murder the other person, i.e., remove him or her from the family. So, {Robert, Joe, Robert, Robert, Sam} may become {Robert, Joe, Sam}. Essentially this rule means that you can treat families as set.

Murder Rule


Marriage problem

Since marriage is an honorable and esteemed state, the goal is to marry off everyone in a family. Thus the perfect family is the empty family. Your goal as sovereign is to create a perfect family by using the three rules. Note that you don't need to marry off everybody in town, just create one perfect family.

Goal


Example

Example

Nick, Victoria, Patricia

Daniel

Olga, Victor, Patricia

Patrick, Leo, Nick

Danielle, Oleg

Lenore, Nick

Nicole


Social club

A social club is really an anti-marriage club. There are two rules:

Only one member of each marriageable pair are eligible members of the social club and all that are eligible are members.

Each family must have one member in the social club.

Social Club


Example1

Example

Nick, Victoria, Patricia

Daniel

Olga, Victor, Patricia

Patrick, Leo, Nick

Danielle, Oleg

Lenore, Nick


A town has a social club if and only if the perfect family cannot be created

A town has a social club if and only if the perfect family cannot be created.

Theorem


Proof sc no perfect family

Suppose a town has a social club. Then every family has at least one member who is in the social club. Each of the rules, marriage, clone, and murder, creates a new family which also has a member in the social club. Clone – obvious. Murder – must leave at least one person with the given name. Marriage – think about it.

Proof: SC -> no perfect family


Proof cont d

Suppose we marry, say Robert and Roberta, from two families. If Robert is not in the social club, then some other member of Robert's family must be. That member is in the new, joined family, so the new family has a member in the social club. If Robert is in the social club, then Roberta can't be, and so another member of her family is – and that person is in the new family.

Proof (cont'd)


Proof cont d1

So, no matter what rule is used, the new family has a member in the social club. By induction, after n applications of the rules, the resulting family must have a member in the social club. If we could create the perfect family, then we would have a family without a member in the social club, which is a contradiction. So, we cannot create the perfect famly.

Proof (cont'd)


Proof no sc perfect family

This is the hard direction. Suppose that we have a town and that it doesn't have a social club. We prove by induction on the number of excess people that we can create the perfect family.

Proof: No SC -> Perfect family


Number of excess people

If a family has zero or one members, it has 0 excess people.

If a family has n people, where n > 1, then it has n-1 excess people.

The number of excess people in a town is the sum of the number of excess people in all the families of the town.

We use this as a measure in our induction proof.

Number of Excess People


Base case

We assume that we have a town with 0 excess people. That means that all the families have 0 excess people, and hence each family consists of zero or one person. If we have a family we zero people, that's the perfect family, and we don't have to do anything. We're done.

Base Case


Base case cont d

If no family has zero people, then all families must have exactly one person. So, if there is a social club, everyone would have to be in it (one member of each family is everyone). So why doesn't this work? The town must contain a marriageable pair. So, marry off those two folks – they are the only people in their respective families and you have the perfect family.

Base Case (cont'd)


Inductive case

We assume the induction hypothesis:

If we have a town with fewer than n excess people, and there is no social club, we can always create the perfect family.

We must show:

If we have a town with n > 0 excess people, and there is no social club, we can create the perfect family.

We assume that we have a with n excess people and no social club.

Inductive Case


Inductive case cont d

Since there is at least one excess person (n > 0) in town, there must be a family with an excess person, call him Sam. We do the following thought experiment. We create a new town, a duplicate of the first, but we remove all Sams, and we delete any families with Samanthas. (Samanthas are useless since there aren't any Sams to marry.)

Inductive Case (cont'd)


Inductive case cont d1

Since Sam was an excess person in at least one family, killing off all Sams lowers the number of excess people in town. We claim that there isn't a social club in the new town. If there were, adding “Sam” to that social club would create a social club for the original town. Thus, by induction, we know that we can create the perfect family in the new town.

Inductive Case (cont'd)


Inductive case cont d2

Continuing this thought experiment: We have found a set of marriages (and murders and clonings) that produces a perfect family in the new town. We perform the same acts, using the original families from the first town (all the families in the new town came from the original town, perhaps with Sam killed off). What happens if we do the same actions?

Inductive Case (cont'd)


Induction case cont d

We either end up with the perfect family, or the family with just Sam by himself. Why? Because we start with the same families in the old town as in the new town, except that Sam might be in the family. If so, Sam is retained in the family after a rule is applied. Again, by induction, if that's the case, we also get the same result, but perhaps with Sam included.

Induction Case (cont'd)


Inductive case cont d3

So, if we were able to create the perfect family (because Sam was not in any of the families we used), then we're done. Otherwise, we created a family with just Sam. Use that family to marry off all the Samanthas in town. Now consider the new town were all the Samanthas are gone and any families with Sam are deleted.

Inductive Case (cont'd)


Inductive case finished

Since the family with Sam has been deleted, the new town has fewer than n excess people and we can apply the induction hypothesis. Again, there's no social club (if there were, just add Samantha for a social club for the original town). By induction we can find the perfect family. Doing the same marriages in the original town yields the perfect family there.

Inductive Case (finished!)


Marriage problem

Thus we can create the perfect family if and only if there's no social club.

What does this have to do with this class?

Theorem Proved


Propositional calculus

Remember the resolution rule?

~P, P v Q |- Q

It turns out this is an extremely useful rule all by itself.

Before letting this rule loose, we need to put our formulas into clause set form.

Propositional Calculus


Clause set form

Here are the sets to put a formula into clause set form:

Rewrite the formula into conjunctive normal form (uses only ^, v, and ~) Push the ~'s in as far as possible, then use distributivity to move all the v's inside of the ^'s.

Propositions and negated propositions are called literals.

Clause Set Form


Clause set form cont d

Each conjunct becomes a set of literals – just rewrite the literals in set format, dropping the v operator (it is implied). This is called a clause and each clause is an implicit disjunction.

The whole formula is taken to be a set of clauses – again, write a set of clauses, dropping the ^ operator. A clause set is an implicit conjunction.

Clause Set Form (cont'd)


Clause set form example

Consider the formula:

(p -> q) v ~(r -> s).

Use the rule (A -> B) is equivalent to (~A v B) yields: (~p v q) v ~(~r v s).

Pushing the ~ inside gives: (~p v q) v (r ^ ~s).

Using the distributive law to move the ^ outside the v yields: (~p v q v r) ^ (~p v q v ~s).

Putting this in clausal form gives us:

{ {~p,q,r}, {~p,q,~s} }.

Clause Set Form - Example


Resolution rule

The resolution for propositional logic in clausal form is straightforward: If we have two clauses, C1 and C2, where P is in C1 and ~P is in C2, the resolvent is C1\{P} U C2\{~P}.

Resolution Rule


Resolution

Given a formula, we negate the formula and then put the result into clausal form. We then choose two clauses from the set which have complementary literals, e.g., P and ~P, and apply the resolution rule to obtain a new clause which is then added to the set. We repeat this process until the empty clause (bottom, or contradiction is obtained). If we can derive bottom, the original formula is a tautology.

Resolution


Example2

Consider the clause set:

{ {N, ~V, ~P}, {D}, {~O, V, ~P}, {P, L, N}, {~D, O}, {~L, N}, {~N}}

8. {~V, ~P} 1,7

9. {~L} 6,7

10. {P, N} 4, 9

11. {O} 2, 5

12. {V, ~P} 3,11

13. {~P} 8,12

14. {N} 10, 13

15. {} 7, 14

Example


Soundness and completeness

Resolution is both sound (if you can prove it, it's true) and complete (if it's true, you can prove it). How do we know resolution is sound and complete? We proved a theorem showing that.

Soundness and Completeness


Proof

A literal is a person. A positive literal is a male and a negative literal is a female. There is a one-to-one correspondence between literals and their negations.

A clause is a family.

A clause set is a town.

The marriage rule is the resolution rule. The murder rules happens because clauses are sets. The clone rule occurs because we keep copies of old clauses.

Proof


Proof cont d2

The perfect family is the empty clause, or bottom. If we can create the perfect family, then we can derive bottom from the clause set.

The social club is an interpretation that satisfies the clause set. That is, each literal or its negation is in the set, i.e., is true. Each clause has at least one literal which is true, so each clause is true as a clause is a disjunction. So, the set is satisfiable.

Proof (cont'd)


Proof finished

So, the theorem is “there is a social club if and only if the perfect family cannot be created,” or conversely, “you can create the perfect family iff there is no social club.” Which means “you can derive a contradiction iff the formula is unsatisfiable, hence it's negative is a tautology.”

Thus resolution is sound and complete.

Proof (finished)


  • Login