Presentation is loading. Please wait.

Presentation is loading. Please wait.

Nifty Assignments Shamelessly Borrowed from Nick Parlante at Stanford University.

Similar presentations


Presentation on theme: "Nifty Assignments Shamelessly Borrowed from Nick Parlante at Stanford University."— Presentation transcript:

1 Nifty Assignments Shamelessly Borrowed from Nick Parlante at Stanford University

2 UTCS Teachers CampNifty Assignments2 A Little History Began as a small panel discussion at SIGCSE in 1999 Friends of Nick Parlante would present cool assignments Now the “800 pound gorilla” of SIGCSE original web site –nifty.stanford.edu/nifty.stanford.edu/ –AP Central has a similar page

3 UTCS Teachers CampNifty Assignments3 Start With the Problem Greg Lavender - “Start with the Problem” Motivate what needs to be learned with an interesting problem Biology teacher I knew started his year with the question “What is food?” I think CS actually has it easy because we can actually solve interesting problems in our labs. –students get immediate feedback and can create non trivial artifacts

4 UTCS Teachers CampNifty Assignments4 What Makes an Assignment Nifty? Not the same answer for everyone I think determining if a 400 digit number is prime is an a very interesting problem –algorithmically interesting with many approaches –look at efficiency of solutions –data representation is interesting –relevant -> Encryption techniques such as RSA A lot of my students DON’T find this as interesting as I do

5 UTCS Teachers CampNifty Assignments5 What Makes an Assignment Nifty? they are fun, playful, interesting they are often, but not always visual. they are scalable. Top students can run with them, others can complete the basics they fulfill Astrachan’s Law Owen Astrachan – “Do not given an assignment that computes something that is more easily figured out without a computer such as the old Fahrenheit / Celsius conversion problem.”

6 UTCS Teachers CampNifty Assignments6 Example 1 – Name Surfer From Nick P. The Name Surfer Social Security Administration “popular baby names” web site. www.ssa.gov/OACT/babynames/ Data on names of children born in US Assignment uses list of 1000 most popular names by decade stored in a text file

7 UTCS Teachers CampNifty Assignments7 Name Surfer Students must read in and store the names, search the names, and complete a GUI to show the names Where did all the Ethels go?

8 UTCS Teachers CampNifty Assignments8 Name Surfer Handout has fairly detailed step by step instructions on how to approach the problem Components –modular design –multiple classes –using ArrayLists and other classes –calculations for lines on display Scalable –do simple text based, then add window, then add GUI –don’t provide data file, have students create it from multiple files

9 UTCS Teachers CampNifty Assignments9 Name Surfer Use the tool you have created to investigate naming trends –plot grand parents names –Rock, Trinity, Dwight –Jose, Mohammed –Mike and Michael, Dave and David, Matt and Matthew –J, D, M

10 UTCS Teachers CampNifty Assignments10 Example 2 – Word Ladders Proposed by Owen Astrachan Begin with two 5 letter words and a list of valid 5 letter words: –brain, smart Change one letter of start word for next word New word be in the list of valid words

11 UTCS Teachers CampNifty Assignments11 Word Ladder smart scart (a type of audio / video connector) scant slant plant plait plain blain (an inflammatory swelling or sore) brain My word list was derived from a Scrabble word list.

12 UTCS Teachers CampNifty Assignments12 Word Ladder Actually exploring a graph the nodes are the words connections (or edges or links) exist between 2 words if they differ by a single letter smartscartstartswartsmaltsmarmscantscare

13 UTCS Teachers CampNifty Assignments13 Word Ladder Assignment I present an algorithm to students that does a breadth first search of the graph using a queue of stacks Students must implement the stack and queue classes and then implement the algorithm Components –implementing data structures –implementing algorithms –comparisons of efficiency

14 UTCS Teachers CampNifty Assignments14 Word Ladder Assignment How do you find words one letter different? do a linear search of all words in the word list –O(N) …but the word list is sorted. Given a word generate all possible 5 letter combinations that are one letter different –smart -> amart, bmart, cmart, … smarx, smary, smarz (125 in all) –take these 125 words and search the word list for each one using a binary search –This can’t be faster can it?

15 UTCS Teachers CampNifty Assignments15 Word Ladders smart to brain Linear search method – 0.991 seconds Binary search method – 0.260 seconds How can that be?

16 UTCS Teachers CampNifty Assignments16 Word Ladders Another extension –Do a depth first search Ladders are much longer smart – brain, 521 words in 0.140 seconds The word list has about 8500 words Other possible extensions: –start from both ends and work towards the middle –find all the connections up front –don’t provide the words in sorted order –map out all the independent sections, which is the biggest? –which word is closest to the center of the largest graph? –what is the largest ladder that exists? –other rules from Wikipedia


Download ppt "Nifty Assignments Shamelessly Borrowed from Nick Parlante at Stanford University."

Similar presentations


Ads by Google