好為人師 3.3

這段改編自 2023 年 6 月 23 日的對話。

.

教師和學生,並不是平等關係。那就可以導致,最終反目。原因是,雙方也會出於禮貌,即使在不同意對方時,也不會直斥其非、議事論事。既然不是開心見誠,無所顧忌,而是有所隱瞞,那就會導致誤會,日久累積加深。這情況在本人身上,發生不少次。有時是與學生反面,有時則是和教授,不相往來。

例子 1.1:

……

例子 1.2:

然後我想起,即使當年在日校教書時,也會遇到類似的「禮貌導致反目」情形。

.

輕則就是在平日教書時,很難改善自己的教學質素;因為,學生通常也不會,如實反映。

那有很多原因,例如,除非聽者本身在該個課題上,和講者的程度相若,否則,他並不知道他的不明白,是因為講者講得不好,還是自己的理解力差於平均。

雖然有眾多原因,但其中一個,必然是「老師是長輩,不好意思批評」。你試想想,即使不知道「不明白」的真正原因,至起碼,可以反映「自己不明白」本身。那樣,教師自然對自己的教學有戒心,會研究是否講得不明白;如果是的話,他有機會修正改善。

.

重則就是即使直接問意見,聽眾也不肯回答。

我試過指派了過多功課,但我只有一半的責任;因為,我在公佈時,就已經問了他們,功課會不會太多。有一兩位學生認為,該年既然準備公開試,多一點功課好。大部分人則沒有發表意見。後來,幸好有同事提點我,有些學生在背後強烈譴責,我指派的功課過多;又或者因來不及做功課,寧願抄襲。於是,我在下一課時,立刻減少功課量。

試想想,為何寧可在背後譴責和抄襲,也不直接跟我講?

即使在我指派功課時,他們不知那是太多,在中途告訴我也可以。那樣,我就可立刻修正之。

如果不是有同事仗義告之的話,功課太多的問題,對於成績的影響,不堪設想。

.

對於師長有禮,本來是好事。但是,禮應是雙向的。師長亦應對晚輩有禮,包括知道自己,在教學方面,在沒有聽眾反饋的情況下,不會有好結果。

單向之禮是禍根。

— Me@2025-01-25 09:22:33 AM

.

.

2025.01.25 Saturday (c) All rights reserved by ACHK

Euler problem 26.1

(defun recurring-cycle (d)
  "Calculate the length of the recurring cycle for 1/d."
  (labels ((remainders (d r rs)
             (if (eql r 0)
                 0               
                 (let ((s (mod r d)))
                   (if (member s rs)
                       (1+ (position s rs))
                       (remainders d (* 10 s) (cons s rs)))))))
    (remainders d 1 nil)))

(defun p26 ()
  "Find the number below 1000 with the longest recurring cycle in its decimal representation."
  (let* ((results (loop :for n :from 1 :to 999 
                        collect (cons n (recurring-cycle n))))
         (max-pair (reduce #'(lambda (a b)
                               (if (> (cdr a) (cdr b))
                                   a
                                   b))
                           results)))
    (car max-pair)))

; SLIME 2.28
CL-USER> (p26)
983
CL-USER> 

— Me@2025-01-20 03:57:23 PM

.

.

2025.01.20 Monday (c) All rights reserved by ACHK

4 Basis Fields, 1

Functional Differential Geometry

.

3.1

… ; they measure how quickly the coordinate functions change in the direction of the vector field, scaled by the magnitude of the vector field: …

\begin{aligned}  b^i_{\chi, \mathbf{v}} &= \mathbf{v}(\chi^i) \circ \chi^{-1}   \end{aligned}

The first factor \mathbf{v}(\chi^i) is just the meaning of the definition of b^i_{\chi, \mathbf{v}}. The second factor is needed because the input of b^i_{\chi, \mathbf{v}} is x, not \mathbf{m}.

\begin{aligned}  b^i_{\chi, \mathbf{v}} (x)   &= \mathbf{v}(\chi^i) (\mathbf{m}) \\  &= \mathbf{v}(\chi^i) ( \chi^{-1} (\chi (\mathbf{m}))) \\  &= \mathbf{v}(\chi^i) \circ \chi^{-1} (x)   \end{aligned}

In other words, \mathbf{v}(\chi^i) (\mathbf{m}) is just the definition of b^i_{\chi, \mathbf{v}} (x).

.

3.2 p. 21

\displaystyle{ \textbf{v}(\text{f})(\textbf{m})} is the direction derivative of the function \displaystyle{\text{f}} at the point \displaystyle{ \textbf{m} }.

