- 55 Views
- Uploaded on

Download Presentation
## PowerPoint Slideshow about 'Marriage Problem' - pelham

**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

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 ProblemOnly 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 RuleYou 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 RuleThe 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 RuleSince 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.

GoalExample is to marry off everyone in a family. Thus the

Nick, Victoria, Patricia

Daniel

Olga, Victor, Patricia

Patrick, Leo, Nick

Danielle, Oleg

Lenore, Nick

Nicole

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 ClubExample rules:

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 rules:cannot be created.

TheoremSuppose 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 familySuppose 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)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)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 familyIf a family has zero or one members, it has 0 excess people. that it doesn't have a social club. We prove by induction on the

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 PeopleWe 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 CaseIf 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)We assume the induction hypothesis: 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.

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 CaseSince 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)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)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)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)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)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!)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 ProvedRemember the resolution rule? no social club.

~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 CalculusHere are the sets to put a formula into clause set form: no social club.

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 FormEach 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)Consider the formula: literals in set format, dropping the v operator (it is implied). This is called a

(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 - ExampleThe 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 RuleGiven a formula, we straightforward: If we have two clauses, Cnegate 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.

ResolutionConsider the clause set: straightforward: If we have two clauses, C

{ {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

ExampleResolution 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 CompletenessA 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.

ProofThe 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)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)
Download Presentation

Connecting to Server..