scholar log

2025-01-03T22:16:56+01:00 For fractions over 7, remember 142857, since 1∕7=0.142857... Not difficult, since you multiply 7 by 2 to get 14, again by 2 to get 28 and finally by 2 to get 56 but since it's the last, we round it to 57 (just mnemo-logic). How do you cycle this number from least to greatest? 142857, 285714, 428571, 571428, 714285 and 857142. These give you the decimals for 2∕7, 3∕7, 4∕7, 5∕7 and 6∕7.

2024-12-26T12:58:38+01:00 It's easy to forget that Bayes' rule is simply p(A|B)=P(A and B)∕p(B). With data, we get p(B) by selecting all cases with B for the first event and any result for the second event (here assuming A is second and B is first). Then, we select all cases with B as 1st and A as 2nd, and divide. Example: probability of passing an exam provided you have already read its statement and find it easy? Imagine we ask people to say whether they find the exam easy or not and collect the answers alongside the final results. Now, p(pass|easy) = p(pass AND easy) ∕ p(easy). We find that 23 % found the statement easy, so p(easy)=0.23. We find that 10% found it easy and passed, so p(pass AND easy)=0.1. Then, p(pass|easy)=0.1∕0.23≈0.43.

2024-12-02T17:35:21+01:00 Here we find five key scenarios where similar triangles are found. Top left: the intercept theorem, where two non parallel lines AC and AB are crossed by two parallel lines BC and ED, forming similar triangles ABC and AED. Centre left: a variation of the intercept theorem, where the two parallel lines GI and HF cross the non-parallel two (HI and FG) but at different sides of their intersection point J. Top right: Two non-parallel lines NK and ML meeting at O are crossed by a circle, making similar triangles OMN and OLK. Bottom left: two segments of length 2a and 2b meet at their midpoints, forming two similar triangles with parallel and equal sides c. Bottom right: two segments of length (a+b) cross at their a-b separation, forming two similar triangles, and with the four edges forming a cyclical quadrilateral.

2024-12-01T22:11:03+01:00 The area of a triangle is equal to p×r∕2, where p = perimeter and r = radius of its inscribed circle. Geogebra.

2024-11-23T11:27:09+01:00 In this diagram we can see the six trigonometric functions all at once. Firstly, it shows how sine (vertical) and cosine (horizontal) are the sides of the right rectangle with hypotenuse = 1. The tangent is just the tangent segment from our chosen point in the unit circle to the horizontal axis. The cotangent is also tangent, but from the point to the vertical axis. Both are tangent and complementary, and they form a hypotenuse where the sides are the secant (horizontal) and the cosecant (vertical). The horizontal pair, cosine and secant, are reciprocal, and so they are the sine and the cosecant (both vertical).

2024-11-16T07:20:05+01:00 Pick's theorem: area of a simple (non-intersecting) polygon with vertices on nodes of a square grid. First, divide all by the length of the grid cell (L), so all vertices have integer coordinates. The area is then i + b∕2 - 1, where i = interior nodes and b = boundary nodes. Then multiply by L to get the first area.

2024-11-09T10:04:56+01:00 In a cercle, let's fix a chord (or an arc). This chord can be seen 1) from the centre, 2) from the circle, 3) from the circumference, and 4) from the exterior of the circle. The angle in each perspective is called 1) central, 2) interior, 3) inscribed, and 4) exterior. The inscribed angle is always the same if we go around the circumference, as long as we stay on the same side of the chord. The central angle is twice the inscribed. For the interior angle, we connect the edges of the chord (A and B) with our interior point P and form two new points (A' from AP and B' from BP). The original chord AB and the new chord A'B' have a central angle each, and we take the mean of the two. This mean is the interior angle. For the exterior angle, we proceed similarly: connect the edges of our chord (A and B) with our exterior point P, to find two new points (A' from AP and B' from BP). The original chord AB and the new chord A'B' have a central angle each, and we take, instead of the mean, the big central angle minus the small one, and divide by two, which gives the exterior angle.

2024-10-26T12:47:33+02:00 Let α be the central angle to a given chord. The chord and two radii define an isosceles triangle. If we now move our point of view along one of these radii a distance d, so that we shift from the centre a factor f=d∕r, the angle when looking at the same chord is now β. The relation between β and α is tanβ=sinα∕(cosα - f). The proof is elemental if drawing a right triangle with the same angle α.

2024-10-19T10:30:13+02:00 Symmetry, etymologically speaking, comes from sym (together) and metron (measuring). The Greek word is συμμετρία, meaning 'agreement in dimensions, due proportion, arrangement'. In architecture, it also means simplicity and cheap reuse of elements.