.

3.3 p. 22 Eq. (3.4):

\displaystyle{ \begin{aligned}  \textbf{v}(\text{f})(\textbf{m})  &= (D( \textbf{f} \circ \chi^{-1}) b_{\chi,\mathbf{v}}) \circ \chi)(\textbf{m}) \\  \end{aligned} }

.

4.1 p. 41 Eq. (4.1):

\displaystyle{ \textbf{v}(\text{f})(\textbf{m})    = \textbf{e}(\textbf{f})(\textbf{m})\textbf{b}(\textbf{m}) = \sum_{i} \textbf{e}_i (\textbf{f})(\textbf{m}) \textbf{b}^i(\textbf{m})}

In other words, \textbf{b}^i‘s and \textbf{e}_i‘s represent the amount and direction of changes respectively.

.

4.2 p. 33

A one-form field is a generalization of this idea; it is something that measures a vector field at each point.

One-form fields are linear functions of vector fields that produce real-valued functions on the manifold.

— Me@2025-01-17 03:59:54 PM

.

.

2025.01.19 Sunday (c) All rights reserved by ACHK

Posted in FDG

Lisp = Process(Lisp), 1.2

Lisp as a Y combinator

.

This concept ties into:

  • Metacircular Evaluators: In SICP, they introduce the concept of a metacircular evaluator, which is an interpreter for Lisp written in Lisp itself. This is a direct example of “Lisp = Process(Lisp)”, where the “Process” is the act of interpretation or implementation.

Sussman’s statement is both a philosophical and practical insight into the nature of Lisp, highlighting its self-referential capabilities and the elegance of its design in terms of theoretical computer science concepts like fixed points.

— Me@2024-12-30 10:45:35 AM

.

.

2025.01.17 Friday (c) All rights reserved by ACHK

真話騙子 2.2

這段改編自 2021 年 12 月 17 日的對話。

.

……

現在集中討論第一點:

即使是所謂的「善意」的假話或隱瞞,也應盡量避免講,因為結果為何,不是你或者任何人,可以控制到。

審判過程中翁靜晶丈夫劉家良在書面口供表示,兩夫婦曾因翁靜晶與林競業的緋聞陷入離婚邊緣,而且翁靜晶為了避免事情鬧大,阻延報警求救最少二十分鐘。靜晶則供稱當日劉家良突然到訪寓所,當時在翁寓所內的林競業為避免遭到劉誤會他與翁偷情,主動爬出窗外,卻失足飛墮平台。

— 維基百科

不必要的隱瞞,後果可以那麼嚴重。

.

那個處境的正確做法是:

1. 其實應該在事先,就避免那個情境的發生——不是情侶的異性,就不要獨處。瓜田李下也。

2. 如果是必須,例如工作需要的話,二人也應該各自,事先通知自己的另一半。

3. 如果不幸地,沒有跟隨這兩個要點,導致遇到例子中情形的話,就要如實反映。講了實話後,別人信不信,並不是重點。

即使伴侶不信任,而導致離婚,也已是兩害取其輕。

— Me@2024-12-18 10:56:12 AM

.

.

2025.01.15 Wednesday (c) All rights reserved by ACHK

Euler problem 25.3

showtime : false$
t0 : elapsed_real_time()$

t: 10^999$

j : 1$
while fib(j) < t do (
    j: j + 1
)$

j;

t1: elapsed_real_time()$

time_taken: t1-t0$

print("Time taken:", float(time_taken), "seconds");

4782

"Time taken:"0.4299999999999997"seconds"

— Me@2025-01-13 08:11:23 AM

.

.

2025.01.13 Monday (c) All rights reserved by ACHK

Ex 1.32 Path functions and state functions, 2.3

Structure and Interpretation of Classical Mechanics

.

2. On the other hand, the path function \bar f[q] and the path function \bar \Gamma (\bar f) \circ \Gamma [q] are not necessarily the same. Explain.

3. Give examples where they are the same and where they are not the same.

~~~

In other words, path q^{(m)} = 0 for all m>n. Or put it simply, q(t) is a polynomial.

.

The second case is when the path function \bar f [q] requires no derivatives of q with order higher than n. For example:

Assume that the path is \displaystyle{q = \sin(t)}, the osculating path is

\displaystyle{\begin{aligned}     &\mathcal{O} (t_0, q(t_0), v(t_0), a(t_0)))(t) \\     &= q_0 + v_0 (t-t_0) + \frac{1}{2} a_0 (t-t_0)^2 \\        \end{aligned}}

and \displaystyle{\bar f [q] = Dq}.

