File:Set partitions with complement relation between blocks.svg

From Wikiversity
Jump to navigation Jump to search

Original file(SVG file, nominally 853 × 1,291 pixels, file size: 728 KB)

This is a file from the Wikimedia Commons. The description on its description page there is shown below.

Commons is a freely licensed media file repository. You can help.

Summary

Description

Set partitions with a complement relationship between the blocks of equivalent elements

Blocks mare marked with thick black rectangles. Complementary blocks are connected by red lines.

The equations on the left describe the change that turns the last object into the next one.
The thick dotted lines correspond to that equation.
The thin dotted lines are implied by the change (because the complement of a complement must be equal).


Such an object can be used to save equality and complement relationships between variables in Boolean algebra.

The image illustrates the following test of such an object in Python.

spc = SetPartComp([[3, 4], [5, 6, 7], [8, 9], [20, 30]], {(1, 2), (3, 8), (10, 11)})

spc.set_equal(2, 4)
assert spc == SetPartComp([[1, 8, 9], [2, 3, 4], [5, 6, 7], [20, 30]], {(1, 2), (10, 11)})

spc.set_comp(11, 20)
assert spc == SetPartComp([[1, 8, 9], [2, 3, 4], [5, 6, 7], [10, 20, 30]], {(1, 2), (10, 11)})

spc.set_comp(12, 30)
assert spc == SetPartComp([[1, 8, 9], [2, 3, 4], [5, 6, 7], [10, 20, 30], [11, 12]], {(1, 2), (10, 11)})

spc.set_equal(6, 13)
assert spc == SetPartComp([[1, 8, 9], [2, 3, 4], [5, 6, 7, 13], [10, 20, 30], [11, 12]], {(1, 2), (10, 11)})

spc.set_comp(3, 30)
assert spc == SetPartComp([[1, 8, 9, 10, 20, 30], [2, 3, 4, 11, 12], [5, 6, 7, 13]], {(1, 2)})

spc.set_comp(40, 50)
assert spc == SetPartComp([[1, 8, 9, 10, 20, 30], [2, 3, 4, 11, 12], [5, 6, 7, 13]], {(1, 2), (40, 50)})

spc.set_equal(60, 70)
assert spc == SetPartComp([[1, 8, 9, 10, 20, 30], [2, 3, 4, 11, 12], [5, 6, 7, 13], [60, 70]], {(1, 2), (40, 50)})

spc.set_comp(0, 70)
assert spc == SetPartComp([[1, 8, 9, 10, 20, 30], [2, 3, 4, 11, 12], [5, 6, 7, 13], [60, 70]], {(1, 2), (40, 50), (0, 60)})

spc.set_comp(0, 40)
assert spc == SetPartComp([[0, 50], [1, 8, 9, 10, 20, 30], [2, 3, 4, 11, 12], [5, 6, 7, 13], [40, 60, 70]], {(1, 2), (0, 40)})

spc.set_equal(0, 1)
assert spc == SetPartComp([[0, 1, 8, 9, 10, 20, 30, 50], [2, 3, 4, 11, 12, 40, 60, 70], [5, 6, 7, 13]], {(0, 2)})

spc.set_equal(2, 5)
assert spc == SetPartComp([[0, 1, 8, 9, 10, 20, 30, 50], [2, 3, 4, 5, 6, 7, 11, 12, 13, 40, 60, 70]], {(0, 2)})
Date
Source Own work
Author
Watchduck
You can name the author as "T. Piesk", "Tilman Piesk" or "Watchduck".

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

25 August 2020

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current16:14, 25 August 2020Thumbnail for version as of 16:14, 25 August 2020853 × 1,291 (728 KB)WatchduckUploaded own work with UploadWizard

The following page uses this file:

Metadata