Created
January 13, 2016 21:26
-
-
Save suhailshergill/e1706e8b94185b19498e to your computer and use it in GitHub Desktop.
church-rejection-query
This file contains hidden or 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
(define (take-sample) | |
(rejection-query | |
(define A (if (flip) 1 0)) | |
(define B (if (flip) 1 0)) | |
(define C (if (flip) 1 0)) | |
(define D (+ A B C)) | |
A | |
(condition (equal? D 3)))) | |
(hist (repeat 100 take-sample) "Value of A, given that D is 3") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment