Wednesday, July 21, 2010

无恶不作

I read this awesome blog Hanzi Smatter, which is... well, you can see for yourself, but it shows strange Chinese tattoos Westerners get (apparently it's quite 风行 to get a Chinese tattoo) and character misuse in general. It's hard to imagine someone would get a tattoo without at least trying to find out what it means, but...

Anyway, these two are my personal favourites (courtesy of the aforementioned blog) :

This tattoo says is a 成语 (see the 成语接龙 post) that literally translates as "there is no evil [that I] will not do."


As for the below, it's from a TV show, "CSI: NY."
The Chinese translates as:
"Vigour and liberation bar
Fresh meat fresh
Vigour and liberation bar"
(bar as in an alcoholic bar)

Sunday, July 18, 2010

Gaits









This post was inspired by a discussion with my dad while walking the dogs. If you look at old paintings of horse races (see above) , their legs are completely outstretched in the front and back. These kinds of paintings, all before high-speed photography, were painted at a time when people didn't really know what horses looked like when they're running.

In 1878, our very own Leland Stanford settled the debate over whether horses are ever fully airborne while running: he organized the first ever example of a high-speed photo shoot (and hence the forerunner of motion picture technology) . Here's the photo, taken on June 10, 1878, at his Palo Alto track.

Here, I'll describe walking (actually the most complicated of gaits) :

The dog alternates between two and three legs supporting the body. Thus, there are eight 4C3 (three-leg combinations) plus 4C2 (two-leg combinations) minus the two combinations where you have the two front legs at the same time and then the two back legs at the sam time. That's four each. It's an eight-beat cycle, which means that after eight steps/lifts, it starts all over, like a video reaching the end and starting again. Each odd beat, for example, the dog has two paws down, and each even one it has three.

Viewing the odd and even beats separately, you can see that on each paw stays down for n beats, where n is the number of paws down on the particular beat. Thus, in the whole cycle, each paw stays down for n=2 + n=3 = 5 beats.

Here's a diagram for the odd beats (let the dot represent a placed paw) :
0 •  |  0 •  |  • 0  |  • 0
• 0  |  0 •  |  0 •  |  • 0
Which, if you think about it, is really the only way you can cycle through those four positions if you adhere to each paw staying down for two beats. There are six possible orderings of the four positions (4! arrangements, but /4 for the cycles) . If you think of the above ordering that we know works as the order 234 (1234) , then you see that to avoid jumping from a position to its opposite, i.e.:
|  0 •  |  • 0  | 
|  0 •  |  • 0  | 
or the equivalent other (the diagonal mirror) , you have to come up with an order that never pairs 2 and 4 together, like above, nor does it do so with 1 and 3, which would automatically follow -- because it's a cycle, hence it repeats, so 1243 still pairs 1 and 3 at the head and tail. So, to avoid such a pairing, your only other possibility is 1423. Or, you could work it out as ordering the letters abB such that the 'b' and the 'B' are never together, so you just fix one at the start (one possibility of the remaining 2! is good) and same for the other, which gives you 1+1=2 total ways to avoid the jump. So, for now let's just remember: there's only one position and its mirror that work.

As for the three-paw steps, you can view the cycle as each next beat. Like so (to view the whole eight-beat cycle, the i^th three-paw beat in this cycle is the beat right after the i^th two-paw step) :
0 •  |  • •  |  • 0  |  • •
• •  |  0 •  |  • •  |  • 0

What about the other five possibilities? For example, how about it be such that the paw that lifts is the next in an anti-clockwise or clockwise circle? As in,
0 •  |  • •  |  • •  |  • 0
• •  |  0 •  |  • 0  |  • •
? Well, if you combine that with the odd beats you get the following:
  1      2   3       4        5       6       7 8
0 • |  0 •  |  0 •  |  • •  |  • 0  |  • •  |  • 0  |  • 0
• 0 |  • •  |  0 •  |  0 •  |  0 •  |  • 0  |  • 0  |  • •
, where 
1|2|3|4|5|6|7|8
the front left paw goes 0|0|0|•|•|•|•|• , which is OK,
the front right paw goes •|•|•|•|0|•|0|0 , which is not,
the back left paw goes •|•|0|0|0|•|•|• , which is OK,
the back right paw goes 0|•|•|•|•|0|0|• , which is not.

front right and back left don't fit. The other five possibilities don't work, either -- but the mirror of the one that does works with our original mirror for the two-paw beats. So, basically, there are only two sets of beats that work for walking: the original that we worked out, and its mirror.

Here's some code I wrote up (quickly, so it's not very nice) you can compile to simulate walking (you'll have to #include iostream, vector, algorithm and iterator for it to compile -- I'd include it here, but the blog posting script treats it as an html tag) :

