A Lie

The Lucifer Effect, 2

.

gringoDan on June 11, 2018

This is a fascinating article about how much of the famous Stanford Prison Experiment was a sham.

The appeal of the Stanford prison experiment seems to go deeper than its scientific validity, perhaps because it tells us a story about ourselves that we desperately want to believe: that we, as individuals, cannot really be held accountable for the sometimes reprehensible things we do. As troubling as it might seem to accept Zimbardo’s fallen vision of human nature, it is also profoundly liberating. It means we’re off the hook. Our actions are determined by circumstance. Our fallibility is situational. Just as the Gospel promised to absolve us of our sins if we would only believe, the SPE offered a form of redemption tailor-made for a scientific era, and we embraced it.

It seems that we fell for the narrative fallacy every time this “research” was used as an explanation for behavior in the real world.

— The Lifespan of a Lie – Why can’t we escape the Stanford Prison Experiment?

— Hacker News

.

.

2023.07.30 Sunday ACHK

反情感勒索 2

人格堤壩 8 | 眾害取其輕 | The least of all evils, 12

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

.

在那愚善的年代,我受到誤導,以為「任何情況下,不可令人不開心」。

那是十分荒謬的。

如果他人的不開心,不是我引起的話,那樣,我就沒有責任要,做些什麼事情,令到他開心。

— Me@2022-08-20 11:27:16 PM

.

一個人做一件事時,往往有超過一個原因。除了「主要原因」外,往往還有「其他原因」。情況許可的話,最好把「主要原因」講出來。那樣處事,會乾淨俐落,而自己的感受,亦會是最舒服的。情況不許可把「主要原因」,給人知道的話,你可以把「其他原因」講出來,而毋須講假話。

記住,千萬不要說假話,除非遇上極端的情形。「極端的情形」是指,如果當時不立刻直接說假話,別人或自己就會,受到嚴重的傷害。但是,既然稱得上是「極端的情形」,即是很少會發生。所以,在絕大部分情況下,你是不需要說假話的。

— Me@2010.10.03

.

十多年前我教了你,在不方便講「真正主要原因」時,可以改為用「真正次要原因」。

現在,內容大方向仍然正確,但細節方面,有一點補充。年青時,我以為的「不方便」,有部分時候,其實是幻覺。

.

有時候,我有權不給任何原因,甚至不理睬。

.

十多年前我教你時,所用的例子是,我讀物理碩士時,有一份功課習作,需二人一組合作。後來意見不合,我就不想再合作,所以刻意包裝成,我的錯誤:

「對於達不到你的要求,我不太好意思。為免影響你的成績,不如我們跟教授提議,分開習作,各自評分?」

那時已是凌晨,在電話中拖拖拉拉後,他終於同意。

.

現在的話,我處理同類事件的方法,則會終極直接。

合作要兩個人的同意,分開則只需一個。

請求對方的准許,只是客氣之辭。需要不要,則視乎個別情況。而在這件事,其實毋須那拍檔的准許。我只需要直接了當:

「我覺得繼續合作,不利雙方,所以,我決定了拆伙。」

在自己一人有權,做決定的事情上,千萬不要企圖,問准他人。

.

記住,和解、道歉 和 解釋 等,只適用於,還要相處的人。

.

別離沒有對錯 要走也解釋不多

— 現代愛情故事

— Me@2023-07-26 05:25:08 PM

.

.

2023.07.29 Saturday (c) All rights reserved by ACHK

Euler problem 14.2

import Data.Array ( listArray, (!) )
import Data.List ( elemIndex )

collatzLengthList m = collatzLengthArray
  where
    collatzLengthArray
      = listArray (1,m) $ 1:map collatzLength [2..m]
      where
        collatzLength n
          | b<=m = 1 + collatzLengthArray ! b
          | otherwise = 1 + collatzLength b
          where
            b
              | even n = n `div` 2 
              | otherwise = 3*n+1

e14 :: (Maybe Int, Integer)
e14 = (n, m)
  where
    m = maximum cArray
    cArray = collatzLengthList p
    p = 1000000
    n = elemIndex m cList
      where
        cList = 0:[cArray ! x | x <- [1..p]]