2024-10-01T10:41:08+02:00 The three anatomical planes: sagittal or lateral plane (left/right), coronal or frontal plane (front/back or ventral/dorsal), and transverse or axial plane (top/bottom or cranial/caudal). If we were planes (standing up, not in superman position), the rotations leaving those planes invariant are pitch (sagittal plane), roll (coronal plane), and yaw (transverse plane).

2024-09-26T19:11:09+02:00 Gauss' famous formula to add consecutive integers from 1 to n, S = n⋅(n+1)∕2 is more intuitive if we just make pairs. For example, in 1+2+3+4+5+6, pair (1,6), (2,5) and (3,4). This makes three times eight. In the formula, n∕2 is the number of pairs, and (n+1) is the contribution of each pair (which is constant). So S = (number of pairs)⋅(contribution of each pair). If n is even, there is an even number of pairs. If odd, there is a half-integer number of pairs. For example, 1+2+3+4+5+6+7 = (3.5 pairs)⋅(8 given per pair). If, instead of adding consecutive numbers, we add equally spaced numbers, like 5+10+15+20+25+30+35, just take the 5 as common factor, so S = (common factor)⋅(sum with consecutive numbers).

2024-09-26T18:19:24+02:00 Drag: The drag force from air is usually written as Fd = 0.5⋅ρ⋅v²⋅A⋅C, where ρ is the density of air, v the speed, A the cross sectional area, and C a drag coefficient. Getting C is the hard part. The Reynolds number Re describes whether inertia dominates over friction. It can be thought as inertia/friction. Specifically, Re = ρ⋅v⋅D/μ, where D is the effective diameter of the object, and μ the dynamic viscosity. We can analyse two regimes: 1) high Reynolds number, where inertia dominates over friction, like in air, where C is more or less constant; 2) low Reynolds number, where friction dominates (like a protein in a cell), where C ∝ 1/Re, meaning that one v is cancelled and Fd ∝ v.

2024-09-25T21:55:28+02:00 Averaging speeds. A person cycles from A to B, the first half at speed v1=20 and the second half at speed v2=30. The overall average speed is the harmonic mean, v = 2 ∕ (1∕20 + 1∕30) = 24. Now, instead of splitting the distance in halves, the person covers the first third (fraction a=1/3) at speed v1=20 and the remaining distance (fraction 1-a=2/3) at speed v2=30. The harmonic mean no longer works. Instead, 1∕v = a∕v1 + (1-a)/v2, so v = 180 ∕ 7 ≈ 25.71. The first example, with the harmonic mean, could be rewritten as 1∕v = 0.5∕v1 + 0.5∕v2.

2024-09-24T11:28:41+02:00 Adding rates. Say a worker A paints a wall in 2 h while a worker B takes 3 h. Rate rA = 1∕2 (walls per hour), while rB = 1∕3. The total rate is simply r = rA + rB = 5∕6 = 1∕1.2 walls per hour. This means it would take 1.2 h for a wall to be painted by both workers together.

2024-09-24T11:11:44+02:00 Three workers paint 4 m² in 2 h. How long will it take for 6 workers to paint 100 m²? How to write "hours per worker per m²? h⋅w∕m²? h∕(w⋅m²)? Fix one quantity, for example the area to be painted. Then, h and w must be such that either h⋅w or h∕w is constant. If there are more workers, less time will be needed, so h⋅w is constant. Now leave w constant. Then, more area to be painted needs more time, so h∕m² is constant. This means that the ratio is written as h⋅w∕m², so that 2⋅3∕4 = 3∕2 is our ratio. Then, 6 workers to paint 100 m² will take x hours. This means 3/2 = 6⋅x∕100, which implies x = 25 h.

2024-09-19T22:45:03+02:00 A refrigerator: a liquid from a closed circuit is compressed by a pump, and since its pressure goes up at constant volume, its temperature increases. Then, this gas is circulated along an external radiator, a heat exchanger, so that its temperature will equal that of the external air. During this path along the coil, the liquid evaporates. Its pressure will still be high. The fluid continues its circuit and goes through an expansion valve, where it is allowed to go back to regular pressure, but this process will cool it. After that, it goes through an inner radiator, another coil path, where it will absorb heat from the inside of the refrigerator and condense again into liquid form, just before going back to the compressor for a new cycle. The compression and the expansion are approximately adiabatic (with no heat exchange).

2024-09-16T21:37:07+02:00 Syphon effect. Take a pipe and fill it with a fluid, no air gaps. One edge at a higher pressure than the other. Then, no matter the path of the pipe (even if it goes up and then down!), the fluid will flow from high to low pressure.