using namespace std;

void PrintEachPaw(const vector<string> &v) {
 cout << "In the order of FL, FR, BL, BR:\n";
 copy(v.begin(), v.end(), ostream_iterator<string>(cout, "\n"));
return;
}

void PrintEachBeat(const vector<string> &v) {
cout << endl;
for (size_t i = 0; i < 8; i++) {
for (size_t j = 0; j < 4; j++) {
if (j == 2)
cout << endl;
cout << v[j][i];
}
cout << endl << endl;
}
return;
}

int main (int argc, char *const argv[]) {
vector<string> v;
string a, b, c, d;
v.push_back(a);
v.push_back(b);
v.push_back(c);
v.push_back(d);
for (size_t i = 0; i < v.size(); i++) {
v[i] = "........";
for (int j = 0; j < 3; j++)
v[i][((i*2)+j)%8] = '0';
}
string temp = v[2];
v[2] = v[1];
v[1] = temp;
PrintEachPaw(v);
PrintEachBeat(v);
return 0;
}

Thursday, July 15, 2010

Dog Trapped in Hot Car Honks to Alert Owner

Two days ago in Pennsylvania, a (horribly negligent!) man accidentally left his chocolate Lab in the car for an hour on a 32˚C (90˚F) day. The dog, uncomfortable from overheating, honked the car's horn to get attention.

From the article (click on the post title) :

She said Max's owner had gone shopping and was unloading packages when she returned but forgot that Max was still in the car. She later heard the horn honking and looked outside several times but saw nothing amiss. Finally, she went outside and saw Max sitting in the driver's seat, honking the horn.


Thankfully, the dog is OK. Man, dogs are smart. Labs have a reputation for being dumb as wood, though. Not all of 'em, I guess.

Wednesday, July 14, 2010

AppleJack 1.6 is out!

If you use a Mac, here's a nice little tidbit: AppleJack 1.6 is out (click on the post title for the link) . If you've never heard of it, AppleJack is a useful bug-fixing piece of software. Just start your computer up in single-user mode by holding down curlique-S (command-S) and type "applejack" at the prompt. It'll usually do a very good job of fixing whatever oddness is happening in your computer. It works especially well if Finder is acting up.

Sunday, July 11, 2010

So You Want to Write a Fugue


This is awesome. Glenn Gould, undoubtedly the best Bach pianist ever (except for Bach himself, who was in his time a world-renowned organist and possibly the best improviser ever -- he composed a six-part fugue from scratch in his head as he was playing it, on command by Fréderic The Great. It ended up becoming his Musical Offering) , composed this four-part fugue (SATB and strings accompaniment) in 1963. In the first recording, the strings were the Juliard String Quartet!

