2016年10月2日日曜日

学習環境

集合・位相入門(松坂 和夫(著)、岩波書店)の第1章(集合と写像)、2(集合の間の演算)、問題7.を取り組んでみる。

問題7.


  1. ( AB )( BA )=( BA )( AB )

  2. x( AB )( AB ) x( AB )x ( AB ) c ( xAxB )x( A c B c ) ( xAxB )( x A c x B c ) ( x A c xB )( xAx B c ) x( A c B )( A B c )

  3. ( ( A B c )( A c B ) )ΔC =( ( ( A B c )( A c B ) ) C c )( ( ( A B c )( A c B ) ) c C ) =( ( A B c C c )( A c B C c ) )( ( ( A B c ) c ( A c B ) c )C ) =( ( A B c C c )( A c B C c ) )( ( ( A c B )( A B c ) )C ) =( ( A B c C c )( A c B C c ) )( ( ( A c B c )( AB ) )C ) =( ( A B c C c )( A c B C c ) )( ( A c B c C )( ABC ) ) AΔ( ( B C c )( B c C ) ) =( A ( ( B C c )( B c C ) ) c )( A c ( ( B C c )( B c C ) ) ) =( A( ( B c C )( B C c ) ) )( ( A c B C c )( A c B c C ) ) =( A( ( B c C c )( CB ) ) )( ( A c B C c )( A c B c C ) ) =( ( A B c C c )( ABC ) )( ( A c B C c )( A c B c C ) )

  4. A( ( B C c )( B c C ) ) =( AB C c )( A B c C ) ( ( AB ) ( AC ) c )( ( AB ) c ( AC ) ) =( ( AB )( A c C c ) )( ( A c B c )( AC ) ) =( AB C c )( A B c C )

コード(Emacs)

python 3.5

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from matplotlib_venn import venn3_unweighted
import matplotlib.pyplot as plt
import sympy

a = sympy.FiniteSet(*range(1, 15))
b = sympy.FiniteSet(*range(5, 20))
c = sympy.FiniteSet(*range(10, 25))

expr = [
    (a.symmetric_difference(b),
     b.symmetric_difference(a)),
    (a.symmetric_difference(b),
     (a | b) - (a & b)),
    ((a.symmetric_difference(b)).symmetric_difference(c),
     (a.symmetric_difference(b.symmetric_difference(c)))),
    (a & b.symmetric_difference(c),
     (a & b).symmetric_difference(a & c))
]

for i, (left, right) in enumerate(expr):
    print('{0}: {1}'.format(chr(ord('a') + i), left == right))

plt.figure(figsize=(6, 6))
venn3_unweighted(subsets=(a, b, c), set_labels=('A', 'B', 'C'))
plt.savefig('sample7.svg')
plt.show()

入出力結果(Terminal, IPython)

$ ./sample7.py
a: True
b: True
c: True
d: True
$

0 コメント:

コメントを投稿

Comments on Google+: