From c04fd874af4e641aeeba2e4a4a991fd81225a5d3 Mon Sep 17 00:00:00 2001 From: Andrew Guschin Date: Sun, 15 May 2022 17:30:56 +0400 Subject: =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D1=82=D0=B5=D1=81=D1=82=D0=BE=D0=B2=20=D0=BF=D1=8F?= =?UTF-8?q?=D1=82=D0=BE=D0=B9=20=D0=BB=D0=B0=D0=B1=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lab5/lab5.py | 14 +++++++++++++- lab5/report/images/test1.png | Bin 0 -> 427686 bytes lab5/report/images/test2.png | Bin 0 -> 447961 bytes lab5/report/lab5.tex | 18 +++++++++++------- 4 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 lab5/report/images/test1.png create mode 100644 lab5/report/images/test2.png diff --git a/lab5/lab5.py b/lab5/lab5.py index 5cf5027..eeda67c 100644 --- a/lab5/lab5.py +++ b/lab5/lab5.py @@ -119,6 +119,15 @@ def print_cayley(semigroup, cayley): print() +def print_ideals(semigroup, right_ideals, left_ideals): + for element in semigroup: + r = right_ideals[element] + l = right_ideals[element] + print(f"({element}] = {{{', '.join(r)}}}") + print(f"[{element}) = {{{', '.join(l)}}}") + print(f"[{element}] = {{{', '.join(r | l)}}}") + + def make_semigroup(): print("Введите элементы полугруппы:") semigroup = set(input().split()) @@ -126,9 +135,9 @@ def make_semigroup(): print("Введите количество преобразований:") k = int(input()) + print(f"Введите преобразования:") translations = [] for _ in range(k): - print(f"Введите преобразование: ") key, val = input().split() translations.append((key, val)) @@ -169,6 +178,9 @@ def main(): d = r + l print(d.astype(int)) + print("Идеалы:") + print_ideals(semigroup, right_ideals, left_ideals) + print("egg-box диаграмма:") egg_box = get_egg_box(d, semigroup) print(egg_box) diff --git a/lab5/report/images/test1.png b/lab5/report/images/test1.png new file mode 100644 index 0000000..90d1e3f Binary files /dev/null and b/lab5/report/images/test1.png differ diff --git a/lab5/report/images/test2.png b/lab5/report/images/test2.png new file mode 100644 index 0000000..d00fd40 Binary files /dev/null and b/lab5/report/images/test2.png differ diff --git a/lab5/report/lab5.tex b/lab5/report/lab5.tex index dbd941f..5088580 100644 --- a/lab5/report/lab5.tex +++ b/lab5/report/lab5.tex @@ -66,7 +66,7 @@ \begin{example} В полугруппе натуральных чисел с операцией сложения $\mathbb{N} = (\mathbb{N}, - +)$ главные идеалы $(n] = {n, n + 1, n + 2, \dots}$ образуют бесконечную + +)$ главные идеалы $(n] = \{ n, n + 1, n + 2, \dots \}$ образуют бесконечную последовательность с пустым пересечением. \end{example} @@ -236,13 +236,17 @@ $R$ мощности $M$ определяющих соотношений. \section{Результаты тестирования} -Картинки +\begin{figure}[H] + \centering + \includegraphics[width=0.7\textwidth]{test1.png} + \caption{Вычисленная полугруппа и её таблица Кэли} +\end{figure} -% \begin{figure}[H] -% \centering -% \includegraphics[width=0.7\textwidth]{test1.png} -% \caption{} -% \end{figure} +\begin{figure}[H] + \centering + \includegraphics[width=0.7\textwidth]{test2.png} + \caption{Идеалы полугруппы и egg"=box"=диаграмма} +\end{figure} \section{Решение задач} -- cgit v1.2.3