2024-09-15T16:58:10+02:00 Morley's trisector theorem. Take any triangle and trisect their three inner angles. The intersections of adjacent trisectors will form an equilateral angle, called Morley triangle.

2024-09-15T16:11:28+02:00 Consider a triangle ABC with sides a,b,c. Take their midpoints Ma,Mb,Mc and join them. They will form the medial triangle, which is similar to triangle ABC. The centroids of both triangles are the same point.

2024-09-15T15:35:21+02:00 Angle bisector theorem. Consider a triangle ABC, and we locate ourselves in the perspective of A, seeing B to our left and C to our right. Bisect angle A, so that side a (in front of us), is divided into a_c (left) and a_b (right). The theorem states that a_c/a_b = c/b. Intuitively, front_left/front_right = left/right. Remarkably, if proving this theorem in the complex plane, the imaginary part brings this theorem, but the real part brings another, giving the length of the angle bisector, b_a, where b_a² = b·c - a_b·a_c.

2024-09-15T13:51:55+02:00 A useful count: 2, π, and 4. Now consider a circle C, its (bigger, outer) circumscribed square CS and its (smaller, inner) inscribed square IS. We can associate IS=2, C=π and CS=4. Then, we get the area ratios C/CS = π/4, C/IS = π/2 and of course IS/CS = 1/2.

2024-09-15T13:28:41+02:00 Let two lines cross at a point, so that four angles can be considered. We call adjacent angles to those who are neighbours. We call vertical angles to those who aren't neighbours. Then, vertical angles are equal, whereas adjacent angles are supplementary, i.e. their sum is 180° (complementary angles sum 90°).

2024-09-15T13:02:21+02:00 The tangent formula. Consider a circle with centre C and an outer point P. Draw the two tangents to the circle through P, touching the circle at A and B. The radii CA and CB divide the circle in two unequal sectors, one with angle β and another with angle γ=360-β, with β>γ. Then, the angle APB = (β-γ)/2.

2024-09-15T11:57:03+02:00 Intersecting secants theorem. Two lines cross at O. Then, we draw any circle with centre C that crosses them in four points A,B,A',B'. The angle AOB=A'OB' is the arithmetic mean of the angles ACB and A'CB'.

2024-09-15T11:29:21+02:00 The intercept theorem (known as Thales' theorem in Spain) is only half of the fun. Let's see why. Take two lines crossing at O. Now, cross these two lines with two parallel lines, one creating A,B and the other A',B'. Thales tells us that the the triangles OAB and OA'B' are similar. Now, instead of cutting the two initial lines with a pair of parallel lines, cut them with *any* circle, getting the 4 points A,B,A',B'. Triangles OAB and OA'B' are also similar.

2024-09-15T09:14:13+02:00 Consider a triangle with sides a,b,c and vertices A,B,C (ordered counterclockwise). Now, choose an inner point P and draw the (⟂) distances from it to the sides (the trilinear coordinates of the triangle), to find the pedal points Pa,Pb,Pc that define the pedal triangle. These points divide a,b,c in a special way. First, go counterclockwise from each vertex of the triangle to a pedal point, and get APc,BPa,CPb. The same now clockwise and get APb,CPa,BPc. Then, Carnot's theorem says that the sum of squares of the former set equals the sum of squares of the latter: APc²+BPa²+CPb² = APb²+CPa²+BPc². The inverse holds: if the latter equation is valid, then Pa,Pb,Pc form a pedal triangle.

2024-09-15T09:02:53+02:00 Consider a triangle with sides a,b,c; vertices A,B,C; medians ma,mb,mc; altitudes ha,hb,hc; perpendicular bisectors pa,pb,pc and angle bisectors ba,bb,bc. The medians cross at the centroid G, the altitudes at the orthocentre H, the perpendicular bisectors at the circumcentre O, and the angle bisectors at the incentre I. Remarkably, G,H,O are collinear along what is called the Euler line. Moreover, G is always between H and O, and HG=2GO. In other words, H--G-O. The nine-point centre also belongs to this line.

2024-09-15T08:23:02+02:00 Take any triangle with sides a,b,c; altitudes ha,hb,hc (defining the orthocenter O); vertices A,B,C; midpoints Ma,Mb,Mc; feet Fa,Fb,Fc; and Pa,Pb,Pc being midpoints of OA,OB,OC. Then, these 9 points A,B,C,Ma,Mb,Mc,Fa,Fb,Fc,Pa,Pb,Pc belong to the same circle, called the nine-point centre.

2024-09-10T23:52:54+02:00 A simplex is the generalisation of the triangle to other dimensions. Thus, a (0,1,2,3,4)-dimensional simplex is a (point, line segment, triangle, tetrahedron, etc). I wonder if the app, SimpleX, is based on multi-dimensional triangles.

2024-09-10T23:25:55+02:00 Yet another diamond of geometry: Viviani's theorem. Consider an equilateral triangle ABC and an interior point P. From P, take the shortest paths to each side: a, b and c to sides BC, CA and AB, respectively. Then, a + b + c = h (the triangle's altitude). The converse also holds. An interesting extension for parallelograms: the sum of the four distances from any interior point is constant (converse also true). Returning to the triangle version, ternary graphs are plotted in an equilateral triangle where each side is an axis, and where the sum of the three plotted variables is a constant, like colour (chromaticity diagram, with r+g+b=colour), (diploid) allele frequencies (de Finetti diagram, with aa+Aa+AA=1) or soil texture (salt+silt+clay percentages = 100%). This allows to represent three coordinates in two dimensions.

2024-09-10T22:54:18+02:00 Another pair of (closely-related) geometry gems: Menelaus' and Ceva's theorems. Take a triangle ABC. Now, consider the lines defined by the three sides AB, BC and CA, and place a point on each line: P, Q and R, respectively. Next, go over the vertices of the triangle making a stopover at each corresponding new point. This means that our whole trip is A, P, B, Q, C, R, A. Using this order, built three consecutive fractions and multiply them, like this: AP/PB · BQ/QC · CR/RA = r. With this in mind: 1) Menelaus' theorem says that if P, Q and R are aligned, r = 1. The converse, which is very useful, says that if r = 1, those three points are aligned. 2) Ceva's theorem says that if AP, BR and CP are cevians (segments connecting a vertex of a triangle with its opposide side) and they meet at a point O, then r = 1. The converse, also very useful, says that if r = 1, the three cevians are concurrent (or exceptionally, parallel). In summary: when having three aligned points crossing a triangle (or its extension), use Menelaus'; when needing to prove alignment, use its converse; if three cevians are concurrent, use Ceva's; and if concurrency (or parallelism) needs to be proven, use its converse.

2024-09-10T22:19:47+02:00 Two lovely geometry theorems that I was never told about in school or uni. 1) Ptolemy's theorem: take four points A, B, C and D on a circumference (cyclically, i.e. in that order). Then, AB·CD + BC·DA = AC·BD. It is a generalisation of Pythagoras' theorem. 2) The British flag theorem: take a rectangle with cyclical points and take any point P inside or outside of the polygon. Then, AP² + PC² = DP² + PB². Which is another generalisation of Pythagoras' theorem. Not a single teacher took the time to introduce me to these gems. Unforgivable.

2024-09-10T12:33:58+02:00 Kendall rank correlation coefficient. Let A, B and C be three objects of study, and m1, m2 two different metrics. The three objects can be ranked according to either m1 or m2. But what is the correlation between these two rankings? This can be measured by coefficient τ. If τ=1, both ranks are identical. If τ=-1, the one rank is the inverse of the other. If τ=0, the ranks are independent. It is calculated as τ = (CP - DP)/P, where CP = number of concordant pairs, DP = number of discordant pairs and P = number of pairs. In R, just import data with data = read.csv("data.csv"). Then, kendall_cor = cor(data, method = "kendall"). Finally, print the matrix with print(kendall_cor). In Python, use scipy.stats.kendalltau. Both will give τB, which is a version of the parameter that accounts for ties. Notice that Kendall's approach is just for ranking. If both the magnitude and direction of each metric is to be considered, then Pearson’s correlation, measuring the linear relationship between metrics, is a better approach.

2024-08-27T15:34:36+02:00 Malus' law: if linearly polarised light with irradiance I0 is passed through a polariser at an angle a, the outgoing irradiance I is such that (I/I0) = cos²(a). This means that if a = pi/2, I = 0. It also means that, if we want light polarised at pi/2 wrt the incident light with maximum intensity, the best approach is to place as many polarisers in the middle as we can, so that the angle between two consecutive ones is minimised. If the light undergoes n polarisations from angle 0 o pi/2, we get (I/I0) = (cos[pi/(2n)])^(2n). For n=0,1,2,... we get (I/I0)≈0,0.25,0.42,0.53,0.61,0.66,..., 1. So basically, a smooth transition would not waste any irradiance. The square of the cosine comes from I being proportional to the square of the electric field: I ∝ E².

