# The problem of induction 3

.

In a sense (of the word “pattern”), there is always a pattern.

.

Where if there are no patterns, everything is random?

Then we have a meta-pattern; we can use probability laws:

In that case, every (microscopic) case is equally probable. Then by counting the possible number of microstates of each macrostate, we can deduce that which macrostate is the most probable.

.

Where if not all microstates are equally probable?

Then it has patterns directly.

For example, we can deduce that which microstate is the most probable.

— Me@2012.11.05

.

.

# defmacro, 2

Defining the defmacro function using only LISP primitives?

.

McCarthy’s Elementary S-functions and predicates were

atom, eq, car, cdr, cons

.

He then went on to add to his basic notation, to enable writing what he called S-functions:

quote, cond, lambda, label

.

On that basis, we’ll call these “the LISP primitives”…

How would you define the defmacro function using only these primitives in the LISP of your choice?

edited Aug 21 ’10 at 2:47
Isaac

asked Aug 21 ’10 at 2:02
hawkeye

.

Every macro in Lisp is just a symbol bound to a lambda with a little flag set somewhere, somehow, that eval checks and that, if set, causes eval to call the lambda at macro expansion time and substitute the form with its return value. If you look at the defmacro macro itself, you can see that all it’s doing is rearranging things so you get a def of a var to have a fn as its value, and then a call to .setMacro on that var, just like core.clj is doing on defmacro itself, manually, since it doesn’t have defmacro to use to define defmacro yet.

– dreish Aug 22 ’10 at 1:40

.

.

# defmacro

SLIME, 2

.

Alt + Up/Down

Switch between the editor and the REPL

— Me@2018-11-07 05:57:54 AM

~~~

defmacro

.


(defmacro our-expander (name) (get ,name 'expander))

(defmacro our-defmacro (name parms &body body)
(let ((g (gensym)))
(progn
(setf (our-expander ',name)
#'(lambda (,g)
(block ,name
(destructuring-bind ,parms (cdr ,g)
,@body))))
',name)))

(defun our-macroexpand-1 (expr)
(if (and (consp expr) (our-expander (car expr)))
(funcall (our-expander (car expr)) expr)
expr))



.

A formal description of what macros do would be long and confusing. Experienced programmers do not carry such a description in their heads anyway. It’s more convenient to remember what defmacro does by imagining how it would be defined.

The definition in Figure 7.6 gives a fairly accurate impression of what macros do, but like any sketch it is incomplete. It wouldn’t handle the &whole keyword properly. And what defmacro really stores as the macro-function of its first argument is a function of two arguments: the macro call, and the lexical environment in which it occurs.

— p.95

— A MODEL OF MACROS

— On Lisp

— Paul Graham

.


(our-defmacro sq (x)
(* ,x ,x))



After using our-defmacro to define the macro sq, if we use it directly,


(sq 2)



we will get an error.

The function COMMON-LISP-USER::SQ is undefined. [Condition of type UNDEFINED-FUNCTION]

Instead, we should use (eval (our-macroexpand-1 ':


(eval (our-macroexpand-1 '(sq 2)))

`

— Me@2018-11-07 02:12:47 PM

.

.

# Existence and Description

Bertrand Russell, “Existence and Description”

.

§1 General Propositions and Existence

“Now when you come to ask what really is asserted in a general proposition, such as ‘All Greeks are men’ for instance, you find that what is asserted is the truth of all values of what I call a propositional function. A propositional function is simply any expression containing an undetermined constituent, or several undetermined constituents, and becoming a proposition as soon as the undetermined constituents are determined.” (24a)

“Much false philosophy has arisen out of confusing propositional functions and propositions.” (24b)

A propositional function can be necessary (when it is always true), possible (when it is sometimes true), and impossible (when it is never true).

“Propositions can only be true or false, but propositional functions have these three possibilities.” (24b)

“When you take any propositional function and assert of it that it is possible, that it is sometimes true, that gives you the fundamental meaning ‘existence’…. Existence is essentially a property of a propositional function. It means that the propositional function is true in at least one instance.” (25a)

— Brandon C. Look

— University Research Professor and Chair

.

.

2018.10.07 Sunday ACHK

# The Sixth Sense, 3

Mirror selves, 2 | Anatta 3.2 | 無我 3.2

.

You cannot feel your own existence or non-existence. You can feel the existence or non-existence of (such as) your hair, your hands, etc.

But you cannot feel the existence or non-existence of _you_.

— Me@2018-03-17 5:12 PM

.

Only OTHER people or beings can feel your existence or non-existence.

— Me@2018-04-30 11:29:08 AM

.

.

# 機遇再生論 1.6

.

（而這個意思，亦在「機遇再生論」的原文中，用作其理據。）

$P(A) = \frac{1}{N}$

$P(\text{not} A) = 1 - \frac{1}{N}$

.

$P(A) = \frac{1}{N}$

$P(\text{not} A) = 1 - \frac{1}{N}$

.

(問：那樣，為什麼要問多一次呢？）

「如果洗牌兩次，起碼一次洗到原本排列 A 的機會率是多少？」

$A_2$ = 兩次洗牌的結果，起碼一次洗到原本排列 A

$A_2$ 的互補事件為「不是 $A_2$」：

= 兩次洗牌的結果，不是起碼一次洗到原本排列 A

= 兩次洗牌的結果，都不是排列 A

$P(\text{not} A_2) = (1 - \frac{1}{N})^2$

$P(A_2)$
$= 1 - P(\text{not} A_2)$
$= 1 - (1 - \frac{1}{N})^2$

.

$P(A_m)= 1 - (1 - \frac{1}{N})^m$

$P(A_m)$
$= 1 - (1 - \frac{1}{N})^m$
$= 1 - (1 - \frac{1}{52!})^{10,000,000}$

$1.239799930857148592 \times 10^{-61}$

— Me@2018-01-25 12:38:39 PM

.

.

# 機遇再生論 1.5

（請參閱本網誌，有關「重言句」、「經驗句」和「印證原則」的文章。）

「同情地理解」的意思是，有些理論，雖然在第一層次的分析之後，有明顯的漏洞，但是，我們可以試試，代入作者發表該理論時的，心理狀態和時空情境；研究作者發表該理論的，緣起和動機；從而看看，該理論不行的原因，會不會只是因為，作者的語文或思考不夠清晰，表達不佳而已？

（而這個意思，亦在「機遇再生論」的原文中，用作其理據。）

$P(A) = \frac{1}{N}$

$P($not $A) = 1 - \frac{1}{N}$

— Me@2017-12-18 02:51:11 PM

# Determined by what?

If you say “an event is determined”, in order to be meaningful, you have to specify, explicitly or by context, that the event is determined by whom.

Similarly, if you say something is free, you have to specify “free from what” or “free with respect to what”.

free ~ independent of

Without a grammatical object, the phrase “independent of” is meaningless, unless the context has implied what that grammatical object is.

— Me@2015-05-23

free [without an object] ~ free from everything

is meaningless, because the word “everything” is meaningful only if it has a context.

— Me@2017-07-20

# 馬後炮

— Me@2017-02-03 04:15:54 PM

# 注定外傳 2.3.3

Can it be Otherwise? 2.3.3

（問：為什麼呢？

（問：如果有神明存在，神明可能透過我的靈感，去指引我。）

（問：如果有道理的，那就可能是「神的旨意」。

— Me@2016-12-30 03:37:35 PM

# 注定外傳 2.3.2

Can it be Otherwise? 2.3.2

— Me@2016-10-15 06:10:12 AM

# 注定外傳 4.0

Can it be Otherwise? 4.0

One of the major difficulties of free-will-VS-determinism problem is its “always-meta” nature.

— Me@2016-08-19 09:00:14 AM

You can will to act, but not will to will.

Man can do what he wants, but he cannot will what he wants.

You can do what you will, but in any given moment of your life you can will only one definite thing and absolutely nothing other than that one thing.

— Schopenhauer

— Me@2016-01-06 06:50:56 PM

By definition, will is a first cause. So you cannot control it.

— Me@2016-01-06 06:55:13 PM

# 注定外傳 3.0

Can it be Otherwise? 3.0

1. 人有自由；

2. 因為一切皆注定，人沒有自由。

（問：應該有差別吧？

「積不積極」主要取決於性格和際遇；與「自己有沒有自由」，或者「覺得自己有沒有自由」，沒有什麼大關係。

（問：如果「人沒有自由」呢？那大概不可能積極吧？

— Me@2016-07-04 11:21:49 PM

# 注定外傳 2.6

Can it be Otherwise? 2.6 | The Beginning of Time, 7.3

『所有』，就是『場所之有』。

— Me@2016-05-18 11:40:31 AM

# 注定外傳 2.5

Can it be Otherwise? 2.5 | The Beginning of Time, 7.2

4. 即使可以追溯到「時間的起點」（第一因），所謂的「可以」，只是宏觀而言，決不會細節到可以推斷到，你有沒有自由，明天七時起牀。

（問：如果因果環環緊扣，即使細節不完全知道，至少理論上，我們可以知道，如果「第一因」本身有自由，那其他個別事件，就有可能有（來自「第一因」的）自由；如果連「第一因」也沒有自由，那其他個別事件，都一律沒有自由。

「第一因有自由。」

「第一因」根據定義，是沒有原因的。亦即是話，「時間的起點」，再沒有「之前」。而「有自由」，就即是「有其他可能性」。所以，「第一因有自由」的意思是，

「第一因還有其他的可能性。」

（問：如果有「造物主」，祂不就是那個誰，可以從宇宙之初的不同可能性中，選擇一個去實現嗎？）

「因果是否真的『環環緊扣』，有沒有可能，有『同因不同果』的情況？」

— Me@2016-03-15 08:43:58 AM

# 注定外傳 2.3

Can it be Otherwise? 2.3

— Me@2016-01-06 03:17:54 PM

# Self-information

The information entropy of a random event is the expected value of its self-information.

In information theory, self-information or surprisal is a measure of the information content [clarification needed] associated with an event in a probability space or with the value of a discrete random variable.

By definition, the amount of self-information contained in a probabilistic event depends only on the probability of that event: the smaller its probability, the larger the self-information associated with receiving the information that the event indeed occurred.

As a quick illustration, the information content associated with an outcome of 4 heads (or any specific outcome) in 4 consecutive tosses of a coin would be 4 bits (probability 1/16), and the information content associated with getting a result other than the one specified would be 0.09 bits (probability 15/16).

— Wikipedia on Self-information

2015.12.31 Thursday ACHK

# 注定外傳 2.2

Can it be Otherwise? 2.2

「成績注定」和「主動溫習」，根本沒有矛盾。

— Me@2015-12-29 03:12:39 PM

# 注定外傳 2.1.2

Can it be Otherwise? 2.1.2 | The problem of induction 2.2

1. 當你的「相似事件」和「原本事件」的結果相同時，你只可以知道「原本事件」，可能是注定；你並不可以肯定「原本事件」，一定是注定，因為，你並不能保證，下一件「相似事件」的結果，會不會仍然和「原本事件」相同。

2. 當你的「相似事件」和「原本事件」的結果不同時，你亦不可以肯定「原本事件」，一定是偶然，因為，結果不同，可能只是由於「相似事件」和「原本事件」，不夠相似而已。

— Me@2015-11-17 02:02:03 PM

# 注定外傳 2.1.1

Can it be Otherwise? 2.1.1 | The problem of induction 2.1

（層次一的事件描述：）

（層次一的反證：）

（層次二 —— 準確一點的事件描述：）

（層次二 —— 詳細一點的反證：）

（層次三：）

（層次四：）

— Me@2015-11-17 02:02:03 PM