Old Final Questions


1. Hardware Issues

Each neuron in the brain can be thought of as having many inputs and one output.  Neurons work by firing a signal whenever they receive a number of signals from other neurons whose sum equals or exceeds some threshold.  For example a neuron with threshold 3 will fire out a signal, whenever 3 or more of its input signals have been fired in.

If we use 1 to mean fire and 0 to mean don't fire, then draw a circuit out of AND, OR and NOT gates that models a neuron with 4 inputs and a threshold of 2.  The circuit should have 4 inputs and one output.  Draw a truth table and show all work.
 
 
 

2.  Logo Programming
a.  Write a recursive Logo procedure called SCREENDIGITS that takes a word and returns a word with all the digits removed.  For example, SCREENDIGITS "fr2o34g returns "frog

b.  Write a recursive Logo procedure called REMOVESHORT that takes a list and returns a list with all words that are length 3 or less removed.  For example, REMOVESHORT [ hello there sir a pleasure to meet you] returns [hello there pleasure meet].

c.  Write recurisve and non-recursive Logo procedures for ADDTEN% which adds 10% to each number in a list.  For example, ADDTEN% [20 40 60] returns [22 44 66].
 
 
 

3.  Machine Language

Write a machine language program that reads in one character and ouputs the letter capitalized.  If the letter input was already capitalized, the program should just output it as is.  The letters are input and output as their ASCII value numbers.  (Note that the ASCII value of A is 65, Z is 90, a is 97, z is 122).
 
 

4.  Essay

A famous computer scientist recently said that The question of whether or not a machine can think is as interesting as the question of whether or not a submarine can swim.  What do you think he meant by this?  How does his comment relate to the Turing Test?  Is his statement pro-AI, anti-AI, or neutral?


 

Solutions and Hints:

1.  This is similar to Quiz 3.  You need to create a chart of 16 rows with all 4-bit input patterns, and calculate the output for each one.  There are 11 rows with an output of 1.

0000    0
0001    0
0010    0
0011    1
0100    0
0101    1
0110    1
etc.
1111    1

Then concentrating on the 1's in the output, you construct a formula.  It starts:

(not In1) and (not In2) and In3 and In4
or
etc.


2.
 to screendigits :aword
      if (= :aword ") op "
    if number? (first :aword) op screendigits bf :aword
    op word (first :aword) screendigits bf :aword
end

to removeshort :alist
    if empty? :alist op []
    if < (count (first :alist)) 4 then op removeshort (bf :alist)
    op se (first :alist) removeshort (bf :alist)
end

to addten%  :alist    ; Recursive
    if empty? :alist op []
    op se (* 1.1 (first :alist)) addten% (bf :alist)
end

to addten% :alist ; not recursive
    make "newlist []
    repeat count :alist [ make "newlist se (*1.1 (first :alist)) :newlist   make "alist bf :alist]
    op :newlist
end

3.  In this program you need to implement the following idea in machine language:

Read X
If X > 96 then subtract 32 from X
Output X

This looks like:

1000    In 100        ; Read X
1004    Load 100     ; Compare X to 96
1008    Sub #96
1012    Bgt 1020    ; X is lower case
1016    Bra 1032    ; X is uppercase
1020    Load 100    ; Subtract 32 from X
1024    Sub #32
1028    Store 100
1032    Out 100

4.  Lots of ideas are okay here -- The main thing is that you discuss the quote in reference to the problem of defining what it means for a machine to think.  Note that the quote is criticizing the definition of swimming via behavior.