Nifty Assignments - PowerPoint PPT Presentation

About This Presentation
Title:

Nifty Assignments

Description:

'popular baby names' web site. www.ssa.gov/OACT/babynames/ Data on names of children born in US ... list of 1000 most popular names by decade stored in a text ... – PowerPoint PPT presentation

Number of Views:173
Avg rating:3.0/5.0
Slides: 17
Provided by: sco1
Category:

less

Transcript and Presenter's Notes

Title: Nifty Assignments


1
Nifty Assignments
  • Shamelessly Borrowed from Nick Parlante at
    Stanford University

2
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/
  • AP Central has a similar page

3
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
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 -gt Encryption techniques such as RSA
  • A lot of my students DONT find this as
    interesting as I do

5
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 Astrachans 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
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
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
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
  • dont provide data file, have students create it
    from multiple files

9
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
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
Word Ladder
  • smartscart (a type of audio / video
    connector)scantslantplantplaitplainblain
    (an inflammatory swelling or sore) brain
  • My word list was derived from a Scrabble word
    list.

12
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

13
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
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 -gt 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 cant be faster can it?

15
Word Ladders
  • smart to brain
  • Linear search method 0.991 seconds
  • Binary search method 0.260 seconds
  • How can that be?

16
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
  • dont 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
Write a Comment
User Comments (0)
About PowerShow.com