utorok 7. júna 2022

Na prechádzke Jurou

 

Búrka ustupuje a po týždni ignorovania bežeckých topánok ma to ťahá von. Na obzore sa týči Jura, prezentujúca vhodný cieľ. Plán: St-Geni – Crêt de la Neige, necelých 15 km jedným smerom s 1500 metrami prevýšenia. Pozerám na staré výkony, usudzujem, že tempo okolo 8:00 min/km je dostatočne pesimistický odhad. Ak nepôjdem úplne mimo, odhad splním a nebudem mať problém s vlakom.

pondelok 23. mája 2022

Adversity and Adaptation

 

Good stories have a plot and a moral, or a learning to take away. This one has both, which – of course – does not make it a good:)

sobota 5. februára 2022

The Clever Cashier – with love to my teachers

Back at uni, we have frequently heard of some mythical creatures. The eagle eye has often spotted what the next step would be. ("Bystré oko snadno nahlédne" was the expression in Czech.) There also was the clever quantum mechanic ("zručný kvantový mechanik") who used the postulates of quantum mechanics and the knowledge of special functions to make headway. While the appearance of the two entities was welcome at times, as it broke the flow of mathematical operations, they often left us wishing we could manage it so easily too.

One such entity made its appearance only once. First, we were reminded about the basics of Riemann integration[1] – cut the integration interval into sub-intervals, take the maximum of the function on each of them multiplied by the length of the corresponding sub-interval, add them together. Then send the number of sub-intervals to infinity and evaluate the limit.


Fig. 1: The main idea of Riemann integration. Picture by Lucas Vieira, Public domain, via Wikimedia Commons.

A simile followed: This is the same approach as the one used by a cashier. When making the daily total, they take value of take each coin[2] and add it to the total.[3] Common sense, right? A revelation followed, though. A smart cashier (šikovný pokladník) does it in a different way. First, he counts all the coins of a particular denomination and create a subtotal by multiplying the number of coins by the denomination. In the end, he adds the subtotals. Clever indeed, right? If you are in education or mathematics, you might guess what followed. The smart cashier's approach was used to approximate the area under the curve in Fig. 1. This was our introduction to the Lebesgue integration by our Calculus lecturer, Mirko Rokyta.  

Fig. 2: Picture by User:Svebert, CC0, via Wikimedia Commons. The main idea of Lebesgue integration is to look “horizontally” and count “how often” the function reaches a certain value. The resulting construction is mathematically very powerful.

I have not heard of the smart cashier since Fall of 2001.

A month or so ago, I came across a challenge in my work. I had a dataset with colours reported by users and I wanted to analyse if the colours  were happy, neutral or sad. We were interested in the aggregate value of happiness, as well as partial sums per sets.

set 1set 2set 3set 4
magenta/fuchsiaburgundyemeraldviolet
chocolateorangecopperbrick red
lemonceruleanbaby blueindigo
navy blue
electric bluebyzantium


baby blue


brick red

My original approach was straightforward: go through ever entry, assign it a value (1, 0 or -1) and process these at the end. Just for fun, try doing so. My main difficulty at this point was not the number of entries but the need to make a choice – often in a situation where I had no strong opinion. Is brick red (left) a happy colour or is it neutral? What about byzantium (right) – is the “dark enough” to be considered sad? Or is it regally happy? When faced with the task, I did what seemed the best: I asked a colleague to rate as well, and then we reconciled the differences. A few weeks later, an onerous task became a seemingly insurmountable one: 

set 1set 2set 3set 4
copperjungle greenharlequinivory
electric bluegreenlavendermaroon
harlequinmagenta/fuchsiamagenta rosemagenta rose
indigojungle greenemeraldgray
mauveindigoorangelemon
lemongreenorchidnavy blue
erinlemonpinklavender
maroonmagenta rosenavy bluepeach
jadeivorycyan/aquapuce
ivorymagenta/fuchsiaoliveindigo
navy bluegrayorangeivory
electric bluejungle greenmauveelectric blue
magenta rosegrayemeraldindigo
limeindigomagenta roseharlequin
ivorynavy bluemagenta rosecyan/aqua
oliveochrelemongreen
navy bluejadejade
orangecopperharlequin
lavendererinmagenta/fuchsia
ivory
green
lilac
maroon
magenta rose
jungle green
magenta/fuchsia
green
lilac
ivory
green
olive
magenta/fuchsia
green
mauve


mauve


jade


electric blue


mauve


Short of employing an algorithmic approach (or paying someone to do it), the only option seems to be going entry by entry. Entry by entry..., like Riemann. Riemann is like a cashier..., oh, what would the clever cashier do? I do not know yet, but let’s see. Wait, if you order the first column, you’ll have four instances of mauve, three of electric blue and three of ivory. So you can count the mauves in the first column, assign it a value (1?) and proceed. Soon afterwards I realise that ivory and mauve are also present in the other columns. Now the solution is clear: you only need to rate the unique entries! Lookups and sums will take care of the rest. In the end, the work needed was reduced by a factor of 3. (That’s a big deal.)

The Clever Cashier emerges victorious. More importantly, the episode shows how a simple beautiful[4] concept can be reused in a different setting decades after being learnt. Allow me to end with a big appreciation to Mirko Rokyta for teaching in this way.


[1] I ask the experts to be generous with the non-rigorous language.

[2] We will consider only coins: they are more visual, especially when stacked.

[3] The cashier uses a discrete approximation.

[4] This is the right combination of adjectives. Henri Lebesgue’s idea is much better than simple and its undeniable elegance gives it beauty.

sobota 25. decembra 2021

How hard is it to run 21k on powder snow?

Nimble footwork handy. For purposes of damage dealt, the stream is lava liquid nitrogen.
 

I set out for a 21k course I know very well. There was fresh powder snow and it was not cold (-4C) with no wind. I did a cross-country the day before and a 12k run the day prior to it. In the end, I finished after 3hours totally exhausted. My previous attempt on the same course was 2h:08min with some snow on the trail and considerable time pressure. And I felt okay after the experience. So where can I attribute the differences in finishing time and the toll the run took?

štvrtok 28. októbra 2021

Two Institutions

 https://upload.wikimedia.org/wikipedia/commons/a/a3/Theatre_Masks_PNG.png

Theatre masks from wikimedia. Attributed to Matthew E. Semrau, www.PureLightStudios.com.

Two is a fantastic number. When you have two objects, you can set them side-by-side to juxtapose them. And you can see a lot more in this way, even if you take almost random objects.

štvrtok 14. októbra 2021

Job's done!

 Not everything goes as smoothly as these simple calculations, where the result (underlined twice) emerges quickly.

Satisfaction from a task done depends on its relevance, complexity and on the ratio of outcome/energy invested. Since rarely do these all meet, I find it nice to celebrate when this is the case. 

nedeľa 10. októbra 2021

Historical memory in France

  Man shrugging from Emoji Terra. The portrait of M.P. from wikimedia.

There are a few French institutions that warm your heart. For example, Boulangerie, bakery. They operate on the premise that people will buy fresh bread and pastry any time of the day. And guess what, they do! (Granted, boulangerie does close around 8 p.m., but that's good enough.)

Another one is the historical memory. While working in the office, you suddenly hear a sonorous voice uttering a calmly energetic invocation of an old historical character, "Oh, Pétain!"  You can only envy the French that they use wartime collaborators as a figure of speech. The trend extends to hard-core intellectuals as well: later in the day there was an alarmingly angry Pétain! from someone who got a letter from the tax office. Very appropriate choice of words.

I find it fascinating that darker characters from national history in the West get the same treatment as old pagans spirits and gods like Perún/Parom, Lempo and become swearing bywords. Wouldn't it be appropriate if we followed suite with our war-time collaborators as well? :)