λ> :set +s
λ> e14
(Just 837799,525)
(1.74 secs, 2,193,219,920 bytes)

— Me@2023-07-25 11:55:41 PM

.

.

2023.07.26 Wednesday (c) All rights reserved by ACHK

Ex 3.1 State Derivatives

Functional Differential Geometry

.

Newton’s equations:

\displaystyle{  \begin{aligned}  D^2 X(t) &= A_x(X(t), Y(t)) \\  D^2 Y(t) &= A_y(X(t), Y(t))  \end{aligned}  }

Coordinate path \displaystyle{\sigma}:

\displaystyle{  \begin{aligned}  \sigma &= \chi \circ \gamma \\  \chi &= (\text{t}, \text{x}, \text{y}, \text{v}_x, \text{v}_y) \\  \end{aligned}  }

What is \chi?

It is a coordinate system on the manifold \mathbf{M}.

What is \gamma?

It is a parametric path.

(p.29) The integral curve of \mathbf{v}

\displaystyle{  \begin{aligned}  \gamma_\mathbf{m}^\mathbf{v}&: \mathbf{R} \to \mathbf{M} \\  \end{aligned}  }

is a parametric path on \mathbf{M} satisfying

\displaystyle{  \begin{aligned}  D(\text{f} \circ \gamma_\mathbf{m}^\mathbf{v})(t)  &= \mathbf{v}(\text{f})(\gamma_\mathbf{m}^\mathbf{v}(t))  = (\mathbf{v}(\text{f}) \circ \gamma_\mathbf{m}^\mathbf{v})(t) \\  \gamma_\mathbf{m}^\mathbf{v}(0) &= \mathbf{m} \\  \end{aligned}  }

What is \mathbf{m}?

(p.22) Let \mathbf{m} be a point on a manifold, \mathbf{v} be a vector on the manifold, and \mathbf{f} be a real-valued function on the manifold.

(define R5 (make-manifold R^n 5))
 
