text:
## mlcourse.ai – Open Machine Learning Course¶

Author: Nikita Simonov (@simanjan)

### Self orginizing map.¶

Self-organizing map is type of neural network is trained using unsupervised learning and also is an one of Kohonen neural network. The idea of creatins the such networks belongs to the Finnish scientist Teuvo Kohonen. Basically that networks perform clustering and data visualization tasks. But they also allow to reduce multidimensional data into a space of a smaller dimension, and are used to search for patterns in the data.

In this article we will see how to solve the clustering problem with help of the Kohonen network and will build self organizing map.

### Kohonen neural network.¶

The main element of the network is the Kohonen layer consists of a number of linear elements has m inputs. Every layer get on input the $x = (x_1, x_2, ... , x_n)$ vector from input data. The output of every layer is $$y_j = \sum_i^n w_{ij}x_i$$

• $i$ - number of input.
• $j$ - number of layer (number of neuron).
• $w_{ij}$ - weight of i-input j-layer.

After the $y$ of each neuron is calculated, the winner’s neuron will be determined according to the “winner takes all” rule. The max $$y_{max} = argmax\{y_j\}$$ is searched among all and then the output of such a neuron will be $1$, all other outputs will be $0$. If the max is reached in several neurons:

• all signals will be equal to $1$.
• the first in the max list will be $1$.

### Kohonen map.¶

• Inizialization

The most popular ways to set the initial node weights are:

• Set the random values to all weights.
• To take random $x_i$ from the input data and set it into weights.
• The choice of weight vectors from from main components (PCA) of the input data set.

As a result, we get $M_k$ is the map of neurons. $k$- neurons, their count is sets by the an analytics.

$N$ - number of input data.

• Trainning

Initializing $t=0$ is it number of iteration and shuffling input data.

• Choosing $x(t)$ from input data.
• Calculate distance $$d_i(x(t), m_i(t)) = \sqrt{(x_1(t) - m_{1i}(t))^2 + (x_2(t) - m_{2i}(t))^2 + ... + (x_n(t) - m_{ni}(t))^2}$$ from the input vector to all neurons of the map. Here:

Аmong all the neurons, it is determined closest to the incoming vector $d_{min} = argmin\{d_i\}$.The neuron associated to the $d_{min}$ will be the winner. If $d_{min}$ is reached at several neurons the winner will chosen randomly. $m_w$ is winner neuron.

Kohonen maps, unlike networks, use the "Winner Takes Most" algorithm in training. In this way the weights of not only the neuron of the winner, but also of topologically close neurons are updated.

• Calculate $h$ function that defines the "measure of neighborhood" for neurons. Typically $h$ is the Gaussian function. $$h_{wi} = \alpha(t) \exp(-\frac{||m_w - m_i||^2}{2 \gamma(t) ^ 2})$$

• $m_w$ is winner neuron.
• $m_i \in M_k$ is neuron from map.
• $\gamma(t)$ is the value function the number of neighbors. The most commonly used function is linearly decreasing from the training itaration number. The value on the first iteration sets by the analyst. Also in simple version $\gamma(t) = \alpha(t)$.
• $\alpha(t)$ is learning rate function. In simple version is constant. But for the best result, the function is often used $$\alpha(t) = \frac{A}{t + B}$$ here
• $t$ is number of iteration.
• $A and B$ is constant.
• Change weights.

Calculate $m_i(t) = m_i(t-1) + h_i(t) (x(t) - m_i(t-1)), i = 1,2,..., k$.

Update the weights of all neurons that are neighbors of the winner's neuron. Increase $t$ and repeat learning.

Training continues until $t < N$ or until the error becomes small.

Self-organizing maps uses in data mining like a text analysis, financial statement analysis or image analysis.

- Dimensionality reduction.
- Topological modeling of the training set.
- Resistance to outliers and missed data.
- Simple visualization

Visualization of the work of the self-organizing card.

Lets see small example.

First we should install the 'SOMPY' library. The "SOMPY" does not have an official documentation.

In [1]:
!pip3 install git+https://github.com/compmonks/SOMPY.git

Collecting git+https://github.com/compmonks/SOMPY.git
Cloning https://github.com/compmonks/SOMPY.git to /tmp/pip-req-build-e6f2f3m_
Requirement already satisfied: numpy>=1.7 in /usr/local/lib/python3.5/dist-packages (from SOMPY==1.0) (1.15.2)
Requirement already satisfied: scipy>=0.9 in /usr/local/lib/python3.5/dist-packages (from SOMPY==1.0) (1.1.0)
Requirement already satisfied: scikit-learn>=0.16 in /usr/local/lib/python3.5/dist-packages (from SOMPY==1.0) (0.20.0)
Collecting numexpr>=2.5 (from SOMPY==1.0)
100% |################################| 163kB 729kB/s ta 0:00:01
Building wheels for collected packages: SOMPY
Running setup.py bdist_wheel for SOMPY ... done
Stored in directory: /tmp/pip-ephem-wheel-cache-8zh2ikor/wheels/cc/5f/3e/4c08f1ca381629d98f50c9ba04bd95c9e704dc37ebdf301c1c
Successfully built SOMPY
Installing collected packages: numexpr, SOMPY
Successfully installed SOMPY-1.0 numexpr-2.6.8

Also you may need to install ipdb.

In [2]:
!pip3 install ipdb

Collecting ipdb
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from ipdb) (20.7.0)
Requirement already satisfied: ipython>=5.0.0 in /usr/local/lib/python3.5/dist-packages (from ipdb) (7.0.1)
Requirement already satisfied: pickleshare in /usr/local/lib/python3.5/dist-packages (from ipython>=5.0.0->ipdb) (0.7.5)
Requirement already satisfied: prompt-toolkit<2.1.0,>=2.0.0 in /usr/local/lib/python3.5/dist-packages (from ipython>=5.0.0->ipdb) (2.0.5)
Requirement already satisfied: backcall in /usr/local/lib/python3.5/dist-packages (from ipython>=5.0.0->ipdb) (0.1.0)
Requirement already satisfied: jedi>=0.10 in /usr/local/lib/python3.5/dist-packages (from ipython>=5.0.0->ipdb) (0.13.1)
Requirement already satisfied: decorator in /usr/local/lib/python3.5/dist-packages (from ipython>=5.0.0->ipdb) (4.3.0)
Requirement already satisfied: traitlets>=4.2 in /usr/local/lib/python3.5/dist-packages (from ipython>=5.0.0->ipdb) (4.3.2)
Requirement already satisfied: pygments in /usr/local/lib/python3.5/dist-packages (from ipython>=5.0.0->ipdb) (2.2.0)
Requirement already satisfied: pexpect; sys_platform != "win32" in /usr/local/lib/python3.5/dist-packages (from ipython>=5.0.0->ipdb) (4.6.0)
Requirement already satisfied: simplegeneric>0.8 in /usr/local/lib/python3.5/dist-packages (from ipython>=5.0.0->ipdb) (0.8.1)
Requirement already satisfied: wcwidth in /usr/local/lib/python3.5/dist-packages (from prompt-toolkit<2.1.0,>=2.0.0->ipython>=5.0.0->ipdb) (0.1.7)
Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.5/dist-packages (from prompt-toolkit<2.1.0,>=2.0.0->ipython>=5.0.0->ipdb) (1.11.0)
Requirement already satisfied: parso>=0.3.0 in /usr/local/lib/python3.5/dist-packages (from jedi>=0.10->ipython>=5.0.0->ipdb) (0.3.1)
Requirement already satisfied: ipython-genutils in /usr/local/lib/python3.5/dist-packages (from traitlets>=4.2->ipython>=5.0.0->ipdb) (0.2.0)
Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.5/dist-packages (from pexpect; sys_platform != "win32"->ipython>=5.0.0->ipdb) (0.6.0)
Building wheels for collected packages: ipdb
Running setup.py bdist_wheel for ipdb ... done
Stored in directory: /root/.cache/pip/wheels/a8/0e/e2/ffc7bedd430bfd12e9dba3c4dd88906bc42962face85bc4df7
Successfully built ipdb
Installing collected packages: ipdb
Successfully installed ipdb-0.11

Import all necessary libraries.

In [3]:
import matplotlib.pylab as plt
%matplotlib inline
import warnings
warnings.filterwarnings("ignore")
import pandas as pd
import numpy as np
from time import time
import sompy
np.random.seed(17)

Loaded backend module://ipykernel.pylab.backend_inline version unknown.

Creating a "toy" dataset.

In [38]:
data_len = 200

data_frame_1 = pd.DataFrame(data=np.random.rand(data_len, 4))
data_frame_1.values[:, 1] = (data_frame_1.values[:, 1] + .42 * np.random.rand(data_len, 1))[:, 0]

data_frame_2 = pd.DataFrame(data=np.random.rand(data_len, 4) + 1)
data_frame_2.values[:, 1] = (-1 * data_frame_2.values[:, 1] + .62 * np.random.rand(data_len, 1))[:, 0]

data_frame_3 = pd.DataFrame(data=np.random.rand(data_len, 4) + 2)
data_frame_3.values[:, 1] = (.5 * data_frame_3.values[:, 1] + 1 * np.random.rand(data_len, 1))[:, 0]

data_frame_4 = pd.DataFrame(data=np.random.rand(data_len, 4) + 3.5)
data_frame_4.values[:, 1] = (-.1 * data_frame_4.values[:, 1] + .5 * np.random.rand(data_len,1))[:, 0]

data_full = np.concatenate((data_frame_1, data_frame_2, data_frame_3, data_frame_4))

fig = plt.figure()
plt.plot(data_full[:, 0], data_full[:, 1],'ob', alpha=0.2, markersize=4)
fig.set_size_inches(7, 7)

In [39]:
data_full

Out[39]:
array([[ 0.70080903,  0.16735077,  0.23902264,  0.15855355],
[ 0.99098624,  0.32836844,  0.52532888,  0.86416106],
[ 0.50765871,  0.39624144,  0.55753557,  0.6274681 ],
...,
[ 4.27444825, -0.31539828,  4.15011112,  3.63629497],
[ 3.60632082,  0.0898611 ,  4.22930109,  4.07777338],
[ 4.03323389, -0.07237765,  3.93762173,  3.79096296]])

First we need to set the size of the map, the set of toy data is small, so first we will set the small size of the map.

In [13]:
mapsize = [2,2]

The build method from SOMFactory creates self organizing map, give it the size of the map and the data. the method takes the size of the map and the data.

initialization='random' is a type of initial node weights, the random values to all weights.

In [14]:
som = sompy.SOMFactory.build(
data_full,
mapsize,
initialization='random')
som.train(n_job=1, verbose='info')

 Training...
random_initialization took: 0.000000 seconds
Rough training...

epoch: 1 ---> elapsed time:  0.106000, quantization error: 1.658845

Finetune training...

epoch: 1 ---> elapsed time:  0.106000, quantization error: 1.515790

Final quantization error: 1.515790
train took: 0.223000 seconds

For visualizaion used mapview.View2DPacked.

In [47]:
v = sompy.mapview.View2DPacked(10, 10, 'example', text_size=8)
v.show(som)

The som could recognize four clusters. Although the scope of the cluster are far from ideal.

The "cluster" method is using sklearn.Kmeans for predict clusters on the raw data.

In [48]:
v = sompy.mapview.View2DPacked(5, 5, 'test',text_size=8)
som.cluster(n_clusters=4)
som.cluster_labels

Out[48]:
array([2, 0, 1, 3], dtype=int32)
In [49]:
v.show(som, what='cluster');

Let's look at the visualization of clusters on the grid. For this use HitMapView.

In [50]:
h = sompy.hitmap.HitMapView(8, 8, 'hitmap', text_size=8, show_text=True)
h.show(som);

The grid of self organizing map have a two types:

- square grid
- hexagonal grid

Now we will create a new SOM and add some arguments for best result.

Increasing map size.

In [51]:
mapsize = [20,20]

lattice='rect' is a square grid of SOM.

normalization='var' is the type of normalization) of the input data. 'var' is t-statistic. $$\frac{X-\bar{X}}{s}$$

initialization='pca' is a type of initial node weights, principal component initialization.

neighborhood='gaussian' use the 'gaussian' function for "measure of neighborhood".

In [64]:
som = sompy.SOMFactory.build(
data_full,
mapsize,
lattice='rect',
normalization='var',
initialization='random',
neighborhood='gaussian')
som.train(n_job=1, verbose='info')

 Training...
random_initialization took: 0.001000 seconds
Rough training...

epoch: 1 ---> elapsed time:  0.127000, quantization error: 0.553699

epoch: 2 ---> elapsed time:  0.126000, quantization error: 1.159679

epoch: 3 ---> elapsed time:  0.113000, quantization error: 0.416257

epoch: 4 ---> elapsed time:  0.113000, quantization error: 0.370592

epoch: 5 ---> elapsed time:  0.123000, quantization error: 0.345972

epoch: 6 ---> elapsed time:  0.111000, quantization error: 0.337165

epoch: 7 ---> elapsed time:  0.128000, quantization error: 0.329347

epoch: 8 ---> elapsed time:  0.123000, quantization error: 0.322139

epoch: 9 ---> elapsed time:  0.117000, quantization error: 0.315155

epoch: 10 ---> elapsed time:  0.118000, quantization error: 0.307990

epoch: 11 ---> elapsed time:  0.143000, quantization error: 0.299146

epoch: 12 ---> elapsed time:  0.119000, quantization error: 0.287074

epoch: 13 ---> elapsed time:  0.120000, quantization error: 0.270343

epoch: 14 ---> elapsed time:  0.126000, quantization error: 0.249964

epoch: 15 ---> elapsed time:  0.114000, quantization error: 0.220684

Finetune training...

epoch: 1 ---> elapsed time:  0.138000, quantization error: 0.182322

epoch: 2 ---> elapsed time:  0.113000, quantization error: 0.208519

epoch: 3 ---> elapsed time:  0.112000, quantization error: 0.204792

epoch: 4 ---> elapsed time:  0.121000, quantization error: 0.201532

epoch: 5 ---> elapsed time:  0.120000, quantization error: 0.198859

epoch: 6 ---> elapsed time:  0.110000, quantization error: 0.196108

epoch: 7 ---> elapsed time:  0.113000, quantization error: 0.193618

epoch: 8 ---> elapsed time:  0.114000, quantization error: 0.191216

epoch: 9 ---> elapsed time:  0.119000, quantization error: 0.188980

epoch: 10 ---> elapsed time:  0.129000, quantization error: 0.187047

epoch: 11 ---> elapsed time:  0.110000, quantization error: 0.184945

epoch: 12 ---> elapsed time:  0.115000, quantization error: 0.183036

epoch: 13 ---> elapsed time:  0.115000, quantization error: 0.181090

epoch: 14 ---> elapsed time:  0.131000, quantization error: 0.178869

epoch: 15 ---> elapsed time:  0.124000, quantization error: 0.176841

epoch: 16 ---> elapsed time:  0.123000, quantization error: 0.174875

epoch: 17 ---> elapsed time:  0.141000, quantization error: 0.172770

epoch: 18 ---> elapsed time:  0.119000, quantization error: 0.170856

epoch: 19 ---> elapsed time:  0.124000, quantization error: 0.168818

epoch: 20 ---> elapsed time:  0.121000, quantization error: 0.166775

epoch: 21 ---> elapsed time:  0.113000, quantization error: 0.164791

epoch: 22 ---> elapsed time:  0.110000, quantization error: 0.162429

epoch: 23 ---> elapsed time:  0.114000, quantization error: 0.160362

epoch: 24 ---> elapsed time:  0.110000, quantization error: 0.158399

epoch: 25 ---> elapsed time:  0.150000, quantization error: 0.156344

Final quantization error: 0.156344
train took: 5.054000 seconds

In [65]:
v = sompy.mapview.View2DPacked(10, 10, 'example', text_size=8)
v.show(som)

In [62]:
v = sompy.mapview.View2DPacked(5, 5, 'test',text_size=8)
som.cluster(n_clusters=4)
som.cluster_labels

Out[62]:
array([3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0], dtype=int32)
In [63]:
h = sompy.hitmap.HitMapView(8, 8, 'hitmap', text_size=8, show_text=True)
h.show(som);

Now let's use the SOM for the Iris Dataset

In [5]:
from sklearn import datasets

In [6]:
iris = datasets.load_iris()

In [7]:
iris.target_names

Out[7]:
array(['setosa', 'versicolor', 'virginica'], dtype='<U10')
In [11]:
mapsize = [20,20]

In [13]:
iris.target

Out[13]:
array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2])
In [41]:
%%time
som = sompy.SOMFactory.build(
iris.data,
mapsize,
lattice='rect',
normalization='var',
initialization='random',
neighborhood='gaussian')
som.train(n_job=1, verbose=False)

CPU times: user 17.4 s, sys: 53.7 s, total: 1min 11s
Wall time: 24.2 s

In [31]:
v = sompy.mapview.View2DPacked(10, 10, 'iris', text_size=8)
v.show(som, which_dim=[0,1,2])

The raw data.

In [33]:
view2D  = sompy.mapview.View2D(10,10,"Iris_raw_data",text_size=8)
view2D.show(som, col_sz=4, which_dim="all",desnormalize=True)

After training, SOM separates four distinct clusters, which is true.

In [34]:
iris.data.shape

Out[34]:
(150, 4)

Visualization of a grid.

In [35]:
v = sompy.mapview.View2DPacked(5, 5, 'test',text_size=8)
som.cluster(n_clusters=3)
som.cluster_labels

Out[35]:
array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 2, 2, 2, 2, 0, 0, 2, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
2, 2, 2, 0, 0, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2,
2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2,
2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 1, 1, 1, 1,
1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1,
1, 1, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0,
0, 0, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,
2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 2, 2, 2,
2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2,
2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1], dtype=int32)
In [36]:
h = sompy.hitmap.HitMapView(8, 8, 'hitmap_iris', text_size=8, show_text=True)
h.show(som, );

Also we can build the U-matrix. Use umatrix.UMatrixView for visualization.

In [37]:
u = sompy.umatrix.UMatrixView(20, 20, 'umatrix')
UMAT  = u.build_u_matrix(som)
UMAT = u.show(som)

### Conclusion¶

Unfortunately, it’s impossible to consider the example of a hexagonal grid, because the library does not have the corresponding implementation. Also normalization='var' is only one implementation of the normalization.

Kohonen self-organizing maps solve many issues and are a powerful tool for data analysis. In this article, we learned the principle of the SOM, as well as considered small examples of clustering and data visualization. But at the moment, the SOM is losing its popularity in favor of other algorithms.


text:
# Checking the asumption of independence in binomial trials using posterior predictive checking