Then \displaystyle{\bar f [q](t = t_0) = \cos (t_0)}; and

\displaystyle{\begin{aligned}    & \left. \bar \Gamma (\bar f) \circ \Gamma [q] \right|_{t_0} \\  &= \left. \bar \Gamma (\bar f) \circ \Gamma[\mathcal{O} (t,q,v,a)](t)\right|_{t_0} \\  &= \left. \bar \Gamma (\bar f) (t, q, v, a)\right|_{t_0} \\  &= \left[ v_0 + a_0 (t-t_0) \right]_{t_0} \\  &= \cos (t_0) \\   \end{aligned}}

.

\displaystyle{\mathcal{O} (t,q,v, \cdots, q^{(n)})} == a taylor series with finite length

.

However, if a path function \bar g requires a higher derivative which is not provided by \Gamma:

\displaystyle{q = \sin(t)}

\displaystyle{\begin{aligned}     &\mathcal{O} (t_0, q(t_0), v(t_0), a(t_0)))(t) \\     &= q_0 + v_0 (t-t_0) + \frac{1}{2} a_0 (t-t_0)^2 \\     &= \sin t_0 + ( \cos t_0 ) (t-t_0) - \frac{1}{2} \sin t_0 (t-t_0)^2 \\        \end{aligned}}

\displaystyle{\bar g [q] = D^3q},

then \displaystyle{\bar g [q](t = t_0) = - \cos (t_0)}; and

\displaystyle{\begin{aligned}    & \left. \bar \Gamma (\bar g) \circ \Gamma [q] \right|_{t_0} \\  &= \left. \bar \Gamma (\bar g) \circ \Gamma[\mathcal{O} (t,q,v,a)](t)\right|_{t_0} \\  &= \left. \bar \Gamma (\bar g) (t, q, v, a)\right|_{t_0} \\  &= \left[ 0 \right]_{t_0} \\  &= 0 \\   \end{aligned}}

— Me@2025-01-12 06:43:55 AM

.

.

2025.01.12 Sunday (c) All rights reserved by ACHK

Lisp = Process(Lisp)

Lisp as a Y combinator

.

Lisp is the fixed point of the process which says, if I know what Lisp was and substituted it in for eval and apply and so on, on the right-hand sides of all those recursion equations, then if it was a real good Lisp, is a real one then the left-hand side would also be Lisp.

— Gerald Jay Sussman

.

Process: This refers to the act of defining or implementing Lisp. Specifically, it’s about defining Lisp’s core functions like eval and apply which are crucial for interpreting and executing Lisp code.

— Me@2024-12-30 10:45:35 AM

.

.

2025.01.10 Friday (c) All rights reserved by ACHK

Panjandrum

大架子

.

On the day when the Nobel Prize was announced, Louise gave me some very wise advice: “Now you have to write some unimportant papers.” I knew what she meant.

Even when scientists who receive the Nobel Prize resist the temptation to become panjandrums like Heisenberg, by issuing judgments about what others should be doing, there is a tendency for laureates to feel that one should stop doing the ordinary hard work of science, and instead go only for the next Big Thing.

I take pride in the fact that I have continued working hard on minor problems and have written a large number—literally hundreds—of unimportant papers, both before and after the Nobel Prize. Whatever other physicists may have learned from these papers, I have learned a lot. And at least I have escaped panjandrum-itis.

— Steven Weinberg: A Life in Physics

.

.

2025.01.09 Thursday (c) All rights reserved by ACHK

Where are you? 2.7

Utopia | 何有之鄉, 2.7

.

不可能遷就到,而為了保命,必須立刻超光速逃離,或者𣊬間轉移的例子有:

……

五、 不可信:

……

大漏洞是,要永久不被發現,你的心神就要,永久經營那些大話,心情永久不能放鬆。

記住,維持誠信有如保持健康,主要是為了自己而做的;他人知不知道,沒有關係。

以下是例外情形,可能有必要講假話。

1. 有時,講真話會危害性命,你就嘗試不答話。仍然不行的話,為了保護自己或他人的人身安全,唯有說假話。

2. 有些近似謊言,會立刻極速自我實現,就叫「自證預言」。如果對人對己極為有利,「自證預言」可以說。

例如,如果有位正常智力的學生問你,他夠不夠聰明,應付公開考試。只要你大力宣稱他夠聰明,而他又相信的話,他就自然會有心機,用心溫習。他在公開試奪取佳績的機會,就會大大提升,應驗了你「他夠聰明」的宣稱。

留意,如果自我實現不是立刻極速,那就有違道義,不可算是「自證預言」。

