Here are some questions and answers which the CATAM Helpline, email@example.com, has been asked about particular Part IB projects. Please read these before you submit your own question to the Helpline, in case your question has already been answered. The answers that were given are included below (slightly edited in some cases).
- Should I do this or should I do that?
- Use of inbuilt MATLAB routines
- Error handling
- Program printouts
- I missed the programming classes
- Comments from books
- "Program" versus "routine"
- Special cases
- Multiple programs
- "Self-contained" projects
- Drawing graphs in Excel
- Programs in VB on Excel
- Submission of Excel and similar files
- Presentation of your results
- Style of writing
- Reading data
- "Random" and pseudorandom numbers
- Program structure
- My programs take too long
Q. The Helpline receives a number of emails of the general nature:
I am unsure how to interpret the question XX: does it mean AAA or does it mean BBB?
I am confused at to what is expected for question XX: it seems to suggest that we are expected to AAA whilst at the same time indicating that it expects BBB. Which does it want?
Does question XX require AAA or BBB?
A. The terms ‘require’, ‘expected’ etc. are terms that are too strong in that context. Please see section 1.2 of the introduction to the project manual: you are expected to use your judgement, in the light of your understanding of the question and any discoveries you may have made, on the best way to respond to explain your findings. In making this judgement it will often help to read beyond the particular question that you are attempting: later questions may help to clarify the context.
If you really cannot decide between two, or more approaches, which is the more relevant, appropriate or enlightening then why not do both and compare the results. That may gain you some quality credit.
The Helpline receives a number of emails on this topic.
Please see section 1.4.3 of the Introduction to the Manual: you may use any inbuilt MATLAB routine provided the project does not explicitly ask you to write your own.
However, in the interest of fairness, in the unlikely event you find an inbuilt routine which makes the project trivial in your estimation, we would appreciate your checking with the Helpline at your earliest convenience.
Q. Is it necessary to include error handling code?
A. This is a matter for your judgement. No error handling other than the most basic is required.
Q. Please could you advise whether or not one should include /* comments */ in printouts of programs.
A. It is up to you to decide how to present the various components of each project. However on this point you might like to know that the reason we ask for program printouts, as well as electronic program files, is so that the assessor can decide whether your program actually produced the results you claim. If he can determine this from your printout that will save him having to ask for your file to be run.
Q. Is it possible to arrange to have introductory practical classes for the CATAM projects as I didn't have the chance to take them last year? I have just made the switch to Maths Tripos this year.
A. A booklet on learning to write MATLAB programs is available online; this covers what you would have learnt from the practical classes. You can also go to the “Computer Teaching Room”, which is room GL.04 in the basement of Pavilion G at the CMS, for some practical experience as you work through the book.
Q. How do we credit our sources (are we allowed to use books or websites which describe, for example, search algorithms)?
A. Yes, you are allowed to use such books – indeed, reading any reference works is encouraged – though you should not simply copy huge programs verbatim straight out of a book or website; instead, you can look up an algorithm and write your own program based on that algorithm.
To credit your sources, simply include a sentence in your write-up describing the books or websites that you used.
Q. What about books on the programming language that we have used? I am using C (or Java or Python or Mathematica or Maple) rather than MATLAB and have been teaching myself. Do I have to acknowledge those?
A. You can use any such books you like to learn the language, and there is no need to acknowledge these.
Q. In general for the graphs produced should I try to find comments in books on them or make my own basic comments just on what I can see for myself?
A. You should make your own basic comments, and try to interpret them both mathematically and physically — e.g. if some quantity \(Z\) increases as a function of \( \lambda \), then there's bound to be a physical reason why it would do.
If you find appropriate comments in books then that's great, but there is no particular need to do so. The projects are self-contained.
Q. Is there a difference between being asked to write a program and a routine?
A. There is no practical difference. A "routine" means a procedure or function. In general, if you're asked to "write a program" then you will have to do so from scratch; whereas if you're asked to "write a routine" then you will often just have to write a new procedure or function which can be slotted into an already-existing program. If I were you I'd ignore this and always read "routine" as "program".
Q. When asked to write a program, to what extent should one avoid tailoring one's program to the input that is provided (e.g. not worrying about matrices with a zero entry because the matrices in the project do not have zero entries)?
A. It doesn't matter if a program doesn't deal with pathological cases. For example, if a program is supposed to calculate the inverse of a matrix but falls over when presented with a near-singular case because the numbers overflow in the computer, that doesn't matter. But a program should definitely work with "normal" data; any special cases for which it wouldn't work should be highlighted in the write-up. It isn't sufficient for it to work only for the specific data in the project.
Q. Is it acceptable for the graphs to be produced by constructing the program to write the data to a text file? This is then manually imported into MS Excel, and its graph-drawing capabilities employed.
A. Yes, that's fine.
Q. Does the exported data need to be included in the write-up if it is not specifically asked for?
A. No, it doesn't.
Q. Is it acceptable to have different programs for different parts of the project though they do similar things?
A Yes, you decide the program structure for the projects. Different questions can use stripped down versions of more complicated programs from previous questions.
Q. In the write up do you need a description/flowchart of every program written? In the write up do you want to see all the workings before the final answer is stated? Or is it sufficient if only a selected few steps are given?
A. The introduction in the projects booklet gives clear guidlines on what is required for the project write-ups. Part of the exercise is to determine the format of a formal report. It may help to think about the report as a project for a company, and imagine that you are passing on what you have found to your manager or the client.
Q. For projects which are described as "self-contained", does it mean that no outside knowledge is required and that all the information is given in the project itself, or must extra research be done? I have found that I need to learn more things than those stated.
A. Reading around the subject will be beneficial even when specific courses are stated as being relevant to the project. Specification as "self-contained" means that there is not a particular course that would be relevant and which it will be assumed you have attended.
Q. I've written my programs with VB macros in Excel, and most of the interface is on separate userforms. Do I need to include a guide as to how to use the program? Some of the input mechanisms aren't really self-explanatory, and there are quite a lot of superfulous outputs and commands.
A. You should include with your write-up and with the files which you submit electronically a README containing instructions to allow us to run the code should an examiner want to verify results.
Q. If I adjust a data file by opening it using, say, Word, should I then submit the adjusted file together with my program files electronically?
A. If we supply you with a data file, we can be assumed to know what's in it. Conversely, we will expect your program to have read it correctly and don't need to know how the data got from our website to your program.
Q. I am using an interactive programming system. What do I submit as my 'program'?
Q. I have used Excel to answer a project, and my spreadsheet is over 100MB. What should I submit?
Q. I have used R to answer a project. R is interactive, so there is no program as such. Should I submit the entire transcript of my R session?
A. We want to see the sequence of steps that you execute in order to produce the desired result. In a conventional programming language (e.g. C, Pascal) this is the program file. In an interactive environment (e.g. Excel or R) this is the set of commands or formulae that you type in. If your programming system does not assist you by keeping a transcript of the commands or formulae that you type in, it is your responsibility to keep a transcript yourself, perhaps in a separate text file. This is what you should submit as your 'program'.
e.g. In R or S-Plus, you can write your commands in a text file, then copy and paste them into the R console to execute them. Submit the text file as your 'program'. Tidy up the transcript of the entire R session (deleting uninformative lines or mistakes) and submit this as your 'program output'. (Users of Emacs may find the ESS package helpful for this purpose.)
e.g. In Excel, copy any Visual Basic scripts you have written and paste them into a text file. Submit this as your program. If you have used in-cell formulae only for trivial reasons (e.g. rearranging the data in order to plot it), you do not need to submit the spreadsheet as part of your program. If you have used in-cell formulae for non-trivial calculations (i.e. performing calculations which are directly related to the questions posed in the project), you should tidy up the spreadsheet so that it contains the formulae you have typed in, but not any data which you have generated, and then submit this as an additional part of your 'program'. It is highly unlikely that you have typed in over 100MB worth of formulae, so there is no need to submit a 100MB file; in fact it is unlikely that your files need to be larger than 100kB. (In Excel 2000 for Windows, you can press Ctrl+` to display formulae rather than results. With this, you can print out a bare-bones spreadsheet containing your formulae but not the data.)
As the submission deadline approaches, the Helpline receives a large number of enquiries which amount to
"Could you advise me on how to present my results?"
Often such enquiries are couched in terms of specific problems that the enquirer has met. We have to emphasise that the presentation of your results is an important part of the project and that therefore you have to use your own judgement on this. There is quite a lot of general guidance in the introductions to both the manuals, Part IB and Part II. However we cannot give advice specific to any particular project.
It might help you to think of the project as something you have been asked to investigate for an intelligent but non-expert community, to which you then have to report back the results of your findings. This is the kind of 'transferable skill' that a future employer is likely to assume you have acquired by completing these projects.
The Helpline receives a number of queries about writing style, such as the following.
Q. In our write-ups is it preferable to use "We suppose that", "I suppose that", or "It is supposed that"? I have heard that you are expecting one or other option.
A. This is entirely up to you, provided you make clear what you mean. Assessors may have their own preferences although none will deduct marks for this sort of thing.
Q. Can pseudorandom numbers, those "random" numbers produced by computer code, be treated as random for these projects?
A. You may assume that the pseudorandom numbers generated by a library routine have passed all appropriate statistical tests and thus are as good as random numbers for all practical purposes.
Q. Is it acceptable to have different programs for different parts of the project though they do similar things?
A. Yes, you decide the program structure for the projects. Different questions can use stripped down versions of more complicated programs from previous questions.
Q. My programs take too long. For example, my graph colouring program works for G(XX,p), taking about 15 minutes, but it can't cope with G(YY,p). Similarly, in a Combinatorics project, my program has a noticable pause when working out the largest d for r=100, for any n: am I using values that are too large or do I need to find a more efficient method to calculate d?
A. For these and similar questions, each person's program will hit a brick wall when the time needed suddenly becomes essentially infinite. Where no explicit guidance is given, this is to give you a chance to think about what's going on and use your judgement to select appropriate parameters.
The "wall" will vary between programs. So the sensible thing to do is to gather as much useful data as you can with your program in the time available (say 1 hour runtime). If that seems inadequate to answer the question you may have to try to improve your program.
Last modified: 18 January 2017