aboutsummaryrefslogtreecommitdiff
path: root/README.org
diff options
context:
space:
mode:
authorLibravatar Comrade Martin Miroslavovich Michalec <martin@michalec.dev>2023-11-25 16:24:10 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-11-07 02:12:00 +0000
commitbca75f071153ddcaa5ceee0722e2152bacfedc78 (patch)
tree7c42e4aa83103aa9813151e4251d2ffb4023ffbe /README.org
downloadlab-01-bca75f071153ddcaa5ceee0722e2152bacfedc78.tar.gz
publishHEADmaster
Diffstat (limited to 'README.org')
-rw-r--r--README.org127
1 files changed, 127 insertions, 0 deletions
diff --git a/README.org b/README.org
new file mode 100644
index 0000000..5eabc45
--- /dev/null
+++ b/README.org
@@ -0,0 +1,127 @@
1#+title: Implementation of Gray code, multisets based on it, and operations on those multisets
2
3* Task[fn:1]
4Implement a program to generate Gray code for populating a universe
5(of a user‑specified bit length). Based on the universe, two multisets
6are formed using two methods of population: manually and automatically
7(the user chooses). The size of the sets is also set by the user. As a
8result, the results of all operations on the sets are displayed on the
9screen. In addition, protection against incorrect user input must be
10implemented.
11
12* Documentation
13The exported report can be found at [[https://git.michalec.dev/uni/term-03/discrete-math/lab-01/report.pdf][this link]].
14
15* Showcase
16
17#+begin_src text
18Задайте разрядность универсума U ("^[[:digit:]]+$"): 3
19[0] = 000 x 97
20[1] = 001 x 67
21[2] = 011 x 52
22[3] = 010 x 50
23[4] = 110 x 50
24[5] = 111 x 16
25[6] = 101 x 99
26[7] = 100 x 71
27
28Зададайте мощность мультимножества A ("^[[:digit:]]+$"): 2
29Заполнить мультимножество автоматически (1) или вручную (2) ("^[12]$"): 1
30[0] = 000 x 96
31[1] = 101 x 35
32
33Зададайте мощность мультимножества B ("^[[:digit:]]+$"): 3
34Заполнить мультимножество автоматически (1) или вручную (2) ("^[12]$"): 1
35[0] = 000 x 80
36[1] = 011 x 16
37[2] = 110 x 13
38
39Объединение A и B:
40[0] = 000 x 96
41[1] = 011 x 16
42[2] = 110 x 13
43[3] = 101 x 35
44
45Пересечение A и B:
46[0] = 000 x 80
47
48Дополнение A:
49[0] = 000 x 1
50[1] = 001 x 67
51[2] = 011 x 52
52[3] = 010 x 50
53[4] = 110 x 50
54[5] = 111 x 16
55[6] = 101 x 64
56[7] = 100 x 71
57
58Дополнение B:
59[0] = 000 x 17
60[1] = 001 x 67
61[2] = 011 x 36
62[3] = 010 x 50
63[4] = 110 x 37
64[5] = 111 x 16
65[6] = 101 x 99
66[7] = 100 x 71
67
68Разность A\B:
69[0] = 000 x 16
70[1] = 101 x 35
71
72Разность B\A:
73[0] = 000 x 0
74[1] = 011 x 16
75[2] = 110 x 13
76
77Арифметическое сложение A и B:
78[0] = 000 x 97
79[1] = 011 x 16
80[2] = 110 x 13
81[3] = 101 x 35
82
83Арифметическая разность A - B:
84[0] = 000 x 16
85[1] = 101 x 35
86
87Арифметическая разность B - A:
88[0] = 000 x 0
89[1] = 011 x 16
90[2] = 110 x 13
91
92Арифметическое произведение A и B:
93[0] = 000 x 97
94
95Арифметическое деление A на B:
96[0] = 000 x 1
97[1] = 101 x 99
98
99Арифметическое деление B на A:
100[0] = 000 x 97
101[1] = 011 x 52
102[2] = 110 x 50
103
104Симетрическая разность A и B:
105[0] = 000 x 16
106[1] = 011 x 16
107[2] = 110 x 13
108[3] = 101 x 35
109#+end_src
110
111* Unlicense
112#+include: UNLICENSE verse
113
114* Footnotes
115
116[fn:1] Original text:
117#+html: <i>
118#+begin_quote
119Реализовать программу генерации бинарного кода Грея для заполнения
120универсума (заданной пользователем разрядности). На основе универсума
121формируются два мультимножества двумя способами заполнения: вручную и
122автоматически (выбирает пользователь). Мощность множеств также задает
123пользователь. В результате на экран выводятся результаты всех
124действий над множествами. Кроме того, требуется реализовать защиту от
125некорректного пользовательского ввода.
126#+end_quote
127#+html: </i>