注定外傳 1.7

Can it be Otherwise? 1.7

第三,純粹邏輯(語理分析)的問題:

兩件東西「一樣」,並不是絕對的概念,而只是相對於某個準確度之下而言。例如:

3.1415926

3.1415927

是否相同,要視乎準確度,達至小數後多少個位。如果四捨五入到,小數後第七個位,它們不同;如果四捨五入到,小數後第六個位,它們就相同。

(問:如果 3.1 和 3.1 呢?它們不是完全(絕對)相同嗎?)

理論上是,實際上未必。

如果你把它們視為兩個數字,而沒有任何現實中的上文下理,它們就很明顯是同一個數字。但是,有實際因素考慮,真的要應用那兩個數字的話,它們就可能「不同」。

(問:怎樣為之「有實際因素考慮,真的要應用」?)

即是,再不是「純數字」,而是「有單位的數字」。例如:你用一把間尺,量度兩支鉛筆的長度,而它們的長度分別是

3.1 厘米 和

3.1 厘米。

那樣,它們是否相同呢?

是否相同,要視乎準確度,達至小數後多少個位。如果四捨五入到,小數後第一個位,它們就相同。

那樣,它們是否「絕對相同」呢?

不知道。幾乎無可能。

要絕對相同,兩段長度,就要準確至小數後無限個位也相同。那可說是沒有可能,因為,間尺的刻度間隔,一定是有限大(有限細),而不是無限細。

在這個例子中,莫講話「準確至小數後無限個位」,即使只是問「準確至小數後第二個位,兩段長度相不相同」,其實也不知道。現實中,沒有量度儀器,可以準確到,小數後無限個位。

凡是量度,都只會得到近似值,所以,只能討論「近似同一性」(量度準確度)。亦即是話,當我們說,那兩支筆的長度「相同」時,是指它們的長度,相近到以當時的肉眼和儀器,暫時感受不到分別而已。

(問:那如果是數數目(使用整體)的情況呢?

例如:你有 10 隻手指,我又有 10 隻手指。

那樣,這兩個 10,不就是「絕對相同」嗎?)

— Me@2015-09-30 04:26:45 AM

2015.09.30 Wednesday (c) All rights reserved by ACHK

Exercise Three

You Could Have Invented Monads! (And Maybe You Already Have.)

Show that lift f * lift g = lift (f.g)

——————————

f' * g' = bind f' . g'
lift f = unit . f
f' = lift f

(lift f * lift g) (x, xs)
= bind (lift f . lift g) (x, xs)
= (hx, xs++hs)
  where
    (hx, hs) = lh x
    lh x = (f' . g') x
    f' = lift f
    g' = lift g

This line does not work, since f' cannot be applied to (g' x), for the data types are not compatible:

f' :: Float -> (Float, String)

g' :: Float -> (Float, String)

(g' x) :: (Float, String)

The meaning of f' * g' should be bind f' . (bind g') instead.

— Me@2015-09-27 10:24:54 PM

2015.09.27 Sunday (c) All rights reserved by ACHK

Problem 14.3a

A First Course in String Theory
 
 
14.3 Massive level in the open superstring.

~~~

b_i^2 = 0

b_i b_j = - b_j b_i

i_1 \ne i_2

Since the sign is ignored, the number of possible b^i b^j states is \frac{1}{2} (8) (7) = 28.

The number of possible b^i b^j b^k states is \frac{1}{6} (8) (7) (6) = 56.

The number of possible b^i b^j b^k b^l states is {8 \choose 4} = 70.

— Me@2015-09-27 10:40:30 AM
 
 
 
2015.09.27 Sunday (c) All rights reserved by ACHK

如何拯救眾生 2

How to improve the world indefinitely?

.

.

There is law of conservation of energy.
There is law of conservation of mass.
But, there is no law of conservation of ideas.

能量守恆,
質量守恆,
意念不守恆,
程式可以無限複製.

— Me

.

.