## Posterior predictive checking

What is a posterior predictive check ? According to Gelman et al. (2013, page 151), “Bayesian predictive checking generalizes classical hypothesis testing by averaging over the posterior distibution of the unknown parameters vector $$\theta$$ rather than fixing it at some estimate $$\hat{\theta}$$”.

To explore this idea in more details, we are going to extend an example presented in Gelman et al. (2013, page 147) to a case study I have already discussed in two previous blogposts (here and here). Let’s say I am recruiting participants for a psychology study that is lasting for approximately half an hour. If everything goes smoothly, I can manage to recruit 2 participants per hour, and doing it between 9am and 6pm (having the first participant at 9am, the second one at 9.30am and the last one at 5.30pm) for a whole week (from Monday to Friday) would give me 90 potential participants.

## Beta-Binomial model

We know that some participants won’t show up to the time slot they registered for. I am interested in knowing the mean probability of presence, that we will call $$\theta$$.

This sequence of binary outcomes (presence vs. absence) $$y_{1}, \dots, y_{n}$$ is modelled as a serie of independent trials with common probability of success (presence) $$\theta$$, which is attributed a conjugate Beta prior, with shape parameters $$\alpha$$ and $$\beta$$ (encoded in the second line of our model).

\begin{aligned} y &\sim \mathrm{Binomial}(n, \theta) \\ \theta &\sim \mathrm{Beta}(\alpha, \beta) \\ \end{aligned}

We could choose to give $$\theta$$ a uniform prior between 0 and 1 (to express our total ignorance about its value), but based on previous experiments I carried out, I know that participants tend to be present with a probability around $$\frac{1}{2}$$. Thus, we will choose a probability distribution that represents this prior knowledge (here a $$\mathrm{Beta}(2,2)$$, see the first figure for an illustration).

################################################################################
# Checking the assumption of independence in binomial trials
# Example inspired from Gelman et al. (2013, page 147)
####################################################################

library(tidyverse)

y <- # getting the data
c(
0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0,
0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1,
1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,
1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1,
0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0
)

## The problem

Our model is assuming independent trials, i.e., it’s assuming that the presence of a participant is independent of the presence of another participant, which is akin to say that the model is assuming no autocorrelation in the serie. Autocorrelation would be evidence that the model is flawed.

One way to estimate the degree of autocorrelation in the serie is to simply count the number of switches between presence and absence (i.e., between zeros and ones). An abnormally low number of switches (for a particular $$n$$ and $$\theta$$) would be evidence that some autocorrelation is present. Thus, the number of switches becomes a test quantity $$T(y)$$, which describes the degree of autocorrelation in the serie, and a way of testing the assumptions of our model.

# function to determine the number of switches in a numerical vector

nb_switches <- function(x) as.numeric(sum(diff(x) != 0) )

# determining the number of switches Ty in observed data y

(Ty <- nb_switches(y) )
## [1] 28

We observed 28 switches in our data. To know whether this number is surprising, given our number of observation and the mean probability of presence, we will use use posterior predictive checking. But first, we need to compute the posterior distribution $$p(\theta | y)$$.

## Computing the posterior distribution

We know that the posterior density under this model is given by:

$p(\theta | y) \sim \mathrm{Beta}(\alpha + y, \beta + n - y)$ where $$y$$ is the number of successes and $$n$$ is the total number of observations. In our case, the posterior distribution of $$\theta$$ given $$y$$ is then $$\mathrm{Beta}(2 + 55, 2 + 90 - 55) = \mathrm{Beta}(57, 37)$$, which is plotted below.

###############################################################
# computing the posterior
#######################################################

n <- length(y) # number of trials
z <- sum(y) # number of 1s
a <- b <- 2 # parameters of the beta prior

grid <- seq(from = 0, to = 1, by = 0.01) # defines grid

################################################
# analytic derivation of the posterior
#########################################

prior <- dbeta(grid, a, b)
posterior <- dbeta(grid, z + a, n - z + b)

data.frame(theta = grid, prior = prior, posterior = posterior) %>%
gather(type, value, prior:posterior) %>%
ggplot(aes(x = theta, y = value, colour = type, fill = type) ) +
geom_area(alpha = 0.8, position = "identity", size = 1) +
theme_bw(base_size = 12) +
scale_fill_grey() +
scale_colour_grey() +
ylab("")

The mean of the posterior distribution is given by $$\dfrac{\alpha + y}{\alpha + \beta + n}$$, and is equal to (a + z) / (a + b + n) = 0.606, which can be interpreted as the mean probability of presence.

## Conjugacy

This example allows us to define what conjugacy is. Formally, if $$\mathcal{F}$$ is a class of sampling distributions $$p(y|\theta)$$, and $$\mathcal{P}$$ is a class of prior distributions for $$\theta$$, then the class $$\mathcal{P}$$ is conjugate fo $$\mathcal{F}$$ if

$p(\theta|y) \in \mathcal{P} \text{ for all } p(\cdot | \theta) \in \mathcal{F} \text{ and } p(\cdot) \in \mathcal{P}$

(Gelman et al., 2013, page 35). In other words, a prior is called a conjugate prior if, when converted to a posterior by being multiplied by the likelihood, it keeps the same form. In our case, the Beta prior is a conjugate prior for the Binomial likelihood, because the posterior is a Beta distribution as well.

## Posterior predictive checking

How posterior predictive checking can help us to assess whether the assumption of indendence is respected in our observed data $$y$$ ? Well, our model is actually assuming independence, so we could ask our model to generate new observations, or replications, called $$y^{rep}$$, to see whether these replications differ from the observed data. If they do, it would mean that the observed data are not well described by a model that is assuming independence.

This is done in two steps. First, we generate possible values of $$\theta$$ from its posterior distribution (i.e., from a $$\mathrm{Beta}(57, 37)$$ distribution). Then, for each of these $$\theta$$ values, we generate a new set of observations $$y^{rep}$$ from a Binomial distribution.

########################################################
# posterior predictive checks
#######################################

nsims <- 1e4 # number of replicated samples

# generating nsims theta values from posterior

thetas <- rbeta(nsims, a + z, b + n - z)

# generating nsims new datasets (Yrep)

Yrep <-
sapply(
# for each theta
1:length(thetas),
# generating samples
function(i) sample(
c(0, 1),
# of the same length as y
length(y),
replace = TRUE,
# with prob of presence equals to theta
# and prob of absence equals to 1 - theta
prob = c(thetas[i], 1 - thetas[i])
)
)

Then, we can compute the number of switches (our test quantity) in each replicated sample, to check whether the number of switches computed on datasets generated under the assumption of independence differ from the number of switches computed on the observed dataset $$y$$. We call the test quantities computed on replicated samples $$T(y^{rep})$$.

# for each new Yrep sample, computing the number of switches Trep, and
# comparing it to observed number of switches Ty

Trep <- apply(Yrep, 2, nb_switches)

Trep %>%
BEST::plotPost(
compVal = Ty, breaks = 20,
col = "#E6E6E6", xlab = expression(T(y^rep) ) )

This histogram reveals that the mean number of switches accross the nsims replications is about 42.04, and the green vertical dotted line represents the position of $$T(y)$$ in the distribution of $$T(y^{rep})$$ values.

To know whether the observed number of switches is surprising given the assumptions of our model (represented by its predictions), we can count the number of replications that lead to a greater number of switches than the number of switches $$T(y)$$ in the observed data.

sum(Trep > Ty)
## [1] 9929

Or we can compute a Bayesian p-value as (Gelman et al., 2013, page 146):

$p_{B} = \text{Pr}(T(y^{rep}, \theta) \geq T(y, \theta) | y)$

1 - sum(Trep > Ty) / nsims # equivalent to sum(Trep <= Ty) / nsims
## [1] 0.0071

Which gives the probability of observing this number of switches under our model. What does it mean ? Does it mean that our model is wrong ? Well, not exactly. Models are neither right or wrong (see Crane & Martin, 2018). But our model does not seem to capture the full story, it does not seem to give a good representation of the process that generated our data (which is arguably one of the characteristics that contribute to the soundness of a model).

More precisely, it misses the point that the probabilities of successive participants being present are not independent. This, in our case, seems to be due to temporal fluctuations of this probability throughout the day. For instance, the probability of a participant being present seems to be the lowest early in the morning or late in the afternoon, as well as between 12am and 2pm. This temporal dependency could be better taken into account by using gaussian process regression models, that generalise the varying effect strategy of multilevel models to continuous variables. In other words, it would allow to take into account that participants coming to the lab at similar hours (e.g., 9am and 9.30am) are more similar (in their probability of being present) than participants coming at very different hours (e.g., 9am and 3pm).

## Conclusions

In this post we aimed to introduce the idea of posterior predictive checking by recycling an elegant and simple example from Gelman et al. (2013). It should be noted however that this kind of check can be done for any test quantity of interest (e.g., the mean or the max of a distribution, or its dispersion).

As put by Gelman et al. (2013, page 148), “because a probability model can fail to reflect the process that generated the data in any number of ways, posterior predictive p-values can be computed for a variety of test quantities in order to evaluate more than one possible model failure”.

So come on, let’s make p-values great again, they are not doomed to be used only as a point-null hypothesis test.

## References

Click to expand

Crane, H., & Martin, R. (2018, January 10). Is statistics meeting the needs of science?. Retrieved from psyarxiv.com/q2s5m

Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian Data Analysis, Third Edition. CRC Press.

format: plain


