• :00Days
  • :00Hours
  • :00Mins
  • 00Seconds
A new era for learning is coming soonSign up for free
Log In Start studying!

Select your language

Suggested languages for you:
Answers without the blur. Sign up and see all textbooks for free! Illustration

Q61E

Expert-verified
Discrete Mathematics and its Applications
Found in: Page 204
Discrete Mathematics and its Applications

Discrete Mathematics and its Applications

Book edition 7th
Author(s) Kenneth H. Rosen
Pages 808 pages
ISBN 9780073383095

Answers without the blur.

Just sign up for free and you're in.

Illustration

Short Answer

Write the deferred acceptance algorithm in pseudocode.

Pa,wa is pair of women and their accepted proposals.

And return is Pa,wa for all a1,2,...,n

See the step by step solution

Step by Step Solution

Step 1:

We will use ‘match’ algorithm.

Procedure match

m1,m2,,mn,w1,w2,.,wn with preference lists M1,M2,Mn,W1,W2,Wn, respectively)

Here pi is the proposal list of women wi .

Every man proposes to their preferred women and the women reject the proposal of all the men that are not their preferred man from the entire proposal. When the men will propose to the first women in their remaining preference list and the women will reject all the proposals of their no preferred men.

This will repeat until all women have exactly one remaining proposal.

Step 2:

For i : = 1 to n ,

Pi:=ϕ

While there exists a Pi with i1,2,...,n such thatPi:=ϕ

For j : = 1 to n

PMi1:=PMi1Mj

For k : = 1 to n

best = pk1

Step 3

For all pPk do if p is preferred over best in Wk then,

Mbest:=Mbest-wk

Else

Mp:=Mp-wk

Hence, Pa,wa is pair of women and their accepted proposals.

And return is Pa,wa for all a1,2,...,n

Recommended explanations on Math Textbooks

94% of StudySmarter users get better grades.

Sign up for free
94% of StudySmarter users get better grades.