Archive for category Matikka

Machine learning article, about minimizing squared error – geogebra to play with

Geogebra applet with 4 datapoints, fitting line with best square distance (from point to line)

square here, as well as in variance concept – is because distance can well be negative, but we need to be able to sum it neatly somehow, therefore square is rational with MMSE and variance

Read the rest of this entry »

Machine Learning, Bayes theorem, simple explanation with GeoGebra visualization

Have met a concept of Bayes theorem, and would pretty much like to visualize it here. As per purpose of this blog, its studying diary, so pretty much – visualizations, and making of those – would give me myself broader understanding.

Not to mention, that keeping notes publicly does make wanders to being neat in thoughtful way, so – lets begin.

Suppose we hear the description of a man: “He is strong and with a loud strong but assuring voice”.

Who is this man, do we want to guess – is he a librarian or a military drill sergeant?

Read the rest of this entry »

Cartesian product of countable infinities is countably infinite proof

Suppose we have two countably infinite sets, which means we can find injection (one-to-one) relation to natural numbers. 

In other words, we could literally assign natural number indexes to only one of each member of the set.

So, we have with cardinality , and with cardinality

Then cartersian product (set of all possible pairs from A and from B) – is also infinite, but countable. I mean, for , we can assign single natural number for each member of P.

Lets prove it. Suppose we injections f and g, so that and

Lets define function this way:

Then for and , because of  unique division into primes and f,g injectivity (a,b)=(c,d).

Therefore there is injection from p(a,b) to natural numbers, and cartesian product is infinitely countable.

About number construction

– Let us construct natural numbers (0,1,2,3..)
– Then from naturals, lets construct integer numbers (…,-2,-1,0,1,2…)
– Then from integers, lets construct rationals (…,-0.3,…,0,…,1/2,..,0.75,..)
– And finally from rationals – real numbers (…,-0.3,…,0,…,1/π,…,1/2,..,0.75,..,e,…,π,…)
Read the rest of this entry »

Elementary Linear Cellular automata example

Lets consider linear cellular automata with Wolfram rule 90

Elementary cellular automata is essentially string of two symbols, lets call them 0 and 1, equipped with rules (and starting configuration, of course) 

Rule takes symbol in the position, as well as left and right neighbors. Ie – when calculating symbol of the cell, we should consider 3 cells, cell to the left, cell itself and cell to the right.

Ie – suppose we have set of rules(*):
111 - 0
110 - 1
101 - 0
100 - 1
011 - 1
010 - 0
001 - 1
000 - 0

Or graphically:


So if we have 10011 for starting configuration, calculation goes like this(from top to bottom):

1 0 0 1 1
(0) 1 1 1 (1)
(1) 1 0 0 (1)

(italics) means that we dont know which symbol is to the left and right to the starting configuration, for simplicity I consider here absent symbols to be 0s (ie …00000100110000…)

Now, what is 90, which is called Wolfram rule.

It is obvious, that  3 cells define state, and since we have two symbols, all possible combinations are , and since we have two possible symbols for each combination – rule of CA can be expressed as (0,2⁸=256) number.

90 in binary would be (*), which is enough to describe elementary ca behavior.

Lebesque measure of line on R² surface

There were question in exam, which I understood very close to correct, thus absolutely wrong.

Roughly translated: “Define real axis ℝ Lebesque outermeasure on ℝ² surface

Lets get into it. Bit intuitively first.. Suppose we have segment of a line (a,b)

segment (a,b) on real axis

segment (s) itself can be expressed as

Actually, lets forget about s, lets consider without segments, ie

Then outer measure can be expressed as union of open sets:

for all

Where intervals are:
Thus length of intervals are from one integer to another – ,.. all integers
Height of intervals are

Ie , where biggest height is , which is quater of epsilon.


or shorter: and for all

It is obvious from here

This article was inspired by Margarita.

Rekursioyhtälö, Turku Energia, Fibonacci luvut

turku-energia-fibonacci“Turku Energia”  laitoksen piipussa ovat numerot:


Ne ovat Fibonacci luvut, niitä saadan seuraavalla tavalla.

Ensimmäiset kaksi ovat 1 ja 1.

Jokainen seuraava saadan laskemalla yhteen kaksi edellistä:


Jne. Mutta entä jos piippu olisi tosi korkea, jos me halutaan vaikka 100, or tuhannes luku siitä jonosta. Laskemaan kaikki edelliset luvut olisi paljon työtä.

Voidaanko me keksiä joku näppärä keino saada Fibonacci luku ilman että laskisimme edelliset yhteen?

Read the rest of this entry »

p-adiset luvut, vähän alkua

p-adiset luvut on hieno työkalu, joka ei vaadi mitään erityistä osaamista. Ainoastaan – pitää unohda koulun asiat.

Ok. Desimaalit ovat tuttu asia, esimerkiksi neljäs osa on 0.25

Periodinen desimaali murtoluku pitäisi olla tuttu myös, esimerkiksi kolmas osa on 0.333…

Entäs jos tehdä sellainen luku jossa … on vasemalla, eikä oikealla puolella? …123123 tyyliin?

Read the rest of this entry »

Infinite serie of powers

Olkoon seuraava yhtälö:

Miten sen voisi ratkaista?

Read the rest of this entry »

Pyramidi 10, Lukio integraalilaskenta, 244


Read the rest of this entry »