text:
# Wade’s outstanding stock consists of 40,000 shares of noncumulative 7.5% preferred stock with a $10. Wade’s outstanding stock consists of 40,000 shares of noncumulative 7.5% preferred stock with a$10 par value and also 100,000 shares of common stock with a $1 par value. During its first four years of operation, the corporation declared and paid the following total cash dividends.2011 . . . . . . . . . . . . . . . . . . . . . . . . . . .$ 10,0002012 . . . . . . . . . . . . . . . . . . . . . . . . . . . 24,0002013 . . . . . . . . . . . . . . . . . . . . . . . . . . . 100,0002014 . . . . . . . . . . . . . . . . . . . . . . . . . . . 196,000Determine the amount of dividends paid each year to each of the two classes of stockholders: preferred and common. Also compute the total dividends paid to each class for the four years combinedView Solution:
Wade s outstanding stock consists of 40 000 shares of noncumulat

## Plagiarism Checker

Submit your documents and get free Plagiarism report

Free Plagiarism Checker


text:
# Intermediate value theorem: Show the function has at least one fixed point

Taken from an old exam, I hope I don't translate it unclear.

Let $f: \left [ 0,1 \right ] \rightarrow \mathbb{R}$ continuous and let $f(\left [ 0,1 \right ]) \subset \left [ 0,1 \right ]$. By using intermediate value theorem, show that $f$ has at least got one fixed point in $\left[0,1\right]$ (aka there is one solution $x \in \left[0,1\right]$ of the equation $f(x) = x$).

I'm not sure at all if I did it right but I have taken the function:

$$f(x) = x$$

Then take the given intervals and insert for $x$ the beginning of interval:

$$f(0)=0$$

And the end of the interval:

$$f(1) = 1 >0$$

Because the function is continuous and because the equality sign changes to an inequality sign right after, the intermediate value theorem provides there must be at least one solution $x_{1} = [0,1]$.

Did I do it correctly? Did I explain correctly?

• How do you know $f(0) = 0$? Also, if you knew that then that would be your fixed point. – tilper Sep 21 '16 at 15:20
• Because $f(x)=x$ put $x=0$ then it must equal $0$ – tenepolis Sep 21 '16 at 15:21
• Right, I glossed over that part for some reason. Ok, but then why are you taking $f(x) = x$? Every point of that is a fixed point. – tilper Sep 21 '16 at 15:24
• No. f(x) does NOT equal x. If that were so the question is trivial and all points are fixed points. x is NOT a variable in the statement "there is one solution x∈[0,1] of the equation f(x)=x)". In that statement $x$ is a value at which $f(x) = x$ but that is not the definition of $f$. And besides, it is what you need to prove; it's not a given. If it helps it might be better to read it as "Prove there is one solution $x_0 \in [0,1]$ where $f(x_0) = x_0$. – fleablood Sep 21 '16 at 15:27
• I'm not going to "make answer" but I'll explain the question: $f$ is a continuous function. for all $x \in [0,1]$ we know $f(x) \in [0,1]$. That is ALL we know about $f$. Prove that there exists a $z \in [0,1]$ so that $f(z) = z$. – fleablood Sep 21 '16 at 15:30

Hint: Apply the intermediate value theorem to the function $g(x)=f(x)-x$. Note that $g(0) \geq 0 \geq g(1)$.


text:
# Proof of divisibility: if $a|b$ and $a|(b+c)$ then $a|c$

This one is killing me, any help is greatly appreciated!

-

Go back to the definition of divisibility: $a\mid b$ means that there is an integer $m$ such that $b=ma$, and $a\mid b+c$ means that there is an integer $n$ such that $b+c=na$. You’re interested in $c$, so isolate it:

$$c=na-b=na-ma=(n-m)a\;.$$

Is $n-m$ an integer? Does this show that $a\mid c$?

-

Hint $\rm\ \ \dfrac{b+c}a,\,\dfrac{b}a\in\Bbb Z\ \Rightarrow\ \dfrac{c}a = \dfrac{b+c}a-\dfrac{b}a\in\Bbb Z\$ since $\,\Bbb Z\,$ is closed under subtraction.

-

If $a\mid b$ and if $a\mid (b+c)$, there exist some integers $k,l$ such that $b=k\cdot a,b+c=l\cdot a$

So,$c=b+c-b=la-ka=a(l-k)\implies \frac c a=k-l$ some integer

-

If $a|b$ then $b=a\cdot n$.
If $a|(b+c)$ then $b+c=a\cdot m$.
Hence $c=b+c-b=a\cdot m-a\cdot n=a\cdot(m-n)$, so $a|c$

-

In general, if $a\mid m$ and $a\mid n$ then $a$ divides any linear combination of $n$ and $m$. That is, for all $x,\ y\in\mathbb{Z}$, we have $a\mid mx + ny$.

Given these facts, can you now find a linear combination of $b$ and $b+c$ which gives $c$?

-

Note that, by definition of divisibility, $a|b$ implies

$$b = ak$$

for some integer $k$. Also, we have that $a|(b + c)$ implies

$$b + c = al$$

for some integer $l$. So, substitute the first into the second and solve for c. You should get $c = a(l - k)$, which implies $a|c$.

-

$a|b$ mean that exists whole number $k$ such that $$b=ka \dots(1)$$ and $a|(b+c)$ mean that exists whole number $l$ such that $$(b+c)=la\dots(2)$$ replacing (1) in (2) we get $$ka+c=la$$ $$c=la-ka$$ $$c=a(l-k)$$ because $l-k=r$ is whole number that mean$$c|a$$

-


text:
/ TEACHING

# Advanced Practical Chemistry - Part II

After the introduction to molecular dynamics in week 1, the students were unleased on their own mini-research project - investigating the transport properties of CaF2. In this exercise, we wanted the students to user DL_POLY to determine the temperature range within which CaF2 becomes a fast ion conductor. For context, CaF2 is already well studied and was choosen because the literature is full of examples for students to compare their results against.

### Week 2

This week, and the subsequent two weeks, aim to put emphasis on the transport properties of materials and on how to analyse the large quantities of data produces by MD simulations. The transport properties of a material are important in many modern technological applications. For example, solid oxide fuel cells (SOFCs - alternatives to traditional batteries) are dependent on the movement of charge carriers through the solid electrolyte and nuclear fuel materials oxidise and fall apart and this corrosive behaviour is dependent on the diffusion of oxygen into the lattice. Due to the importance of the transport properties of these materials, scientists and engineers spend large amounts of their time trying to optimise these properties.

The week began with a background tutorial in how to use DL_POLY within a Jupyter Notebook. In this way, we could provide the instruction in Markdown cells, and then the DL_POLY simulations could be launched with a subprocess call in the following code cell. This would eliminate the need for a traditional, printed lab manual.

Transport properties are the end game of the exercise, so it is important to show the students how to analyses their data in order to obtain diffusion coefficients and what these quantities actually mean. DL_POLY prints out a diffusion coefficient, but this is useless in a learning environment because the students need to understand where the number comes from. So a theoretical background was provided in Markdown cells explaining mean squared displacements (MSD) and Arrhenius plots.

The final part of the tutorial, before the students we set loose, to determine the fast ion conduction temperature range in CaF2 was to show them how to analyse their data. A few months ago, as a learning/procrastination exercise, I wrote an MSD analysis code for DL_POLY, so the students were given a stripped down version to use for analysis. The general workflow looks like this.

data = msd.read_history("Example/HISTORY", "F") msd_data = msd.run_msd(data)

plt.plot(msd_data['time'], msd_data['msd'], lw=2, color="red", label="MSD")
plt.plot(msd_data['time'], msd_data['xmsd'], lw=2, color="blue", label="X-MSD")
plt.plot(msd_data['time'], msd_data['ymsd'], lw=2, color="green", label="Y-MSD")
plt.plot(msd_data['time'], msd_data['zmsd'], lw=2, color="black", label="Z-MSD")

plt.ylabel("MSD (" r'$\AA$' ")", fontsize=15)
plt.xlabel("Time / ps", fontsize=15)
plt.ylim(0, np.amax(msd_data['msd']))
plt.xlim(0, np.amax(msd_data['time']))
plt.legend(loc=2, frameon=False)
plt.show()

slope, intercept, r_value, p_value, std_err = stats.linregress(msd_data['time'], msd_data['msd'])

diffusion_coefficient = (np.average(slope) / 6)
print("Diffusion Coefficient: ", diffusion_coefficient, " X 10 ^-9 (m/s^-2)")

Diffusion Coefficient: 1.4550282026323467 X 10 ^-9 (m/s^-2)

And that was it.

It took them about an hour to get through the full tutorial and then they were free to run theiry own simulations at various temperatures. For me, it proved to be an interesting teaching experiment. In order to analyse their data they had two options, they could open the DL_POLY output and copy the diffusion coefficient to an Excel spreadsheet, or they could use the method outlined above and analyse their simulations programmatically in a single notebook. I was pleased to note that nearly everyone used the latter method, for a variety of reasons:

1. The students were required to keep a hand-written lab book to ensure reproducibility (sigh). Students would record everything that they did and then a member of staff would grade it based upon how likely it is that they could repeat their work. Some of the students quickly deduced that by running everything in a notebook, they could provide their simulation data along with the notebook and by definition of the mark scheme…get full marks.
2. The MSD plot shown above can reveal an awful lot about the behaviour of the system. For example, the figure below compares the MSD for fluorine at 1500 K (left) and 300 K (right). It is easy to tell from these the state of the system.
3. Simplicity. Some students ran 30+ simulations and quickly realised that opening the large output file, searching for the diffusion coefficient and then copying it to excel is incredibly boring and tedious.

### Feedback

In the past, we have run this lab without the Python based tutorials, or the introduction to molecular dynamics. I remember last year being asked by two students why they had both run the same simulation but got slightly different diffusion coefficients. I have to explain what MD was and that the initial velocities were assigned randomly, thus their answeres would be slightly different. When asked the same question this year, my answer was simply “think back to last week”, and within 15 seconds this was met with “Oh yeah! The velocities are randomly assigned”. So the introduction to MD in week 1 was clearly a success.

Feedback this week was largely positive, there were issues at the beginning with setting up file-paths to the DL_POLY code, this may need to be addressed in future years as it was clear that file-paths go beyond some students understanding. In contrast to last year, much les time was devoted to copying diffusion coefficients from an output file to a spreadsheet and much more time was spent actually thinking about the data collected. The students who has not dabbled with Python before week 1 had no issues with the programming in week 2 and were able to use the analysis code without any difficulty. In future years, I think that the programming can be expanded further and they would be able to write their own bits of analysis, for example they were given the above snippet, however I believe that many could write it themselves without any difficulty.

In week 3 the students will be taking on Frenkel and Schottky defects - stay tuned.


text:
To understand why this is the case, it’s useful to bring up the concept of chemical equilibrium. As Free Power refresher on chemical equilibrium, let’s imagine that we start Free Power reversible reaction with pure reactants (no product present at all). At first, the forward reaction will proceed rapidly, as there are lots of reactants that can be converted into products. The reverse reaction, in contrast, will not take place at all, as there are no products to turn back into reactants. As product accumulates, however, the reverse reaction will begin to happen more and more often. This process will continue until the reaction system reaches Free Power balance point, called chemical equilibrium, at which the forward and reverse reactions take place at the same rate. At this point, both reactions continue to occur, but the overall concentrations of products and reactants no longer change. Each reaction has its own unique, characteristic ratio of products to reactants at equilibrium. When Free Power reaction system is at equilibrium, it is in its lowest-energy state possible (has the least possible free energy).
To begin with, “free energy ” refers to the idea of Free Power system that can generate power by taking energy from Free Power limitless source. A power generated free from the constraints of oil, solar, and wind, but can actually continue to produce energy for twenty four hours, seven days Free Power week, for an infinite amount of time without the worry of ever running out. “Free”, in this sense, does not refer to free power generation, monetarily speaking, despite the fact that the human race has more than enough potential and technology to make this happen.
The complex that results, i. e. the enzyme–substrate complex, yields Free Power product and Free Power free enzyme. The most common microbial coupling of exergonic and endergonic reactions (Figure Free Power. Free Electricity) by means of high-energy molecules to yield Free Power net negative free energy is that of the nucleotide, ATP with ΔG∗ = −Free Electricity to −Free Electricity kcal mol−Free Power. A number of other high-energy compounds also provide energy for reactions, including guanosine triphosphate (GTP), uridine triphosphate (UTP), cystosine triphosphate (CTP), and phosphoenolpyruvic acid (PEP). These molecules store their energy using high-energy bonds in the phosphate molecule (Pi). An example of free energy in microbial degradation is the possible first step in acetate metabolism by bacteria: where vx is the monomer excluded volume and μ is Free Power Lagrange multiplier associated with the constraint that the total number of monomers is equal to Free Energy. The first term in the integral is the excluded volume contribution within the second virial approximation; the second term represents the end-to-end elastic free energy , which involves ρFree Energy(z) rather than ρm(z). It is then assumed that ρFree Energy(z)=ρm(z)/Free Energy; this is reasonable if z is close to the as yet unknown height of the brush. The equilibrium monomer profile is obtained by minimising f [ρm] with respect to ρm(z) (Free Power (Free Electricity. Free Power. Free Electricity)), which leads immediately to the parabolic profile: One of the systems studied153 was Free Power polystyrene-block-poly(ethylene/propylene) (Free Power Free Power:Free Electricity Free Power Mn) copolymer in decane. Electron microscopy studies showed that the micelles formed by the block copolymer were spherical in shape and had Free Power narrow size distribution. Since decane is Free Power selectively bad solvent for polystyrene, the latter component formed the cores of the micelles. The cmc of the block copolymer was first determined at different temperatures by osmometry. Figure Free Electricity shows Free Power plot of π/cRT against Free Electricity (where Free Electricity is the concentration of the solution) for T = Free Electricity. Free Power °C. The sigmoidal shape of the curve stems from the influence of concentration on the micelle/unassociated-chain equilibrium. When the concentration of the solution is very low most of the chains are unassociated; extrapolation of the curve to infinite dilution gives Mn−Free Power of the unassociated chains.
We need to stop listening to articles that say what we can’t have. Life is to powerful and abundant and running without our help. We have the resources and creative thinking to match life with our thoughts. Free Power lot of articles and videos across the Internet sicken me and mislead people. The inventors need to stand out more in the corners of earth. The intelligent thinking is here and freely given power is here. We are just connecting the dots. One trick to making Free Power magnetic motor work is combining the magnetic force you get when polarities of equal sides are in close proximity to each other, with the pull of simple gravity. Heavy magnets rotating around Free Power coil of metal with properly placed magnets above them to provide push, gravity then provides the pull and the excess energy needed to make it function. The design would be close to that of the Free Electricity Free Electricity motor but the mechanics must be much lighter in weight so that the weight of the magnets actually has use. A lot of people could do well to ignore all the rules of physics sometimes. Rules are there to be broken and all the rules have done is stunt technology advances. Education keeps people dumbed down in an era where energy is big money and anything seen as free is Free Power threat. Open your eyes to the real possibilities. Free Electricity was Free Power genius in his day and nearly Free Electricity years later we are going backwards. One thing is for sure, magnets are fantastic objects. It’s not free energy as eventually even the best will demagnetise but it’s close enough for me.

## In most cases of interest there are internal degrees of freedom and processes, such as chemical reactions and phase transitions, which create entropy. Even for homogeneous “bulk” materials, the free energy functions depend on the (often suppressed) composition, as do all proper thermodynamic potentials (extensive functions), including the internal energy.

Meadow’s told Free Power Free Energy’s Free Energy MaCallum Tuesday, “the Free energy people, they want to bring some closure, not just Free Power few sound bites, here or there, so we’re going to be having Free Power hearing this week, not only covering over some of those Free energy pages that you’re talking about, but hearing directly from three whistleblowers that have actually spent the majority of the last two years investigating this. ”

Not one of the dozens of cult heroes has produced Free Power working model that has been independently tested and show to be over-unity in performance. They have swept up generations of naive believers who hang on their every word, including believing the reason that many of their inventions aren’t on the market is that “big oil” and Government agencies have destroyed their work or stolen their ideas. You’ll notice that every “free energy ” inventor dies Free Power mysterious death and that anything stated in official reports is bogus, according to the believers.
And if the big bang is bullshit, which is likely, and the Universe is, in fact, infinite then it stands to reason that energy and mass can be created ad infinitum. Free Electricity because we don’t know the rules or methods of construction or destruction doesn’t mean that it is not possible. It just means that we haven’t figured it out yet. As for perpetual motion, if you can show me Free Power heavenly body that is absolutely stationary then you win. But that has never once been observed. Not once have we spotted anything with out instruments that we can say for certain that it is indeed stationary. So perpetual motion is not only real but it is inescapable. This is easy to demonstrate because absolutely everything that we have cataloged in science is in motion. Nothing in the universe is stationary. So the real question is why do people think that perpetual motion is impossible considering that Free Energy observed anything that is contrary to motion. Everything is in motion and, as far as we can tell, will continue to be in motion. Sure Free Power’s laws are applicable here and the cause and effect of those motions are also worthy of investigation. Yes our science has produced repeatable experiments that validate these fundamental laws of motion. But these laws are relative to the frame of reference. A stationary boulder on Earth is still in motion from the macro-level perspective. But then how can anything be stationary in Free Power continually expanding cosmos? Where is that energy the produces the force? Where does it come from?
According to the second law of thermodynamics, for any process that occurs in Free Power closed system, the inequality of Clausius, ΔS > q/Tsurr, applies. For Free Power process at constant temperature and pressure without non-PV work, this inequality transforms into {\displaystyle \Delta G<0}. Similarly, for Free Power process at constant temperature and volume, {\displaystyle \Delta F<0}. Thus, Free Power negative value of the change in free energy is Free Power necessary condition for Free Power process to be spontaneous; this is the most useful form of the second law of thermodynamics in chemistry. In chemical equilibrium at constant T and p without electrical work, dG = 0. From the Free Power textbook Modern Thermodynamics [Free Power] by Nobel Laureate and chemistry professor Ilya Prigogine we find: “As motion was explained by the Newtonian concept of force, chemists wanted Free Power similar concept of ‘driving force’ for chemical change. Why do chemical reactions occur, and why do they stop at certain points? Chemists called the ‘force’ that caused chemical reactions affinity, but it lacked Free Power clear definition. ”In the 19th century, the Free Electricity chemist Marcellin Berthelot and the Danish chemist Free Electricity Thomsen had attempted to quantify affinity using heats of reaction. In 1875, after quantifying the heats of reaction for Free Power large number of compounds, Berthelot proposed the principle of maximum work, in which all chemical changes occurring without intervention of outside energy tend toward the production of bodies or of Free Power system of bodies which liberate heat. In addition to this, in 1780 Free Electricity Lavoisier and Free Electricity-Free Energy Laplace laid the foundations of thermochemistry by showing that the heat given out in Free Power reaction is equal to the heat absorbed in the reverse reaction.

Not Free Power lot to be gained there. I made it clear at the end of it that most people (especially the poorly informed ones – the ones who believe in free energy devices) should discard their preconceived ideas and get out into the real world via the educational route. “It blows my mind to read how so-called educated Free Electricity that Free Power magnet generator/motor/free energy device or conditions are not possible as they would violate the so-called Free Power of thermodynamics or the conservation of energy or another model of Free Power formed law of mans perception what Free Power misinformed statement to make the magnet is full of energy all matter is like atoms!!”

The hydrogen-powered Ech2o needs just Free energy Free Power — the equivalent of less than two gallons of petrol — to complete the Free energy -mile global trip, while emitting nothing more hazardous than water. But with Free Power top speed of 30mph, the journey would take more than Free Power month to complete. Ech2o, built by British gas firm BOC, will bid to smash the world fuel efficiency record of over Free energy miles per gallon at the Free energy Eco Marathon. The record is currently…. Free Power, 385 km/per liter [over Free Electricity mpg!]. Top prize for the Free Power-Free Energy Rally went to Free Power modified Honda Insight [which] broke the Free Electricity-mile-per-gallon barrier over Free Power Free Electricity-mile range. The car actually got Free Electricity miles-per gallon. St. Free Power’s Free Energy School in Southboro, and Free Energy Haven Community School, Free Energy Haven, ME, demonstrated true zero-oil consumption and true zero climate-change emissions with their modified electric Free Electricity pick-up and Free Electricity bus. Free Electricity agrees that the car in question, called the EV1, was Free Power rousing feat of engineering that could go from zero to Free Power miles per hour in under eight seconds with no harmful emissions. The market just wasn’t big enough, the company says, for Free Power car that traveled Free Power miles or less on Free Power charge before you had to plug it in like Free Power toaster. Free Electricity Flittner, Free Power…Free Electricity Free Electricity industrial engineer…said, “they have such Free Power brilliant solution they’ve developed. They’ve put it on the market and proved it works. Free Energy still want it and they’re taking it away and destroying it. ”Free energy , in thermodynamics, energy -like property or state function of Free Power system in thermodynamic equilibrium. Free energy has the dimensions of energy , and its value is determined by the state of the system and not by its history. Free energy is used to determine how systems change and how much work they can produce. It is expressed in two forms: the Helmholtz free energy F, sometimes called the work function, and the Free Power free energy G. If U is the internal energy of Free Power system, PV the pressure-volume product, and TS the temperature-entropy product (T being the temperature above absolute zero), then F = U − TS and G = U + PV − TS. The latter equation can also be written in the form G = H – TS, where H = U + PV is the enthalpy. Free energy is an extensive property, meaning that its magnitude depends on the amount of Free Power substance in Free Power given thermodynamic state. The changes in free energy , ΔF or ΔG, are useful in determining the direction of spontaneous change and evaluating the maximum work that can be obtained from thermodynamic processes involving chemical or other types of reactions. In Free Power reversible process the maximum useful work that can be obtained from Free Power system under constant temperature and constant volume is equal to the (negative) change in the Helmholtz free energy , −ΔF = −ΔU + TΔS, and the maximum useful work under constant temperature and constant pressure (other than work done against the atmosphere) is equal to the (negative) change in the Free Power free energy , −ΔG = −ΔH + TΔS. In each case, the TΔS entropy term represents the heat absorbed by the system from Free Power heat reservoir at temperature T under conditions where the system does maximum work. By conservation of energy , the total work done also includes the decrease in internal energy U or enthalpy H as the case may be. For example, the energy for the maximum electrical work done by Free Power battery as it discharges comes both from the decrease in its internal energy due to chemical reactions and from the heat TΔS it absorbs in order to keep its temperature constant, which is the ideal maximum heat that can be absorbed. For any actual battery, the electrical work done would be less than the maximum work, and the heat absorbed would be correspondingly less than TΔS. Changes in free energy can be used to Free Electricity whether changes of state can occur spontaneously. Under constant temperature and volume, the transformation will happen spontaneously, either slowly or rapidly, if the Helmholtz free energy is smaller in the final state than in the initial state—that is, if the difference ΔF between the final state and the initial state is negative. Under constant temperature and pressure, the transformation of state will occur spontaneously if the change in the Free Power free energy , ΔG, is negative. Phase transitions provide instructive examples, as when ice melts to form water at 0. 01 °C (T = Free energy. Free energy K), with the solid and liquid phases in equilibrium. Then ΔH = Free Power. Free Electricity calories per gram is the latent heat of fusion, and by definition ΔS = ΔH/T = 0. Free Power calories per gram∙K is the entropy change. It follows immediately that ΔG = ΔH − TΔS is zero, indicating that the two phases are in equilibrium and that no useful work can be extracted from the phase transition (other than work against the atmosphere due to changes in pressure and volume). Free Power, ΔG is negative for T > Free energy. Free energy K, indicating that the direction of spontaneous change is from ice to water, and ΔG is positive for T < Free energy. Free energy K, where the reverse reaction of freezing takes place.
Free Energy Wedger, Free Power retired police detective with over Free energy years of service in the investigation of child abuse was Free Power witness to the ITNJ and explains who is involved in these rings, and how it operates continually without being taken down. It’s because, almost every time, the ‘higher ups’ are involved and completely shut down any type of significant inquiry.
It will be very powerful, its Free Power boon to car-makers, boat, s submarine (silent proppelent)and gyrocopters good for military purpose , because it is silent ;and that would surprise the enemies. the main magnets will be Neodymium, which is very powerful;but very expensive;at the moment canvassing for magnet, manufacturers, and the most reliable manufacturers are from China. Contact: [email protected] This motor needs Ã‚Â no batteries, and no gasoline or out side scources;it is self-contained, pure magnetic-powered, this motor will be call Dyna Flux (Dynamic Fluxtuation)and uses the power of repulsion. Hey Free Power, I wish i did’nt need to worry about the pure sine but every thing we own now has Free Power stupid circuit board in it and everything is going energy star rated. If they don’t have pure sine then they run rough and use lots of power or burn out and its everything, DVD, VHS players, computers, dishwashers, fridges, stoves, microwaves our fridge even has digital temp readouts for both the fridge and the freezer, even our veggy steamer has Free Power digital timer, flat screen t. v’s, you can’t get away from it anymore, the world has gone teck crazzy. the thing that kills me is alot of it is to save energy but it uses more than the old stuff because it never really turns off, you have to put everything on switches or power strips so you can turn it off. I don’t know if i can get away from using batteries for my project. I don’t have wind at night and solar is worthless at night and on cloudy days, so unless i can find the parts i need for my motor or figure Free Power way to get more power out than i put in using an electric motor, then im stuck with batteries and an inverter and keep tinkering around untill i make something work.
Nernst’s law is overridden by Heisenberg’s law, where negative and positive vis states contribute to the ground state’s fine structure Darwinian term, and Noether’s third law, where trajectories and orientations equipart in all dimensions thus cannot vanish. Hi Paulin. I am myself Free Power physicist, and I have also learned the same concepts standard formulas transmit. However, Free Electricity points are relevant. Free Power. The equations on physics and the concepts one can extract from them are aimed to describe how the universe works and are dependent on empirical evidence, not the other way around. Thinking that equations and the concepts behind dogmatically rule empirical phenomena is falling into pre-illustrative times. Free Electricity. Particle and quantum physics have actually gotten results that break classical thermodynamics law of conservation of energy. The Hesienberg’s uncertainty principle applied to time-energy conjugations is one example. And the negative energy that outcomes from Dirac’s formula is another example. Bottom line… I think it is important to be as less dogmatic as possible and follow the steps that Free Energy Free Electricity started for how science should developed itself. My Name is Free Energy Sr and i have made Free Power Magnetic motor.

“What is the reality of the universe? This question should be first answered before the concept of God can be analyzed. Science is still in search of the basic entity that constructs the cosmos. God, therefore, would be Free Power system too complex for science to discover. Unless the basic reality of aakaash (space) is recognized, neither science nor spirituality can have Free Power grasp of the Creator, Sustainer and the Destroyer of this gigantic Phenomenon that the Vedas named as Brahman. ” – Tewari from his book, “spiritual foundations. ”

Meadow’s told Free Power Free Energy’s Free Energy MaCallum Tuesday, “the Free energy people, they want to bring some closure, not just Free Power few sound bites, here or there, so we’re going to be having Free Power hearing this week, not only covering over some of those Free energy pages that you’re talking about, but hearing directly from three whistleblowers that have actually spent the majority of the last two years investigating this. ”

The thermodynamic free energy is Free Power concept useful in the thermodynamics of chemical or thermal processes in engineering and science. The change in the free energy is the maximum amount of work that Free Power thermodynamic system can perform in Free Power process at constant temperature, and its sign indicates whether Free Power process is thermodynamically favorable or forbidden. Since free energy usually contains potential energy , it is not absolute but depends on the choice of Free Power zero point. Therefore, only relative free energy values, or changes in free energy , are physically meaningful.


text:
RaRCTF 2021 - A3S

This was a nice challenge from an excellent CTF.

# A3S

I don't like these bits that's why we're using trits!

