Charlie Brown

d_2018_02_15__00_15_18_AM_

Charlie Brown: I thought being in love was supposed to make you happy…

Peppermint Patty: Where’d you get that idea?

.

.

2018.03.02 Friday ACHK

Shape of a program

(defun bad-reverse (lst)
  (let* ((len (length lst))
	 (ilimit (truncate (/ len 2))))
    (do ((i 0 (1+ i))
	 (j (1- len) (1- j)))
	((>= i ilimit))
      (rotatef (nth i lst) (nth j lst)))))

It used to be thought that you could judge someone’s character by looking at the shape of his head. Whether or not this is true of people, it is generally true of Lisp programs. Functional programs have a different shape from imperative ones. The structure in a functional program comes entirely from the composition of arguments within expressions, and since arguments are indented, functional code will show more variation in indentation. Functional code looks fluid on the page; imperative code looks solid and blockish, like Basic.

Even from a distance, the shapes of bad- and good-reverse suggest which is the better program. And despite being shorter, good-reverse is also more efficient: O(n) instead of O(n^2).

(defun good-reverse (lst)
  (labels ((rev (lst acc)
		(if (null lst)
		    acc
		  (rev (cdr lst) (cons (car lst) acc)))))
    (rev lst nil)))

— p.30

— On Lisp

— Paul Graham

.

.

2018.03.02 Friday ACHK

Problem 14.4a

Closed string degeneracies.

For closed string states the left-moving and right-moving excitations are each described like states of open strings with identical values of \alpha' M^2. The value of \alpha' M^2 for the closed string state is four times that value.

How come?

.

Equation (14.78):

\frac{1}{2} \alpha' M^2 = \alpha' M_L^2 + \alpha' M_R^2

Mass M is two times that value (M = 2 M_L or M = 2 M_R). So M^2 is four times.

— Me@2015.07.14 12:47 PM

.

Not necessarily so.

— Me@2015.07.16 08:14 AM

.

Instead, it is just due to this definition.

— Me@2015.07.30 09:19 AM

.

p.322 “In the closed string theory the value of the mass-squared is given by…”

Equation (14.78) is actually a definition of the mass-squared of a closed string state.

Also, consider

p.322 “As befits closed strings there is also the level-matching condition \alpha_0^- = \bar \alpha_0^- on the states. This condition guarantees that the left and right sectors give identical contributions to the mass-squared: \alpha' M_L^2 = \alpha' M_R^2.”

Then

\frac{1}{2} \alpha' M^2 = \alpha' M_L^2 + \alpha' M_R^2

\alpha' M^2 = 2 \left( \alpha' M_L^2 + \alpha' M_R^2 \right) = 4 \alpha' M_L^2

— Me@2018.03.02 11:05 AM

.

.

2018.03.02 Friday (c) All rights reserved by ACHK