Difference between revisions of "TADM2E 1.6"

From Algorithm Wiki
Jump to: navigation, search
(Fixed.)
Line 1: Line 1:
Let <math>U=\{1,2,3\}</math> and S consists of <math>S_1=\{1,2,8,4,10\}</math>, <math>S_2=\{1,3,6,9\}</math>, <math>S_3=\{1,2,3\}</math>. The algorithm would give an answer of <math>S_1</math>, <math>S_2</math> but the correct answer is <math>S_3</math> because it has the fewest elements and covers <math>U</math>.
+
Let <math>U=\{1,2,3,4,5\}</math> and S consists of <math>S_1=\{1,2,3,4\}</math>, <math>S_2=\{1,2,5\}</math>, <math>S_3=\{3,4,6\}</math>. The algorithm would give an answer of <math>S_1</math>, <math>S_2</math>, <math>S_3</math> but the correct answer is <math>S_2</math>,<math>S_3</math> because it has the fewest subsets and covers <math>U</math>.
 
 
The algorithm would remove elements <math>\{1,2\}</math> (members of <math>S_1</math> is the largest subset in <math>S</math>. Then chose <math>S_2</math> because it is the next largest and remove element <math>\{3\}</math>. The algorithm would exit because <math>U</math> is empty. However, <math>S_3</math> is the correct answer.
 

Revision as of 22:54, 18 June 2019

Let $ U=\{1,2,3,4,5\} $ and S consists of $ S_1=\{1,2,3,4\} $, $ S_2=\{1,2,5\} $, $ S_3=\{3,4,6\} $. The algorithm would give an answer of $ S_1 $, $ S_2 $, $ S_3 $ but the correct answer is $ S_2 $,$ S_3 $ because it has the fewest subsets and covers $ U $.