I'm reading category theory for scientists book and I can't understand this part.
When book introduces spans it's says something like that span R is [ 1, 10, 11 2, 20, 21, 3, 30, 31] Where (10, 20, 30) is recorded temperatures in experiment and (11, 21, 31) is recorded pressures (please see the book, it's free)
Let A and B be sets and let A <- R -> B be a span. By the universal property of products, we have a unique map R p-> A x B. We make a matrix of natural numbers out of this data as follows. The set of rows is A, the set of columns is B. For elements a from A and b from B, the (a, b)-entry is the cardinality of its preimage, i.e. the number of elements in R that are sent by p to (a,b).
My comments
The set of rows is A..
What? I thought A is the set of temperatures, not the rows. If it's rows is it {(1, 10, 11), (2, 20, 21)...} or is he talking about row numbers? The rest of it I can't understand because of this part.
Writing $A \leftarrow R \to B$ we mean that $R,A,B$ are objects in some category (here they seem to be sets) and we have arrows $R \to A$ and $R \to B$ (here they seem to be functions). This data together is also called a span.
In this case, we have $R = \{1,2,3\}$, which are just names for the three measurements you made. You have $A = \{10,20,30\}$, the set of recorded temperatures, and $B = \{11, 21, 31\}$, the set of recorded pressures. Then, the function $R \to A$ is given by $x \mapsto 10\cdot x$, and the function $R \to B$ is given by $x \mapsto 10 \cdot x + 1$. Then the product $A \times B$ is given by $\{(a,b) \mid a \in A, b \in A\}$. For instance, $(10,21) \in A \times B$.
From the universal property of the product you obtain a mapping $P \to A \times B$, which takes $1$ to $(10,11)$, which takes $2$ to $(20,21)$ and which takes $3$ to $(30,31)$. Note that this just encodes both the mappings $R \to A$ and $R \to B$ at the same time, which is precisely what the product is supposed to do.
Then, we form a matrix out of this: when we say that "the set of rows is $A$", what we mean is that the matrix will have one row for each element of $A$; and similarly, the matrix will have one column for each element of $B$. Since both have $3$ elements, it will be a $3 \times 3$ matrix. Each element $a\in A$ corresponds to a row, and each element $b \in B$ corresponds to a column, so each element $(a,b) \in A \times B$ corresponds to an entry in this matrix.
Then, the value of entry $(a,b)$ in this matrix is the number of elements of $R$ that gets mapped to $(a,b)$ by the morphism $R \to A \times B$. In the example you gave, this is not particularly interesting (because the outcome for all experiments is different). If you get the same observation multiple times -- for example, on the fourth measurement you get a temperature of 20 and a pressure of 22 -- this matrix contains more interesting information.