2024-08-24T21:34:06+02:00 The key application of Bayes' rule: A model gives p(data values | parameters values) along with the prior, p(parameters values). Then, we use the rule to convert this to how strongly we should trust some parameters, given the data, i.e. p(parameters values | data values). In summary, p(parameters|data) = p(data|parameters)p(parameters)/p(data). Usually, data is given in rows and parameters in columns. Let data be D and parameters be λ. Then, for each cell in the table we can compute p(Di,λj)=p(Di|λj)p(λj), and for each row we get a marginal p(Di)=∑_j p(Di,λj). For each column we get the marginal p(λ). Bayes' rule consists in dividing each cell by their row marginal. In other words, the posterior distribution on p(λ) is obtained by renormalising on the current row. Bayes' rule is about moving the attention from the margin of the table (where marginals are written) to the row. In other words, shifting from the prior (marginal) to the posterior (row). A summary: p(λ|D) = p(D|λ)p(λ)/p(D) or posterior = (likelihood)·(prior)/(evidence or marginal likelihood). We can go from the theoretical prior p(λ) to the data-supported posterior p(λ|D).

2024-08-24T21:19:09+02:00 From p(A|B)=p(A,B)/p(A) it's easy to derive Bayes' rule: p(A|B)=p(B|A)p(A)/p(B), where p(B) = ∑_ip(B|A_i)p(A_i). The numerator is just the joint probability p(A,B) or p(A and B). The denominator is a marginal probability p(X), a sum (or ∫) of p(X,Y) over all possible values of Y (or p(X)=∫p(X,Y)dY). Marginal is prior. Joint is posterior.

2024-08-24T21:13:57+02:00 Bayes firstly discovered the rule, but it was Laplace who rediscovered and developed the method. The alternative school, the frequentist, was pioneered by Fisher. The 20th century has been frequentist. The 21th century is shifting towards Bayesian analysis.

2024-08-24T20:59:30+02:00 If A and B are independent, p(A|B)=p(A) and p(B|A)=p(B), or equivalently, p(A and B) = p(A)·p(B).

2024-08-24T20:49:55+02:00 p(A|B) = p(A given B) = p(A and B) / p(A), where p(A) = ∑_i p(A and Bi). Interestingly, there is no inherent arrow of time here. p(A|B) does not mean that B happens before A. Yet, in QM, probability collapse seems aligned with causality.

2024-08-24T17:44:54+02:00 Doing Bayesian Data Analysis by John K. Kruschke. The mean of a distribution minimises (x-mean)², and the median minimises |x-median|. Mean is way more used than median, but why? According to Taleb, the standard deviation gives `much larger weight to larger observations`. But why should larger deviations weight more? Using the mean absolute deviation, mad = ∑|x-median|/n seems more intuitive than using the standard deviation std = sqrt(∑(x-mean)²/n). For a Gaussian distribution, srd/mad = sqrt(π/2)≈1.25 (close to 1). Take a million data, with 999999 0's and one 10⁶. In this case, mean = 1 and std ≈ 999.9995 ≈ 1000, whereas median = 0 and mad ≈ 1.999998 ≈ 2. Then, std/mad ≈ 500. With fat tails, this ratio increases dramatically. In summary, std is way more sensitive to outliers and farther from the intuitive idea of what dispersion is. And, most importantly, the std/mad ratio increases as tails become more prominent, so for normal distributions we don't care much, but when we depart from it, the std vs mad decision needs to be carefully taken.

2024-05-04T18:58:55+02:00 Animals and Cities: A reflection on their potential in innovating Nature-Based Solutions, by Giulia Granai et al. NBS traditionally focus on plants, but what about animals? City of Lucca (Tuscany, Italy) to become the 1st human-animal city. The article talks about wild and non-wild urban non-human animals. "We observed the lack of valorization of animals." They introduce the concept of animal NBS.

2024-05-04T18:39:32+02:00 The spatial-temporal evolution and driving mechanism of Urban resilience in the Yellow River Basin cities, by Haiyang Li et al. They measure Urban Resilience (UR) and provide its temporal dynamics and its spatial distribution in different cities. We need to understand entropy weighting better. What is a cloud model? We also need to be acquainted with the polyhedron method; the Geographical Detector; grey correlation analysis; and spatial Dubin analysis. They claim that "research on UR indicator systems and measurements is relatively mature". The reveal an irony: research on UR is concentrated in economically developed regions, whereas underdeveloped areas "have a more urgent need to enhance UR".

2024-05-04T11:47:35+02:00 Wildlife as Property Owners, by Karen Bradshaw, and Animal Property Rights, by John Hadley. Relevant references to read.

2024-05-04T11:43:35+02:00 Rituals as Nature-Based Governance, by Carsten Herrmann-Pillath. Rituals vs laws & regulations. Possession (factual use) vs property (legal claim). Ritual as the universal form of claiming possession.