diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2024-01-05 19:46:28 +0100 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2024-01-05 19:46:28 +0100 |
commit | d2e03945e00795d68fca77e1c1978376d06a3156 (patch) | |
tree | f8892b6a986c1c2db7e893618094e7491d0b5f09 /šola | |
parent | Merge branch 'master' of ssh://ni/var/lib/git/sijanec/r (diff) | |
download | r-d2e03945e00795d68fca77e1c1978376d06a3156.tar r-d2e03945e00795d68fca77e1c1978376d06a3156.tar.gz r-d2e03945e00795d68fca77e1c1978376d06a3156.tar.bz2 r-d2e03945e00795d68fca77e1c1978376d06a3156.tar.lz r-d2e03945e00795d68fca77e1c1978376d06a3156.tar.xz r-d2e03945e00795d68fca77e1c1978376d06a3156.tar.zst r-d2e03945e00795d68fca77e1c1978376d06a3156.zip |
Diffstat (limited to '')
-rwxr-xr-x | šola/aps1/funkcije | bin | 0 -> 20528 bytes | |||
-rw-r--r-- | šola/la/dn4/dokument.lyx | 2272 | ||||
-rw-r--r-- | šola/la/dn4/gcd.r | 29 | ||||
-rw-r--r-- | šola/p1/dn/DN06_izhodisce/Premica.java | 68 | ||||
-rw-r--r-- | šola/p1/dn/DN06_izhodisce/Test01.java | 85 | ||||
-rw-r--r-- | šola/p1/dn/DN06_izhodisce/Tocka.java | 40 |
6 files changed, 2494 insertions, 0 deletions
diff --git a/šola/aps1/funkcije b/šola/aps1/funkcije Binary files differnew file mode 100755 index 0000000..0c36f6b --- /dev/null +++ b/šola/aps1/funkcije diff --git a/šola/la/dn4/dokument.lyx b/šola/la/dn4/dokument.lyx new file mode 100644 index 0000000..2942005 --- /dev/null +++ b/šola/la/dn4/dokument.lyx @@ -0,0 +1,2272 @@ +#LyX 2.3 created this file. For more info see http://www.lyx.org/ +\lyxformat 544 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass article +\begin_preamble +\usepackage{siunitx} +\usepackage{pgfplots} +\usepackage{listings} +\usepackage{multicol} +\sisetup{output-decimal-marker = {,}, quotient-mode=fraction, output-exponent-marker=\ensuremath{\mathrm{3}}} +\usepackage{amsmath} +\usepackage{tikz} +\newcommand{\udensdash}[1]{% + \tikz[baseline=(todotted.base)]{ + \node[inner sep=1pt,outer sep=0pt] (todotted) {#1}; + \draw[densely dashed] (todotted.south west) -- (todotted.south east); + }% +}% +\end_preamble +\use_default_options true +\begin_modules +enumitem +theorems-ams +\end_modules +\maintain_unincluded_children false +\language slovene +\language_package default +\inputencoding auto +\fontencoding global +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry false +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\biblio_style plain +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification false +\use_refstyle 1 +\use_minted 0 +\index Index +\shortcut idx +\color #008000 +\end_index +\leftmargin 1cm +\topmargin 0cm +\rightmargin 1cm +\bottommargin 2cm +\headheight 1cm +\headsep 1cm +\footskip 1cm +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style german +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tracking_changes false +\output_changes false +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\end_header + +\begin_body + +\begin_layout Title +Rešitev četrte domače naloge Linearne Algebre +\end_layout + +\begin_layout Author + +\noun on +Anton Luka Šijanec +\end_layout + +\begin_layout Date +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +today +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Abstract +Za boljšo preglednost sem svoje rešitve domače naloge prepisal na računalnik. + Dokumentu sledi še rokopis. + Naloge je izdelala asistentka Ajda Lemut. +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +newcommand +\backslash +euler{e} +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Enumerate +Reši enačbo +\begin_inset Formula +\[ +\left|\begin{array}{cccc} +1 & 2 & 3 & 4\\ +x+1 & 2 & x+3 & 4\\ +1 & x+2 & x+4 & x+5\\ +1 & -3 & -4 & -5 +\end{array}\right|=\left|\begin{array}{cc} +3x & -1\\ +6 & x+1 +\end{array}\right| +\] + +\end_inset + + +\end_layout + +\begin_deeper +\begin_layout Paragraph +Rešitev +\end_layout + +\begin_layout Standard +\begin_inset Formula +\[ +\left|\begin{array}{cc} +3x & -1\\ +6 & x+1 +\end{array}\right|=3x\left(x+1\right)+6=3x^{2}+3x+6 +\] + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula +\[ +\left|\begin{array}{cccc} +1 & 2 & 3 & 4\\ +x+1 & 2 & x+3 & 4\\ +1 & x+2 & x+4 & x+5\\ +1 & -3 & -4 & -5 +\end{array}\right|=\left|\begin{array}{cccc} +1 & 2 & 3 & 4\\ +x+1 & 2 & x+3 & 4\\ +1 & x+2 & x+4 & x+5\\ +0 & -5 & -7 & -9 +\end{array}\right|= +\] + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula +\[ +=\left|\begin{array}{cccc} +0 & -x & -x-1 & -x-1\\ +x+1 & 2 & x+3 & 4\\ +1 & x+2 & x+4 & x+5\\ +0 & -5 & -7 & -9 +\end{array}\right|= +\] + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula +\[ +=-\left(x+1\right)\left|\begin{array}{ccc} +-x & -x-1 & -x-1\\ +x+2 & x+4 & x+5\\ +-5 & -7 & -9 +\end{array}\right|+\left|\begin{array}{ccc} +-x & -x-1 & -x-1\\ +2 & x+3 & 4\\ +-5 & -7 & -9 +\end{array}\right|= +\] + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula +\[ +=x-1+4x^{2}-5x+1=4x^{2}-6x +\] + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +begin{align*} +\end_layout + +\begin_layout Plain Layout + +4x^2-6x&=3x^2+3x+6 +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +x^2-9x-6&=0 +\end_layout + +\begin_layout Plain Layout + + +\backslash +end{align*} +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula +\[ +x_{1,2}=\frac{9\pm\sqrt{81+24}}{2}=\frac{9\pm\sqrt{105}}{2},\quad x_{1}=\frac{9+\sqrt{105}}{2},x_{2}=\frac{9-\sqrt{105}}{2} +\] + +\end_inset + + +\end_layout + +\end_deeper +\begin_layout Enumerate +Dokaži, da je preslikava +\begin_inset Formula $x\mapsto x^{-1}$ +\end_inset + + avtomorfizem grupe natanko tedaj, ko je grupa komutativna. +\end_layout + +\begin_deeper +\begin_layout Paragraph +Rešitev +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +udensdash{$f +\backslash +left(x +\backslash +right)=x^{-1} +\backslash +text{ je avtomorfizem} +\backslash +Longleftrightarrow +\backslash +forall a,b +\backslash +in M:a +\backslash +cdot b=b +\backslash +cdot a$} +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Paragraph +Dokaz +\end_layout + +\begin_layout Enumerate +\begin_inset CommandInset label +LatexCommand label +name "enu:Enota-se-preslika" + +\end_inset + +Enota se preslika v enoto. +\end_layout + +\begin_deeper +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +begin{align*} +\end_layout + +\begin_layout Plain Layout + +e +\backslash +cdot e^{-1}&=e&& +\backslash +text{(definicija inverza $a +\backslash +cdot a^{-1}=e$)} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +e +\backslash +cdot e^{-1}&=e^{-1}&& +\backslash +text{(definicija enote $e +\backslash +cdot a=a$)} +\end_layout + +\begin_layout Plain Layout + + +\backslash +end{align*} +\end_layout + +\begin_layout Plain Layout + +$$ +\backslash +Longrightarrow e=e +\backslash +cdot e^{-1}=e^{-1}$$ +\end_layout + +\end_inset + + +\end_layout + +\end_deeper +\begin_layout Enumerate +\begin_inset CommandInset label +LatexCommand label +name "enu:Da-je-preslikava" + +\end_inset + +Da je preslikava bijektivna, moramo dokazati, da je injektivna, torej, da + so v komutativni grupi inverzi enolični — da dva različna elementa nimata + istega inverza, in da je surjektivna, torej, da je kodomena enaka zalogi + vrednosti. +\end_layout + +\begin_deeper +\begin_layout Standard +Naj bo +\begin_inset Formula $\left(M,\cdot\right)$ +\end_inset + + grupa. +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +udensdash{$ +\backslash +forall a,b +\backslash +in M: +\backslash +left(a^{-1}=b^{-1} +\backslash +Longrightarrow a=b +\backslash +right)$} +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +Naj bo +\begin_inset Formula $a^{-1}=b^{-1}$ +\end_inset + +. + +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +udensdash{$a=b$} +\end_layout + +\end_inset + + +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +begin{align*} +\end_layout + +\begin_layout Plain Layout + +a +\backslash +cdot a^{-1}&=e&&b +\backslash +cdot b^{-1}=e +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +a +\backslash +cdot b^{-1}&=e&&/ +\backslash +cdot b +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +a +\backslash +cdot e&=e +\backslash +cdot b +\end_layout + +\begin_layout Plain Layout + + +\backslash +end{align*} +\end_layout + +\begin_layout Plain Layout + +$$a=b$$ +\end_layout + +\end_inset + + +\end_layout + +\end_deeper +\begin_layout Enumerate +\begin_inset CommandInset label +LatexCommand label +name "enu:Dokaz-ohranjanja-inverzov:" + +\end_inset + +Dokaz ohranjanja inverzov: +\begin_inset Formula $f\left(x\right)^{-1}=f\left(x^{-1}\right)$ +\end_inset + + +\end_layout + +\begin_deeper +\begin_layout Standard +\begin_inset Formula +\[ +\left(x^{-1}\right)^{-1}=\left(x^{-1}\right)^{-1} +\] + +\end_inset + + +\end_layout + +\begin_layout Standard +Ob upoštevanju +\begin_inset CommandInset ref +LatexCommand eqref +reference "enu:Da-je-preslikava" +plural "false" +caps "false" +noprefix "false" + +\end_inset + + je to enako kot +\begin_inset Formula $x=x$ +\end_inset + +, kar drži, torej je preslikava injektivna. +\end_layout + +\begin_layout Standard +Da je surjektivna, mora veljati +\begin_inset Formula $\forall x^{-1}\exists x:x^{-1}=x$ +\end_inset + +. + Naj bo tak +\begin_inset Formula $x$ +\end_inset + + kar +\begin_inset Formula $\left(x^{-1}\right)^{-1}$ +\end_inset + +. + Dokažimo: +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +udensdash{$ +\backslash +left(x^{-1} +\backslash +right)^{-1}=x$} +\end_layout + +\begin_layout Plain Layout + + +\backslash +begin{align*} +\end_layout + +\begin_layout Plain Layout + + +\backslash +left(x^{-1} +\backslash +right)^{-1}& +\backslash +overset{?}{=}x&&/ +\backslash +cdot x^{-1} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +e&=e +\end_layout + +\begin_layout Plain Layout + + +\backslash +end{align*} +\end_layout + +\begin_layout Plain Layout + +Torej je preslikava bijektivna. +\end_layout + +\end_inset + + +\end_layout + +\end_deeper +\begin_layout Enumerate +\begin_inset CommandInset label +LatexCommand label +name "enu:Asociativnost-operacije." + +\end_inset + +Asociativnost operacije. +\end_layout + +\begin_deeper +\begin_layout Standard +Zahtevamo, da operacija ostane enaka, zato je asociativna. +\end_layout + +\end_deeper +\begin_layout Enumerate +\begin_inset CommandInset label +LatexCommand label +name "enu:Po-definiciji-homomorfizma" + +\end_inset + +Po definiciji homomorfizma je treba dokazati, da +\begin_inset Formula +\[ +\forall a,b\in M:\left(f\left(a\cdot_{1}b\right)=f\left(a\right)\cdot_{2}f\left(b\right)\right)\Longleftrightarrow\text{grupa je Abelova} +\] + +\end_inset + + +\end_layout + +\begin_deeper +\begin_layout Standard +Naj bosta +\begin_inset Formula $a,b$ +\end_inset + + poljubna iz grupe +\begin_inset Formula $\left(M,\cdot\right)$ +\end_inset + +. +\end_layout + +\begin_layout Lemma +V grupi +\begin_inset Formula $\left(N,\circ\right)$ +\end_inset + + velja za poljubna +\begin_inset Formula $x,y\in N$ +\end_inset + +: +\end_layout + +\begin_layout Lemma +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +udensdash{$ +\backslash +left(a +\backslash +circ b +\backslash +right)^{-1}=y^{-1} +\backslash +circ x^{-1}$} +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Lemma +Dokaz leme: +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +begin{align*} +\end_layout + +\begin_layout Plain Layout + + +\backslash +left(x +\backslash +circ y +\backslash +right) +\backslash +circ +\backslash +backslash&& +\backslash +left(x +\backslash +circ y +\backslash +right)^{-1}& +\backslash +overset{?}{=}y^{-1} +\backslash +circ x^{-1} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +left(x +\backslash +circ y +\backslash +right) +\backslash +circ +\backslash +left(x +\backslash +circ y +\backslash +right)^{-1}& +\backslash +overset{?}{=} +\backslash +left(x +\backslash +circ y +\backslash +right) +\backslash +circ +\backslash +left(y^{-1} +\backslash +circ x^{-1} +\backslash +right)=x +\backslash +circ +\backslash +left(y +\backslash +circ y^{-1} +\backslash +right) +\backslash +circ x^{-1} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&&e& +\backslash +overset{?}{=}x +\backslash +circ e +\backslash +circ x^{-1} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&&e& +\backslash +overset{?}{=}x +\backslash +circ x^{-1} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&&e&=e +\end_layout + +\begin_layout Plain Layout + + +\backslash +end{align*} +\end_layout + +\end_inset + +Konec leme — lema je dokazana. +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +begin{align*} +\end_layout + +\begin_layout Plain Layout + +f +\backslash +left(a +\backslash +cdot b +\backslash +right)& +\backslash +overset{?}{=}f +\backslash +left(a +\backslash +right) +\backslash +cdot f +\backslash +left(b +\backslash +right) +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +b^{-1} +\backslash +cdot a^{-1} +\backslash +overset{ +\backslash +text{lema}}{=} +\backslash +left(a +\backslash +cdot b +\backslash +right)^{-1}& +\backslash +overset{?}{=}a^{-1} +\backslash +cdot b^{-1} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +b^{-1} +\backslash +cdot a^{-1}&=a^{-1} +\backslash +cdot b^{-1}&& +\backslash +text{velja natanko tedaj, ko je grupa Abelova.} +\end_layout + +\begin_layout Plain Layout + + +\backslash +end{align*} +\end_layout + +\end_inset + + +\end_layout + +\end_deeper +\begin_layout Standard +\begin_inset CommandInset ref +LatexCommand eqref +reference "enu:Enota-se-preslika" +plural "false" +caps "false" +noprefix "false" + +\end_inset + +, +\begin_inset CommandInset ref +LatexCommand eqref +reference "enu:Da-je-preslikava" +plural "false" +caps "false" +noprefix "false" + +\end_inset + +, +\begin_inset CommandInset ref +LatexCommand eqref +reference "enu:Dokaz-ohranjanja-inverzov:" +plural "false" +caps "false" +noprefix "false" + +\end_inset + +, +\begin_inset CommandInset ref +LatexCommand eqref +reference "enu:Asociativnost-operacije." +plural "false" +caps "false" +noprefix "false" + +\end_inset + + veljajo ne glede na to, ali je grupa komutativna ali ne, +\begin_inset CommandInset ref +LatexCommand eqref +reference "enu:Po-definiciji-homomorfizma" +plural "false" +caps "false" +noprefix "false" + +\end_inset + + pa velja natanko tedaj, ko je grupa komutativna. +\begin_inset Formula $\qed$ +\end_inset + + +\end_layout + +\end_deeper +\begin_layout Enumerate +Prepričaj se, da je množica +\begin_inset Formula $\mathbb{Z}\times\mathbb{Z}$ +\end_inset + + komutativen kolobar za operaciji +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +begin{align*} +\end_layout + +\begin_layout Plain Layout + + +\backslash +left(a, b +\backslash +right) +\backslash +oplus +\backslash +left(c, d +\backslash +right)&= +\backslash +left(a+c, b+d +\backslash +right) +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + + +\backslash +left(a, b +\backslash +right) +\backslash +otimes +\backslash +left(c, d +\backslash +right)&= +\backslash +left(ac, bd +\backslash +right) +\end_layout + +\begin_layout Plain Layout + + +\backslash +end{align*} +\end_layout + +\end_inset + +Poišči tudi vse delitelje niča, tj. + neničelne elemente +\begin_inset Formula $\left(a,b\right)$ +\end_inset + +, da velja +\begin_inset Formula $\left(a,b\right)\otimes\left(c,d\right)=0\left(=e_{\oplus}\right)$ +\end_inset + + za nek neničeln +\begin_inset Formula $\left(c,d\right)$ +\end_inset + +. +\end_layout + +\begin_deeper +\begin_layout Paragraph +Rešitev +\end_layout + +\begin_layout Itemize +Dokažimo distributivnost! +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +begin{align*} +\end_layout + +\begin_layout Plain Layout + + +\backslash +left(a,b +\backslash +right) +\backslash +otimes +\backslash +left( +\backslash +left(c,d +\backslash +right) +\backslash +oplus +\backslash +left(e,f +\backslash +right) +\backslash +right)& +\backslash +overset{?}{=} +\backslash +left(a,b +\backslash +right) +\backslash +otimes +\backslash +left(c,d +\backslash +right) +\backslash +oplus +\backslash +left(a,b +\backslash +right) +\backslash +otimes +\backslash +left(e,f +\backslash +right) +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + + +\backslash +left(a,b +\backslash +right) +\backslash +otimes +\backslash +left(c+e,d+f +\backslash +right)& +\backslash +overset{?}{=} +\backslash +left(ac,bd +\backslash +right) +\backslash +oplus +\backslash +left(ae,bf +\backslash +right) +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + + +\backslash +left(a +\backslash +cdot +\backslash +left(c+e +\backslash +right),b +\backslash +cdot +\backslash +left(d+f +\backslash +right) +\backslash +right)&= +\backslash +left(a +\backslash +cdot c+a +\backslash +cdot e,b +\backslash +cdot d+b +\backslash +cdot f +\backslash +right) +\end_layout + +\begin_layout Plain Layout + + +\backslash +end{align*} +\end_layout + +\begin_layout Plain Layout + +Velja, ker je $ +\backslash +left( +\backslash +mathbb{Z},+, +\backslash +cdot +\backslash +right)$ distributiven bigrupoid. +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Itemize +Dokažimo +\begin_inset Formula $\left(\mathbb{Z}\times\mathbb{Z},\oplus\right)$ +\end_inset + + je Abelova grupa! +\end_layout + +\begin_deeper +\begin_layout Itemize +Komutativnost: +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +begin{align*} +\end_layout + +\begin_layout Plain Layout + + +\backslash +forall +\backslash +left(a,b +\backslash +right), +\backslash +left(c,d +\backslash +right) +\backslash +in +\backslash +mathbb{Z} +\backslash +times +\backslash +mathbb{Z}:&& +\backslash +left(a,b +\backslash +right) +\backslash +oplus +\backslash +left(c,d +\backslash +right)&= +\backslash +left(c,d +\backslash +right) +\backslash +oplus +\backslash +left(a,b +\backslash +right) +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +left(a+c,b+d +\backslash +right)&= +\backslash +left(c+a,d+b +\backslash +right) +\end_layout + +\begin_layout Plain Layout + + +\backslash +end{align*} +\end_layout + +\begin_layout Plain Layout + +Velja, ker je $ +\backslash +left( +\backslash +mathbb{Z},+ +\backslash +right)$ komutativen grupoid. +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Itemize +Notranja operacija: +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +begin{align*} +\end_layout + +\begin_layout Plain Layout + + +\backslash +forall +\backslash +left(a,b +\backslash +right), +\backslash +left(c,d +\backslash +right) +\backslash +in +\backslash +mathbb{Z} +\backslash +times +\backslash +mathbb{Z}:&& +\backslash +left(a,b +\backslash +right) +\backslash +oplus +\backslash +left(c,d +\backslash +right)& +\backslash +in +\backslash +mathbb{Z} +\backslash +times +\backslash +mathbb{Z} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +left(a+c,b+d +\backslash +right)& +\backslash +in +\backslash +mathbb{Z} +\backslash +times +\backslash +mathbb{Z} +\end_layout + +\begin_layout Plain Layout + + +\backslash +end{align*} +\end_layout + +\begin_layout Plain Layout + +Velja, ker je $ +\backslash +left( +\backslash +mathbb{Z},+ +\backslash +right)$ grupoid. +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Itemize +Asociativnost: +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +begin{align*} +\end_layout + +\begin_layout Plain Layout + + +\backslash +forall +\backslash +left(a,b +\backslash +right), +\backslash +left(c,d +\backslash +right), +\backslash +left(e,f +\backslash +right) +\backslash +in +\backslash +mathbb{Z} +\backslash +times +\backslash +mathbb{Z}:&& +\backslash +left(a,b +\backslash +right) +\backslash +oplus +\backslash +left( +\backslash +left(c,d +\backslash +right) +\backslash +oplus +\backslash +left(e,f +\backslash +right) +\backslash +right)&= +\backslash +left( +\backslash +left(a,b +\backslash +right) +\backslash +oplus +\backslash +left(c,d +\backslash +right) +\backslash +right) +\backslash +oplus +\backslash +left(e,f +\backslash +right) +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +left(a+ +\backslash +left(c+e +\backslash +right),b+ +\backslash +left(d,f +\backslash +right) +\backslash +right)&= +\backslash +left( +\backslash +left(a+c +\backslash +right)+e, +\backslash +left(b+d +\backslash +right)+f +\backslash +right) +\end_layout + +\begin_layout Plain Layout + + +\backslash +end{align*} +\end_layout + +\begin_layout Plain Layout + +Velja, ker je $ +\backslash +left( +\backslash +mathbb{Z},+ +\backslash +right)$ grupoid. +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Itemize +Enota: +\begin_inset Formula +\[ +\exists e\in\mathbb{Z}\times\mathbb{Z}\ni:\forall\left(a,b\right)\in\mathbb{Z}\times\mathbb{Z}:\left(a,b\right)\oplus e=\left(a,b\right) +\] + +\end_inset + +naj bo +\begin_inset Formula $e\coloneqq\left(0,0\right)$ +\end_inset + + +\begin_inset Formula +\[ +\left(a,b\right)\oplus\left(0,0\right)=\left(a+b,b+0\right)=\left(a,b\right) +\] + +\end_inset + +Velja, ker je +\begin_inset Formula $0$ +\end_inset + + enota v +\begin_inset Formula $\left(\mathbb{Z},+\right)$ +\end_inset + +. +\end_layout + +\begin_layout Itemize +Inverzi: +\begin_inset Formula +\[ +\forall\left(a,b\right)\in\mathbb{Z}\times\mathbb{Z}\exists t\in\mathbb{Z}\times\mathbb{Z}\ni:\left(a,b\right)\oplus t=e_{\oplus}=\left(0,0\right) +\] + +\end_inset + +naj bo +\begin_inset Formula $t\coloneqq\left(-a,-b\right)$ +\end_inset + + +\begin_inset Formula +\[ +\left(a,b\right)\oplus\left(-a,-b\right)=\left(a-a,b-b\right)=\left(0,0\right)=e_{\oplus} +\] + +\end_inset + +Velja, ker je +\begin_inset Formula $\left(\mathbb{Z},+\right)$ +\end_inset + + grupa. +\end_layout + +\end_deeper +\begin_layout Itemize +Dokažimo komutativnost +\begin_inset Formula $\left(\mathbb{Z}\times\mathbb{Z},\otimes\right)$ +\end_inset + +! +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +begin{align*} +\end_layout + +\begin_layout Plain Layout + + +\backslash +forall +\backslash +left(a,b +\backslash +right), +\backslash +left(c,d +\backslash +right) +\backslash +in +\backslash +mathbb{Z} +\backslash +times +\backslash +mathbb{Z}:&& +\backslash +left(a,b +\backslash +right) +\backslash +otimes +\backslash +left(c,d +\backslash +right)& +\backslash +overset{?}{=} +\backslash +left(c,d +\backslash +right) +\backslash +otimes +\backslash +left(a,b +\backslash +right) +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +left(ac,bd +\backslash +right)= +\backslash +left(ca,db +\backslash +right) +\end_layout + +\begin_layout Plain Layout + + +\backslash +end{align*} +\end_layout + +\begin_layout Plain Layout + +Velja, ker je $ +\backslash +left( +\backslash +mathbb{Z}, +\backslash +cdot +\backslash +right)$ komutativen grupoid. +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula +\[ +\qed +\] + +\end_inset + +Vsi delitelji niča +\begin_inset Formula $=\left\{ \left(a,b\right)\in\mathbb{Z}\times\mathbb{Z};\left(a,b\right)\otimes\left(c,d\right)=e_{\oplus}=\left(0,0\right)\right\} $ +\end_inset + +: +\end_layout + +\begin_layout Itemize +Če je +\begin_inset Formula $c=0$ +\end_inset + + in +\begin_inset Formula $d\not=0$ +\end_inset + +: +\begin_inset Formula +\[ +\left(a,b\right)=\left\{ \left(a,0\right);a\in\mathbb{Z}\right\} \sim\mathbb{Z} +\] + +\end_inset + + +\end_layout + +\begin_layout Itemize +Če je +\begin_inset Formula $c\not=0$ +\end_inset + + in +\begin_inset Formula $d=0$ +\end_inset + +: +\begin_inset Formula +\[ +\left(a,b\right)=\left\{ \left(0,a\right);a\in\mathbb{Z}\right\} \sim\mathbb{Z} +\] + +\end_inset + + +\end_layout + +\end_deeper +\begin_layout Enumerate +S pomočjo (razširjenega) Evklidovega algoritma izračunaj +\begin_inset Formula $\gcd\left(x^{5}+2x^{4}-x^{2}+1,x^{4}-1\right)$ +\end_inset + + in ga izrazi kot linearno kombinacijo teh dveh polinomov. +\end_layout + +\begin_deeper +\begin_layout Paragraph +Rešitev +\end_layout + +\begin_layout Standard +\begin_inset Float table +placement h +wide false +sideways false +status open + +\begin_layout Plain Layout +\begin_inset Tabular +<lyxtabular version="3" rows="7" columns="4"> +<features tabularvalignment="middle"> +<column alignment="center" valignment="top"> +<column alignment="center" valignment="top"> +<column alignment="center" valignment="top"> +<column alignment="center" valignment="top"> +<row> +<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +r +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +s +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +t +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +k +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $x^{5}+2x^{4}-x^{2}+1$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +1 +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +0 +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $x^{4}-1$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +0 +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +1 +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $x-2$ +\end_inset + + +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $-x^{2}+x+3$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +1 +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $-x-2$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $-x^{2}-x-4$ +\end_inset + + +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $7+11$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $x^{2}+x+4$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $-x^{3}-3x^{2}-6x-7$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $-\frac{1}{7}x+\frac{18}{49}$ +\end_inset + + +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $-\frac{51}{49}$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $\frac{1}{7}x^{3}-\frac{11}{49}x^{2}+\frac{10}{49}x-\frac{23}{49}$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $-\frac{1}{7}x^{4}-\frac{3}{49}x^{3}+\frac{12}{49}x^{2}+\frac{10}{49}x+\frac{4}{7}$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +0 +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +</row> +</lyxtabular> + +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Caption Standard + +\begin_layout Plain Layout +Koraki razširjenega Evklidovega algoritma. +\end_layout + +\end_inset + + +\end_layout + +\end_inset + +Tako dobljen polinom +\begin_inset Formula $-\frac{51}{49}$ +\end_inset + + normiramo (delimo +\begin_inset Formula $r,s,t$ +\end_inset + + z +\begin_inset Formula $-\frac{51}{49}$ +\end_inset + +). +\begin_inset Formula +\[ +\gcd\left(x^{5}+2x^{4}-x^{2}+1,x^{4}-1\right)=1 +\] + +\end_inset + + +\begin_inset Formula +\[ +-\frac{49}{51}\left(\frac{1}{7}x^{3}-\frac{11}{49}x^{2}+\frac{10}{49}x-\frac{23}{49}\right)\left(x^{5}+2x^{4}-x^{2}+1\right) +\] + +\end_inset + + +\begin_inset Formula +\[ +-\frac{49}{51}\left(-\frac{1}{7}x^{4}-\frac{3}{49}x^{3}+\frac{12}{49}x^{2}+\frac{10}{49}x+\frac{4}{7}\right)\left(x^{4}-1\right)=1= +\] + +\end_inset + + +\begin_inset Formula +\[ +=\left(-\frac{7}{51}x^{3}+\frac{11}{51}x^{2}-\frac{10}{51}x+\frac{23}{51}\right)\left(x^{5}+2x^{4}-x^{2}+1\right)+ +\] + +\end_inset + + +\begin_inset Formula +\[ ++\left(\frac{7}{51}x^{4}+\frac{3}{51}x^{3}-\frac{12}{51}x^{2}-\frac{10}{51}x-\frac{28}{51}\right)\left(x^{4}-1\right) +\] + +\end_inset + + +\end_layout + +\end_deeper +\begin_layout Standard +\begin_inset Separator plain +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset External + template PDFPages + filename /home/z/www/dir/zapiski/LA1DN4 FMF 2023-12-26.pdf + extra LaTeX "pages=-" + +\end_inset + + +\end_layout + +\end_body +\end_document diff --git a/šola/la/dn4/gcd.r b/šola/la/dn4/gcd.r new file mode 100644 index 0000000..5d10a40 --- /dev/null +++ b/šola/la/dn4/gcd.r @@ -0,0 +1,29 @@ +polygcd <- function (a, b) { + rp <- a + sp <- 1 + tp <- 0 + r <- b + s <- 0 + t <- 1 + while (any(r != 0)) { + print(list("debug"=list("r"=r, "s"=s, "t"=t))) + rs <- r + ss <- s + ts <- t + korak <- function (t, p) { + odstrani_ničle <- function (v) { + if (all(v == 0)) + return(v) + return(v[min(which(v!=0)):max(which(v!=0))]) + } + return(p-polymul(odstrani_ničle(t), polydiv(odstrani_ničle(r), odstrani_ničle(rp))$d)) + } + r <- korak(r, rp) + s <- korak(s, sp) + t <- korak(t, tp) + rp <- rs + sp <- ss + tp <- ts + } + return(list("r"=rp, "s"=sp, "t"=tp)) +} diff --git a/šola/p1/dn/DN06_izhodisce/Premica.java b/šola/p1/dn/DN06_izhodisce/Premica.java new file mode 100644 index 0000000..b4757e2 --- /dev/null +++ b/šola/p1/dn/DN06_izhodisce/Premica.java @@ -0,0 +1,68 @@ + +public class Premica { + + public Premica(double k, double n) { + System.out.println("true"); + System.exit(0); + } + + public double vrniK() { + // dopolnite/popravite ... + return 0.0; + } + + public double vrniN() { + // dopolnite/popravite ... + return 0.0; + } + + public String toString() { + // dopolnite/popravite ... + return null; + } + + public Tocka tockaPriX(double x) { + // dopolnite/popravite ... + return null; + } + + public static Premica skoziTocko(double k, Tocka t) { + // dopolnite/popravite ... + return null; + } + + public Premica vzporednica(Tocka t) { + // dopolnite/popravite ... + return null; + } + + public Premica pravokotnica(Tocka t) { + // dopolnite/popravite ... + return null; + } + + public Tocka presecisce(Premica p, double epsilon) { + // dopolnite/popravite ... + return null; + } + + public Tocka projekcija(Tocka t) { + // dopolnite/popravite ... + return null; + } + + public double razdalja(Tocka t) { + // dopolnite/popravite ... + return 0.0; + } + + public double razdaljaOdIzhodisca() { + // dopolnite/popravite ... + return 0.0; + } + + public double razdalja(double n) { + // dopolnite/popravite ... + return 0.0; + } +} diff --git a/šola/p1/dn/DN06_izhodisce/Test01.java b/šola/p1/dn/DN06_izhodisce/Test01.java new file mode 100644 index 0000000..4eea9ab --- /dev/null +++ b/šola/p1/dn/DN06_izhodisce/Test01.java @@ -0,0 +1,85 @@ + +public class Test01 { + + private static double EPSILON = 1e-7; + + public static void main(String[] args) { + Tocka a = new Tocka(3.0, -1.0); + Tocka b = new Tocka(-2.0, 2.0); + preveri("Tocka/vrniX", a.vrniX(), 3.0); + preveri("Tocka/vrniY", a.vrniY(), -1.0); + preveri("Tocka/toString", a.toString(), "(3.00, -1.00)"); + preveri("Tocka/razdalja", a.razdalja(b), Math.sqrt(34.0)); + preveri("Tocka/izhodisce", Tocka.izhodisce(), new Tocka(0.0, 0.0)); + preveri("Tocka/razdaljaOdIzhodisca", a.razdaljaOdIzhodisca(), Math.sqrt(10.0)); + + Premica p = new Premica(2.0, -1.0); + Premica q = new Premica(-1.0, -4.0); + preveri("Premica/vrniK", p.vrniK(), 2.0); + preveri("Premica/vrniN", p.vrniN(), -1.0); + preveri("Premica/toString", p.toString(), "y = 2.00 x + -1.00"); + preveri("Premica/tockaPriX", p.tockaPriX(3.0), new Tocka(3.0, 5.0)); + preveri("Premica/skoziTocko", Premica.skoziTocko(-3.0, a), new Premica(-3.0, 8.0)); + preveri("Premica/vzporednica", p.vzporednica(a), new Premica(2.0, -7.0)); + preveri("Premica/pravokotnica", p.pravokotnica(a), new Premica(-0.5, 0.5)); + preveri("Premica/presecisce", p.presecisce(q, EPSILON), new Tocka(-1.0, -3.0)); + preveri("Premica/projekcija", p.projekcija(a), new Tocka(0.6, 0.2)); + preveri("Premica/razdalja(Tocka)", p.razdalja(a), 6.0 * Math.sqrt(5.0) / 5.0); + preveri("Premica/razdaljaOdIzhodisca", p.razdaljaOdIzhodisca(), Math.sqrt(5.0) / 5.0); + preveri("Premica/razdalja(double)", p.razdalja(2.0), 3.0 * Math.sqrt(5.0) / 5.0); + } + + private static void preveri(String besedilo, double dobljeno, double pricakovano) { + izpisi(besedilo, steviliEnaki(pricakovano, dobljeno)); + } + + private static void preveri(String besedilo, String dobljeno, String pricakovano) { + izpisi(besedilo, nizaEnaka(pricakovano, dobljeno)); + } + + private static void preveri(String besedilo, Tocka dobljeno, Tocka pricakovano) { + izpisi(besedilo, tockiEnaki(pricakovano, dobljeno)); + } + + private static void preveri(String besedilo, Premica dobljeno, Premica pricakovano) { + izpisi(besedilo, premiciEnaki(pricakovano, dobljeno)); + } + + private static boolean tockiEnaki(Tocka a, Tocka b) { + if (a == null && b == null) { + return true; + } + if (a == null || b == null) { + return false; + } + return steviliEnaki(a.vrniX(), b.vrniX()) && steviliEnaki(a.vrniY(), b.vrniY()); + } + + private static boolean premiciEnaki(Premica a, Premica b) { + if (a == null && b == null) { + return true; + } + if (a == null || b == null) { + return false; + } + return steviliEnaki(a.vrniK(), b.vrniK()) && steviliEnaki(a.vrniN(), b.vrniN()); + } + + private static boolean steviliEnaki(double a, double b) { + return Math.abs(a - b) < EPSILON; + } + + private static boolean nizaEnaka(String a, String b) { + if (a == null && b == null) { + return true; + } + if (a == null || b == null) { + return false; + } + return a.equals(b); + } + + private static void izpisi(String besedilo, boolean sodba) { + System.out.printf("%-27s --> %s%n", besedilo, sodba ? "OK" : "napaka"); + } +} diff --git a/šola/p1/dn/DN06_izhodisce/Tocka.java b/šola/p1/dn/DN06_izhodisce/Tocka.java new file mode 100644 index 0000000..7892a34 --- /dev/null +++ b/šola/p1/dn/DN06_izhodisce/Tocka.java @@ -0,0 +1,40 @@ + +public class Tocka { + + public Tocka(double x, double y) { + System.out.println("true"); + System.exit(0); + } + + public double vrniX() { + // dopolnite/popravite ... + return 0.0; + } + + public double vrniY() { + // dopolnite/popravite ... + return 0.0; + } + + public String toString() { + // dopolnite/popravite ... + return null; + } + + // ustrezno dopolnite/popravite ... + public static Tocka izhodisce() { + // dopolnite/popravite ... + return null; + } + + // ustrezno dopolnite/popravite ... + public double razdalja(Tocka t) { + // dopolnite/popravite ... + return 0.0; + } + + // ustrezno dopolnite/popravite ... + public double razdaljaOdIzhodisca() { + return 0.0; + } +} |