Monday, February 27, 2017

Not so Golden?

We discussed Golden section search method for optimizing functions in 1D last week. Naturally, we had to talk about the golden ratio (GR) and its appearance in the cultural zeitgeist.

However, there are many misconceptions/misunderstandings about the golden ratio, as researched in this eminently readable 1992 article by George Markowsky (pdf). For example:

  • neither the great pyramid of Cheops, nor the Parthenon, were designed to conform to the GR
  • da Vinci did not use the GR in his paintings
  • the golden rectangle is not obviously the most aesthetically pleasing rectangle
  • connection with the dimensions of the human body are exaggerated,
  • etc.

Keith Devlin explores this misconception in this video:




Saturday, February 25, 2017

Interesting Links

1. The Overpopulation Myth (video)


2. Is Bill Belichick lucky? (Russ Roberts on medium)

3. Math and the Good Life (quanta)
If I learn mathematics and I become a better thinker, I develop perseverance, because I know what it’s like to wrestle with a hard problem, and I develop hopefulness that I will actually solve these problems. And some people experience a kind of transcendent wonder that they’re seeing something true about the universe. That’s a source of joy and flourishing.
4. Indian snake catchers in Florida!

Thursday, February 23, 2017

Split a Text File using csplit

Suppose you have a large "sectioned" text file which looks like the following

> cat bigfile.txt
data1
1
2
3

data2
11
22
33

...

csplit bigfile.txt /data/ {*}

splits it into a bunch of files xx0, xx1, xx2, ..., where each of the "xx" files holds a section. Thus,

> cat xx1
data1
1
2
3

and so on. Can be just the quick tool you need at times.

Friday, February 17, 2017

Google N-Grams for Keywords in Journals

Google Ngram Viewer allows us to visualize popularity of keywords as a function of time. It uses books archived on Google Books as its corpus.



However, it doesn't work quite as well on some domain specific scientific keywords.

The best tools for this is Web of Science, if you are lucky enough to have institutional access to it.

Once you search a keyword, scroll to the bottom left and look for the "Analyze Results" button. Then choose "Publication Years" in the "Rank the records by this field" window.

Here I looked for "tube model", which is a popular model in polymer melt dynamics.


You can export the result and play with it.

Thursday, February 9, 2017

QuickTip: Reducing PDF Size using GhostScript

The command is:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Source.

Wednesday, February 1, 2017

Neat Little Integral Trick

John D. Cook writes about a useful integration trick by rewriting trigonometric functions as complex variables. He recasts the integral \[\int e^{-x} \sin(4x) dx,\] using \(e^{ix} = \cos x + i \sin x\) as the imaginary part of \[\int e^{-x} e^{4ix} dx.\]

The derivation is cleaner (no integration by parts), and you don't have to remember any trig formulae. You can do pretty much any trig integral:\[\begin{align} \int \cos x dx & = \int e^{ix} dx \\
& = e^{ix}/i \\ & = -i e^{ix}. \end{align}\] The real part of the last expression is \(\sin x\).