If you have an apple and I have an apple, and we exchange apples, we both still only have one apple. But if you have an idea and I have an idea, and we exchange ideas, we each now have two ideas.

— George Bernard Shaw

.

.

. . . it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it. Its peculiar character, too, is that no one possesses the less, because every other possesses the whole of it. He who receives an idea from me, receives instruction himself without lessening mine; as he who lights his taper at mine, receives light without darkening me.

That ideas should freely spread from one to another over the globe, for the moral and mutual instruction of man, and improvement of his condition, seems to have been peculiarly and benevolently designed by nature, …

— Thomas Jefferson

.

.

.

2008.10.21 Tuesday (c) All rights reserved by ACHK

注定外傳 1.6

Can it be Otherwise? 1.6

… 因為,如果真的是「百份百相同」的情境,又怎可能有不同的結果呢?

如果有可能有不同結果,那樣,引起另一結果的因素,總會與引起原本結果的因素,至少有一點不同。

(問:不是呀。在量子力學中,即使有兩組百分百一樣的物理系統,即使它們獲得完全相同的輸入,都可能有不同的輸出。)

你大概正確。但是,你要留意,量子力學中的「百分百一樣」物理系統,未必是你心目中的「百分百一樣」。

第一,量子力學(或其他任何科學)中的數學公式,只是數學模型,簡稱「理論」。模型的意思是,現實的近似,而不是現實的全部細節。

例如,地圖是實地的大概。試想想,一幅地圖比實地小那麼多,又怎可能包含了實地的所有細節呢?

量子力學中的『百分百一樣』物理系統,未必是你心目中的『百分百一樣』」的第一個理由是,量子力學的運算起點公式組,只是現實的近似。在量子力學理論中,所謂「相同」的物理系統,並不一定在現實中,真的「相同」。

第二,承接上點,量子力學理論中,最明顯與現實不同的,是它雙重標準。

在某個實驗裝置中,量子力學會用量子方程式,去預測(例如)某一粒粒子的速度和位置變化。但是,該粒子周圍的事物,即使那些事物,明顯地仍然算是,該個實驗裝置的一部分,都一概統稱為「儀器」和「環境」。它們會被敷衍了事 —— 要麼用「經典力學」處理,要麼乾脆不處理。

總而言之,它們不會被量子方程式去處理。量子力學(的推理和運算過程)會刻意忽略,「儀器」和「環境」怎樣影響,主角粒子的運動變化。

方便起見,以下本文把「儀器」和「環境」,統稱為「非核心部分」,或者「延伸裝置」,簡稱為「周邊」。

地圖不是百分百準確,並不是地圖的缺點。相反,那是地圖的優點,因為,正正由於地圖只是實地的大概,它比實地小很多,可以指出重點,引導你到達目的地。

一方面,原本你以為「相同」的兩個物理系統,其實,只是在同時也忽略了兩者「周邊」的情況下,才會相對地相同。

如果,你不只關心,兩者「周邊」的宏觀外貌,還同時考慮,兩者「周邊」的微觀粒子排列的話,它們就不會再被視為,「完全相同」的物理系統了。

在量子力學中,即使有兩組百分百一樣的物理系統,即使它們獲得完全相同的輸入,都可能有不同的輸出。

另一方面,如果你不計成本,肯把實驗的「量度儀器」和「環境」,之中的每粒粒子,都一併用量子方程式去處理的話,很有可能地,你就可以杜絕了,量子力學中,「一因多果」的情況。

換句話說,所有資料也考慮的話,就再不會有「同因不同果」的現象。但是,那個時候,量子力學,就會失去了它原本的功用了。

當地圖的比例是一比一,與實地一樣大時,你就不能使用它了。以實地為地圖,即是沒有地圖。

— Me@2015-09-25 10:40:58 AM

2015.09.25 Friday (c) All rights reserved by ACHK

flatMap()

Functors, Applicatives, and Monads

skybrian 70 days ago

If functional languages had called them the Mappable, Applicable, and FlatMappable interfaces, and used map(), apply(), and flatMap() instead of operators, it would have avoided a lot of confusion.

— Hacker News

bind ~ flatMap

— Me@2015-07-22 06:30:25 PM

2015.09.23 Wednesday ACHK

Problem 14.2.2

A First Course in String Theory
 
 
14.2 Generating function for the unoriented bosonic open string theory.

~~~

How to add “a term that implements the projection to unoriented states”?

What is the projector? \Omega?

f_{os} (x)

= \frac{1}{x} \prod_{n=1}^\infty \frac{1}{(1-x^n)^{24}} 

= \frac{1}{x} \left( 1 + 24 x + 324 x^2 + 3200 x^3 + ... \right)

To keep only the odd-power terms, we should construct an odd function:

f_{uos} (x)

= \frac{1}{2} \left( f_{os} (x) - f_{os} (-x) \right)

= \frac{1}{x} \prod_{n=1}^\infty \frac{1}{(1-x^n)^{24}} - \left( \frac{-1}{x} \prod_{n=1}^\infty \frac{1}{(1-(-x)^n)^{24}} \right)

— Me@2015-09-17 02:27:20 PM
 
 
 
2015.09.23 Wednesday (c) All rights reserved by ACHK

Englert–Greenberger duality relation, 2

The most recent work claims that Afshar’s core claim, that the Englert–Greenberger duality relation is violated, is not true. They re-ran the experiment, using a different method for measuring the visibility of the interference pattern than that used by Afshar, and found no violation of complementarity, concluding “This result demonstrates that the experiment can be perfectly explained by the Copenhagen interpretation of quantum mechanics.”

Numerous experiments have shown, however, that any modification of the apparatus that can determine which slit a particle passes through reduces the visibility of interference at the screen, thereby illustrating the complementarity principle: that light (and electrons, etc.) can behave as either particles or waves, but not both at the same time. An experiment performed in 1987 produced results that demonstrated that information could be obtained regarding which path a particle had taken, without destroying the interference altogether. This showed the effect of measurements that disturbed the particles in transit to a lesser degree and thereby influenced the interference pattern only to a comparable extent.

In other words, if one does not insist that the method used to determine which slit each photon passes through be completely reliable, one can still detect a (degraded) interference pattern.

— Wikipedia on Englert–Greenberger duality relation

— Wikipedia on Double-slit experiment

2015.09.22 Tuesday ACHK

如何拯救眾生 1

.

The meeting of two personalities is like the contact of two chemical substances: if there is any reaction, both are transformed. — Carl Jung

Generalized Newton’s Third Law: You cannot change others without being changed. — John Wheeler

改變別人時, 你也會被改變. — Me

.

.

You are an A person. You befriend with an F person. The result is that your friend becomes a better person, you become a worse person. In theory, you become a C person. Your friend becomes a C person. In practice, since being a bad person is much easier than being a good person, you two will become both F people. — Me

無友不如己者. — 孔子

Be slow in making friends, slower in changing. — Benjamin Franklin

You have to know how to accept rejection and reject acceptance. — Ray Bradbury

If you hire all A people, he said, they’ll also hire A people. But if you hire B people, they’ll hire the C people and then it’s all over. — Joel Spolsky

.

.

So that means you cannot help anyone weaker than you?

NO.

Instead, you should help others. But you have to help others in a smart way. — Me

.

How?

.

. . . it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it. Its peculiar character, too, is that no one possesses the less, because every other possesses the whole of it. He who receives an idea from me, receives instruction himself without lessening mine; as he who lights his taper at mine, receives light without darkening me.

— Thomas Jefferson

.

.

.

2008.10.22 Wednesday (c) All rights reserved by ACHK

Can it be Otherwise?

注定外傳 1.5

幾乎所有情況下,在同一個科學求知的任務中,理論(運算)和實驗(觀察)兩者,也是必須的;只是,在不同的任務,兩者的比重不同而已。

一方面,不可能只有理論而完全沒有實驗。即使沒有直接實驗,也必定有間接的實驗成份。試想想,那些理論從何而來?

不就是從無數的觀察和實驗中,歸納出來嗎? 

即使有些理論,真的來自靈感,不是來自實際,那個理論提出來以後,你又怎麼知道,正不正確,可不可靠呢?

未經證實的理論,只是「猜想」,不是「理論」。能經得起實際考驗的,才能升格為「理論」。

另一方面,不可能只有實驗而完全沒有理論。即使沒有直接理論,也必定有間接的理論成份。

試想想,那些實驗儀器,如何建造,從何而來?

不就是建基於,已知的理論嗎?

– Me@2015-09-22 07:41:07 AM

2015.09.22 Tuesday (c) All rights reserved by ACHK

Monad

Monads in Haskell can be thought of as composable computation descriptions. The essence of monad is thus separation of composition timeline from the composed computation’s execution timeline, as well as the ability of computation to implicitly carry extra data, as pertaining to the computation itself, in addition to its one (hence the name) output, that it will produce when run (or queried, or called upon). This lends monads to supplementing pure calculations with features like I/O, common environment or state, etc.

— Haskell Official Wiki

2015.09.21 Monday ACHK

Problem 14.2.1

A First Course in String Theory
 
 
14.2 Generating function for the unoriented bosonic open string theory.

~~~

What is the difference between oriented and unoriented bosonic open strings?

p.268: “The theory of unoriented strings is obtained by restricting the oriented string spectrum to the set of states that are invariant under the action of  \Omega. Unoriented strings are not strings without orientation: they should be viewed as a quantum superposition of states that as a whole, are invariant under orientation reversal.”

An unoriented state is a superposition of 2 opposite oriented states.

— Me@2015.07.03 12:12 PM

 
Clue 2: “… adding a term that implements the projection to unoriented states.”

Equation (14.63):

The generating function f_{os} for bosonic open string theory is

f_{os} (x)
= \frac{1}{x} + 24 + 324 x + 3200 x^2 + ...
= \frac{1}{x} \left( 1 + 24 x + 324 x^2 + 3200 x^3 + ... \right)

Clue 3: p.278 Problem 12.12e

\Omega = (-1)^{N^\perp}

An unoriented string state is a superposition of two opposite-oriented string states. An unoriented string state has twist invariant.

We can choose to keep all states |\psi \rangle with \Omega |\psi \rangle = + |\psi \rangle.

We can also choose the states with \Omega |\psi \rangle = - |\psi \rangle. However, they are only valid for the basis states, not for other states, because other states are superpositions of basis states. The relative phase between basis states are physical in a superposition.

Effectively, the states |\psi \rangle with \Omega |\psi \rangle = + |\psi \rangle are the only possible choices. In other words, N^\perp must be even.
 

— This answer is my guess. —

For the unoriented open strings, we should keep only the even powers of N^\perp:

f_{uos} (x) = \frac{1}{x} \left( 1 + 324 x^2 + 176256 x^4 + ... \right)

— This answer is my guess. —

 
— Me@2015-09-17 02:27:20 PM
 
 
 
2015.09.21 Monday (c) All rights reserved by ACHK

Quantum Indeterminacy

注定外外傳 1

Quantum indeterminacy is the apparent necessary incompleteness in the description of a physical system, that has become one of the characteristics of the standard description of quantum physics.

Indeterminacy in measurement was not an innovation of quantum mechanics, since it had been established early on by experimentalists that errors in measurement may lead to indeterminate outcomes. However, by the later half of the eighteenth century, measurement errors were well understood and it was known that they could either be reduced by better equipment or accounted for by statistical error models. In quantum mechanics, however, indeterminacy is of a much more fundamental nature, having nothing to do with errors or disturbance.

— Wikipedia on Quantum indeterminacy

Quantum indeterminacy is the inability to predict the behaviour of the system with 100% accuracy, even in principle.

If everything is connected , quantum indeterminacy is due to the logical fact that, by definition, a “part” cannot contain (all the information of) the “whole”.

