## Prof. Jing Deng's Misc

Home | Teaching | Research | Publications | CV | Misc

### ST

• ST:VOY The Waking Moments, The Random Thoughts, The Killing Game, etc.

The mind-boggling warp and transwarp speeds were not very accurate in ST series. It is believed that, when the warp factor w is between 0 and 9, the actual speed can be expressed as s=c*w^(10/3), where c is the speed of light. So at warp 9, a space shuttle can achieve the speed of 1516c, 1516 times as fast as light.

When we'd ever enter warp 9 and warp 10 (if warp 10 exists at all), we will see some vague speeds. The following equation,

s = 1663 * 1.1583 ^ ((- log(10-w) ) ^ (pi/2)),

works relatively well with the warp speeds ever appeared in ST as summarized by this page. Or maybe the warp speeds have been computed at random.

Nobody knows about transwarp. Maybe Q or his son.

### Baseball Streaks

• Baseball is full of streaks. The most interesting one is hitting streak, the record of which belongs to New York Yankees Joe DiMaggio. He had a hitting streak of 56 games, i.e., having at least one hit in 56 consecutive games. You got to be pretty good in order to get that streak.

While not trying to play down the significance of the long hitting streaks, we can use stochastic process to explain some of these numbers.

For simplicity, let us assume every player has a hitting percentage of 250 or 0.25. Each player hits 3 times in each game. There are 180 games each year and there are 30 teams with 9 regular players. We further assume that the outcome of each batting chance is decided randomly based the hitting percentage and independently, i.i.d..

The chance of a player getting at least a hit in a game is

1 - (1-0.25)^3

The chance of no one player gets into a hitting streak of N games is

P0 = (1-(1-0.25)^3)^(30*9)

where 30*9 represents the total number of hitting record (players).

The chance of having a streak of N game hitting is then 1 minus the above result. And on an average, it takes the following number of years to find such a streak

1/ (1-P0) / 180

where we have assumed 180 games each year.

The following figure shows the number of years it takes to have certain hitting streak, for different hitting percentage:

From this figure, we can see that the hitting streak of 30 should appear quite often. Again, this does not mean that the player getting this streak isn't a great player. The mathematical point of view is that, with so many games played, some streaks are bound to appear.

The real computation should be much more complex because players have different hitting percentage and they react differently when they enter a streak.

### Alpine's message shrank problem with Gmail

If you are like me, you like gmail but not much of clicking mouse. Keyboard is generally 1000 times faster than mouse (although there are some tasks that have to be performed with mouse). That calls for terminal-based email client and the candidates are limited. Alpine (or pine) is one of them. Others include sup, Mutt.

So using Alpine to retrieve email from gmail server and read/manage your email locally is not difficult.

Alpine works fine with a few glitches, not being able to search full text in multiple email among one of them. One other headache is its complaint of message size change after retrieving email body from gmail servers. The message of "Message to save shrank! (msg # 1): Continue anyway ?" will be shown to you and even if you respond "Always (ignore)" you will be asked the same question again and again.

After searching Internet for a possible solution for quite some time, I could not find any solution except recompiling from source code. I couldn't recompile because of some other issues. So gdb came to the rescue.

The trick is to edit the binary file itself by skipping the call function. Open the alpine binary file in Emacs (hexl-mode, move to the right line, then Ctrl-Alt-x to insert in hex mode) or any other hex editor. Search for ' e8e3 6803 00' and replace it with ' b861 0000 00'. Save the file into a new name. The prompt will be gone.

While in the hexl-mode, go to line 582E0 and change byte location 582E2:582E6 into "B8:01:00:00:00". This is the machine code of "mov eax, 1" to automatically respond yes to the nasty question of "Preserve password for next login".

The version of alpine I am using is Version 2.00 (built Sun Sep 28 00:59:01 EDT 2008) running on Mac OS X, 10.6.8 Intel-based Mac Book Air 2010.

Happy emailing!