Here are the lyrics (and here's the link) :
So you want to write a fugue.
You got the urge to write a fugue.
You got the nerve to write a fugue.
So go ahead, so go ahead and write a fugue.
Go ahead and write a fugue that we can sing.
Pay no heed, Pay no mind.
Pay no heed to what we tell you,
Pay no mind to what we tell you.
Cast away all that you were told
And the theory that you read.
As we said come and write one,
Oh do come and write one,
Write a fugue that we can sing.
Now the only way to write one
Is to plunge right in and write one.
Just forget the rules and write one,
Just ignore the rules and try.
And the fun of it will get you.
And the joy of it will fetch you.
Its a pleasure that is bound to satisfy.
When you decide that John Sebastian must have been a very personable guy.
Never be clever
for the sake of being clever,
for the sake of showing off.
For a canon in inversion is a dangerous diversion, 
And a bit of augmentation is a serious temptation,
While a stretto diminution is an obvious allusion.
For to try to write a fugue that we can sing.
And when you finish writing it
I think you will find a great joy in it.
or so...
Nothing ventured, nothing gained they say
But still it is rather hard to start.
Well let us try right now.
Now we are going to write a fugue.
We are going to write a good one.
We are going to write a fugue ... right now.

Saturday, July 10, 2010

Chinese Driver's Test Questions

I'll be taking the test soon. Here are some questions, verbatim, from the test booklet (which is not to say that the US test didn't have a few asinine/opaque questions, too) :

4.3.2.5. When a vehicle runs left through an interchange, it should turn right and turn right again before passing the interchange. (T/F)
Answer: false

4.3.2.6 When a vehicle runs left through an interchange, it should pass the interchange before turning right, entering the ramp, and turning right again. (T/F)
Answer: true

5.2.1.1 When evading an emergency, the driver should be calm, and stick to the principle of 
a) evading people first and objects first
b)evading objects first and people later.

3.3.1.14 When driving a vehicle the driver should drive in a safe, ____ manner.
a) courteous
b) nimble

3.2.1.6 The main feature of pedestrians participating in road traffic is that they are
a) they are not stable
b) the walk around at will and can easily change directions
Answer: b)

1.1.1.10
The motorized vehicle driver should
a) drive according to the traffic rules and in a safe and courteous manner
b) may drive at will when there is no traffic police

3.4.2.50
When encountering a "watch for children" sign, the driver should speed up and pass the sign in case children abruptly cross the road. (T/F)

4.1.2.9
The "safe distance ascertaining section" of an expressway is used to ascertain the safe distance for the vehicles running at 100km/h. (T/F)
Answer: true

DVD Blurbs in China

When my dad and I saw these at the local DVD 商店,we couldn't resist buying them:

Once The Terror And Violence Actually Begin (which Doesn't Happen Until The Lsat Third Of The Movie No Less) It Goes Way Downhill. For One, It Was Marketed As A Torture Movie, But There Is Barely Any Of It! Sure, There's A Brutal Killing Here And There, But When It Came To Gore, This Film Was Very Tame. Second ,the Cinematography In During The Night Scenes Was Awful, With The Chase Scenes And Violence Barely Viewable. You Could Not Tell What Was Happening On Screen, And All Of The vIewers Of The Film Were Lost With What Was Going On. Third, The Last Third Was Extremely Predictable. You Could Tell Who Was Going To Die And When. The Main Villain (who Ironically Looks Like The President Of Iran) Is Not Well Drawn Out, And The Climax" Of The Film Is Pitiful.

Here's the Chinese blurb, which is a description of parts of the plot. That is, nothing like the English.
美丽迷人的巴西海滩引得无数的旅游者前来此地度假游玩。年轻人阿列克斯和漂亮的女友普鲁也加入到南下巴西旅游的行列当中。准备在巴西迷人的沙滩上度过他们难得的假期。但是在前往海滩度假圣地的旅途中,他们和一班同行的游客所乘坐的旅游巴士却意外发生了故障。车上的乘客无奈之下,衹好下车四处的丛林裹闲逛。


About the struggle between the Roman Empire and its rebellious conquest Judaea, and two best friends caught in a terrible moment in history. The cast is absolutely awful, not on character seems to fit (mesala was perhaps the only good choice) and discolored curly hair is ridiculous in an antic set up. Lucia Jimenez, who plays Athene, is probably the worst actress I've ever seen, every single line of her dialogs were painful other and almost made you feel bad for her.


Friday, July 9, 2010

The Two Children Problem

If 张三 has two children, and one of whom is a boy, what's the probability that he has two boys?


Clearly the answer isn't 1/2, otherwise I wouldn't be asking. Indeed, the two events are independent. The hinge lies on the first event being ambiguous: we're not told which of the two children is the boy; it's not fixed. Thus, the first event (one of the children is a boy) is actually two: child A is, in which case B is the unknown, or child B is the boy and A is the unknown.


Tabulating all of the possibilities helps:
     A | B
     ____
1.  g  |  g // ignore this one
2.  b  |  g
3.  g  |  b
4.  b  |  b


We can eliminate 1., because it's given that A or B is a boy. Thus, we're left with two cases of one boy and one case of two boys. Hence, 1/3.


Or, with conditional probability:
Let A be the event child A is a boy.
Let B be the event child B is a boy.
Let C be the event that P(A U B) = 1. //given
//P(P | Q) means "the probability of P, given Q."
//P(P^Q) means "the probability of P and Q both happening)."


P((P^Q) | C) = P(A^B^C) / P(C)  
                 = P(A^B) / (3/4)  
                 = 4(.25) / 3 = 1/3         //A and B are independent
You can drop the C from P(A^B^C) because for A^B to occur, C also has to occur. For example:
Let M be the event that you roll a die.
Let N be the event that you roll a six.
P(M^N) = P(N) . Or, more specifically, P(N^M') = 0, where M' means "not M." In English, the probability of you rolling a six and you don't roll a die both happening is zero.

Underwater Basket Weaving

If you haven't heard of the term, it's used to describe any useless university course or major. Apparently its usage dates back to the 1950s.


In 1968, presumably referring to college students coming up with ways to escape the draft, a senator said: "I am just as interested as you and the chairman or anyone else in seeing that we don't get into the situation that we were in after World War II where we had universities setting up courses in underwater basket-weaving."


Reed College, in Oregon, which is awesome because of the prevalence of dogs on its campus, offers a course on underwater basket weaving, every year since 1980. The University of Arizona offered a snorkelling basket weaving class in 1998, too.


However, willow basket weaving does involve putting reeds underwater to soak for ten hours.

The Galaxy S Captivate

Samsung just launched a new Android phone through AT&T, called the "Galaxy S Captivate." Have you ever heard of a crazier phone name?

Wednesday, July 7, 2010

Beijing Heat

Two days ago was the hottest day in Beijing in 50 years -- it got to 41  at around 3:30. At 10:30, the meteorological department upgraded its weather alert from yellow (third level) to orange (second level) . I shudder to think of what it has to be like to qualify for red...

Mihail Pletnev Accused of Raping a 14-year-old Boy in Thailand

Gosh, I hope it ends up being false. Pletnev is a great Russian pianist, though there are a bunch of those. He founded the Russian National Orchestra and has a bunch of wonderful recordings out there. He also composes and conducts! He received Государственная Премия Российской Федерации, the highest award given by the Russian government to musicians.

World Cup Symmetry

From I Love Charts, a strange, single-minded blog that posts just about any kind of graph:


Why Germany Will Win the World Cup: Symmetry

Tuesday, July 6, 2010

成语 of the Day (and 成语接龙)

www.chinese-tools.com, which is supposed to be a pretty decent website for studying Chinese (I use the MDBG online dictionary for my computer and 请问 for iPhone, though) , has a new 成语 each day. Good for building up your vocab for intense games of 成语接龙。

成语接龙,in case you don't know, is a really fun, really hard game where each person in turn has to say a 成语 that starts with the previous person's last character's pronunciation. If you're being really strict, you have to adhere to tone, too. Adhering to character is basically impossible to continue for more than just a few turns. For example, part of a game would be 杀鸡儆猴 -- 厚德载物 -- 无法无天 -- 天长地久 -- 酒虎诗龙 -- 龙舞凤飞。

Saturday, July 3, 2010

Narita Airport Cleaning Robots



Tokyo's Narita Airport's cleaning robots, Narita-kun and Epo-Chan. I might get to meet them next time I stop there on the way to/from home!