This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; eg | |
;; sicp 3.3.3 - 2D tables | |
;; exercise 3.25 done baby! | |
(define (assoc key records) | |
(cond ((null? records) false) | |
((equal? key (caar records)) (car records)) | |
(else (assoc key (cdr records))))) | |
(define (make-subtable keys value) | |
(if (null? (cdr keys)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; SICP Exercise 3.22 | |
;; Queue structure implemented as a procedure with local state | |
;; Rik G. - September 2020 | |
(define (make-queue) | |
(let ((front-ptr '()) | |
(rear-ptr '())) | |
(define (dispatch m) | |
(cond ((eq? m 'insert) | |
(lambda (z) | |
(let ((new-pair (cons z '()))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Eric Gullufsen | |
# Visualize the central limit theorem | |
# take 10, 50, 100, 1000 random samples of size ten of integers in [0, 10] | |
# take average of each one | |
# plot these | |
# the resulting probability density function will look incresingly 'normal' | |
# as n increases - the number of samples taken |