## Solution

The cipher is almost identical to AES in structure so I won't go over how it works in detail. I highly recommend studying AES (reading Wikipedia and trying to implement it yourself is good). It would have taken me a lot longer to solve the challenge if I didn't already have a general understanding of how AES works.

A3S differs to standard AES in a couple of ways:

• Instead of bits, trits are used; these take on one of three values instead of just two
• Instead of bytes, we have trytes which are three trits
• The block size is 9 trytes
• There are 28 rounds
• The shift rows and mix columns steps are similar (in structure) to AES, but obviously differs to work with trits and trytes
• The SBOX is an affine transformation

### General Idea

Given that we only have a very small amount of known plaintext/ciphertext and that there are 28 rounds, my first suspicion was that the SBOX was completely linear/affine. This would mean that we can form a linear system of equations involving plaintext trytes, key trytes and ciphertext trytes which might be able to help us recover the flag. So the idea is simple; get a symbolic representation of the plaintext and key trytes, then run them through the cipher (i.e. encrypt the plaintext with the key) to get the ciphertext in terms of the plaintext and key trytes. Then, we substitute our known plaintext/ciphertext to get a bit of information about the key. Finally, we add our flag ciphertext blocks to the system and try to solve for the unknown plaintext variables. It seems easy enough, but of course, the devil is in the (implementation) details.

### Setting the Stage

In regular AES, bytes are represented as elements of $\mathbb{F}_{2^8} \cong \mathbb{F}_2[x]/(x^8 + x^4 + x^3 + x + 1)$. In A3S we have something similar for trytes; they are represented as elements of $\mathbb{F}_{3^3} \cong \mathbb{F}_3[z]/(z^3 + z^2 + 2)$. For example, the tryte $(1, 0, 2)$ is the element $1 + 2z^2$. It is important that we have this representation as it allows us to write each step of the encryption process in terms of operations on elements in this field.

So the current goal is: represent each step as operations on elements in this finite field so that we can get an algebraic expression for the ciphertext in terms of the plaintext and key. We'll briefly go through the approach for each step.

#### ApplyRoundKey

For a state $M \in M_{3 \times 3}(\mathbb{F}_{3^3})$ (a $3 \times 3$ matrix with entries in the finite field) and key $K \in M_{3 \times 3}(\mathbb{F}_{3^3})$, we apply the key to the plaintext via matrix addition. i.e. the new state after applying the key is $M' = M + K$.

#### ShiftRows

All we need to do for this is rearrange entries of the state matrix $M$. The first row remains unchanged, while the second row is rotated left by one and the third row is rotated left by two:

\begin{aligned} M'_{1, 1} &= M_{1, 1} \quad M'_{1, 2} = M_{1, 2} \quad M'_{1, 3} = M_{1, 3} \\ M'_{2, 1} &= M_{2, 2} \quad M'_{2, 2} = M_{2, 3} \quad M'_{2, 3} = M_{2, 1} \\ M'_{3, 1} &= M_{3, 3} \quad M'_{3, 2} = M_{3, 1} \quad M'_{3, 3} = M_{3, 2} \\ \end{aligned}

#### MixColumns

In regular AES, the MixColumns step can be represented with matrix multiplication. We'll do the same here. This step mixes the trytes in each column by using them as coefficients of a polynomial in $\mathbb{F}_{3^3}[X]/(f)$ ($f$ is a known polynomial) and multiplying them by some fixed constant polynomial $c(X)$. To determine a matrix representation, we let the column entries be $a_0, a_1, a_2$ and multiply $a_0 + a_1 X + a_2 X^2$ by $c(X)$. We then look at the coefficients of the result:

\begin{aligned} (a_0 + a_1 X + a_2 X^2)c(X) &\equiv (a_0 + a_1 X + a_2 X^2) ((1 + 2z) + (2 + z^2)X + (1 + z + z^2)X^2) \pmod{f(X)} \\ &\equiv ((1 + 2z) a_0 + (2 + 2z + 2z^2) a_1 + (2 + 2z^2) a_2) + \\ &\quad ((2 + z^2) a_0 + (1 + z^2) a_1 + (1 + z^2) a_2) X \\ &\quad ((1 + z + z^2) a_0 + (1 + z^2) a_1 + (2 + z + z^2) a_2) X^2 \end{aligned}

So the operation of mixing a single column can be represented by left multiplication by the matrix

$\begin{bmatrix} 1 + 2z & 2 + 2z + 2z^2 & 2 + 2z^2 \\ 2 + z^2 & 1 + z^2 & 1 + z^2 \\ 1 + z + z^2 & 1 + z^2 & 2 + z + z^2 \end{bmatrix}$

#### SubBytes

Now for the star of the show. First we map integers in $[0, 26]$ to elements of $\mathbb{F}_{3^3}$ using a natural mapping. Once we do that, we see that the first few entries of the SBOX are given by

$(2z, 2z^2 + 2z + 1, z^2 + 2z + 2, z^2 + 2, \cdots)$

if this is a linear or affine transformation as we suspect, then we must have $0$ mapping to $2z$. If this is the case, then the linear transformation part must by multiplication by $2z^2 + 1$. Indeed, we can go and check for the remaining entries that $\mathrm{SBOX}(x) = (2z^2 + 1)x + 2z$.

### Obtaining a Linear System

Now that we have each step as algebraic operations, we want to obtain expressions for the ciphertext in terms of the plaintext and key. When we substitute our known plaintext/ciphertext, and unknown plaintext, we'll be able to solve this system for the unknown plaintext variables to recover the flag.

To do this in Sage, we can define a polynomial ring over $\mathbb{F}_{3^3}$ in the variables $m_1, m_2, \ldots, m_9, k_1, k_2, \ldots, k_{252}$ for the plaintext trytes and all the round key trytes (we don't care about the key schedule, just let each tryte be it's own variable).

### Solving the Linear System

We solve the linear system for $m_1, \ldots, m_9$ using Gröbner bases. Because of the ordering of the result of the Gröbner basis computation, the "smallest" polynomials come first and to our luck, the first nine are of the form $m_i - c_i$ so we can simply read off the plaintext trytes from these!

from helpers import * # import functions from the handout code

T.<z> = GF(3^3, modulus=x^3 + x^2 + 2)
R.<X> = PolynomialRing(T)
RR.<X> = R.quotient((2 + z^2) + (1 + 2*z)*X + (2*z + z^2)*X^2 + (2 + z^2)*X^3)
CONS = (1 + 2*z) + (2 + z^2)*X + (1 + z + z^2)*X^2

def T_to_tyt(t):
s = list(map(int, t.polynomial().coefficients(sparse=False)))
return tuple(s + [0]*(3-len(s)))
def T_to_int(t):
return tri_to_int(list(map(int, t.polynomial())))
def int_to_T(x):
return sum([b*z^i for i, b in enumerate(int_to_tri(x))])
def byt_to_T(b):
return [int_to_T(tri_to_int(x)) for x in int_to_tyt(byt_to_int(b))]

def SBOX(x):
return (2*z^2 + 1)*x + 2*z

def sub_trytes(M):
return Matrix([[SBOX(x) for x in r] for r in M])

def mix_columns(M):
S = Matrix(T, [[2*z + 1, 2*z^2 + 2*z + 2, 2*z^2 + 2],
[z^2 + 2, z^2 + 1, z^2 + 1],
[z^2 + z + 1, z^2 + 1, 2*z^2 + z + 2]])
return S*M

def shift_rows(M):
M = [list(r) for r in M.rows()]
M[1][0], M[1][1], M[1][2] = M[1][1], M[1][2], M[1][0]
M[2][0], M[2][1], M[2][2] = M[2][2], M[2][0], M[2][1]
return Matrix(M)

def apply_key(M, K):
return M+K

def encrypt(M, K):
subkeys = [Matrix(P, 3, 3, K[i:i+9]) for i in range(0, len(K), 9)]
NROUNDS = 28
M = apply_key(M, subkeys[0])
for r in range(1, NROUNDS-1):
M = sub_trytes(M)
M = shift_rows(M)
M = mix_columns(M)
M = apply_key(M, subkeys[r])
M = sub_trytes(M)
M = shift_rows(M)
M = apply_key(M, subkeys[-1])

return M

P = PolynomialRing(T, [f'm{i}' for i in range(1, 10)] + [f'k{i}' for i in range(1, 9*28+1)])
P.inject_variables()
Mgens = P.gens()[:9]
K = P.gens()[9:]

msg = b'sus.'
m = byt_to_int(msg)
m = up(int_to_tyt(m), W_SIZE ** 2, int_to_tyt(0)[0])[-1]
M = byt_to_T(msg)
M += [0]*(9 - len(M))
M = Matrix([M[i:i+3] for i in range(0, 9, 3)])

kp = encrypt(M, K).list()
sus = bytes.fromhex('060f22028ed1')
kc = byt_to_T(sus)
I = []
for i in range(9):
I.append(kp[i] - kc[i])

flag_enc = bytes.fromhex('0100c9e96d3d0d077804abd35dd3cd1a8eaa873b3cf15bb8e025ecdb2a44eb1009a0b92e1a7af025dc167a122430178d31')
flag_ct_blocks = [byt_to_T(x) for x in chunk(flag_enc)]
M0 = Matrix(P, 3, 3, Mgens)
my_flag_ct = encrypt(M0, K).list()