其他情形下,謊言假話,幾乎一概不可接受。

……

— Me@2024-09-05 03:33:08 PM

.

.

2025.01.07 Tuesday (c) All rights reserved by ACHK

Euler problem 25.2.2

import System.CPUTime
import Text.Printf (printf)
import Data.List (findIndex)

time :: (Show a) => a -> IO a
time result = do
    start <- getCPUTime
    let computed = result
    end <- computed `seq` getCPUTime
    let diff = (fromIntegral (end - start)::Float)/(10^12)
    printf "Result: %s\n Time taken: %.6f seconds\n" (show computed) diff
    return computed
    
matrixMultiply :: Num a => [(a, a)] -> [(a, a)] -> [(a, a)]
matrixMultiply [(a11, a12), (a21, a22)] [(b11, b12), (b21, b22)] =
  [ (a11*b11 + a12*b21, a11*b12 + a12*b22)
  , (a21*b11 + a22*b21, a21*b12 + a22*b22) ]
 
matrixPower :: Num a => [(a, a)] -> Int -> [(a, a)]
matrixPower m 1 = m
matrixPower m n =
  let half = matrixPower m (n `div` 2)
      squared = matrixMultiply half half
  in if odd n then matrixMultiply squared m else squared
 
digitsInNumber :: (Show a, Integral a) => a -> Int
digitsInNumber = length . show
 
fibNth :: Integral a => a -> a
fibNth n 
  | n <= 2    = 1
  | otherwise = fst $ head $ matrixPower [(1, 1), (1, 0)] (fromIntegral (n - 1))
 
fibUpperBound :: Int -> Integer
fibUpperBound digitCount =
  let phi = 1.618033988749895
      logPhi = logBase 10 phi
      log5 = logBase 10 5
  in ceiling $ (fromIntegral digitCount - 1 + (log5 / 2)) / logPhi
 
binarySearchFibIndex :: Int -> Maybe Integer
binarySearchFibIndex digitCount =
  let upperBound = fibUpperBound digitCount
      binarySearch left right 
        | left > right = Nothing
        | otherwise =
            let mid = left + (right - left) `div` 2
                midFib = fibNth mid
                midDigits = digitsInNumber midFib
            in case compare midDigits digitCount of
                 EQ ->
                   let prevDigits = digitsInNumber $ fibNth (mid - 1)
                   in if prevDigits < digitCount then Just mid else binarySearch left (mid - 1)
                 LT -> binarySearch (mid + 1) right
                 GT -> binarySearch left (mid - 1)
  in binarySearch 1 upperBound

λ> time $ binarySearchFibIndex 1000
Result: Just 4782
 Time taken: 0.000852 seconds
Just 4782
λ> 
λ> time $ binarySearchFibIndex 1000
Result: Just 4782
 Time taken: 0.006747 seconds
Just 4782
λ> 

— Me@2024-12-25 07:00:13 AM

.

.

2025.01.01 Wednesday (c) All rights reserved by ACHK

Problem 14.5d1.2.3

A First Course in String Theory

.

The generating function is an infinite product:

\displaystyle{ \begin{aligned} \alpha' M_L^2: \end{aligned}}

\displaystyle{\begin{aligned} &f_{L, NS+}(x) \\ &= a_{NS+} (r) x^r \\ &= \frac{1}{x} \prod_{r=1}^\infty \frac{(1 + x^{r-\frac{1}{2}})^{32}}{(1 - x^r)^8} \\ \end{aligned}}

.

To evaluate the infinite product, you can use wxMaxima. However, it does not provide \LaTeX rendering of answers yet. Instead, you can call Maxima‘s code in SageMath, if you use Jupyter Notebook to access SageMath.

reset()

%display latex

maxima('taylor((1/x)*product((1 + x^(r - 1/2))^32 / (1 - x^r)^8, r, 1, oo), x, 0, 6)')

\displaystyle {{1}\over{x}}+{{32}\over{\sqrt{x}}}+504+5248\,\sqrt{x}+40996\,x+  258624\,x^{{{3}\over{2}}}+1384320\,x^2+6512384\,x^{{{5}\over{2}}}+  27623826\,x^3+107640288\,x^{{{7}\over{2}}}+390667136\,x^4+1334500992  \,x^{{{9}\over{2}}}+4325559288\,x^5+13390178752\,x^{{{11}\over{2}}}+  39794729472\,x^6+\cdots

— Me@2024-12-02 06:33:46 AM

.

.

2024.12.31 Tuesday (c) All rights reserved by ACHK