Computer Science Concepts Come Alive Susan H. Rodger Duke University February 20, 2007.

Slides:



Advertisements
Similar presentations
CS 345: Chapter 9 Algorithmic Universality and Its Robustness
Advertisements

C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Finite Automata Great Theoretical Ideas In Computer Science Anupam Gupta Danny Sleator CS Fall 2010 Lecture 20Oct 28, 2010Carnegie Mellon University.
Introduction to Computability Theory
Welcome to CSE105 and Happy and fruitful New Year
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2009 with acknowledgement.
CS 490: Automata and Language Theory Daniel Firpo Spring 2003.
1 Foundations of Software Design Lecture 23: Finite Automata and Context-Free Grammars Marti Hearst Fall 2002.
CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG)
January 15, 2014CS21 Lecture 61 CS21 Decidability and Tractability Lecture 6 January 16, 2015.
Regular Expressions and Automata Chapter 2. Regular Expressions Standard notation for characterizing text sequences Used in all kinds of text processing.
Alice: A Free 3D Animation World for Teaching Programming Barbara Ericson Georgia Institute of Technology Oct 2005.
An Interactive Approach to Formal Languages and Automata with JFLAP
Adventures in Alice Programming One-Week Workshop Motivation and Background Susan Rodger Duke University June/July, 2010 Supported by the National Science.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 7 Mälardalen University 2010.
Computer Science Concepts Come Alive Susan H. Rodger Duke University Haverford College Philadelphia, PA April 18, 2010 Supported by.
Concepts Come Alive through Visualization and Interaction University of Wisconsin Oshkosh July 16-17, 2009 Susan Rodger Professor of the Practice Duke.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
Increasing Engagement in Automata Theory with JFLAP Susan H. Rodger Duke University Visual Thinking Workshop – Duke University May 4,
CSC1401: Introductory Programming Steve Cooper
Increasing Engagement in Automata Theory with JFLAP Susan H. Rodger Duke University SIGCSE 2009 March 7, 2009 Supported by NSF Grant.
Pushdown Automata.
Introduction to Alice Alice is named in honor of Lewis Carroll’s Alice in Wonderland.
An Interactive and Visual Approach to Learning Computer Science Susan H. Rodger Department of Computer Science Duke University November 30, 2004 This work.
 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar
Teaching Strategies and Learning Styles CRA-W Workshop Feb 23, 2005 Susan Rodger Associate Professor of the Practice Duke University
An Innovative Approach with Alice for Attracting K-12 Students to Computing Susan H. Rodger Duke University IBM University Days May 7, 2007 Supported by.
An Interactive Approach to Formal Languages and Automata with JFLAP Susan H. Rodger Duke University NSF CCLI Showcase March 9, 2007 Supported by NSF Grant.
Pushdown Automata (PDAs)
Profs. Necula CS 164 Lecture Top-Down Parsing ICOM 4036 Lecture 5.
Teaching Strategies and Learning Styles CRA-W Workshop Mar 7, 2007 Susan Rodger Associate Professor of the Practice Duke University
CompSci 4 Introduction to Programming Animation and Virtual Worlds Prof. Susan Rodger.
Computability Construct TMs. Decidability. Preview: next class: diagonalization and Halting theorem.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 11 Midterm Exam 2 -Context-Free Languages Mälardalen University 2005.
Increasing Interaction and Support in the Formal Languages and Automata Theory Course Susan H. Rodger Duke University ITiCSE 2007 June 25, 2007 Supported.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 6 Mälardalen University 2010.
Increasing the Use of JFLAP in Courses Susan H. Rodger Duke University Durham, NC USA Program Visualization Workshop June 30, 2011 NSF.
Final Exam Review CS Total Points – 60 Points Writing Programs – 50 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Pushdown Automata Chapters Generators vs. Recognizers For Regular Languages: –regular expressions are generators –FAs are recognizers For Context-free.
90-723: Data Structures and Algorithms for Information Processing Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 1: Introduction Data.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Nonvisual Arrays by Chris Brown under Prof. Susan Rodger Duke University June 2012.
Career Path and Passions - So many decisions along the way Susan H. Rodger Professor of the Practice Duke University Nov. 13, 2015 IBM Research Triangle.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2010 with acknowledgement.
Experimenting with Grammars to Generate L-Systems October 29, 2007
CompSci 4 Starting Alice Jan 15, 2009 Prof. Susan Rodger Alice is named in honor of Lewis Carroll’s Alice in Wonderland.
CompSci 4 Starting Alice Sep 2, 2010 Prof. Susan Rodger Alice is named in honor of Lewis Carroll’s Alice in Wonderland.
Data Structures and Algorithms in Java AlaaEddin 2012.
Formal Languages, Automata and Models of Computation
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 2 Context-Free Languages Some slides are in courtesy.
Final Exam Review CS Total Points – 20 Points Writing Programs – 65 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Finite Automata Great Theoretical Ideas In Computer Science Victor Adamchik Danny Sleator CS Spring 2010 Lecture 20Mar 30, 2010Carnegie Mellon.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
CS 154 Formal Languages and Computability February 11 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 8 Mälardalen University 2011.
Mid-Terms Exam Scope and Introduction. Format Grades: 100 points -> 20% in the final grade Multiple Choice Questions –8 questions, 7 points each Short.
Experimenting with Grammars to Generate L-Systems – in JFLAP March 31, 2011 Prof. Susan Rodger Computer Science Dept.
Theory of Computation. Introduction to The Course Lectures: Room ( Sun. & Tue.: 8 am – 9:30 am) Instructor: Dr. Ayman Srour (Ph.D. in Computer Science).
Changes to JFLAP to Increase Its Use in Courses Susan H. Rodger Duke University ITiCSE 2011 Darmstadt, Germany June 29, 2011 NSF Grants.
Final Exam Review CS 3358.
INTERMEDIATE PROGRAMMING WITH JAVA
CSE 105 theory of computation
PDAs Accept Context-Free Languages
An Interactive Approach to Formal Languages and Automata with JFLAP
Sub: Theoretical Foundations of Computer Sciences
Presentation transcript:

Computer Science Concepts Come Alive Susan H. Rodger Duke University February 20, 2007

Outline Introduction CS Concepts Come Alive with Software –CS 1/CS 2 with JAWAA –Automata Theory with JFLAP –Pre-CS 1 with Alice CS Concepts Come Alive with Props Challenges in Designing Educational Software

About Me - Education PhD, 1989 Computer Science Assistant Prof Assistant Professor of the Practice Associate Professor of the Practice 1997-present

About Me - Research Interests Computer Science Education Visualization and Interaction –Instructional Tools for Theoretical concepts Automata theory and formal languages –Teaching Introductory Computer Science Algorithm Animation

About Me - Personally SpouseMother

About Me - Hobby –Shape cakes

How do you make those cakes?

Why find interactive and visual approaches to learning?

Students Ready to Learn Automata Theory!

Things start well enough...

But soon, instead of pictures, there are WORDS.

Big words! The type with more than one syllable!

VIOLENCE AMONG STUDENTS AS NERVES FRAY!

We only wanted to learn automata theory! Isn’t there a better way?

Try JFLAP...

Students Learning Automata with JFLAP

Intro - Why Use Interaction and Visualization? Learning Styles –Visual Learners Learn through seeing Learn best from visual displays –Auditory Learners Learn through listening Learn best through verbal lectures, discussions –Kinesthetic Learners Learn through moving, doing and touching Learn best through hands-on approach

How do you reach all three types? You must do all three! –Provide pictures, diagrams –Discuss what you are doing –Provide activities for trying it

Outline Introduction CS Concepts Come Alive with Software –CS 1/CS 2 with JAWAA –Automata Theory with JFLAP –Pre-CS 1 with Alice CS Concepts Come Alive with Props Challenges in Designing Educational Software

