Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (31 sloc) 1.04 KB
#! /usr/bin/env racket
#lang racket/base
(require "question-answer.rkt" racket/function)
(define (normalize . numbers)
(define sum (apply + numbers))
(map (curryr / sum) numbers))
(define (2-measurement-question)
(define probability-bright-given-lane 8/10)
(define probability-dark-given-offroad 9/10)
'("2 measurement question"
"probability of bright given on lane marker is ~v"
"probability of dark given off lane marker is ~v"
"x1 is on a lane marker"
"x2 is off lane marker"
"measure bright"
"what's the normalized weight of x1 and x2?"
"there are 3 particles on lane, 3 off lane"
'("weight of x1 = ~v"
"weight of x2 = ~v")
(list-ref (normalize 8/10 1/10 8/10 8/10 1/10 1/10) 0)
(list-ref (normalize 8/10 1/10 8/10 8/10 1/10 1/10) 1)))
(printf question-separator)
(2-measurement-question) (printf question-separator)
(printf question-separator))
(provide normalize)
Jump to Line
Something went wrong with that request. Please try again.