/
Programming Challenge Problem Programming Challenge Problem

Programming Challenge Problem - PowerPoint Presentation

gagnon
gagnon . @gagnon
Follow
0 views
Uploaded On 2024-02-16

Programming Challenge Problem - PPT Presentation

Chris Haack Joe Como Programming Challenge Problem Logistics You can work in groups of 23 Code and brief write up due Tuesday May 21 st at 230pm Must be done in python3 no extensions are going to be provided ID: 1046327

tandem duplication 001001 info duplication tandem info 001001 string code distance steps seed bio position challenge 10111011 python algorithm

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "Programming Challenge Problem" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

1. Programming Challenge ProblemChris HaackJoe Como

2.

3. Programming Challenge Problem LogisticsYou can work in groups of 2-3! Code and brief write up due Tuesday May 21st at 2:30pm Must be done in python3!no extensions are going to be providedYou will then make a presentation on your algorithm and ideas!We will run an in class competition

4. Language RequirementYour code must be written in Python 3.Why Python?We want you to focus on your algorithms and not the language optimizations.Easy to understand what is going on with your code!

5. Challenge IntroductionImplement a function that retrieves the minimum number of steps it takes to generate a string using only tandem duplications from one of the following starts strings [0, 1, 01, 10, 101, 010] as listed in problem 1a on homework one

6. Refresher Problem 1a00010101

7. Tandem DuplicationA tandem duplication of length k is defined as a duplication of a substring of length k next to it’s original position.For example 0011101 with a duplication of length 3 at position 2 would become 0011011101**note python is 0 indexed, so something at position 1 in python is at position 2 in a string!

8. Duplication DistanceThe duplication distance is defined as the minimum number of steps required to generate a given string from a seed by a tandem duplication process.001001 can be generated from 01 in two ways01 -> 0101 -> 00101 -> 001001 ( 3 steps)01 -> 001 -> 001001 (2 steps)The duplication distance for 001001 is then 2 since this is the minimal number of tandem duplications required to generate 001001 from seed 01.

9. Duplication Distance ExampleWhat is the duplication distance of string 10111011101 -> 101101101101 -> 10111011011101 -> 10111011

10. Duplication Distance Example Part 2How can we get to 10111011 with just tandem duplications101 -> 10111011 -> 101110112 steps

11. Reverse?10111011 -> 1011 -> 101

12.

13. Solution010100110101010010101010101010101!

14. Problems?Once you have completed this you will realize that for large strings it takes a lot of time for your program to grow as the search space becomes much larger.

15.

16. Last Years Winners!

17.

18.

19. 100100Bio. Info. Channel19

20. 100100SEED: 10Bio. Info. Channel20

21. 100100SEED: 10Generate possible duplications: [110, 100, 1010]Repeat?Bio. Info. Channel21

22. 100100Now Start from ending string.Bio. Info. Channel22

23. 100100Possible deduplications: [10010, 10100, 100]Repeat until you reach a seed.What do you have to keep count of?Bio. Info. Channel23

24. 100100Possible deduplications: [10010, 10100, 100]Repeat until you reach a seed.What do you have to keep count of?Second generation:[1010, 100, 101010]Bio. Info. Channel24

25. OptimizationThe challenge is to think of ways to optimize this generation process and argue why your solution is good. Please in your solution describe your algorithm and approach. Discuss pros and cons and what things you like/dislike about your algorithm.

26. Tips!Work With Friends!Start Early!Ask Your TA’s for help and advice

27. RemindersWrite Code in solver.py and have your main solution be in the solve function! Feel free to use any other helper functions!There is useful template code in helpers.py and a walk through on an initial algorithm in the intro_solver ipython notebook. If you have questions please reach out to jcomo@caltech.edu - Joesidjain@caltech.edu - Sidd