Top Banner
The Mystery of “b := (b = false)” Stuart Reges University of Washington http://www.cs.washington.edu/homes/ reges/mystery
17

The Mystery of “b := (b = false)” Stuart Reges University of Washington .

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: The Mystery of “b := (b = false)” Stuart Reges University of Washington .

The Mystery of “b := (b = false)”

Stuart Reges

University of Washingtonhttp://www.cs.washington.edu/homes/reges/mystery

Page 2: The Mystery of “b := (b = false)” Stuart Reges University of Washington .

Data overview 1988 AP Computer Science Exam (Pascal) Divided into A and B (roughly CS1 and CS2) 35 A multiple choice 15 B multiple choice 3 A free response 2 B free response 7,374 AB tests; 3,344 A-only tests

Page 3: The Mystery of “b := (b = false)” Stuart Reges University of Washington .

Analysis overview Correlations between multiple choice

questions Any correlation below 0.2 ignored Correlations between multiple choice

and free response questions Didn't find much of interest in correlating

free response with free response

Page 4: The Mystery of “b := (b = false)” Stuart Reges University of Washington .

The mystery? In general, not much correlated at the

level of 0.2 or higher But, five multiple choice questions kept

popping up over and over nickname: the powerhouse questions One question in particular (question 23)

stood out

Page 5: The Mystery of “b := (b = false)” Stuart Reges University of Washington .

A multiple choice correlations

Page 6: The Mystery of “b := (b = false)” Stuart Reges University of Washington .

Minus powerhouse questions

Page 7: The Mystery of “b := (b = false)” Stuart Reges University of Washington .

B multiple choice correlations

Page 8: The Mystery of “b := (b = false)” Stuart Reges University of Washington .

Minus powerhouse questions

Page 9: The Mystery of “b := (b = false)” Stuart Reges University of Washington .

Free response correlations

1 (A) 2 (A) 3 (A) 4 (B) 5 (B)

1 (A) 1 0.46 0.37 0.35 0.35

2 (A) 0.46 1 0.42 0.37 0.39

3 (A) 0.37 0.42 1 0.42 0.48

4 (B) 0.35 0.37 0.42 1 0.48

5 (B) 0.35 0.39 0.48 0.48 1

Page 10: The Mystery of “b := (b = false)” Stuart Reges University of Washington .

Free response vs powerhouse

1 (A) 2 (A) 3 (A) 4 (B) 5 (B)

14 0.30 0.35 0.34 0.27 0.30

15 0.34 0.38 0.36 0.31 0.31

18 0.32 0.39 0.30 0.28 ?

20 0.34 0.41 0.31 0.28 0.30

23 0.36 0.44 0.37 0.32 0.32

Page 11: The Mystery of “b := (b = false)” Stuart Reges University of Washington .

Greatest AB vs A-only deltas

Question AB correct A correct Delta

20 69.2% 38.7% 30.5

23 60.0% 35.3% 24.7

15 66.3% 43.8% 22.5

32 46.6% 25.7% 20.9

14 65.2% 46.0% 19.2

18 71.7% 52.6% 19.1

Page 12: The Mystery of “b := (b = false)” Stuart Reges University of Washington .

Mysterious question 23If b is a Boolean variable, then the statement

b := (b = false) has what effect?A. It causes a compile-time error message.B. It causes a run-time error message.C. It causes b to have value false regardless of its value

just before the statement was executed.D. It always changes the value of b.E. It changes the value of b if and only if b had value

true just before the statement was executed.

Page 13: The Mystery of “b := (b = false)” Stuart Reges University of Washington .

And question 20procedure Wow(n : integer);begin if n > 1 then Wow(n div 2); write(n, ' ')end;The procedure call Wow(16) will yield as output which of the following

sequences of numbers?A. 10 8 6 4 2B. 16 8 4 2 1C. 1 2 4 8 16D. 32 16 8 4 2E. 2 4 8 16 32

Page 14: The Mystery of “b := (b = false)” Stuart Reges University of Washington .

What does this mean? Bob Floyd: These questions seem to

test whether a student has a model of computation; whether they can play computer in their head

Don Knuth: "I conclude that roughly 2% of all people ‘think algorithmically,’ in the sense that they can reason rapidly about algorithmic processes."

Page 15: The Mystery of “b := (b = false)” Stuart Reges University of Washington .

More Knuth“The other missing concept that seems to separate mathematicians from computer scientists is related to the ‘assignment operation’ :=, which changes values of quantities. More precisely, I would say that the missing concept is the dynamic notion of the state of a process. ‘How did I get here? What is true now? What should happen next if I’m going to get to the end?’ Changing states of affairs, or snapshots of a computation, seem to be intimately related to algorithms and algorithmic thinking.”

Page 16: The Mystery of “b := (b = false)” Stuart Reges University of Washington .

Snapshot examplepublic static int mystery(int n) { int x = 0; while (n % 2 == 0) { // Point A n = n / 2; x++; // Point B } // Point C return x;}

Is (n % 2 == 0) always true, never true, or sometimes true/sometimes false at points A, B and C?

Page 17: The Mystery of “b := (b = false)” Stuart Reges University of Washington .

What next? More exploration, more studies Powerhouse questions suggest certain

kinds of questions to explore Is this measuring some innate aptitude?

Some acquired ability? Or is it a fluke? Join the discussion:http://www.cs.washington.edu/homes/reges/mystery