Q = PolynomialRing(T, [f'm{i}' for i in range(1, 10)])
FLAG_tyts = []
for flag_ct_block in flag_ct_blocks:
J = I[::]
for i in range(9):
J.append(my_flag_ct[i] - flag_ct_block[i])
G = Ideal(J).groebner_basis()
V = Ideal([Q(p) for p in G[:9]]).variety()
FLAG_tyts.append([V[0][m] for m in Mgens])
chunks = []
for F in FLAG_tyts:
c = [T_to_tyt(x) for x in F]
chunks.append(int_to_byt(int(tyt_to_int(c))))

print(unchunk(chunks).decode())

Flag: rarctf{wh3n_sb0x_1s_4_5u55y_baka_02bdeff124}


text:
# Chapter 1 - Structure and Bonding - Exercises - Page 27d: 34

Potassium Methoxide, $KOCH_{3}$ has 1 ionic and 4 covalent bonds.

#### Work Step by Step

In potassium methoxide, $K^{+}$$^{-}OCH_{3}$ has one ionic bond between potassium and methoxide ion. The Methoxide ion on the other hand has 4 covalent bonds ( 3 C - H covalent bonds and one C - O bonds ).

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.


text:
Authors

Fanny Yang, Zuowen Wang, Christina Heinze-Deml

Abstract

This work provides theoretical and empirical evidence that invariance-inducing regularizers can increase predictive accuracy for worst-case spatial transformations (spatial robustness). Evaluated on these adversarially transformed examples, standard and adversarial training with such regularizers achieves a relative error reduction of 20% for CIFAR-10 with the same computational budget. This even surpasses handcrafted spatial-equivariant networks. Furthermore, we observe for SVHN, known to have inherent variance in orientation, that robust training also improves standard accuracy on the test set. We prove that this no-trade-off phenomenon holds for adversarial examples from transformation groups.


text:
# 51 year-old dad who has no clue...

#### fhtorres

##### New member
I have been going over the examples in my daughter's book and none of them help me get started.

a/(ab-b^2)+b/(ab-a^2)

#### Jomo

##### Elite Member
You really did not ask a question. I assume that you want to add these two fractions?

Then you need to get a common denominator.
I will factor the left denominator and you/your daughter can try to factor the 2nd denominator and come up with a common denominator--preferable the least common denominator

(ab-b^2) = b(a-b)

#### Otis

##### Senior Member
Hello fhtorres. As outlined in the forum's guidelines, we need the instructions that came with the exercise. Thanks!

$$\;$$

#### pka

##### Elite Member
I have been going over the examples in my daughter's book and none of them help me get started.a/(ab-b^2)+b/(ab-a^2)
$$\displaystyle \dfrac{a}{ab-b^2}+\dfrac{b}{ab-a^2}=\\\dfrac{a}{b((a-b)}+\dfrac{b}{a(b-a)}=\\\dfrac{a}{b((a-b)}-\dfrac{b}{a(a-b)}=\\\dfrac{1}{(a-b)}\left(\dfrac{a}{b}-\dfrac{b}{a}\right)$$
Can you finish?


text:
Document Type : Research Paper

Authors

1 Department of Mathematics, Faculty of Science, Applied Mathematics Laboratory, Ferhat Abbas- Setif 1 University, Setif, Algeria

2 Department of Mathematics, Faculty of Science, Fundamental and Numerical Mathematics Laboratory, Ferhat Abbas- Setif 1 University, Setif, Algeria

Abstract

In this work, we study two uncoupled quasistatic problems for thermo viscoplastic materials. In the model of the equation of generalised thermo viscoplasticity, both the elastic and the plastic rate of deformation depend on a parameter $\theta$ which may be interpreted as the absolute temperature. The boundary conditions considered here as displacement-traction conditions as well as unilateral contact conditions. We establish a variational formulation for the model and we prove the existence of a unique weak solution to the problem, reducing the isotherm problem to an ordinary differential equation in a Hilbert space.

Keywords

###### ##### References
[1] K.T. Andrews, A. Klarbring, M. Shillor and S. Wright, A dynamic contact problem with friction and wear, Int. J. Engng. Sci., 35 (1997), pp. 1291-1309.
[2] K.T. Andrews, K.L. Kuttler and M. Shillor, On the dynamic behaviour of thermoviscoelastic body in frictional contact with a rigid obstacle, Euro. Jnl. appl. Math., 8 (1997), pp. 417-436.
[3] V. Barbu, Optimal Control of Variational Inequalities, Research Notes in Mathematics,
100. Pitman (Advanced Publishing Program), Boston, 1984.
[4] I. Boukaroura and S. Djabi, A dynamic Tresca's frictional contact problem with damage for thermo elastic-viscoplastic bodies, Studia Univ. Babes Bolayai Mathematica, 64 (2019), pp. 433-449.
[5] I. Boukaroura and S. Djabi, Analysis of a quasistatic contact problem with wear and damage for thermo-viscoelastic materials, Malaya Journal of Matematik, 6 (2018), pp. 299-309.
[6] S. Djabi, A monotony method in quasistatic processes for viscoplastic materials with internal state variables, Revue Roumaine de Maths Pures et Appliquées, 42 (1997), pp. 401-408.
[7] S. Djabi, A monotony method in quasistatic processes for viscoplastic materials with $varepsilon = varepsilon(epsilon(dot{u}),k)$, Mathematical Reports, 2 (2000), pp. 9-20.
[8] S. Djabi and M. Sofonea, A fixed point method in quasistatic rate-type viscoplasticity, Appl. Math. and Comp Sci., 3 (1993), pp. 269-279 .
[9] G. Duvaut and J.L. Lions, Les inéquations en mecanique et en physique (in French). The inequalities in mechanics and physics], Springer, Berlin,1976.
[10] K.L. Kuttler, Dynamic friction contact problems for general normal and friction laws, Nonlin. Anal, 28 (1997), pp. 559-575.
[11] A. Merouani and S. Djabi, A monotony method in quasistatic processes for viscoplastic materials, Studia Univ. Babes Bolyai Mathematica, 3 (2008), pp. 25-33.
[12] M. Sofonea, On existence and behaviour of the solution of two uncoupled thermo-elastic-visco-plastic problems, An. Univ. Bucharest, 38 (1989), pp.56-65.


text:
# Can we distinguish $\aleph_0$ from $\aleph_1$ in Nature?

Can we even find examples of infinity in nature?

-
Can we even find examples of $1/2$ in Nature? – Gerry Myerson Jun 5 '12 at 13:09
That doesn't answer the question. Anyway, where do we see $\pi$ in Nature? Have you ever seen a circle in Nature? – Gerry Myerson Jun 5 '12 at 13:17
Actually, we don't even know if there are an infinite number of particle in nature. – Vittorio Patriarca Jun 5 '12 at 13:24
Did you really mean to use $\aleph_1$ rather than the continuum? – Harry Altman Jun 5 '12 at 13:53
@draks: then you have a folded object, not a 1/2. – Hurkyl Jun 6 '12 at 8:31

If by nature mean physical universe, note that there is no proof that an infinite set exists. While some of us would like to believe that universe is infinite, this cannot be proved. You also have to remember that while we wish to perceive reality as a continuous process, we cannot measure it in a precise accuracy. Given two pieces of metal of length 1m (by the same ruler) they might differ by a few atoms, which means an actual increase in length since while very very small atoms still have a physical size. So we cannot really point out an infinite object in the universe, but we also fail pointing out something which is "exactly half" of another thing, etc.

If, on the other hand, you mean "in mathematics outside of set theory", then $\aleph_1$ is somewhat hidden. The reason is that in non-set theoretic constructions there is often little importance to cardinalities but rather countability; the cardinality of the continuum; and perhaps the power set of that.

However there are still mild appearances of $\aleph_1$. For example Shelah proved in 1980 that there is a group of size $\aleph_1$ such that every proper subgroup of it is countable. Another example (although slightly more set theoretic in nature) is the solution for Whitehead problem's for $\aleph_1$. If we assume in addition to ZFC a certain set theoretical assumption then every $W$-group of size $\aleph_1$ is free; if we prove a different assumption (again, with ZFC) then there is a $W$-group of size $\aleph_1$ which is not free.

Somewhat related:

-

How about this : the set of the possible repartition of probability of presence of, say, an electron is a continuum (well at least in most models!), while the set of its possible energy levels is countable.

-
What does a continuum have to do with this question? – Chris Eagle Jun 5 '12 at 15:15
"Can we even find examples of infinity in nature?" – Glougloubarbaki Jun 5 '12 at 15:34
I think you give the game away when you write, "well, at least in most models". Models are mathematics, not nature. – Gerry Myerson Jun 6 '12 at 0:07

The question as asked is somewhat ill-defined. I'm taking the word "nature" to mean "the thing described by physics", but what does it mean to say that some mathematical object is found "in nature"?

Such a phrase can only have meaning relative to some scheme of associating mathematical objects to physical "things". It's easy to construct such a scheme: e.g. if I consider an interpretation where I associate "$\aleph_1$" to the apple sitting on the table and don't assign meaning to any mathematical objects, then I have found $\aleph_1$ in nature: it's sitting on the table.

Maybe more interesting is a more 'standard' interpretation associated with a physical theory. The interpretations typically seen in a physical theory don't tend to associate cardinal numbers to objects. In particular, they don't assign $\aleph_1$ to any sort of object, and this fact is a banality.

But, in this case, we can turn to higher-order concepts. e.g. a version of Newtonian physics based upon ZFC+CH says that the number of points in any region of space is $\aleph_1$.

-