Computational Modeling Fall 2008 For today, you should: 1) read my Chapter 5 2) read "Objectivity, Value Judgment, and Theory Choice" (see below) 3) really finish your Chapter 4 and prepare for peer evaluation move to a temporary directory, check out a fresh copy of your repository, and try to compile. Today: 1) quiz 3 solutions 2) Kuhn and Theory Choice 3) work on Chapter 5. questions? 4) handing back some evaluated chapters! (about 11/33) For next time you should: 1) prepare for a quiz on Chapter 5 2) evaluate a peer's Chapter 4 3) read http://en.wikipedia.org/wiki/Science_wars http://en.wikipedia.org/wiki/Scientific_realism Comments on Chapters -------------------- Generally good, generally achieving goals: 1) Engagement with material is great! 2) Comprehension seems to be very good (and I think the format is good for evaluating this). 3) Many of you are taking my challenge---book writing as a creative enterprise---seriously, which makes me happy. But many are struggling to find a voice/audience, and I wonder if it is too hard to get away from writing a solution manual. Options: a) Forget it, just write a solution manual. b) Continue to work at making your book a personal project, recognizing the limitations. I would like to relax the structure in the second half, which might help (although there are dangers!). Welcome to the second half! --------------------------- Chapter 5: 1D Cellular Automata Chapter 6: 2D CAs, Game of Life, Percolation models Chapter 7: Self-organized criticality Chapter 8: Agent-based models (many choices, some unwritten) Chapter 9: Stochastic models (half-finished chapter) I am hoping that you will help me finish Chapters 8 and 9! Options: 1) About 1.5 weeks per chapter (same as first half) 2) Only 1 week per chapter, then you get to pick one to expand. Or I can hand out all the chapters next time. Then you can choose (1) or (2) or 3) Skip some chapters to get deeper into others and/or a self-directed project. You would still have to _read_ all of my chapters, with quizzes as pace setter. Chapter 5 Exercise Guide ------------------------ Might be a short chapter. 5.1: wrap-around world... short, not hard, needed for 5.2 5.2: if you only do one part, do 5.2.4 5.3: fun, but limit the time you sink into it! 5.4: write about this if you are interested. we will discuss in class. Quiz 3 Solutions ---------------- def find_depth(t, target): try: for x in t: if x == target: return 1 else: depth = find_depth(x, target) if depth: return depth+1 return 0 except TypeError: return 0 (I'm not particularly proud of this solution.) Python style discourages explicit type-checking because it is often too restrictive. This function works with any iterable type, not just lists. The best way to check whether something is iterable is to try... Any successful non-recursive solutions? 2) The CDF of the Weibull distribution is 1- e^{-(x/lambda)^k} So the ccdf is y = e^{-(x/lambda)^k} Taking the log of both sides yields ln y = -(x/lambda)^k Taking logs again yields: ln (ln y) = - k ln x + k ln lambda Which is a linear relationship between ln (ln y) and ln x with slope -k and intercept k ln lambda. 3) Many of you successfully (re)invented inverse transform sampling! http://en.wikipedia.org/wiki/Inverse_transform_sampling a) generate a random percentile uniformly in [0, 1] b) compute the quantile that corresponds to that percentile Or, in Python def random_variate(self): return self.quantile(random.random()) Some of you insisted in reimplementing Dist.quantile; don't be shy about using existing functions! Kuhn ---- Concepts in Structure of Scientific Revolutions: 1) normal science/paradigm shift dictionary.reference.com Usage Note: Paradigm first appeared in English in the 15th century, meaning "an example or pattern," and it still bears this meaning today: Their company is a paradigm of the small high-tech firms that have recently sprung up in this area. For nearly 400 years paradigm has also been applied to the patterns of inflections that are used to sort the verbs, nouns, and other parts of speech of a language into groups that are more easily studied. Since the 1960s, paradigm has been used in science to refer to a theoretical framework, as when Nobel Laureate David Baltimore cited the work of two colleagues that "really established a new paradigm for our understanding of the causation of cancer." Thereafter, researchers in many different fields, including sociology and literary criticism, often saw themselves as working in or trying to break out of paradigms. Applications of the term in other contexts show that it can sometimes be used more loosely to mean "the prevailing view of things." The Usage Panel splits down the middle on these nonscientific uses of paradigm. Fifty-two percent disapprove of the sentence The paradigm governing international competition and competitiveness has shifted dramatically in the last three decades. 2) incommensurate paradigms mathworld.com Two lengths are called incommensurate or incommensurable if their ratio cannot be expressed as a ratio of whole numbers. Irrational numbers and transcendental numbers are incommensurate with the integers. From Through the Looking Glass: 'When I use a word,' Humpty Dumpty said, in a rather scornful tone, 'it means just what I choose it to mean, neither more nor less.' 3) rejection of idealized models of scientific method Reactions to SSR, from mild to strong 1) scientists are human, but the scientific method is still the goal of good science 2) theory choice is frequently under-determined by facts, other criteria also matter, but choices can be justified 3) science is no more objective than any other field of inquiry, theory choice is a personal preference, scientific consensus is mob rule 4) so-called "truth" is all relative, there are no "facts", science has no special claim on truth, it is just a tool the Man uses to keep the people down... See http://en.wikipedia.org/wiki/Science_wars The essay you read is Kuhn's reaction to #4, where he makes an argument for something like #2. What are his criteria for theory choice?