User Tools

Site Tools


haas:spring2019:unix:projects:pct0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
haas:spring2019:unix:projects:pct0 [2019/04/01 15:32] – [Letter Division: an example] wedgehaas:spring2019:unix:projects:pct0 [2019/08/04 13:46] (current) – [Objective] wedge
Line 11: Line 11:
  
 =====Objective===== =====Objective=====
-To continue to cultivate your problem solving, critical thinking, analytical, and observation skills; to apply your skills on the UNIX command-line.+To continue to cultivate your problem solving, critical thinking, analytical, and observation skills.
  
 +The aim here is on observation, analysis, and documentation. You are solving and documenting a problem by hand, thinking your way through to solution, NOT copying something, NOR writing any sort of program.
 =====Background===== =====Background=====
-The true nature of problem solving frequently involves critical thinking, analytical, and observation skills. Where problems are not solved by memorizing some pre-defined set of answers and regurgitating them mindlessly, but it crafting an elaborate solution from subtle cues and tested, experimental realizations.+The true nature of problem solving frequently involves critical thinking, analytical, and observation skills. Where problems are not solved by memorizing some pre-defined set of answers and regurgitating them mindlessly, but in crafting an elaborate solution from subtle cues and tested, experimental realizations.
  
-This project has puts you in contact with such endeavours.+This project puts you in contact with such endeavours.
  
-====Letter Division====+====Long Division====
 Letter division is a category of logic problem where you would take an ordinary math equation (in long form), and substitute all the numbers for letters, thereby in a direct sense masking the numeric values present that correctly enable the problem to work from start to completion. It is your task, through exploring, experimenting, and playing, to ascertain the numeric value of each letter (as many as 10, one for each numeric value 0-9). Letter division is a category of logic problem where you would take an ordinary math equation (in long form), and substitute all the numbers for letters, thereby in a direct sense masking the numeric values present that correctly enable the problem to work from start to completion. It is your task, through exploring, experimenting, and playing, to ascertain the numeric value of each letter (as many as 10, one for each numeric value 0-9).
  
Line 232: Line 233:
  
 We cannot instantly proceed to the next subtraction in as obvious a progression, as we'll need more information on the various letters involved. We cannot instantly proceed to the next subtraction in as obvious a progression, as we'll need more information on the various letters involved.
 +
 +===Finding K (and J and L and O as well)===
  
 However, looking at the puzzle, I'm interested in seeing if we can find any obvious examples of 0. You know, letter minus same letter sort of things. Because they will typically end up equalling 0 (or 9). However, looking at the puzzle, I'm interested in seeing if we can find any obvious examples of 0. You know, letter minus same letter sort of things. Because they will typically end up equalling 0 (or 9).
Line 351: Line 354:
  
 Can't really do much more with it at this point, but it is important to know to help us identify the borrows needing to happen. Can't really do much more with it at this point, but it is important to know to help us identify the borrows needing to happen.
 +
 +===Finding our zero value (R and B)===
  
 Why don't we go ahead and find 0? If you look in the subtraction above the bottom one, we have another "letter minus same letter" scenario, and it doesn't equal K! Why don't we go ahead and find 0? If you look in the subtraction above the bottom one, we have another "letter minus same letter" scenario, and it doesn't equal K!
Line 404: Line 409:
  
 Basically just down to V, G, P, and M. Basically just down to V, G, P, and M.
 +
 +===Finding V and G===
  
 And I think we have the means to find V: notice the second to last subtraction, the "LKBKV". You know where we get that from? Multiplying the divisor (KJKK) by J (since it is the third subtraction taking place). And I think we have the means to find V: notice the second to last subtraction, the "LKBKV". You know where we get that from? Multiplying the divisor (KJKK) by J (since it is the third subtraction taking place).
Line 450: Line 457:
   * R < B < V < G << M << O < L < J < K   * R < B < V < G << M << O < L < J < K
   * R < B < V < G << P << O < L < J < K   * R < B < V < G << P << O < L < J < K
 +
 +===Finding M and discovering P===
  
 And then there were 2. We really just need to find M, or P, and we're done. And since there are no 'P' values in the puzzle, we need to target M. So let's look for some candidates: And then there were 2. We really just need to find M, or P, and we're done. And since there are no 'P' values in the puzzle, we need to target M. So let's look for some candidates:
Line 502: Line 511:
  
   * R < B < V < G < P < M < O < L < J < K   * R < B < V < G < P < M < O < L < J < K
 +
 +I wasn't able to show it as well in text on the wiki, but I also made a point to mark up each subtraction to show whether a borrow occurred or not:
 +
 +{{ :undefined:borrows.jpg?400 |}}
  
 To be sure, there are likely MANY, MANY ways to arrive at these conclusions. What is important is being observant, performing little experiments, seeing if there can be any insights to have, even if whittling away knowing what things can NOT be. To be sure, there are likely MANY, MANY ways to arrive at these conclusions. What is important is being observant, performing little experiments, seeing if there can be any insights to have, even if whittling away knowing what things can NOT be.
  
 Your performance on this project will be directly tied to being able to document your process through the puzzle; I have provided this writeup in order to show you an example of what that process may look like. Your performance on this project will be directly tied to being able to document your process through the puzzle; I have provided this writeup in order to show you an example of what that process may look like.
-=====Get started===== +=====Getting started=====
-This week's project has 2 points of origin.+
  
-First, in the **upf1/** sub-directory of the UNIX Public Directory, under a directory by the name of your username, you will find the following file:+In the **pct0/** sub-directory of the UNIX Public Directory, under a directory by the name of your username, you will find the following files:
  
-  * **TASK**+  * **bonus** 
 +  * **practice0** 
 +  * **practice1** 
 +  * **practice2** 
 +  * **practice3** 
 +  * **puzzle**
  
-Copy this file into your project directory.+Copy these file into your project directory.
  
-The **TASK** file will contain the particular units to start with and convert to.+There is also a **MANIFEST** file in the parent directory (the **pct0/** sub-directory), which will contain MD5sums of the various puzzle keys, provided to help you in verifying your puzzle key.
  
-Next, you will want to grab the latest version of the **unittools** suite from the following URL:+For this projectthe only puzzle you HAVE to solve in order to be eligible for full credit will be the one contained in the **puzzle** file.
  
-  https://lab46.g7n.org/~wedge/projects/unittools/+Should you desire, there's an opportunity to gain some bonus points, which can be earned by successfully solving and documenting your solution to the puzzle contained within the file **bonus** and reporting it to me as appropriate.
  
-You will want to use a tool like **wget(1)** or **curl(1)** to non-interactively download it onto your lab46 accountand similarly extractcompile, and install that (check its own README file).+As you gear up to work on the project-required puzzle (or additionally the bonus puzzle), I have provided a sampling of practice puzzles that you can try your hand on in order to get more experience working with these type of puzzles. Doing them will not net you any points, nor will not doing them diminish your totals for this project. I would recommend doing themthoughas the more exposure you have within this domainthe more patterns become identified, further facilitating your chances of success. 
 +=====Process===== 
 +Solve and document the puzzle.
  
-There may be multiple versions of **unittools** available at the download link. Unless you have specific reason otherwise (for this project, you do not), you want to go for the latest version, which will be reflected by the most recent datestamp encoded in the file's name.+On your own.
  
-For examplesay you have the following:+Seek to discover and explore and understandNOT to just come up with an answer. 
 +=====Your Solution===== 
 +As this project focuses more on the critical thinking process than being heavy in unravelling a problem using UNIX commands, your solution will be in 2 parts:
  
-  * unittools-20160731-10.tar.gz +  * your puzzle key, in a textfile called 'puzzle.key' containing ONLY the capital letters corresponding in order to the 0-9 values (and a trailing newline)
-  * unittools-20161024-14.tar.gz +  * your documentation of your solving and exploration of the puzzleIf you did this on paper, I'll want it digitized and submitted as a file with this projectThe file, if is text form, should be called 'puzzle.solution'; if an image, please append the image format to the end of the filename.
-  * unittools-20170123-13.tar.gz +
-  * unittools-20170201-09.tar.gz+
  
-From visual inspection, you would select the "20170201-09" onebecause the date it encodes (Feb 1st2017 at 9am) is the most recent in that group. You will find this to be common practice with many software projects on the internet.+====puzzle key==== 
 +As indicated, you are to place the determined key to your puzzle in a regular text file called 'puzzle.key'and will contain ONLY the capital letters, in order from 0-9, of your puzzle (and trailing newline).
  
-Notehowever, that visual inspection alone is not good enough for your steps file. New versions may be released, and your steps file needs to obtain the most recent version available. To facilitate this task, the latest and greatest version of unittools will be listed in a file called LATEST (which you should see near the top of the directory index listing). You can make use of this file to assist you in automating the process of determining and downloading the latest version of the unittools tools.+For exampleusing the example puzzle above:
  
-Once those two steps are complete, you can begin on the tasks listed in your **TASK** file.+|  0  |  R  | 
 +|  1  |  B  | 
 +|  2  |  V  | 
 +|  3  |  G  | 
 +|  4  |  P  | 
 +|  5  |  M  | 
 +|  6  |  O  | 
 +|  7  |  L  | 
 +|  8  |  J  | 
 +|  9  |  K  |
  
-====unittools suite==== +We'll want to put them, in order, in our key file:
-The unittools suite is a collection of command-line tools that perform various unit conversions you may find useful for this project. The tools include:+
  
-  * **cm2in** - convert centimeters to inches +<cli> 
-  * **cu2mm** - convert cubits to millimeters +lab46:~/src/unix/pct0$ echo "RBVGPMOLJK" > puzzle.key 
-  * **dm2cm** - convert decimeters to centimeters +lab46:~/src/unix/pct0$  
-  * **Dm2mi** - convert Decameters to miles +</cli>
-  * **ft2hm** - convert feet to hectometers +
-  * **ft2yd** - convert feet to yards +
-  * **hm2dm** - convert hectometers to decimeters +
-  * **hm2Dm** - convert hectometers to Decameters (if not available, use **hm2dcm** instead) +
-  * **in2cu** - convert inches to cubits +
-  * **in2ft** - convert inches to feet +
-  * **km2ft** - convert kilometers to feet +
-  * **mi2km** - convert miles to kilometers +
-  * **mi2yd** - convert miles to yards +
-  * **mm2dm** - convert millimeters to decimeters +
-  * **st2mi** - convert stadions to miles +
-  * **yd2mi** - convert yards to miles +
-  * **yd2st** - convert yards to stadions+
  
-The tools by default expect input via STDIN, and will output to STDOUT.+Want to know what a proper 'key' file should look like? This:
  
-These tools have command-line arguments which can alter their default behavior. You may want to review the options and defaults (try running them with the **-h** argument to see what sort of functionality is available).+<cli> 
 +lab46:~/src/unix/pct0$ cat puzzle.key 
 +RBVGPMOLJK 
 +lab46:~/src/unix/pct0$  
 +</cli>
  
-=====Process===== +JUST the letters (and trailing newline).
-In the **TASK** file, you will be given set of source quantities/units and destination units you need to construct command-lines for to solve, using the tools provided to you in the **unittools** suite. You will also want to make use of pipes and command expansions in your solutions.+
  
-As an exampletake the following (formatted is it would appear in your **TASK** file):+====solution documentation==== 
 +As stateda very large part of this project's evaluation will be based on your clear and detailed documentation of how you determined each letter's mapping in the solution key of your puzzle.
  
-<code> +Just providing the 'key' will not result in success.
-task: 0 +
-precision: 3 +
-input_value: 35 +
-input_unit: cm +
-output_unit: ft +
-chain_delim: " >> " +
-</code>+
  
-With these in mindwe can set about solving this problemusing the tools in combination to arrive at the desired result.+Your documentation shouldwhile there may be supporting informationprovide some identified path that showed the steps you went through to identify each letter, be it directly or indirectly.
  
-A potential solution would be as follows:+You are free to write out your solution with pen on paper (that is how I usually do these puzzles); but if you do so, you MUST digitize it and submit it as an image file when you submit this project.
  
-<cli> +The aim here is not to dump a bunch of data on me, but instead present me with connected and pertinent information that documents your process of progression through the puzzle from start to finish. 
-lab46:~/src/unix/upf1$ echo "35" | cm2in +=====Verification===== 
-13.78 in +Want to check to see if your key is correct (ie all letters in the right order)?
-lab46:~/src/unix/upf1$ echo "13.78" | in2ft +
-1.15 ft +
-lab46:~/src/unix/upf1$  +
-</cli>+
  
-But that's not very optimized. We could instead do something betterlike:+====Generate MD5 sum==== 
 +You can do soby generating an MD5 sum of your 'key' file and grepping for it in the MANIFEST file:
  
 <cli> <cli>
-lab46:~/src/unix/upf1echo "35.000 cm" cm2in OPTIONS | in2ft OPTIONS +lab46:~/src/unix/pct0md5sum puzzle.key cut -d' ' -f1 
-35.000 cm >> 13.780 in >> 1.148 ft +1395327d0826e3145b4f285a2b936707 
-lab46:~/src/unix/upf1+lab46:~/src/unix/pct0
 </cli> </cli>
  
-Note that with **precision**you need to instruct the tools to display out to the specified number of decimal places.+ObviouslyYOUR MD5 sum will be DIFFERENT from this, because this is the MD5 sum of the puzzle key explored at the top of this project page.
  
-We'll want to record our command-lines in the appropriate place. Since this is task #0, we'll want to record it in a file called: **task0.cli**which should basically just contain the command-lines you ran, merely placed in a text file.+NOTE: MD5 sums of your bonus and practice puzzles are also present in the MANIFEST file, so you can perform verifications on them in the same manner.
  
-For final output, we'll want to display the chain of conversions we went through. So, for this above example:+====Look for matching MD5 sum in MANIFEST==== 
 +Let's say the path to the **pct0/** sub-directory of the public directory is in a variable called PROJECTDIR; if soyou can check your MD5 sum for a match in MANIFEST as follows:
  
 <cli> <cli>
-lab46:~/src/unix/upf1./task0.cli +lab46:~/src/unix/pct0cat ${PROJECTDIR}/MANIFEST | grep $(md5sum puzzle.key | cut -d' ' -f1) && echo "MATCH FOUND" || echo "NO MATCHES FOUND" 
-35.000cm >> 13.780in >> 1.148ft +MATCH FOUND 
-lab46:~/src/unix/upf1+lab46:~/src/unix/pct0
 </cli> </cli>
  
-Basicallyeach task#.cli will be its own script. If we were to execute it, the correct result should be produced.+If you have a matchcongratulations, you unravelled the puzzle correctlyJust remember: evaluation is heavily based on your documentation of the processnot whether or not you can arrive at the correct answer key. 
 +=====Submission===== 
 +By successfully performing this project, you should be submitting files that satisfy the following requirements:
  
-=====upf1steps===== +  * 'puzzle.key' file formatted as indicated elsewhere in this project document 
-You will once again be creating steps file that can automate your project (ie it contains list of non-interactive steps to complete the task). +  * 'puzzle.solution' file containing organized and informative detailing of your path to solution
  
-As in previous projects**upf1steps** will contain the steps you took from the point of copying the numbers suite and downloading the unittools suite up until the submit step (hintjust run the task#.cli scripts within the steps script)+Additionallyalthough optional, if you'd like to do similar for the bonus puzzle: 
-  * To clarify: YES, I want to see steps creating project directory, copying and downloading files in question, extracting, compiling, installing, and then of course running each individual task#.cli script.+  * a 'bonus.key' file formatted as indicated elsewhere in this project document 
 +  * a 'bonus.solution' file containing organized and informative detailing of your path to solution
  
-There are some additional constraints you need to keep in mind:+To submit this project to me using the **submit** tool, run the following command at your lab46 prompt:
  
-  * your script should not produce ANY STDERR output +<cli> 
-  * your script should ONLY produce STDOUT output in conformance with the below stated requirementsAny other output needs to be silenced+$ submit unix pct0 puzzle.key puzzle.solution 
-  * You will want one unified command-line producing the end result, not separate one-step transitions. The idea is to utilize pipes. +Submitting unix project "pct0": 
-    * semi-colons used to separate commands do not constitute one command-line, but several. +    -> puzzle.key(OK) 
-  * For each task, you'll want to display things as follows: +    -> puzzle.solution(OK)
-    * "Task X conversion chain: CHAIN" +
-      * where X is the task number (0, 1, 2, etc.+
-      * where CHAIN is the conversion chain output matching the TASK file result requested (ie, you must run your task#.cli script to produce this output)+
-        * note that the task#.cli output appears on the SAME line as the "Task X conversion chain:" text, and there is a single space separating it from the colon. +
-        * there is NO space between value and unit+
  
-For example, a sample output of your **upf1steps** script should appear like follows (but your # values will of course be different based on your individual **TASK** file): +SUCCESSFULLY SUBMITTED
- +
-<cli> +
-lab46:~/src/unix/upf1$ ./upf1steps +
-Task 0 conversion chain: 35.000cm >> 13.780in >> 1.148ft +
-... +
-lab46:~/src/unix/upf1$ +
 </cli> </cli>
  
-=====Submission===== +orif submitting results for the bonus puzzle as well:
-By successfully performing this projectyou should have a set of task#.cli files (one for each task). You will want to submit these, along with a **upf1steps** file. +
- +
-To submit this project to me using the **submit** tool, run the following command at your lab46 prompt:+
  
 <cli> <cli>
-$ submit unix upf1 upf1steps task*.cli +$ submit unix pct0 puzzle.key puzzle.solution bonus.key bonus.solution 
-Submitting unix project "upf1": +Submitting unix project "pct0": 
-    -> upf1steps(OK) +    -> puzzle.key(OK) 
-    -> task0.cli(OK) +    -> puzzle.solution(OK) 
-    -> task1.cli(OK) +    -> bonus.key(OK) 
-    -> task2.cli(OK) +    -> bonus.solution(OK)
-    -> task3.cli(OK) +
-       ...+
  
 SUCCESSFULLY SUBMITTED SUCCESSFULLY SUBMITTED
 </cli> </cli>
  
-You should get some sort of confirmation indicating successful submission  if all went according to plan. If not, check for typos and or locational mismatches.+You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches.
  
 I'll be looking for the following: I'll be looking for the following:
  
 <code> <code>
-78:upf1:final tally of results (78/78) +78:pct0:final tally of results (78/78) 
-*:upf1:upf1steps has valid list of non-interactive instructions [4/4] +*:pct0:puzzle.key file submitted with correct values [7/7
-*:upf1:upf1steps only copies/alters files if USER matches [4/4] +*:pct0:puzzle.key file formatted according to project specifications [6/6
-*:upf1:upf1steps builds the various task#.cli files it runs [4/4] +*:pct0:puzzle.solution is organized and easy to read [35/35
-*:upf1:upf1steps obtains the latest pipemath release from site [4/4] +*:pct0:puzzle.solution adequately documents discovery of each letter [30/30]
-*:upf1:upf1steps only displays specified STDOUT output [4/4] +
-*:upf1:upf1steps resiliently creates local project directory [4/4] +
-*:upf1:upf1steps copies public dir data with absolute path [4/4+
-*:upf1:upf1steps makes clear, effective use of wildcards [4/4] +
-*:upf1:upf1steps defines and uses custom variables [4/4] +
-*:upf1:upf1steps uses command expansions to get information [4/4+
-*:upf1:upf1steps uses a loop to drive numbers in final output [4/4] +
-*:upf1:upf1steps automates the task when run [4/4] +
-*:upf1:all files are organized, clear, and easy to read [4/4+
-*:upf1:task#.cli files output using specified precision [3/3] +
-*:upf1:task#.cli files output using specified delimiter [3/3] +
-*:upf1:task#.cli files output only correct value and unit [4/4] +
-*:upf1:task#.cli files output in specified format [4/4] +
-*:upf1:task#.cli files display no STDERR output [4/4] +
-*:upf1:task#.cli files have solution within given constraints [4/4] +
-*:upf1:task#.cli files only contain the solution command-line [4/4]+
 </code> </code>
- 
-Additionally: 
-  * Solutions not utilizing descriptive why and how comments will be subject to a 25% overall deduction 
-  * Solutions not utilizing indentation to promote scope and clarity will be subject to a 25% overall deduction 
haas/spring2019/unix/projects/pct0.1554132771.txt.gz · Last modified: 2019/04/01 15:32 by wedge