Skip to main content
added 25 characters in body
Source Link
rnso
  • 141
  • 3

A computer program can be used to solve it (following is in Racket language):

; SUN M T W TH F SAT
; 0   1 2 3 4  5 6

(define (f)
                                        ; assume today is x;
  (for ((x 7))                          ; check x for 0 to 6
    (printf "x=~a; count=~a ~n"
            x
            (count
             (lambda(x) x)
             (list (= 3 (+ x 2))        ; statements are listed here
                   (= x 3)
                   (= x 2)
                   (and (not(= x 1)) (not(= x 2)) (not(= x 3)))
                   (= x 5)
                   (= x 3)
                   (not (= 0 x))
                   )))))

(f)

It takes values of 0 to 6 for Sun to Sat and checks how many statements are correct for each of them. The output is:

x=0; count=1 
x=1; count=2 
x=2; count=2 
x=3; count=3 
x=4; count=2 
x=5; count=3 
x=6; count=2 

Hence, only 1 statement is correct only for Sunday (x = 0), hence that is the answer.

A computer program can be used to solve it (following is in Racket language):

; SUN M T W TH F SAT
; 0   1 2 3 4  5 6

(define (f)
                                        ; assume today is x;
  (for ((x 7))                          ; check x for 0 to 6
    (printf "x=~a; count=~a ~n"
            x
            (count
             (lambda(x) x)
             (list (= 3 (+ x 2))        ; statements are listed here
                   (= x 3)
                   (= x 2)
                   (and (not(= x 1)) (not(= x 2)) (not(= x 3)))
                   (= x 5)
                   (= x 3)
                   (not (= 0 x))
                   )))))

(f)

It takes values of 0 to 6 for Sun to Sat and checks how many statements are correct. The output is:

x=0; count=1 
x=1; count=2 
x=2; count=2 
x=3; count=3 
x=4; count=2 
x=5; count=3 
x=6; count=2 

Hence, only 1 statement is correct only for Sunday, hence that is the answer.

A computer program can be used to solve it (following is in Racket language):

; SUN M T W TH F SAT
; 0   1 2 3 4  5 6

(define (f)
                                        ; assume today is x;
  (for ((x 7))                          ; check x for 0 to 6
    (printf "x=~a; count=~a ~n"
            x
            (count
             (lambda(x) x)
             (list (= 3 (+ x 2))        ; statements are listed here
                   (= x 3)
                   (= x 2)
                   (and (not(= x 1)) (not(= x 2)) (not(= x 3)))
                   (= x 5)
                   (= x 3)
                   (not (= 0 x))
                   )))))

(f)

It takes values of 0 to 6 for Sun to Sat and checks how many statements are correct for each of them. The output is:

x=0; count=1 
x=1; count=2 
x=2; count=2 
x=3; count=3 
x=4; count=2 
x=5; count=3 
x=6; count=2 

Hence, only 1 statement is correct only for Sunday (x = 0), hence that is the answer.

Source Link
rnso
  • 141
  • 3

A computer program can be used to solve it (following is in Racket language):

; SUN M T W TH F SAT
; 0   1 2 3 4  5 6

(define (f)
                                        ; assume today is x;
  (for ((x 7))                          ; check x for 0 to 6
    (printf "x=~a; count=~a ~n"
            x
            (count
             (lambda(x) x)
             (list (= 3 (+ x 2))        ; statements are listed here
                   (= x 3)
                   (= x 2)
                   (and (not(= x 1)) (not(= x 2)) (not(= x 3)))
                   (= x 5)
                   (= x 3)
                   (not (= 0 x))
                   )))))

(f)

It takes values of 0 to 6 for Sun to Sat and checks how many statements are correct. The output is:

x=0; count=1 
x=1; count=2 
x=2; count=2 
x=3; count=3 
x=4; count=2 
x=5; count=3 
x=6; count=2 

Hence, only 1 statement is correct only for Sunday, hence that is the answer.