Exercises 3
Answer:
for row in range(2):
3.6 (Turing Test) The great British mathematician Alan Turing proposed a simple test
to determine whether machines could exhibit intelligent behavior. A user sits at a comput-
er and does the same text chat with a human sitting at a computer and a computer oper-
ating by itself. The user doesn’t know if the responses are coming back from the human
or the independent computer. If the user can’t distinguish which responses are coming
from the human and which are coming from the computer, then it’s reasonable to say that
the computer is exhibiting intelligence.
Create a script that plays the part of the independent computer, giving its user a sim-
ple medical diagnosis. The script should prompt the user with ‘What is your problem?’
When the user answers and presses Enter, the script should simply ignore the user’s input,
then prompt the user again with ‘Have you had this problem before (yes or no)?’ If
the user enters ‘yes’, print ‘Well, you have it again.‘ If the user answers ‘no’, print
‘Well, you have it now.’
Would this conversation convince the user that the entity at the other end exhibited
intelligent behavior? Why or why not?
3.28 (Intro to Data Science: Mean, Median and Mode) Calculate the mean, median and
mode of the values 9, 11, 22, 34, 17, 22, 34, 22 and 40. Suppose the values included an-
other 34. What problem might occur?
3.29 (Intro to Data Science: Problem with the Median) For an odd number of values,
to get the median you simply arrange them in order and take the middle value. For an even
number, you average the two middle values. What problem occurs if those two values are
different?
3.30 (Intro to Data Science: Outliers) In statistics, outliers are values out of the ordinary
and possibly way out of the ordinary. Sometimes, outliers are simply bad data. In the data
science case studies, we’ll see that outliers can distort results. Which of the three measures
of central tendency we discussed—mean, median and mode—is most affected by outliers?
Why? Which of these measures are not affected or least affected? Why?
Answer: Outliers would always change the mean, but they may have little or no
3.31 (Intro to Data Science: Categorical Data) Mean, median and mode work well with
numerical values. You can use them in calculations and arrange them in meaningful order.
Categorical values are descriptive names like Boxer, Poodle, Collie, Beagle, Bulldog and