Scary Halloween Lights
1st test of the “scary light barrier”:
The flickering is not on purpose but it looks scary.
1st test of the “scary light barrier”:
The flickering is not on purpose but it looks scary.
The e.g. 30th birthday is celebrated with more attention than the 27th birthday. Why is this so? The reason is the zero after the three or in mathematical terms the multiple of ten (your daily numeral system with base 10). As a computer affine guy I celebrate the 32nd birthday even more because it has a lot more zeros, at least in the binary, octal, hexadezimal and duotrigesimal (base 32) numeral systems. The small and not so unimportant question appeared.
Which birthday has to be celebrated the most?
This gives me the opportunity to use one of my favorite computation methods: Brute Force. I like to use brute force algorithms because of their simplicity. There are no gradients I have to follow, no clever selection of choices, no neural gas and no discussion about the runtime order because brute force algorithms perform badly. A big plus is, that you scan the whole parameter space without exception.
Now back to the task: Which is the birthday with the most zeros in “all” number systems? Actually I only use the number systems from 2 to 128 because no human according to Wikipedia got older than 122 years and I like numbers, which are two to the power of a natural number.
Lets establish the solution step by step and than perform some induction programming. The idea is to find a simple mathematical rule, which gives us the number of zeros. Lets start with the binary system. The following numbers are interesting for our solution:
Base 2 Numeral System | Short Decimal Representation | Decimal Representation | Number of Zeros |
---|---|---|---|
10 | $2^1$ | 2 | 1 |
100 | $2^2$ | 4 | 2 |
1000 | $2^3$ | 8 | 3 |
10000 | $2^4$ | 16 | 4 |
100000 | $2^5$ | 32 | 5 |
1000000 | $2^6$ | 64 | 6 |
10000000 | $2^7$ | 128 | 7 |
100000000 | $2^8$ | 256 | 8 |
One could assume, to go through each base $b$ with the exponent $e$ and the exponent gives us the number of zeros. This has a caveat which is shown in the following table for the numeral system with base three:
Base 3 Numeral System | Short Decimal Representation | Decimal Representation | Number of Zeros |
---|---|---|---|
10 | $1 \cdot 3^1$ | 3 | 1 |
20 | $2 \cdot 3^1$ | 6 | 1 |
100 | $1 \cdot 3^2$ | 9 | 2 |
200 | $2 \cdot 3^2$ | 18 | 2 |
1000 | $1 \cdot 3^3$ | 27 | 3 |
2000 | $2 \cdot 3^3$ | 54 | 3 |
10000 | $1 \cdot 3^4$ | 81 | 4 |
20000 | $2 \cdot 3^4$ | 162 | 4 |
This looks like a better solution with $n$ from 1 to $b-1$ times $b^e$. The caveat here is, that $110_3$, $120_3$, $210_3$ etc. are missing in the list.
Another problem with the decimal system we live in. It does not explain if we celebrate the $101$ birthday more then the 10th birthday? Lets keep it simple and say: Each zero counts, no matter of its place in the number.
Because the very simple mathematical solutions do not get the results I want, I would have to switch on my brain to figure a clever way to find the solution. Because thinking is difficult, I start programming ;-)
The idea is to represent a year in all number systems from base 2 to base 128 (127 systems) and then to count the zeros. Do this for all years from 0 128. Et Voila. To do this a new Python script is born:
Gist: https://gist.github.com/Threadmonkey/bf07ee6af7134d8b5b90cabe595f3778
As you can guess, birth at year 0 has in ‘all’ numeral systems a zero, which makes it the winner by far. Here a chart with the number of zeros on the y-axis and the years on the x-axis.
To see a little bit more details, here without the outlier.
I hope you had fun reading. If there is a broader interest in this topic, I would invest more time on a more detailed investigation. Let me know.
You have decided to get a PhD. OK but I cannot let you do it without giving you a few life saving instructions in order to survive. Most human beings do not know what it means to get a PhD. You have to say goodbye to about 18 years of protection by the syllabus mommy. You leave the warm home, where teachers and professors tell you what to learn and what to do.
Welcome to the wild side. Its like becoming a member of a tribe with crazy rites, a chief (professor), subordinates (post docs), sub-subordinates (PhD students), sub-sub-subordinates (students) and handicrafts (structured paper stacking, reading multi color layered white board paintings, dealing with different types of deadlines, …). Because life in the wild is tough here a list of websites you should use during your PhD to adapt to the new circumstances.
Phd Comics (Jorge Cham)
At the beginning of your thesis you will laugh, later you will use it as a source for compassion ;-).
http://phdcomics.com/comics.php
XKCD (Randall Munroe)
If you need something else to think about with relation to maths, technology, childish or grown-up curiosity you will enjoy XKCD.
http://www.xkcd.com
(If you are not able to enjoy it: http://www.explainxkcd.com)
The magic button
If nothing works, this button will also not work. At least you will feel a little bit better.
http://make-everything-ok.com
Correlation?
Some correlations are just not as true as necessary for a publication.
http://www.tylervigen.com
Paper generator
Its true, there is a generator for papers, which works. Unfortunately you have to submit often till it gets accepted.
http://pdos.csail.mit.edu/scigen/
Nobel prize
If you cannot get the real one, you can at least bring glory and honor to your institute with the ig Nobel prize.
http://www.improbable.com/ig/
List of not obvious (techy) procrastination sites
http://dilbert.com/ (ok this one is obvious)
http://thecodinglove.com/
http://devopsreactions.tumblr.com/
https://devhumor.com/
A little bit more useful procrastination sites
http://www.ted.com/
http://99u.com/
I wish you well and hope to see you in some of the dance your PhD videos.
http://gonzolabs.org/dance/
Traffic jams and rush hours reduce my free time, which I can spend with more meaningful activities. Usually I use the commute to come down from work and to switch into private mode. Unfortunately I do not need an hour to arrive in the private world, such that I waste a lot of time in the car. Even the best podcasts are sometimes of no use to bridge the time. In order to reduce the commute time from my office to my home, I tried experimentally to figure out which departure time is the best. Beside the desired sampling rate and a long observation period, I am lazy and I forget to make notes. After a week the experiments felt fuzzy and the way of solving the problem did not satisfy the little nerdiness I carry with me but I got the best case and worst case timings:
Travel distance: 50 km Best case (moderate speed): 35 minutes Best case (pedal to the metal): 30 minutes Worst case: 60 minutes
What do humans in the 21st century use to estimate the travel time? Google maps! OK thats the way to go. The nice thing is, that google maps is able to take the current traffic situation into account. I can let the computer do the nasty work of taking notes.
Within 80 lines of Java code (with empty lines ;-), the google maps API is queried every minute and the result is stored in a file. After about $3.5$ weeks of data acquisition a bash script extracts and groups the estimated travel time for each day of the week into a single file. One data point consists of the time and estimated travel time pair: “HH-MM-SS : estimated travel time”. Up to 4 data points of each minute made the visualization messy. To reduce the number of data points a python script computes the mean value for each minute. Finally D3 javascript is used to visualize the data as you can see if you click on one of the following weekdays.
Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday
Between 1 am and 5 am google does not deliver travel time estimations or the more probable explanation is, that google knows about a stargate nearby, which opens from 1 am to 5 am. Beside the things google knows, the interesting parts for me are the rush hour peaks around 5 pm. On Monday there is surprisingly no peak. Maybe the measurement period of about $3.5$ weeks was to short. On Tuesday and Wednesday the peaks are after 5 pm and on Thursday and Friday the peaks are shifted towards 4pm. Surprisingly a 12 o’clock peak occurs on saturday. A colleague called it “the Saturday shopping rush”, which matches pretty well with my observations of shopping on a saturday. Sunday is no surprise at all.
As a result for me: Find the Stargate! Go early to work and leave early. If you want to stay in the bed for a few moments, consider a few moments more.
Supplement: The experimental observation indicates, that during school vacations the rush hour is significantly shorter.
Coding in a train is usually a thing for itself but during winter time it is much harder because your fingers are cold and rigid. Once it got really cold and I needed a method to heat my fingers up. How to programmatically heat fingers? The good thing was, that I had an old IBM Thinkpad with a hot air exhaust, which can be activated. The magic trick to activate the fan is to give the CPU an endless busy waiting task, such that I awkwardly typed with my frozen fingers a piece of heating code, which is not more than a parallel endless loop iterating over an integer.
#include "omp.h" int main (int argc, char *argv[]) { int i; #pragma omp parallel { while (1) { i++; } } return 0; }
This piece of code is unusual and falls pretty well into the definition of a Chindogu, which is a japanese art form. It is unusual because the program does not have a digital output.
If your fingers are feeling cold, feel free to download the source code from GitHub:
There are a lot ways to transfer files from A to B but which one is the right choice for $x$ bytes over a distance of $y$ kilometers? The actual problem was to transfer about 80 GB from my office to the office of a colleague, which was around 1 km away. We had a similar discussion about the way to exchange data as Randall Munroe (xkcd.com) drew in his xkcd 949 “File Transfer”.
My solution was to compute transfer rates for different solutions, such that I can decide if I can sit or if I have to walk, drive or fly. By flying I mean pidgins with attached hard disk drive or the newer version of them, drones with hard disk drives. Take a look at the result and feel free to play around with it.
Compute transfer rates: Sit, walk, drive or fly?
A PhD thesis is a written scientific work between 9 [source] and 2000 [source] pages. The average page count varies for different scientific fields as depicted in this nice diagram from Robert T. Gonzalez Blog
The question what a phd is, should be of interest for a phd student. If you cannot find or formulate your definition of a phd, then it will be hard for you to perform well as a phd student. How can you do something if you do not know what you are doing or for what you are doing it for?
You have to find your definition of a PhD thesis. A search leads very fast to 2 great blogs about what a PhD is and what the difficulties in academia are:
A must see talk of James Hayton is http://youtu.be/4MkRMp3roKQ . He’s not only explaining how you do not go insane, he also provides you with the big picture. Another must see is The Illustrated Guide to a Ph.D. of Matt Might.
I hope you find some of the provided information and links helpful for your decisions.
This is a collection of some documents about how-to-write-a-paper. Just google it an you will find much more. The important thing is, that you have to find your definition of what science is and how communication between scientists should work. It has to be your own definition, which makes writing much easier.
What you should do is to read some of the content behind the provided links to see the very different interpretations of scientific communication.
One thing that worked for me is the advice in source one. Grab a coffee or beer and start to think about the structure and ideas of the paper by writing down everything on a A3 page in landscape alignment.
The 99U Website is very inspiring. I watched the talk from Teresa Amabile Track Your Small Wins to Motivate Big Accomplishments about creativity and how to improve work. I wanted to read her book The Progress Principle and so one of my XMas presents in 2013 was her book. I could not let go reading it because it reminded me about my feelings and my every day events at work. Because it is of great value for me, I want all of you to read her book.
She describes very profound the properties of a good and a bad work environment and the events, which boost your inner work life to the bright or the dark side.
For all of you, which are more comfortable watching videos, here is a awesome talk from Simon Sinek: Leadership Is Not a Rank, It’s a Decision. His talk is strongly related to the Progress Principle book Teresa wrote but from another perspective.
I hope you watch the videos and start to get curious about your work environment and your place in the food chain ;-)