WRIGHT STATE UNIVERSITY
Department of Computer Science and Engineering
CS7200: Algorithm Design and Analysis
Spring 2021 Midterm (30 pts
[Stable Matching Problem: 4 + 4 + 1 + 1 pts]
Consider an instance of the stable marriage problem with the priority lists:
Albert
Diane
Emily
Fergie
Bradley
Diane
Emily
Fergie
Charles
Diane
Emily
Fergie
Diane
Albert
Bradley
Charles
Emily
Albert
Charles
Bradley
Fergie
Charles
Bradley
Albert
Is {Albert-Diane, Bradley-Emily, Charles-Fergie} a stable matching? If yes, then provide an informal justification
Computer Science Feb 24, 2021
WRIGHT STATE UNIVERSITY
Department of Computer Science and Engineering
CS7200: Algorithm Design and Analysis
Spring 2021 Midterm (30 pts
[Stable Matching Problem: 4 + 4 + 1 + 1 pts]
Consider an instance of the stable marriage problem with the priority lists:
Albert
Diane
Emily
Fergie
Bradley
Diane
Emily
Fergie
Charles
Diane
Emily
Fergie
Diane
Albert
Bradley
Charles
Emily
Albert
Charles
Bradley
Fergie
Charles
Bradley
Albert
Is {Albert-Diane, Bradley-Emily, Charles-Fergie} a stable matching? If yes, then provide an informal justification. If no, provide a “witness” pair that causes instability.
(b) Determine man-optimal and woman-optimal solutions.
Man-optimal:
Woman-optimal:
(c) Number of functions from the set {Albert, Bradley, Charles} to the set {Diane, Emily, Fergie} =
(d) Number of perfect matchings from the set {Albert, Bradley, Charles} to the set {Diane, Emily, Fergie} =
[Greedy Algorithm: ((1+1+2) + (1+1+2)) pts]
Original Coin Exchange Problem: Given coins of denominations, say, 1, 5, 10, and 25, find the minimum number of coins that add up to a given amount of money.
Does the greedy algorithm provide an optimal strategy to exchange 41 cents using denominations 1, 5, 10, and 15? What is the optimal solution?
YES / NO
GREEDY SOLUTION:
OPTIMAL SOLUTION:
Does the greedy algorithm provide an optimal strategy to exchange 41 cents using denominations 1, 3, 9, and 14? What is the optimal solution?
The inequality constraints are required only of adjacent numbers.
Given an array B[1…2n+1] of distinct numbers, describe a linear-time algorithm that outputs a reordering of numbers belonging to the input array B in A[1...2n+1] such that A is bouncy. Your solution will be graded on its clarity and correctness. Base your solution on the ideas underlying Quicksort Algorithm and you may assume that Median can be computed in linear-time using Quicksort logic.
Important Note:
This solution is from our archive and has been purchased by others. Submitting it as-is may trigger plagiarism detection. Use it for reference only.
For ready-to-submit work, please order a fresh solution below.