haas:fall2019:discrete:projects:eoce
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
haas:fall2019:discrete:projects:eoce [2019/10/29 11:02] – external edit 127.0.0.1 | haas:fall2019:discrete:projects:eoce [2019/11/13 13:04] (current) – wedge | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | <WRAP centeralign round box> | + | at the bottom |
- | < | + | |
- | < | + | |
- | <fs 125%>End of Course Experience</ | + | |
- | </ | + | |
- | ======EoCE====== | + | |
- | + | ||
- | =====Rules===== | + | |
- | Presented within will be various questions evaluating your knowledge and experience gained this semester. In places where you are able, the more you write and explain topics the better the chance you will have of receiving full credit (and alternatively, | + | |
- | + | ||
- | Unless otherwise specified, the questions on this experience are open resource with the exception of other individuals. In that respect, it is **CLOSED PERSON**. This means you are not to communicate with other people (either in the class or otherwise), in real life or electronically. Use your own knowledge, use your own skills, and use your own ability to access the allowed resources to aid you in coming up with your well thought out responses to each question. | + | |
- | + | ||
- | You are allowed, and expected, to seek clarification on any question by asking any of the tutors or me. But the aim here is to evaluate what you have learned, so do not expect tutoring. Any help should be prompted by a well-asked question. Any reply (if possible) from a tutor, should also be in the form of a question. | + | |
- | + | ||
- | You are to do **all** items. Submission is to be as follows: | + | |
- | * an organized and easy to read presentation of information on your EoCE wiki page. | + | |
- | * if applicable, a supplemental archive submitted using the **submit** tool (likely via Makefile) | + | |
- | + | ||
- | The EoCE is worth 26 points of your overall grade (projects + participation + journal | + | |
- | + | ||
- | ====Finals Week Availability==== | + | |
- | While some classes are allocated a specific meeting time during finals week, I make all such times available should you be free and have questions. As such, finals week in **CHM123** will look something like this: | + | |
- | + | ||
- | * Monday, | + | |
- | * Tuesday, | + | |
- | * Wednesday, | + | |
- | + | ||
- | **DEADLINE FOR SUBMISSION: | + | |
- | + | ||
- | Good luck! | + | |
- | + | ||
- | =====DISCRETE EoCE===== | + | |
- | + | ||
- | ====Coding Restrictions==== | + | |
- | Since a lot of our explorations this semester were algorithmic in nature, we made a lot of use of restricting various approaches we could take in the implementation of our solutions. | + | |
- | + | ||
- | As such, the following restrictions are in place for your implementations: | + | |
- | * no global variables | + | |
- | * no infinite loops | + | |
- | * no if() shunts (have good conditions!) | + | |
- | * what is the difference between an if() shunt and a valid conditional statement? if() shunts are a messy way of avoiding iterations; valid if() statements denote conditionally optional processing that occurs every iteration. | + | |
- | * one return statement (max) per function | + | |
- | * exit() calls are limited to command-line or resource allocation error processing | + | |
- | * avoid redundant sections of code (merge logic, or break out functions) | + | |
- | + | ||
- | Remember, the focus should be on writing elegant code, and NOT on brute forcing some solution. Show me that you've learned something this semester- write clean, well commented, consistently indented code. | + | |
- | + | ||
- | ====0x0: Visualizing Long Division==== | + | |
- | Here we will pursue letter division, essentially a long division where the numbers had been swapped out for letters, and you had to ascertain the appropriate mapping of letter to number. | + | |
- | + | ||
- | This problem explores the basis of that puzzle, where you will be writing a program that generates a numeric long division problem (step 1 in a process of writing our own letter division puzzle generator). | + | |
- | + | ||
- | ===Specification=== | + | |
- | Your program is as much about the values generated as it is the output formatted. | + | |
- | * Everything goes to STDOUT | + | |
- | * subtraction signs justified to the left-most digit of the longer value being subtracted (see examples) | + | |
- | * quotient should not be less than 3 digits | + | |
- | * divisor should be 3-5 digits long | + | |
- | * dividend should be 7-9 digits long | + | |
- | * program runs through to final remainder | + | |
- | * note the alignment | + | |
- | * values should be randomly generated | + | |
- | * seed your random number generator with: **srand(time(NULL)); | + | |
- | * you'll want to include **time.h** to use the **time()** function | + | |
- | + | ||
- | ===Execution=== | + | |
- | Your program does not need to accept any arguments, but when run, will produce a numeric visualization of a long division problem (spacing and formatting so everything lines up). A few examples follow: | + | |
- | + | ||
- | < | + | |
- | lab46: | + | |
- | 3320 | + | |
- | +--------- | + | |
- | 17382 | 57716687 | + | |
- | | + | |
- | ===== | + | |
- | | + | |
- | -52146 | + | |
- | | + | |
- | 35608 | + | |
- | | + | |
- | ===== | + | |
- | 8447 | + | |
- | </ | + | |
- | + | ||
- | Another example: | + | |
- | + | ||
- | < | + | |
- | lab46: | + | |
- | | + | |
- | +--------- | + | |
- | 6270 | 71498775 | + | |
- | | + | |
- | ==== | + | |
- | | + | |
- | -6270 | + | |
- | | + | |
- | | + | |
- | -25080 | + | |
- | | + | |
- | | + | |
- | -18810 | + | |
- | | + | |
- | 1965 | + | |
- | </ | + | |
- | + | ||
- | ====0x1: Letter-ifying your Long Division==== | + | |
- | In the previous problem, we were tasked with writing the logic that generates the long division problem, as a first step in our " | + | |
- | + | ||
- | Here, we perform the next step, and swap out the numbers with randomly chosen letters. You'll also want te display an answer " | + | |
- | + | ||
- | Ideally, this program can be used to generate new letter division puzzles that you can then enjoy, to your heart' | + | |
- | + | ||
- | ===Specifications=== | + | |
- | Specifications are the same as with 0x0, plus: | + | |
- | * letters should all be capital | + | |
- | * no duplication (obviously), | + | |
- | * key should be listed at the very end, following a " | + | |
- | + | ||
- | ===Execution=== | + | |
- | + | ||
- | A couple examples of desired program output: | + | |
- | + | ||
- | < | + | |
- | lab46: | + | |
- | | + | |
- | +--------- | + | |
- | AAV | DZMLLZVK | + | |
- | | + | |
- | ==== | + | |
- | | + | |
- | -KZVV | + | |
- | | + | |
- | | + | |
- | -LWAW | + | |
- | | + | |
- | IAVK | + | |
- | | + | |
- | ==== | + | |
- | AK | + | |
- | + | ||
- | LETTERDIVISION: | + | |
- | </ | + | |
- | + | ||
- | Another example: | + | |
- | + | ||
- | < | + | |
- | lab46: | + | |
- | | + | |
- | +--------- | + | |
- | KIII | KRARAQGM | + | |
- | | + | |
- | ==== | + | |
- | | + | |
- | -KIII | + | |
- | | + | |
- | | + | |
- | -IBHHH | + | |
- | | + | |
- | ATMRG | + | |
- | | + | |
- | ===== | + | |
- | | + | |
- | -TBBBB | + | |
- | | + | |
- | HQMQ | + | |
- | + | ||
- | LETTERDIVISION: | + | |
- | </ | + | |
- | + | ||
- | ====0x2: Choose your poison==== | + | |
- | Pick one from the following list to perform: | + | |
- | * letter division generator where the divisor, dividend, and puzzle key are all english-readable words (perhaps from reading from a dictionary file, or provided via input from the user/ | + | |
- | * dcf3: autodetect optimal stride and control byte (based on input file data) | + | |
- | * sort buffet: implement bubble/ | + | |
- | + | ||
- | Note that I'm not looking for name drops or other surface level attempts to gain credit. I want to see well thought out, and central utilizations of discrete structures-related concepts and practices in the solutions to your choices. | + | |
- | + | ||
- | ====0x3: Variable Factor Pair Processing==== | + | |
- | In a previous cnvX project, you wrote a program that simply (brute forcedly, naively) generated a listing of appropriate nary values in space-separated fashion, executed as follows: | + | |
- | + | ||
- | < | + | |
- | + | ||
- | We will be adding an additional (fourth) optional argument (argv[4]), which if present (as a 1), will display in set notation form, the factors of the identified N-ary value, in a list form). Omitted or specifying a 0 will format in a familiar space-separated output format. | + | |
- | + | ||
- | ===N-ary values=== | + | |
- | What we know of as prime numbers are those numbers with just 1 factor pair (1 and the number itself). | + | |
- | + | ||
- | Secondary numbers are those with 2 factor pairs (1 and itself, plus another 2 values). 6 is a secondary number, as its factors are: 1, 2, 3, 6. | + | |
- | + | ||
- | There are some " | + | |
- | + | ||
- | Tertiary and beyond merely continue the scaling of this specification- tertiary numbers have 3 factor pairs (for example, the number 12- 1, 2, 3, 4, 6, 12). | + | |
- | + | ||
- | ===Specification=== | + | |
- | You are to write a program that: | + | |
- | * accepts the following values as command-line arguments: | + | |
- | * argv[1]: the N-ary value to check for (1 or more) | + | |
- | * argv[2]: the lower bound | + | |
- | * argv[3]: the upper bound | + | |
- | * argv[4]: optional; nothing or 0, default to pnc-style output; if 1, horizontally list factors, while vertically listing individual entries. | + | |
- | * proper error checking should be performed so that the program cannot proceed (and should display an appropriate error) if violations occur. | + | |
- | * perform the necessary calculations to determine the factors, according to command-line arguments given. | + | |
- | * you may want to STORE the factors | + | |
- | * display the results for that number, according to format (see **execution** section below) | + | |
- | * factor output should be padded for the largest values being displayed | + | |
- | + | ||
- | ===Execution=== | + | |
- | Your program output should be as follows (given the specific inputs via the command-line): | + | |
- | + | ||
- | ==All secondary numbers between 2 and 40== | + | |
- | < | + | |
- | lab46: | + | |
- | 4 6 8 9 10 14 15 21 22 25 26 27 33 34 35 38 39 | + | |
- | lab46: | + | |
- | </ | + | |
- | + | ||
- | ==Tertiary numbers between 2 and 40== | + | |
- | < | + | |
- | lab46: | + | |
- | 12 16 18 20 32 | + | |
- | lab46: | + | |
- | </ | + | |
- | + | ||
- | ==Quadrary numbers between 2 and 66, with factor list== | + | |
- | < | + | |
- | lab46: | + | |
- | 24 = { 1, 2, 3, 4, 6, 8, 12, 24 } | + | |
- | 30 = { 1, 2, 3, 5, 6, 10, 15, 30 } | + | |
- | 40 = { 1, 2, 4, 5, 8, 10, 20, 40 } | + | |
- | 42 = { 1, 2, 3, 6, 7, 14, 21, 42 } | + | |
- | 54 = { 1, 2, 3, 6, 9, 18, 27, 54 } | + | |
- | 56 = { 1, 2, 4, 7, 8, 14, 28, 56 } | + | |
- | 64 = { 1, 2, 4, 8, 8, 16, 32, 64 } | + | |
- | 66 = { 1, 2, 3, 6, 11, 22, 33, 66 } | + | |
- | lab46: | + | |
- | </ | + | |
- | + | ||
- | ====0x4: Weird Numbers==== | + | |
- | We continue to apply our skills in implementing an algorithm that determines certain attributes of a number based on its factor composition. | + | |
- | + | ||
- | ===Weird and Semi-perfect numbers=== | + | |
- | In the **ewn0** project, we explored the computation of **abundant**, | + | |
- | + | ||
- | A **semi-perfect** number is a natural number that is equal to the sum of //all or some// of its factors. A **semi-perfect** number that is equal to the sum of all its proper divisors is a **perfect** number. So by this definition, **semi-perfect** numbers can be **abundant** or **perfect ** numbers, but that is limited by the constraining requirement of some combination of sums equalling the number we are evaluating. | + | |
- | + | ||
- | Some examples of **semi-perfect** numbers include: | + | |
- | * 6: with factors of 1, 2, 3, we see that 1+2+3 = 6. As this is also ALL the factors, this was identified as a perfect number in the previous project (and from the definition above, all perfect numbers are semi-perfect, | + | |
- | * 12: with factors of 1, 2, 3, 4, 6, we see that 1+2+3+6 = 12. Adding up ALL the factors gives us a value greater than 12 (and in the previous project, it would have been classified as an abundant number). | + | |
- | * 18: with factors of 1, 2, 3, 6, 9, we see that 3+6+9 = 18. Adding up ALL the factors gives us a value greater than 18 (and in the previous project, it would have been classified as an abundant number). | + | |
- | + | ||
- | A **weird** number is defined as a natural number that is **abundant** but __not__ // | + | |
- | + | ||
- | Some examples of **weird** numbers include: | + | |
- | * 70: with factors 1, 2, 5, 7, 10, 14, 35, is an abundant number where the factors sum to 74. Yet there is no subset of factors that can be summed that give us a value of 70. Therefore, 70 is classified as a weird number. | + | |
- | + | ||
- | ===Subset of sums=== | + | |
- | Calculating **semi-perfect** and **weird** numbers requires us to analyze the various combinations of factor sums. This requires some additional consideration in our implementation, | + | |
- | + | ||
- | ===Specification=== | + | |
- | You are to write a program that: | + | |
- | * accepts two values via command-line arguments | + | |
- | * argv[1]: the starting value | + | |
- | * argv[2]: the ending value | + | |
- | * proper error checking should be performed so that the program cannot proceed (and should display an appropriate error) if the following conditions are encountered: | + | |
- | * values less than 2 are provided, with an error " | + | |
- | * missing argv[2], with the error " | + | |
- | * missing both argv[1] and argv[2]: " | + | |
- | * assumptions: | + | |
- | * while we are including 1 as a factor, we are not including the number itself in the list of factors. | + | |
- | * perform the necessary calculations to determine the factors, from (and including) argv[1] through (and including) argv[2] | + | |
- | * be sure to STORE the factors | + | |
- | * sum the factors, and determine its abundant/ | + | |
- | * **NOTE:** the starting value does NOT have to be less than the ending value. We are merely connecting the two. | + | |
- | * display the results for that number: | + | |
- | * if it is **NOT** a **semi-perfect** nor a **weird** number, we keep the format from the previous project: | + | |
- | * < | + | |
- | * for example: < | + | |
- | * if it **IS** a **semi-perfect** or a **weird** number, we specifically display that information: | + | |
- | * < | + | |
- | * for example: < | + | |
- | * or: < | + | |
- | + | ||
- | Basically, requirements are the SAME as for 0x4, only we are adding in the check, processing, and output identification of **semi-perfect** and **weird** numbers. | + | |
- | + | ||
- | There exists the possibility that there may be multiple combinations of factor subset sums that will prove semi-perfection. For the purposes of this project, display the FIRST match you find (as such, you do not need to find EVERY possible combination, | + | |
- | + | ||
- | ===Execution=== | + | |
- | Your program output should be as follows (given the specific inputs via the command-line): | + | |
- | + | ||
- | < | + | |
- | lab46: | + | |
- | [66] abundant: | + | |
- | [67] deficient: 1 = 1 | + | |
- | [68] deficient: 1+2+4+17+34 = 58 | + | |
- | [69] deficient: 1+3+23 = 27 | + | |
- | [70] abundant: | + | |
- | lab46: | + | |
- | </ | + | |
- | + | ||
- | As with **ewn0**, starting and ending at any acceptable value is possible, as well as the starting value being higher than the ending value. | + | |
- | + | ||
- | ====0x5: Anagrams==== | + | |
- | An anagram is process of rearranging all the letters in a word to spell out different combinations. | + | |
- | + | ||
- | For example, **tar** can have anagrams of: | + | |
- | * tra | + | |
- | * atr | + | |
- | * art | + | |
- | * rat | + | |
- | * rta | + | |
- | + | ||
- | Your task is to write a program that accepts a word or phrase as input (spaces ALLOWED), and will display all the possible UNIQUE anagrams (NO DUPLICATES!) possible from the source input. | + | |
- | + | ||
- | You need to also display the total number of variations possible, along with the anagrammed words. | + | |
- | + | ||
- | Input can be via command-line, | + | |
- | + | ||
- | Please place your code in the **0x5/** directory of the **eoce/** project directory. | + | |
- | + | ||
- | ====0x6: Personal Assessment==== | + | |
- | After an exciting and intellectually challenging run, we're arriving at the end of this semester' | + | |
- | + | ||
- | So, searching deep down within your soul- balancing reason with emotion, and considering attendance and timeliness; what grade do you feel you deserve for this course, and why? Justify your answer based on your own perceived performance to course ideals and content, not on need or desire. | + | |
- | + | ||
- | Also, answer me the following: | + | |
- | + | ||
- | * Of all the work you've done this semester in this course, identify something that was meaningful to you. What is it? Why does it stick out in your mind? Explain. | + | |
- | * How did you feel about the course? | + | |
- | * Was it useful/ | + | |
- | * What was your least favorite aspect, and why? | + | |
- | * Any comments, suggestions? | + | |
- | + | ||
- | Please reflect your response based on your insights and understanding of computing. Don't just say "that one thing" was your least favorite aspect. Say why that was- How did your least favorite aspect play to your limitations of your knowledge and experiences? | + | |
- | + | ||
- | ====0x7: In-person Knowledge Assessment==== | + | |
- | During some standard time between now and 05:29:59pm (that' | + | |
- | + | ||
- | Valid times include any remaining class or office/lab hours **with no structured/ | + | |
- | + | ||
- | Note that you only have a single opportunity to take this (no make sure you allocate yourself an adequate amount of time). | + | |
- | + | ||
- | __Pro tip__: Don't wander in 30 minutes (or similarly time deficient) before a deadline and expect an extension/ | + | |
- | + | ||
- | When ready, please proceed: [[/ | + | |
- | + | ||
- | =====Submission===== | + | |
- | + | ||
- | ====EoCE document==== | + | |
- | All responses to questions, unless specifically indicated otherwise, should be addressed on this document (or the intended wiki document). | + | |
- | + | ||
- | Please edit the appropriate section and provide the necessary information. | + | |
- | + | ||
- | ====File Submission==== | + | |
- | For any other specific deliverables, | + | |
- | + | ||
- | < | + | |
- | lab46: | + | |
- | ... | + | |
- | </ | + | |
- | + | ||
- | If no formal project, you can submit requested files (preferably in an archive of their own), using the **submit** tool. A project called **eoce** has been likely set up for this purpose. | + |
haas/fall2019/discrete/projects/eoce.txt · Last modified: 2019/11/13 13:04 by wedge