Wednesday, May 3, 2023

Jokes from Sidney Morgenbesser

I'm enjoying reading David Edmonds's Parfit: A Philosopher and His Mission to Save Morality. Recounting Parfit's time in New York with a Harkness Fellowship, the author squeezes in some jokes from the philosopher Sidney Morgenbesser, new to me, who was teaching at Columbia. The jokes:
  • On pragmatism: "It's all very well in theory, but it doesn't work in practice."
  • J.L. Austin is saying that while there are double negatives to express a positive -- "she is not uninteresting" -- there are no double positives to express a negative. Morgenbesser interrupts: "Yeah, yeah".
  • Eating dinner at a restaurant, the waitress says there are two choices for pie: apple or blueberry. Morgenbesser says he'll have the apple. The waitress comes back a minute later to say there's actually a third choice, cherry. Morgenbesser: "In that case, I'll have the blueberry pie."

Saturday, February 11, 2023

Impressed with sympy

I know this doesn't even come close to scratching the surface of what's possible with it, but I was impressed with this little interaction with sympy already:
import sympy
from sympy import Rational

a = sympy.symbols('a')
e = Rational(13, 4) * (5 - 6 * a) - Rational(1, 4) * (Rational(1, 3) * a - 3)
print(sympy.latex(e))
$$22 - \frac{307 a}{12}$$

Tuesday, August 30, 2022

The Bitter Lesson

The Bitter Lesson by Richard Sutton

One thing that should be learned from the bitter lesson is the great power of general purpose methods, of methods that continue to scale with increased computation even as the available computation becomes very great. The two methods that seem to scale arbitrarily in this way are search and learning.

The second general point to be learned from the bitter lesson is that the actual contents of minds are tremendously, irredeemably complex; we should stop trying to find simple ways to think about the contents of minds, such as simple ways to think about space, objects, multiple agents, or symmetries. All these are part of the arbitrary, intrinsically-complex, outside world. They are not what should be built in, as their complexity is endless; instead we should build in only the meta-methods that can find and capture this arbitrary complexity. Essential to these methods is that they can find good approximations, but the search for them should be by our methods, not by us. We want AI agents that can discover like we can, not which contain what we have discovered. Building in our discoveries only makes it harder to see how the discovering process can be done.

Are there any lessons for the social sciences here? E.g., should economists give up on trying to find general laws and instead create systems to find those patterns, perhaps in incomprehensible form? Of course, a machine found model doesn't need to be incomprehensible... even with an ordinary least squares regression model, the parameters are still "found by the machine". Also, Sutton is speaking to AI researchers so the "bitter lesson" may not be for everyone. Even if speech synthesis based on linguistic expertise wasn't competitive, linguistics is still useful, right?

Sunday, August 14, 2022

Cochrane Collaboration and Campbell Collaboration

I'm enjoying reading Tim Harford's book The Data Detective. (Looking at that link for it, I'm amused to see a blurb from Malcolm Gladwell on the cover; if I didn't already know Harford, I would consider this a negative endorsement.) Harford mentions two groups I'd like to keep in mind, both of which aim to do systemic reviews of the literature:
  • Cochrane: "Cochrane is for anyone interested in using high-quality information to make health decisions... We are an independent, diverse, global organization that collaborates to produce trusted synthesized evidence, make it accessible to all, and advocate for its use."
  • Campbell Collaboration: "The Campbell Collaboration is an international social science research network that produces high quality, open and policy-relevant evidence syntheses, plain language summaries and policy briefs."
What other groups are there like these, doing systematic reviews to try to produce consensus docs? (I know it's pretty common to see survey articles in journals.)

Tuesday, January 4, 2022

Factorial in Forth

I've been enjoying playing with Forth. Here's what I came up with to implement factorial:
: fact dup 2 < if drop 1 else dup 1 - recurse * then ;

3 fact . 6  ok
6 fact . 720  ok
This looks pretty similar to the example code here: http://progopedia.com/example/factorial/253/.

Tuesday, June 8, 2021

Finding years on which December 5th was a Friday in Squeak

2000 to: 2021 do: [ :year |
  date := Date year: year month: 12 day: 5.
  date weekday == #Friday ifTrue:
    [Transcript print: year; cr; flush.]
]
Answer:
2003
2008
2014

Wednesday, May 19, 2021

Playing with Racket: random lines GIF

I'm enjoying playing with Racket. Takes me back to some good old college days writing Scheme, but I don't think creating a GIF was so easy in any of the Scheme systems we were using then. (Which ecosystem -- language + standard libraries -- provides the nicest environment for making animated GIFs?)
#lang racket

(require mrlib/gif)
(require racket/draw)

(define (random-lines-bitmap width height line-count)
  (let* ([target (make-bitmap width height)]
         [dc (new bitmap-dc% [bitmap target])])
    (begin
      (send dc draw-rectangle
       0 0   ; Top-left at (0, 10), 10 pixels down from top-left
       (- width 1) (- height 1))
      (for ([i line-count])
        (send dc draw-line
              (random width) (random height)
              (random width) (random height)))
      target)))

(define (write-random-lines-gif width height line-count frame-count filename)
  (write-animated-gif
   (for/list ([i frame-count])
     (random-lines-bitmap width height line-count))
   10
   filename
   #:loop? true))

(write-random-lines-gif 300 200 50 10 "random-lines.gif")