An observer (A) cannot separate itself from the system (B) that it wants to observe, because an observation is an interaction between the observer and the observed .  

In order to get a perfect prediction of a measurement result, observer (A) must have all the information of the present state of the whole system (A+B). However, there are two logical difficulties.

First, observer A cannot have all the information about (A+B).

Second, observer A cannot observe itself to get (all of) its present state information, since an observation is an interaction between two entities. Logically, it is impossible for something to interact with itself directly. Just as logically, it is impossible for your right hand to hold your right hand itself. 

So the information observer A can get (to the greatest extent) is all the information about B, which is only part of the system (A+B) it (A) needs to know in order to get a prefect prediction for the evolution of the system B.

— Me@2015-09-14 08:12:32 PM

2015.09.15 Tuesday (c) All rights reserved by ACHK

注定外傳 1.4

乙:沒有問題。我可以把地圖畫得又再大一點,以包括又再多細節。

甲:不行。那還不夠準確。

乙:你想多準確?

甲:完全、百分百、鉅細無遺、分毫不差。

乙:那唯有造一張「一比一的地圖」。

甲:什麼是「一比一的地圖」?

乙:即是與實地一樣大小的地圖。

換句話說,即是以實地為地圖。那樣,地圖就會失去了它原本的意義。

甲:什麼是「意義」?

乙:用途就是意義。

地圖本來的用途,是把實地的重點表達出來,從而帶領你,找到要去的地方。

當地圖的比例是一比一,與實地一樣大時,你就不能使用它了。以實地為地圖,即是沒有地圖。

地圖不是百分百準確,並不是地圖的缺點。相反,那是地圖的優點,因為,正正由於地圖只是實地的大概,它比實地小很多,可以指出重點,引導你到達目的地。

同理,科學理論中的數學模型,並不是現實的全部。理論不會包括實際的所有細節,並不是理論的缺點。相反,那是理論的優點,因為,正正由於理論(運算)只是實際的大概,它可以用比實驗(觀察)小很多的成本,事先推斷實驗結果的重點,從而令你知道,那些實驗毋須執行。

當理論百分百準確,包含了實際的所有細節時,你就不能使用它了,因為,那就相當於,直接觀察實際。所謂「實際」,即是自然現象,或者人工實驗。

以現實的數據為理論,即是沒有理論。

至於,什麼時候應該用理論和運算,什麼時候應該用實驗和觀察,並沒有一定的答案。那要視乎哪方可以用較低的成本,得到你需要知道的數據。

(問:你不是說理論的成本較低嗎?)

還要考慮上文下理。

一般而言,透過閱讀地圖的指引,走去目的地,會快過在從未看過地圖的情況下,就走進實地之中,直接尋找目的地。但是,那是假設了,那時你的手中已有地圖。

如果你手中未有地圖,在比較「地圖」和「實地」的成本時,一方面,你要考慮製作地圖、尋找地圖 和 購買地圖 等,所需的時間和金錢等資源;另一方面,你亦要考慮,在實地之中,環境複不複雜、自己熟不熟路、問路方不方便 等。

同理,在盤算「理論」和「實驗」的成本時,一方面,你要考慮,理論是否已有;已有的話,自己熟不熟悉;不熟的話,有沒有專家可問,自學的成本有多高;熟悉的話,運算複不複雜;複雜的話,可不可以用電腦程式代勞,等等。

另一方面,你亦要考慮,實驗那邊的對應問題,例如:

該實驗有沒有標準的工序流程,還是要自己設計?

該實驗所需的工具和儀器,是否現成,還是要自己建造?

現成的話,昂不昂貴?

買來之後,自己懂不懂操作?

幾乎所有情況下,在同一個科學求知的任務中,理論(運算)和實驗(觀察),兩者也是必須的;只是,在不同的任務,兩者的比重不同而已。

— Me@2015-09-07 08:59:31 PM

2015.09.08 Tuesday (c) All rights reserved by ACHK