What is JAWAA? Scripting Language for Animation Easily create, modify and move objects Runs over the web, no need to install More Advanced Students Output JAWAA Command from Program Animate Data Structures Easily SIGCSE 2003 and SIGCSE 1998 Students: Pierson, Patel, Finley, Akingbade, Jackson, Gibson, Gartland

Related Work Samba, Jsamba - Stasko (Georgia Tech) AnimalScript – Roessling (Darmstadt Univ of Tech, SIGCSE 2001) JHAVE – Naps (U. Wisc. Oshkosh, SIGCSE 2000)

JAWAA Commands circle cl blue red moveRelative c move right moveRelative c move down changeParam c1 bkgrd blue

JAWAA Primitives circle rectangle line oval polygon text

JAWAA Data Structures Array

JAWAA Data Structures Stack Queue

JAWAA Data Structures Linked List Trees

JAWAA Editor Easily create animations Graphically layout primitives Modify across time No knowledge of JAWAA Export to JAWAA file Start with JAWAA editor, finish with JAWAA output from program

Instructor Use of JAWAA in CS 1/2 Use JAWAA Editor to make quick animations for lecture Fast minutes each animations, Fall 2002 CS 2 Course Create quick animation of data structure in an existing program, add JAWAA commands as output Show web pages with JAWAA animations in lecture Students replay animations later

Instructor Animations for CS 2 Lecture How Pointers Work in Memory Recursion Shellsort Linked List - Insert at the Front Quadratic Collision Resolution Build Heap and Heapsort Josephus Problem

JAWAA w/o Editor vs Editor Nonmajors course Spring 2001 No JAWAA Editor Fall 2002 Using JAWAA Editor

Outline Introduction CS Concepts Come Alive with Software –CS 1/CS 2 with JAWAA –Automata Theory with JFLAP –Pre-CS 1 with Alice CS Concepts Come Alive with Props Challenges in Designing Educational Software

Formal Languages and Automata Theory Traditionally taught –Pencil and paper exercises –No immediate feedback –More mathematical than most CS courses –Less hands-on than most CS courses

What is a finite automaton? Models a problem – represent a set of strings Example: –All valid integers {-3, 8, 0, 456, 13, …} –Starting place Start state –Ending place Final state

Why study finite automata? Application: Compiler Compiler tells you where your syntax errors are Can write a big DFA to identify all words in a Java program –integers, doubles, boolean –Keywords, variable names –Arithmetic operators, punctuation symbols

Why Develop Tools for Automata? Textual Tabular Visual Interactive

Overview of JFLAP Java Formal Languages and Automata Package Instructional tool to learn concepts of Formal Languages and Automata Theory Topics: –Regular Languages –Context-Free Languages –Recursively Enumerable Languages –Lsystems

Thanks to Students - Worked on JFLAP and Automata Theory Tools NPDA , C++, Dan Caugherty FLAP , C++, Mark LoSacco, Greg Badros JFLAP , Java version Eric Gramond, Ted Hung, Magda and Octavian Procopiuc Pâté, JeLLRap, Lsys Anna Bilska, Jason Salemme, Lenore Ramm, Alex Karweit, Robyn Geer JFLAP 4.0 – 2003, Thomas Finley, Ryan Cavalcante JFLAP 6.0 – Stephen Reading, Bart Bressler, Jinghui Lim

JFLAP – Regular Languages Create –DFA and NFA –Moore and Mealy –regular grammar –regular expression Conversions –NFA to DFA to minimal DFA –NFA  regular expression –NFA  regular grammar

JFLAP – Regular languages (more) Simulate DFA and NFA –Step with Closure or Step by State –Fast Run –Multiple Run Combine two DFA Compare Equivalence Brute Force Parser Pumping Lemma

JFLAP – Context-free Languages Create –Nondeterministic PDA –Context-free grammar –Pumping Lemma Transform –PDA  CFG –CFG  PDA (LL & SLR parser) –CFG  CNF –CFG  Parse table (LL and SLR) –CFG  Brute Force Parser