(define U5 (patch 'origin R5))
 
(define R5-rect
  (coordinate-system 'rectangular U5))

(define R5-rect-chi-inverse
  (point R5-rect))

(define R5-rect-point
  (R5-rect-chi-inverse
   (up 't 'x 'y 'v_x 'v_y)))
 
(define-coordinates
  (up t x y v_x v_y) R5-rect)
 
(define v5
  (literal-vector-field 'b R5-rect))
 
(show-expression
 ((v5 (literal-manifold-function
       'f_rect
       R5-rect))
  R5-rect-point))

(show-expression
 ((v5 (chart R5-rect)) R5-rect-point))

(p.29) We can recover the differential equations satisfied by a coordinate representation of the integral curve by letting \mathbf{f}=\chi.

\displaystyle{\begin{aligned}  D(f \circ \gamma_\mathbf{m}^\mathbf{v})(t)  &= \mathbf{v}(f)(\gamma_\mathbf{m}^\mathbf{v}(t))  = (\mathbf{v}(f) \circ \gamma_\mathbf{m}^\mathbf{v})(t) \\  \gamma_\mathbf{m}^\mathbf{v}(0) &= \mathbf{m} \\  \end{aligned}}

(p.29)

\displaystyle{\begin{aligned}  D \sigma(t) &= D(\chi \circ \gamma) (t) \\  &= ... \\  &= (b \circ \sigma)(t), \\  \end{aligned}}

where \displaystyle{  b = \mathbf{v}(\chi) \circ \chi^{-1}} is the coefficient function for the vector field \displaystyle{  \mathbf{v}} for the coordinates \displaystyle{  \chi} (see equation 3.7).

(define R5->R
  (-> (UP Real Real Real Real Real) Real))

(print-expression
 ((literal-function 'f (-> (X Real Real) Real))
  'x 'y))

(define v5
  (components->vector-field
   (up (lambda (b) 1)
       (lambda (b) (ref b 3))
       (lambda (b) (ref b 4))
       (lambda (b)
         ((literal-function 'A_x
                            (-> (UP Real Real) Real))
          (up (ref b 1) (ref b 2))))
       (lambda (b)
         ((literal-function 'A_y
                            (-> (UP Real Real) Real))
          (up (ref b 1) (ref b 2)))))
   R5-rect))

(show-expression
 ((v5 (chart R5-rect)) R5-rect-point))

(series:for-each
 print-expression
 (((exp (* 't v5)) (chart R5-rect))
  ((point R5-rect) (up 't 'x 'y 'v_x 'v_y)))
 3)

(series:for-each
 show-expression
 (((exp (* 't v5)) (chart R5-rect))
  ((point R5-rect) (up 't 'x 'y 'v_x 'v_y)))
 4)

(define ((((evolution order) delta-t v) f) m)
  (series:sum
   (((exp (* delta-t v)) f) m)
   order))

(show-expression
 ((((evolution 1) 'Delta_t v5) (chart R5-rect))
  ((point R5-rect)
   (up 't_0 'x_0 'y_0 'v_x0 'v_y0))))

(show-expression
 ((((evolution 2) 'Delta_t v5) (chart R5-rect))
  ((point R5-rect) 
   (up 't_0 'x_0 'y_0 'v_x0 'v_y0))))

— Me@2023-07-21 08:12:30 PM

.

.

2023.07.23 Sunday (c) All rights reserved by ACHK

Posted in FDG

Counting of identical bosons

Two bosons (non-composite) can occupy the same state, including the same spatial location. When they do, they are identical.

[guess]

So, for a particular system, you cannot know the number of bosons by counting. Counting does not work when you have no way to avoid double-counting.

To distinguish among different total numbers of identical bosons, you need to check, for example, the total energy of the system.

[guess]

— Me@2015-10-12 06:16:15 PM

— Me@2023-07-19 12:11:16 PM

.

.

2023.07.19 Wednesday (c) All rights reserved by ACHK

The Animatrix

Diary
[]
02[.]11[.]2003

I read "The Now Habit". I experienced the emotional 
downs yesterday again. But after 8 hours of sleep, 
my mind is much clearer now and can [has] start[ed] 
to work again, thank God J! 

05072003

just read animatrix, very deeply

06122002 
[]
One month ago, I had to construct a circuit to 
control the remote car. I was nervous and confused. 
I didn't know where to start. 
[]
    (I had told Ng zh ho and Chris Lau 
my nervousness on the Electronics.)
[]
    One cause of my nervous[ness] is due to 
the failure of the signal generator project 
in Year 1 Basic Electronics. And the cause 
of the failure, as I have found now, 
is that I am timid. The thing itself was not 
and is not difficult. It is my timidity, 
my indecision, and [my] inaction [that] 
make every simple thing difficult. 

(I have made my circuit work today, or tonight.)

Thank Spacetime!

.

.

2023.07.18 Tuesday (c) All rights reserved by ACHK

Memoize

Euler problem 14.1.2

.

(defun range (max &key (min 0) (step 1))
  (loop :for n :from min :below max :by step
        collect n))

(defun max-item (lst)
  (loop :for item :in lst
        :maximize item))

(defmacro r-nth (n lst)
  `(nth (- (length ,lst) ,n) ,lst))

(defun collatz-length (n c)
  (cond ((= n 1) c) 
        ((evenp n) (collatz-length (/ n 2) (1+ c)))
        ('t (collatz-length (1+ (* 3 n)) (1+ c)))))

(defun memoize (fn)
  (let ((cache (make-hash-table :test #'equal)))
    #'(lambda (&rest args)
        (multiple-value-bind (val win)
            (gethash args cache)
          (if win
              val
              (setf (gethash args cache)
                    (apply fn args)))))))

(setf (fdefinition 'collatz-length)
      (memoize #'collatz-length))

(time (max-item (mapcar #'(lambda (x)
                            (collatz-length x 1))
                        (range 1000001 :min 1))))

;; Heap exhausted (no more space for allocation).
;; 109314048 bytes available, 171127632 requested.

;; PROCEED WITH CAUTION.
;;    [Condition of type
;;       SB-KERNEL::HEAP-EXHAUSTED-ERROR]

(time (max-item (mapcar #'(lambda (x)
                            (collatz-length x 1))
                        (range 250001 :min 1))))

;; Evaluation took:
;; 1.380 seconds of real time

(time (max-item (mapcar #'(lambda (x)
                            (collatz-length x 1))
                        (range 250001 :min 1))))

;; Evaluation took:
;; 0.068 seconds of real time

— Me@2023-07-14 02:54:38 PM

.

.

2023.07.14 Friday (c) All rights reserved by ACHK

Ex 1.29 A particle of mass m slides off a horizontal cylinder, 2.2

Structure and Interpretation of Classical Mechanics

.

A particle of mass m slides off a horizontal cylinder of radius R in a uniform gravitational field with acceleration g. If the particle starts close to the top of the cylinder with zero initial speed, with what angular velocity does it leave the cylinder?

~~~

(define ((KE m g R) local)
  (let ((t (time local))
        (thetadot (velocity local)))    
    (* 1/2 m (square R) (square thetadot))))

(define ((PE m g R) local)
  (let ((t (time local))
        (theta (coordinate local))
        (thetadot (velocity local)))    
    (- (* m g R (- 1 (cos theta))))))

(define L (- KE PE))

(show-expression
 ((L 'm 'g 'R)
  (->local 't
           'theta
           'thetadot)))

(show-expression
 (((Lagrange-equations
    (L 'm 'g 'R))
   (literal-function 'theta))
  't))


This derivation is wrong, because the constraint force is missing.

.

(define ((F->C F) local)
  (->local (time local)
           (F local)
           (+ (((partial 0) F) local)
              (* (((partial 1) F) local)
                 (velocity local)))))

(define (q->r local)
  (let ((q (coordinate local)))
    (let ((r (ref q 0))
          (theta (ref q 1))
          (lambd (ref q 2)))
      (let ((x (* r (sin theta)))
            (y (* r (cos theta))))
        (up x y lambd)))))

(show-expression
 (q->r
  (->local 't
           (up 'r 'theta 'lambda)
           (up 'rdot 'thetadot 'lambdadot))))

(define (KE m vx vy)
  (* 1/2 m (+ (square vx) (square vy))))

(define ((T-rect m) local)
  (let ((q (coordinate local))
        (v (velocity local)))
    (let ((xdot (ref v 0))
          (ydot (ref v 1)))
      (KE m xdot ydot))))

(show-expression
 ((T-rect 'm)
  (up 't
      (up 'x 'y 'lambda)
      (up 'xdot 'ydot 'lambdadot))))

(show-expression
 ((T-rect 'm)
  ((F->C q->r)
   (->local 't
            (up 'r 'theta 'lambda)
            (up 'rdot 'thetadot 'lambdadot)))))

(define ((U-rect g m) local)
  (let* ((q (coordinate local))
         (y (ref q 1)))
    (* g (+ (* m y)))))

(define (L-rect g m)
  (- (T-rect m) (U-rect g m)))

(define (L g m)
  (compose
   (L-rect g m) (F->C q->r)))

(show-expression
 ((L 'g 'm)
  (->local 't
           (up 'r 'theta 'lambda)
           (up 'rdot 'thetadot 'lambdadot))))

(show-expression
 (((Lagrange-equations
    (L 'g 'm))
   (up
    (literal-function 'r)
    (literal-function 'theta)
    (literal-function 'lambda)))
  't))

(define ((U-constraint R) local)
  (let* ((q (coordinate local))
         (x (ref q 0))
         (y (ref q 1))
         (lambd (ref q 2))
         (r_sq (+ (square x) (square y))))
    (* lambd (- r_sq (square R)))))

(define ((U2-constraint R) local)
  (let* ((q (coordinate local))
         (x (ref q 0))
         (y (ref q 1))
         (lambd (ref q 2))
         (r_sq (+ (square x) (square y))))
    (* lambd (- (sqrt r_sq) R))))
(define (L-rect-constraint g m R)
  (- (T-rect m) (+ (U-rect g m) (U-constraint R))))

(define (L2-rect-constraint g m R)
  (- (T-rect m) (+ (U-rect g m) (U2-constraint R))))

(show-expression
 ((L-rect-constraint 'g 'm 'R)
  ((F->C q->r)
   (->local 't
            (up 'r 'theta 'lambda)
            (up 'rdot 'thetadot 'lambdadot)))))

(show-expression
 ((L2-rect-constraint 'g 'm 'R)
  ((F->C q->r)
   (->local 't
            (up 'r 'theta 'lambda)
            (up 'rdot 'thetadot 'lambdadot)))))

(show-expression
 (((Lagrange-equations
    (compose (L-rect-constraint 'g 'm 'R) (F->C q->r)))
   (up
    (literal-function 'r)
    (literal-function 'theta)
    (literal-function 'lambda)))
  't))

(show-expression
 (((Lagrange-equations
    (compose (L2-rect-constraint 'g 'm 'R) (F->C q->r)))
   (up
    (literal-function 'r)
    (literal-function 'theta)
    (literal-function 'lambda)))
  't))

(show-expression
 (((Lagrange-equations
    (compose (L-rect-constraint 'g 'm 'R) (F->C q->r)))
   (up
    (lambda (t) 'R)
    (literal-function 'theta)
    (literal-function 'lambda)))
  't))

— Me@2023-07-12 10:00:19 PM

.

.

2023.07.13 Thursday (c) All rights reserved by ACHK

Russell’s paradox

Universal set, 2 | For all, 4.2 | Alfred Tarski, 1.3

.

The universal set is the set that contains everything, including itself.

Since it contains everything, it should be the biggest set. However, according to the power set theorem, for any set A, its power set P(A) has more elements. So the power set of the universal set should have more elements than the universal set. This is the paradox of universal set.

The cause of the paradox is the mixing of language levels. That is exactly what the word “paradox” means. A logical error (dox) due the mixing of the language and its meta-language (para-language).

The cause of the language level mixing is the meaninglessness of the word “everything”. “Everything” (or “all”) is meaningful only if within a context, such as:

All the people in this house.

When you use “everything” without a context, it will include itself, thus the mixing of language levels.

— Me@2015-12-27 02:12:12 PM

— Me@2023-07-11 10:57:17 AM

.

.

2023.07.12 Wednesday (c) All rights reserved by ACHK

守時 6.1

這段改編自 2010 年 4 月 24 日的對話。

.

(安:如何跟難以相處的人相處?)

方法是,不要跟他們相處。

— Me@2010.05.19

.

我發覺對很多人而言,「遲到」和「失約」才是正常。

以前,我以為一般人只會間中遲到。後來發現實情是,一般人即使只是「間中準時」,也未必做到。而且,還完全沒有任何意識,要改掉。其中一個可能的心態是:「反正其他大部分人遲到,我自己守時,又有何意思呢?」

(安:另外有些人會,感到不好意思,其實想改,但只是想。)

自僱有一個不好處是,僱客時常臨時取消補習。我不知如何處理。

(安:我估計,你除了勸喻外,還要帶點責備,希望他有同理心,促使他改變。)

我有。但是沒有作用,所以我才「不知如何處理」。

.

十三年後記:

在極超巨大部分情況下,你不能改變別人,你只能更換別人。例如,你不能期望,不守時的人,會變成守時。你要朋友守時,就直接找守時的人做朋友。

— Me@2023-05-29 02:37:56 PM

.

.

2023.07.07 Friday (c) All rights reserved by ACHK

Shadow

Euler problem 14.1.1

.

(defun range (max &key (min 0) (step 1))
  (loop :for n :from min :below max :by step
        collect n))

(defun col (n c)
  (cond ((= n 1) c)     
        ((evenp n) (col (/ n 2) (1+ c)))
        ('t (col (1+ (* 3 n)) (1+ c)))))

(defun max-item (lst)
  (loop :for item :in lst
        :maximize item))

(defun e14 ()
  (let* ((c-lst
           (mapcar #'(lambda (x)
                       (col x 1))
                   (range 1000001 :min 1)))
         (max-len
           (max-item c-lst))
         (max-index
           (1+ (position max-len c-lst))))    
    (list max-index max-len)))

(time (e14))

;; Evaluation took:
;; 1.084 seconds of real time
  
;; (837799 525)

— Me@2023-07-03 12:33:40 AM

.

.

2023.07.03 Monday (c) All rights reserved by ACHK