Ideas for learners with an interest in numbers

A student having trouble in English class came for some help. We ended up talking about computers, programming, and free software. The next time, he came with his computer. It seemed to be the computer recommended and sold by the university co-op. The computer booted into the MS Windows OS, so the easiest way to get started seemed to be with DrRacket. There wasn't much time to play with Inkscape, Gimp, or Emacs. The student seemed to enjoy DrRacket. He wanted to play with big numbers, so I had to figure out the term for exponent and how to do exponents ( (expt 6 36) )with the Racket Language.

DrRacket catches errors before RUNning

The episode has been in my mind for the last nine months or so. After learning Scheme's iota and Racket's plot over the past month or so I'm wondering if this sort of sequence might be fun for learners with a desire to play with numbers.

Possible Graded Sequence for Plotting Functions

#lang racket

(require (only-in srfi/1 iota))

;; Play with lists of numbers: lon (iota 10) (iota 10 1) (iota 10 1 .5)

;; define terms with Ogden's Basic English (define TenNumbersFrom0By1 (iota 10)) (define TenNumbersFrom1By1 (iota 10 1)) (define TenNumbersFrom1By.5 (iota 10 1 .5))

TenNumbersFrom1By1 (map (lambda (n) (+ n n)) TenNumbersFrom1By1)

(map (lambda (n) (* n n)) TenNumbersFrom1By1)

(map (lambda (n) (expt n n)) TenNumbersFrom1By1)

(define MapFunctionOverListOfNumbers (lambda (func lon) ; function, list of numbers (map (lambda (n) (func n n)) lon)))

(MapFunctionOverListOfNumbers expt TenNumbersFrom1By1) ;; Put + and * in place of expt

(require plot)

(plot (function (lambda (n) (+ n n)) 0 10))

(plot (function (lambda (n) (* n n)) 0 10))

(plot (function (lambda (n) (expt n n)) 0 10))

(plot (function (lambda (n) (expt n n)) -5 5))

(plot (function (lambda (n) (* n n)) -5 5))

(plot (function sqr -5 5 #:label “square 正方”))

(plot (function sqr -5 5 #:label “square 正方”) #:legend-anchor 'top)

(plot (function (lambda (n) (expt n n)) 0 10 #:label “n^n from 0 to 10”) #:legend-anchor 'top)

To get started with Racket, download it from the web page and install it. If you are a beginner or would like to use a graphical environment to run programs, run the DrRacket executable. Otherwise, the racket executable will run a command-line Read-Eval-Print-Loop (REPL).

On Windows, you can start DrRacket from the Racket entry in the Start menu. In Windows Vista or newer, you can just type DrRacket. You can also run it from its folder, which you can find in Program Files → Racket → DrRacket.

On Mac OS, double click on the DrRacket icon. It is probably in a Racket folder that you dragged into your Applications folder.

#Racket #DrRacket #LearningRacket #Programming #LearningProgramming #plot #Scheme #iota #RacketThroughExamples