JFLAP – Recursively Enumerable Languages Create –Turing Machine (1-Tape) –Turing Machine (multi-tape) –Building Blocks –Unrestricted grammar Parsing –Unrestricted grammar with brute force parser

JFLAP - Lsystems Create an L-system Render the L-system

Finite Automata Editing and Simulation The most basic feature of JFLAP has always been the creation of automata, and simulation of input on automata. Here we demonstrate the creation and simulation on a simple NFA.

FA Edit & Simulation Start up JFLAP When we start up JFLAP we have a choice of structures. The first of these is the Finite Automata!

FA Edit & Simulation Start Editing! We start with an empty automaton editor window.

FA Edit & Simulation Create States We create some states...

FA Edit & Simulation Create Transitions We create some transitions...

FA Edit & Simulation Initial and Final State We set an initial and final state. Now we can simulate input on this automaton!

FA Edit & Simulation Input to Simulate... When we say we want to simulate input on this automaton, a dialog asks us for the input.

FA Edit & Simulation Start Simulation! When simulation starts, we have a configuration on the initial state with all input remaining to be processed.

FA Edit & Simulation After One Step This is a nondeterministic FA, and on this input we have multiple configurations after we “Step.”

FA Edit & Simulation After Two Steps The previous configurations on q 1 and q 2 are rejected, and are shown in red. The remaining uncolored configurations paths are not rejected, and are still open.

FA Edit & Simulation After Three Steps Yet another step.

FA Edit & Simulation After Four Steps One of the final configurations has been accepted!

FA Edit & Simulation Traceback One can then see a traceback to see the succession of configurations that led to the accepting configuration.

FA Multiple Run Select Multiple Run One can then enter many strings and receive acceptance info.

L-Systems L-Systems may be used to model biological systems and create fractals. Similar to Chomsky grammars, except all variables are replaced in each derivation step, not just one! Commonly, strings from successive derivations are interpreted as strings of render commands and are displayed graphically.

L-Systems This L-System renders as a tree that grows larger with each successive derivation step.

L-Systems L-systems may also be stochastic. The T → Tg rule adds g to the derivation, which draws a line segment. We add another rewriting rule for T, T → T. With two rewriting rules for T, the rule chosen is random, leading to uneven growth!

L-Systems The same stochastic L-system, rendered 3 different times all at the 9th derivation.

Students like L-systems

Using JFLAP during Lecture Use JFLAP to build examples of automata or grammars Use JFLAP to demo proofs Load a JFLAP example and students work in pairs to determine what it does, or fix it if it is not correct.

JFLAP’s use Outside of Class Homework problems –Turn in JFLAP files –OR turn in on paper, check answers in JFLAP Recreate examples from class Work additional problems –Receive immediate feedback

JFLAP’s Use Around the World JFLAP web page has over 70,000 hits since 1996 Google Search –JFLAP appears on over 20,000 web pages –Note: search only public web pages JFLAP been downloaded in over 160 countries

JFLAP in German

JFLAP in Spanish

JFLAP in Chinese

More on JFLAP JFLAP is free! JFLAP book (Jones & Bartlett, 2006) –Use as supplement to a textbook

Outline Introduction CS Concepts Come Alive with Software –CS 1/CS 2 with JAWAA –Automata Theory with JFLAP –Pre-CS 1 with Alice CS Concepts Come Alive with Props Challenges in Designing Educational Software

What Is Alice? A modern programming tool –3-D graphics –3-D models of objects Animation –Objects can be made to move around virtual world (a simulation or video game) Developed at Carnegie Mellon University At Duke – Use Alice in CompSci 4

The Power of Alice Automatically keeps track of 3-D objects –What objects are in the virtual world –Types of objects –Positions of objects in the world

Classes and Objects Classes –In Alice, classes are predefined as 3D models Objects –An object is an instance of a class Class: Chicken Objects: Chicken, Chicken2, Chicken3

Objects in Alice Objects already exist Objects have parts

Galleries of 3D Objects Sources of 3D objects –Local gallery – comes with Alice –Alice web gallery

Object Position Objects –Are positioned in 3D space –Have six degrees of freedom

