We have discussed the idea before that there are many approaches to problem-solving, and one of the things that good problem-solvers must do, is to identify strategies for when to use one approach over another. Some of the approaches we have identified include:…One approach that we will look at today is inspired by the black-box philosophy of PS: that given the input and understanding what form the output should take, the task of solving a problem comes down to processing that input to become output. All you need are strategies and tools to set up the processing…and that process generally uses one or more of these methods.Learning to express oneself in terms of an algorithmic solution, requires us to use specific “language” of logic – both in terms of setting up the problem and using the language of the processing environment. Today we will experiment with an IPO tool to begin familiarizing ourselves with the idea of algorithmic approaches and we hope to even apply this a little (and begin learning a new language) in the Ruby environment.
So here is what I propose for an agenda…OK?
HANDOUT: IPO sheet…use a dimensional analysis exercise as a sample: how many tsp in a quart?IPO is a form of system analysis…always start a programmatic problem by doing the analysis or else you will waste time later as you near a solution. Having a clear understanding where you are going and how will almost always benefit you in time, effort and frustration.Problem Statement – Rephrase in your own words (this may be the most important step as per dimensional analysis)Output – what is the form of the output? What is the measure, what level of accuracy, what format: report/table/list?Input – not all info is useful inputNotation – set up variables, symbols, scopeDiagram – Flowchart? Table? Image? Characters?Approach – mathematical problem? Deduction? Induction? Substitutions? Rules/laws? Assumptions?Solution & Check – what would prove the solution?
Programmatic is methodic – take it one step at a time…DO NOT TRY TO SOLVE THIS PROBLEM (until you have done the analysis).
Any problem stating the problem? Let’s hear your statements. Feedback on that?Any obstacles in creating the statement or filling in any other information? How many wanted to get right at the solution rather than setting up the analysis?What innovations did you consider? What were your approaches? Anyone have any other approaches?…
Ruby is an open source programming environment and interpreted language - not compiled - requires an interpreter (ruby.exe)Ruby on Flash – downloading and unpackingSetting Path - getting batch files from my site - running the batch filesTesting the installation with command promptDownloading and running RDE (setting the path again?)
Integers for all whole numbers – negative and positiveFloats for decimal valuesString for most things – and default for RubyFire up RDE and do a quick programputs “Hello, World” or puts ‘hello,world!’ (form of quotes is important, but not of interest right now)SAVE the file as an .rb in your rubygems folder (on the flash drive root preferably)
So here is what we covered in this lesson…Next lesson…
The assignment due for next class is…
Class 4 IPO and Intro to Ruby
IPO and Intro to Ruby<br />Class 4 – Programmatic Problem-Solving<br />
Introduction<br />Problem Solving Approaches<br />Mathematic<br />Algorithmic<br />Heuristic<br />IPO: The black box<br />The Language of Logic<br />
Agenda<br />Warm-up: Brain Teasers<br />Review Assignment I /Complete Week 3 <br />IPO and Problem Solving <br />Installing and Running Ruby<br />An introduction to Ruby Programming <br />Variables and Data Types <br />Methods: Puts and Gets <br />String Methods<br />Assignment II: Binary & Hexadecimal<br />
IPO Problem Solving - Practice<br />Exercise: Confusion at the Restaurant<br />What is the problem?<br />What would the output look like?<br />What inputs do you have?<br />Process & Approach?<br />Check?<br />
IPO Problem Solving - Practice<br />Exercise: Confusion at the Restaurant<br />Debrief<br />Issues with problem?<br />Obstacles?<br />Solution before Process?<br />Innovation?<br />Other points?<br />
Introducing Ruby<br />What is Ruby and how does it differ from other languages?<br />Where do you get Ruby?<br />How do you install it?<br />Unique college lab setups<br />Testing installation<br />C:> ruby –v<br />Ruby development environments- RDE, etc.<br />