Compare commits

...

4 Commits
v0.3.1 ... main

Author SHA1 Message Date
a91d55151b
fix: typo 2025-06-16 13:39:34 +03:00
66bb36d746
fix: small-o example 3
o(n^3) -> o(3^n)
2025-06-15 22:05:52 +03:00
be4811206c
fix: and table 2025-06-15 20:35:17 +03:00
4741efe3dc
fix: graph caption 2025-06-15 20:32:39 +03:00

View File

@ -643,7 +643,7 @@ Tātad vienādojums ir
patiess.
=== Piemērs (mazais-$o$)
$ 2^n n^2 =^? o(n^3) $
$ 2^n n^2 =^? o(3^n) $
Pēc tās pašas aprakstītās īpašības, kā @small-o-example-3, sanāktu
$ lim_(n->oo) (2^n n^2)/3^n $
@ -802,9 +802,9 @@ saprātīgie deterministiskie skaitļošanas modeļi ir polinomiāli ekvivalenti
- Dots grafs $G$ un divas virsotnes $u$, $v$.
- Jautājums: vai eksistē ceļš no $u$ uz $v$?
- Rupjais-spēks: pārbaudīt visus ceļus eksponenciāls laiks.
- Rupjais-spēks: pārbaudīt visus ceļus -- eksponenciāls laiks.
- Efektīvs algoritms: meklēšana plašumā (breadth-first search); laika
sarežģītība: $O(|V| + |E|)$.
sarežģītība: $O(abs(V) + abs(E))$.
== Piemērs ($"RELPRIME"$)
@ -820,7 +820,7 @@ saprātīgie deterministiskie skaitļošanas modeļi ir polinomiāli ekvivalenti
#NP (nederminēti-polinomiālas) problēmas
ir problēmas (2 ekvivalentas definīcijas):
+ $L in NP$, ja eksistē pārbaudes algoritms - $O(n^c)$ laika Tjūringa mašīna $M$:
+ $L in NP$, ja eksistē pārbaudes algoritms -- $O(n^c)$ laika Tjūringa mašīna $M$:
+ Ja $L(x) = 1$, tad eksistē y: $M(x, y) = 1$.
+ Ja $L(x) = 0$, tad visiem y: $M(x, y) = 0$.
+ _Informācija $y$ var saturēt brīvi definētu informāciju._
@ -830,7 +830,7 @@ ir problēmas (2 ekvivalentas definīcijas):
Ekvivalence ir pierādīta ar abpusēju pārveidojumu no pārbaudītāja uz nedet.
#TM un atpakaļ.
== NP-pilnas probēmas un to redukcijas
== NP-pilnas problēmas un to redukcijas
=== Polinomiāla redukcija $(<=#sub("poly"))$
@ -909,11 +909,11 @@ Vai dotā lineāru nevienādību sistēma ar bināriem mainīgajiem ir atrisinā
$x_n$) ievieš jaunus mainīgos $y_i$.
- Katriem vārtiem formulē atbilstošas izteiksmes.
Piemērs AND vārtiem. Nosaucam ievades kā x, y un izvadi kā z: $z = x and y$
Piemērs `AND` vārtiem. Nosaucam ievades kā x, y un izvadi kā z: $z = x and y$
#table(
columns: 4,
[*$x$*], [*$y$*], [*$z$*], [*$z = x and z$?*],
[*$x$*], [*$y$*], [*$z$*], [*$z = x and y$?*],
$0$, $0$, $0$, [jā],
$0$, $0$, $1$, [nē],
$0$, $1$, $0$, [jā],
@ -1006,39 +1006,40 @@ Vārdiski. Jauns grafs $G$, kurā ir visas virsotnes no $V$, bet
visas šķautnes, kas ir $G$ nav $G'$ un pretēji -- visas šķautnes
kā nav $G$ ir $G'$.
#figure(diagram(
cell-size: 1mm,
node-stroke: 0pt,
spacing: 1em,
node-shape: circle,
// phantom location nodes
dot-node((0, 0), <b1>),
dot-node((-2, 1), <a1>),
dot-node((0, 2), <c1>),
#figure(
diagram(
cell-size: 1mm,
node-stroke: 0pt,
spacing: 1em,
node-shape: circle,
// phantom location nodes
dot-node((0, 0), <b1>),
dot-node((-2, 1), <a1>),
dot-node((0, 2), <c1>),
dot-node((0, 4), <b2>),
dot-node((-2, 5), <a2>),
dot-node((0, 6), <c2>),
dot-node((0, 4), <b2>),
dot-node((-2, 5), <a2>),
dot-node((0, 6), <c2>),
// label nodes
node((rel: (0.7em, 0.7em), to: <b1>), $B$),
node((rel: (-0.7em, 0em), to: <a1>), $A$),
node((rel: (0.7em, 0.7em), to: <c1>), $C$),
node((1, 1), text(green, $G$)),
// label nodes
node((rel: (0.7em, 0.7em), to: <b1>), $B$),
node((rel: (-0.7em, 0em), to: <a1>), $A$),
node((rel: (0.7em, 0.7em), to: <c1>), $C$),
node((1, 1), text(green, $G$)),
node((rel: (0.7em, 0.7em), to: <b2>), $B$),
node((rel: (-0.7em, 0em), to: <a2>), $A$),
node((rel: (0.7em, 0.7em), to: <c2>), $C$),
node((1.6, 5), text(green, $G "papildinājums"$)),
node((rel: (0.7em, 0.7em), to: <b2>), $B$),
node((rel: (-0.7em, 0em), to: <a2>), $A$),
node((rel: (0.7em, 0.7em), to: <c2>), $C$),
node((1.6, 5), text(green, $G "papildinājums"$)),
edge(<a1>, <b1>),
edge(<c1>, <b1>, "--", stroke: yellow),
edge(<c1>, <a1>),
edge(<a2>, <b2>, "--", stroke: yellow),
edge(<c2>, <b2>),
edge(<c2>, <a2>, "--", stroke: yellow),
)),
caption: "Papildgrafa piemērs",
edge(<a1>, <b1>),
edge(<c1>, <b1>, "--", stroke: yellow),
edge(<c1>, <a1>),
edge(<a2>, <b2>, "--", stroke: yellow),
edge(<c2>, <b2>),
edge(<c2>, <a2>, "--", stroke: yellow),
),
caption: "Papildgrafa piemērs",
)
Ir spēkā sakarība $"INDSET"(G, k) = "CLIQUE"(G', k)$.
@ -1118,26 +1119,26 @@ Ir spēkā sakarība $"INDSET"(G, k) = "CLIQUE"(G', k)$.
[Summa], [$ f(x) + g(x) $], [$ f'(x) + g'(x) $],
[Starpība], [$ f(x) - g(x) $], [$ f'(x) - g'(x) $],
[Reizinājums], [$ f(x) * g(x) $],
[Reizinājums], [$ f(x) dot g(x) $],
[
$
f'(x) * g(x) + \
f(x) * g'(x)
f'(x) dot g(x) + \
f(x) dot g'(x)
$
],
/*
[Quotient Rule], [$ (f'(x) * g(x) - f(x) * g'(x)) / (g(x))^2 $], [$ (f'(x) * g(x) - f(x) * g'(x)) / (g(x))^2 $],
[Chain Rule], [$ f(g(x)) $], [$ f'(g(x)) * g'(x) $],
[Quotient Rule], [$ (f'(x) dot g(x) - f(x) * g'(x)) / (g(x))^2 $], [$ (f'(x) * g(x) - f(x) * g'(x)) / (g(x))^2 $],
[Chain Rule], [$ f(g(x)) $], [$ f'(g(x)) dot g'(x) $],
[Eulers Number Exponent Rule], [$ e^x $], [$ e^x $],
[Constant Exponent Rule], [$ a^x $], [$ a^x * ln(a) $],
[Constant Exponent Rule], [$ a^x $], [$ a^x dot ln(a) $],
[Natural Log Rule], [$ ln(x) $], [$ 1 / x $],
[Logarithm Rule], [$ log_a(x) $], [$ 1 / (x * ln(a)) $],
[Logarithm Rule], [$ log_a(x) $], [$ 1 / (x dot ln(a)) $],
[Sine Rule], [$ sin(x) $], [$ cos(x) $],
[Cosine Rule], [$ cos(x) $], [$ -sin(x) $],
[Tangent Rule], [$ tan(x) $], [$ sec^2(x) $],
[Cosecant Rule], [$ csc(x) $], [$ -csc(x) * cot(x) $],
[Secant Rule], [$ sec(x) $], [$ sec(x) * tan(x) $],
[Cosecant Rule], [$ csc(x) $], [$ -csc(x) dot cot(x) $],
[Secant Rule], [$ sec(x) $], [$ sec(x) dot tan(x) $],
[Cotangent Rule], [$ cot(x) $], [$ -csc^2(x) $],
*/
)