Program an Object - Demo

Can Teach Computer Science Concepts with Alice Conditional and looping structures Methods, functions Events Inheritance Recursion Lists, Arrays

Methods Built-in methods Write class methods Write world methods

Inheritance Dragon FlyingDragon

Example – parameters and events People are trapped in a burning building Select which person will be rescued

Parameters Types and number of parameters must match with arguments Call

Events Default event Other events

Three Events The argument sent to parameters depends on which person is mouse clicked Note - we positioned fire truck so distance from floor X is X meters (to floor 3 is 3 meters)

Example – Lists - WacAMole List of Moles Randomly moves one of them up and down Counter to keep track of score Event: when click on object, search through list to see if object is a mole

Example – Binary guessing Game Three switches represent 3 digit binary number Random number generated to guess Click on switch to move it (up = 1, down = 0)

Example - Arrays Shuffle, then sort by height

Function to return object with the tallest height from an Array

Alice Software – is free! Runs on Mac and PC CompSci 4 web site Textbook available –Learning to Program with Alice by Dann, Cooper, and Pausch Download from web

Outline Introduction CS Concepts Come Alive with Software –CS 1/CS 2 with JAWAA –Automata Theory with JFLAP –Pre-CS 1 with Alice CS Concepts Come Alive with Props Challenges in Designing Educational Software

Teaching Strategies Activities Without a Computer Get creative in bringing hands-on activities into the classroom

Interaction in Class – Props Passing “Parameters” in Class Pass by reference – throw frisbee Pass by value – throw copy of frisbee Pass by const reference – throw “protected” frisbee

Interaction in Class – Props Linked List and Memory Heaps ITiCSE 98 – Astrachan – “Concrete Teaching: Hooks and Props as Instructional Technology

Interaction in Class – Props Memory Heap

Interaction with Class Binary Tree and Recursion Build a binary tree –Pick a root –Root picks two children – point at them –Repeat until everyone is part of the tree Recursively calculate height of tree –Start at root –Ask children their height –Leaf notes know their height is 0 SIGCSE 2002 – Wolfman – “Making Lemonade: Exploring the Bright Side of Large Lecture Classes

Students building DFA with cookies and icing

Example: Be a Robot 4 People –Controller (head) –Sensors (eyes) –Manipulators (2 hands) Blindfolded except eyes Controller knows what to build Limited communication SIGCSE 96, Rodger,Walker

Example: Sorting Over 100 Words An envelope with over 100 words, each word on one slip of paper Sort the words Write down the algorithm Early assignment, before sorting is covered anchor physiotherapist pathetic bootstrapped acrimonious polarization firecracker palindrome observatory controversial orchestrate statistician confrontation scrumptious revolutionary …

Outline Introduction CS Concepts Come Alive with Software –CS 1/CS 2 with JAWAA –Automata Theory with JFLAP –Pre-CS 1 with Alice CS Concepts Come Alive with Props Challenges in Designing Educational Software

Make your tool as interactive as possible – but not too tedious! User shouldn’t type everything Sometimes select

Allow user to proceed on if they got it Complete the rest for them Complete parts for them

Avoid Too Many Pop up windows OLD JFLAP LR PARSE TOOL

Add Checkpoint questions Pop up a quiz question to see if the user understands what he/she just did JHAVE tool does this

Suggest Appropriate Uses of Tool Order HW questions so they are incremental in the usage of JFLAP 1.Load a DFA. What is the language? Students only enter input strings. 2.Load a DFA that is not correct. What is wrong? Fix it. Students only modifying a small part. 3.Build a DFA for a specific language. Last, students build from scratch.

What can make the tool more useable? Annotations on states Multiple run window –Develop test data –Easier for grading General definitions –FA – recognize one or more symbols –NPDA – pop or push 0 or more symbols Batch processing

Naming your software What is a “good” name for your tool?

JAWAA name is not unique How popular is JAWAA?

JFLAP name is unique

That’s all! JFLAP and ALICE are free – – My Home page: –