{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

final(8) - CS 473 Final Exam Questions Extended Dance Remix...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 473 Final Exam Questions — Extended Dance Remix Spring 2010 This exam lasts 180 minutes. Write your answers in the separate answer booklet. Please return this question sheet with your answers. 1. Choreographer Michael Flatley has hired a new dance company to perform his latest Irish step- dancing extravaganza. At their first practice session, the new dancers line up in a row on stage and practice a movement called the Flatley Flip : Whenever Mr. Flatley calls out any positive integer k , the k rightmost dancers rotate 180 degrees as a group, so that their order in the line is reversed. Each dancer wears a shirt with a positive integer printed on the front and back; different dancers have different numbers. Mr. Flatley wants to rearrange the dancers, using only a sequence of Flatley Flips, so that these numbers are sorted from left to right in increasing order. 7 4 1 5 3 8 2 6 6 2 8 3 5 7 4 1 6 2 7 4 1 5 3 8 “5” “3” Two Flatley flips. (a) Describe an algorithm to sort an arbitrary row of n numbered dancers, using O ( n ) Flatley flips. (After sorting, the dancers may face forward, backward, or some of each.) Exactly how many flips does your algorithm perform in the worst case? 1 (b) Describe an algorithm that sorts an arbitrary row of n numbered dancers and ensures that all dancers are facing forward , using O ( n ) Flatley flips. Exactly how many flips does your algorithm perform in the worst case? 2 2. You’re in charge of choreographing a musical for your local community theater, and it’s time to figure out the final pose of the big show-stopping number at the end. (“Streetcar!”) You’ve decided that each of the n cast members in the show will be positioned in a big line when the song finishes, all with their arms extended and showing off their best spirit fingers. The director has declared that during the final flourish, each cast member must either point both their arms up or point both their arms down; it’s your job to figure out who points up and who points down. Moreover, in a fit of unchecked power, the director has also given you a list of arrangements that will upset his delicate artistic temperament. Each forbidden arrangement is a subset of cast members paired with arm positions; for example: “Marge may not point her arms up while Ned and Apu point their arms down.” Prove that finding an acceptable arrangement of arm positions is NP-hard. [Hint: Describe a reduction from 3SAT.] 1 This is really a question about networking. 2 This is really a question about mutating DNA. 1
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 473 Final Exam Questions — Extended Dance Remix Spring 2010 3. Dance Dance Revolution is a dance video game, first introduced in Japan by Konami in 1998.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern