Some advices for IT1005 exams: Last update on: 29 April 2008, 3.50pm (Even more hints >.<) Previously : 23 April 2008, 1.10pm (Make my hints one step clearer) Previously : 22 April 2008, 6.02pm (Add my hints for past paper, since not everyone attended my last class) 1. If MCQ appears again, do it LAST. MCQ in NUS tends to be quite confusing. Most likely the MCQ part is 'just' 20-30 marks, you can always do it (read: gamble) at the last 30 minutes. Concentrate on the essays first (you cannot gamble for this). My trick: -. Eliminate the impossible options first (you are 100% sure with your elimination): -. If you are left with one option good, choose that, and do not look back :) -. If you are left with two or more options do ROULETTE WHEEL selection based on subjective feeling on how probable an option is correct. Read about this technique here: http://en.wikipedia.org/wiki/Fitness_proportionate_selection or here: http://www.edc.ncl.ac.uk/highlight/rhjanuary2007g02.php This is to escape from serious pyschological trap of thinking that your (faulty) assumptions are correct. My answers for past IT1005 paper (AY 2006/07): 1. Look at lecture note 2! 2. Remember BODMAS, you can quickly filter some options just by looking at the final operations done in each option. Anyway, you can always type in this question in Matlab and get the correct answer without asking me. 3. Do this one first, before no 2. 4. Simulate this by hand, slowly... it is not that hard... 5. Okay, this requires some careful insights, let me share what are the two errors first: this bubble sort is initially try to do ascending sort (we want the other way around), then the way it do swapping does not seem correct. 6. B, shown in class. Look at the notes in 'fmincon' lecture, you will see a note about 'backslash operator' there. 7. If you look at Lab 8 q2, you will answer D, because fminsearch is fmincon without any constraints... but the best answer is not D, do google search on the suspicious option and see how that function works. 8. Ok, try f(x) = x^2-4 and x = 0, not all solvers will give you +2, some will give you the other root. 9. Look at ODE lecture 3 about second order ODE. 10. Matlab is powerful :D The answers are not uploaded, so those outside my classes can try them first. How to check whether your answer is correct or not? Ask one of my students (2B/3B/4B/5A/7A) who attended my last session on week 13! Some of them already verified/cross checked their answers with mine. Or, email me those 10 A/B/C/D/E, I will tell whether you are right or wrong. 2. The essay questions tend to be a Math/Physics/Chemical Engineering principle but modeled as computer program. Thus, you need to: -. Revise your A-level knowledge, if necessary. -. Develop your ability to write Matlab code WITHOUT even running Matlab! Serious, this is not as easy as you think! -. Write comments LATER, give enough white space between your answers. You can add comments if you still have spare time before the exam is over! -. Write down assumptions, if you think it will help your explanation of if the question seems ambigious. -. Perhaps bring two or three different pen (black, blue, red, green). one color for codes, another color for comments, another color for ... I think your grader will like it :) My hints (not answers) as discussed in class for past IT1005 paper (AY 2006/07): 11. a. straightforward, rewrite the equations Perhaps, write it in Mathematical notations, otherwise your answer for this will be too similar with 11.d. 11. b. state your assumptions, why you choose to ask those inputs e.g. you should realize that if you use the same heater, two things will remain CONSTANT... also, check what is '15 minutes' means to you... perhaps not everything on the RHS of 11.a should be asked? or are they? 11. c. real bonus do something with 11.b. and then with 11.a :D 11. d. rewrite 11.a. in Matlab version as function! however, it will depends on your assumptions in 11.b... perhaps not every variable values are from user inputs! 11. e. do 11.c. in Matlab version remember to reuse the function in 11.d! remember that not everything should be asked (see 11.b. again). 12. a. free body diagram: negative 'rolling' friction, weight <-> cancelled by 'normal force'! If you think you need to look at the actual Physics equation, see: http://webphysics.davidson.edu/faculty/dmb/PY430/Friction/rolling.html 12. b. Friction = Cd * N (normal force) = Cd * m * g..., not just Friction = Cd * m ... not everyone will be able to remember this actual Friction formula as it is not clearly stated... if you end up with Friction = Cd * m (according to your interpretation of the question), most likely you will still get good marks as this is not a Physics test. anyway, since g (gravity) is CONSTANT, you can always combine g into the value of Cd, so, we can stick to the original formula Friction = Cd * m :), do not worry about this. so, a = F/m, a = ... calculate this yourself. check: the sign of a should be ... 12. c. IVP, IVs are given, v_out(1) = v_initial, s_out(1) = 0! you can use explicit/Euler method, like spidey fall, or car up in an incline (Lab 6 q2) or you can use ODE solver! but remember that velocity CANNOT be negative! if you use Euler method, a simple 'if check' is enough to handle this negative velocity issue. if you use ODE solver with ODE function handle, you will need to use 'if check' too, but here it is a little bit more complex :) 12. d. straightforward you can use loop, scan the first occurence of s_out(index) that is >= x, then, report the associated v_out(index)! if you are a Matlab geek, you may just want to use 'find'! but remember the note in 12.c. if b1 stops before hitting b2, there is no answer! 12. e. bonus, rewrite the equations and then write it as Matlab function! 12. f. combine everything, you need to reuse the functions created in 12.c, d, and e! remember the notes in 12.c and 12.d... b1 does NOT always hit b2! one more note: to get vn, what values do you set for v1 and v2? is it v1 = 10, v2 = 0, v1 = 10, v2 = ??, or what? serious, check your answer again! 13. a. set of NON-LINEAR equations with three unknowns, find the roots :) think: what are the root finding tools for SET of NON-LINEAR equations in Matlab? what should be the proper initial guess? CA is constrained by the first equation, which is a quadratic equation. we can guess from there! CB is constrained by CA and the second equation, we can also guess CB! T is too complex, let use the solver to get T :) 13. b. similar to Lab 8 q1.b, really... study that Lab question again if you are unsure what to do for this question! 13. c. similar with your term assignment q2/3: IVP! The IVs comes from 13a! CAS, CBS, and TS You need to highlight that TC is now set to TC1! This is an important part of the question, otherwise I know what your plot of CA, CB, and T over time without even running the ODE solver... It will be a STRAIGHT LINE, as CAS, CBS, and TS are steady state IVs (remember your term assignment question 2D and 2E?) Finally, you can plot the resulting ODE solver output in a graph of CA, CB, T over time... Remember, you need to try writing down the answers for q11, q12, q13 in a PAPER first! Then, if you find a lot of errors when you typed those answers in Matlab, you need to work harder! All the best for your final exam...