update meta data
This commit is contained in:
parent
f3a896c724
commit
90e15ed6ce
3307 changed files with 1674 additions and 7 deletions
27
Task/Symmetric-difference/00DESCRIPTION
Normal file
27
Task/Symmetric-difference/00DESCRIPTION
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
Given two [[set]]s ''A'' and ''B'', where ''A'' contains:
|
||||
|
||||
* John
|
||||
* Bob
|
||||
* Mary
|
||||
* Serena
|
||||
|
||||
and ''B'' contains:
|
||||
|
||||
* Jim
|
||||
* Mary
|
||||
* John
|
||||
* Bob
|
||||
|
||||
compute
|
||||
|
||||
:<math>(A \setminus B) \cup (B \setminus A).</math>
|
||||
|
||||
That is, enumerate the items that are in ''A'' or ''B'' but not both. This set is called the [[wp:Symmetric difference|symmetric difference]] of ''A'' and ''B''.
|
||||
|
||||
In other words: <math>(A \cup B) \setminus (A \cap B)</math> (the set of items that are in at least one of ''A'' or ''B'' minus the set of items that are in both ''A'' and ''B'').
|
||||
|
||||
Optionally, give the individual differences (<math>A \setminus B</math> and <math>B \setminus A</math>) as well.
|
||||
|
||||
;Notes
|
||||
# If your code uses lists of items to represent sets then ensure duplicate items in lists are correctly handled. For example two lists representing sets of <code>a = ["John", "Serena", "Bob", "Mary", "Serena"]</code> and <code>b = ["Jim", "Mary", "John", "Jim", "Bob"]</code> should produce the result of just two strings: <code>["Serena", "Jim"]</code>, in any order.
|
||||
# In the mathematical notation above <code>A \ B</code> gives the set of items in A that are not in B; <code>A ∪ B</code> gives the set of items in both A and B, (their ''union''); and <code>A ∩ B</code> gives the set of items that are in both A and B (their ''intersection'').
|
||||
Loading…
Add table
Add a link
Reference in a new issue