MATH36031 Problem solving by computer.Project 1 - deadline 27th October 2023, time 1100hrs. Submission of theproject is via Blackboard.In the tasks required for this project you are asked to use an algorithm which originatesfrom the Vedic system of mathematics developed in India several hundred years ago. Thealgorithm is described in the video clip which is available via Blackboard in the Projectsfolder.

Project Tasks

  1. Write a function myrandi(n) which takes as input a positive integer n and generatesas output a string a1, a2, . . . , an containing the digits of a positive number a1a2 . . . an.Here the ak are random integers 0 ≤ ak ≤ 9.
  2. Watch the video clip to learn about the algorithm used to multiply two numbers. Inthe video clip, the algorithm is described for multiplication of numbers up to 5 digitslong. Your task is to generalise the algorithm to work out the patterns to multiply twon digit numbers. In your report you should describe and explain howthis algorithmworks.
  3. Write a function vedicmultiply to implement this algorithm and such thatc=vedicmultiply(a,b) returns a string c which contains all the digits of the multiplication of a and b (which are input as a string). Also the integers represented bya and b can have a different number of digits. In your report you should explain andprovide details of any testing and validation that you have done.Example c=vedicmultiply(’12’,’34’) returns c=’408’.function [ myans ] = vedicmultiply (a ,b)

     % vedicmultiply computes the product a*b
     % vedcimultiply computes the product of the numbers a*b where
     % a and b are input as strings (to allow for long integers )
     % usage : a= '12345 '; b= '123 ' c= vedicmultiply (a,b)
     % myans is a list containing all the digits of the answer
    
  4. Use your myrandi and vedicmultiply functions to give all thedigits in the multiplication of two randomly-chosen random positive numbersa and b where a is of length30 and b is of length 40. The full output (showing all the digits) should be given inyour report.
  5. Produce a clearly labelled plot showing N, the number of digits in the integer along thex−axis versus T the average time to do 100multiplications using two positive randomintegers each with N digits, on the y−axis. Ideally take N = 10 : 10 : 50.1Additional Information

     ˆ All coding must be done in MATLAB and you are required to submit your MATLABfunctions and m (or mlx)-files via the Blackboard submission box. Project reportsin pdf form only should be submitted via the Turnitin submission box. Rememberthe Turnitin software will automatically scan reports for plagiarism.
     ˆ Please ask if you need help on any commands, or whether there are built-in commands/functions to accomplish certain tasks (especially important if you think you have agood approach to the questions, but do not know the related commands).
     ˆ The default datatype is double (decimal number), and be aware of possible side effectswhen using the numbers as integers. Remember that the same question can be solvedby different approaches, and the same approach can be implemented in different ways.All relevant commands should be covered during the lectures or tutorial exercises,
     but you are free to explore your own. Make critical judgement tochoose the bestapproach/implementation.
     ˆ Aim for efficiency of the code, which is an additional marking criteria, besides thegeneric rubric. Although you only need to record the answer for the given input,make sure that the computational time or memory does not increase significantly withlarger input parameters (these issues will be mentioned constantly during the classdemonstrations).
     ˆ List the complete code of the whole code for solving the tasks at the end of eachquestion, or in an appendix. Make your source codemore readable, by keeping theindentation and stylistic features, and can be copied from the electronic file.
     ˆ The results reported in your report must be reproducible from your codes. Rememberthat markers will be able to run the codes in case of any doubts and any inconsistenciesbetween reported results and actual results from running codes will lead to reportsbeing marked down.
    

Guidelines for the report.

  1. Have a look at the generic rubric and frequently asked questions, which is given onBlackboard in the Projects folder and about how your report will be marked. Therubric also describes the intended learning outcomes about what you are expected toachieve at the end.
  2. Avoid copying (too many) sentences directly from the projectdescription, and try torestate the problem with your own words or examples if possible.
  3. You may use your report in the future as evidences of writtenwork, so take it seriously.
  4. Your target audience is a fellow student on your course: explain the questions so thatthe report can be understood without this project description and your approach canbe implemented in another computer. The report should indicate to the reader howwell you understand the problem and the approach you have taken, thevalidation andother checks that you made to ensure your results are credible. Reports submittedcontaining codes only and with no explanations of how the problem was solved, willresult in a failing mark, even though the codes may work perfectly well and give thecorrect answers.
  5. Balance the explanation of the approach and the comments in thecode. Avoid undercommenting and over-commenting.
  6. Aim for precision and clarity of writing (discussed in Week 5).
  7. Keep your page length not exceeding eight A4 pages, with a font size no smallerthan 11, and page margins no smaller than 2cm. There is no need for a title page fora relative short report like this. If more than 8 pages are submitted only thefirst 8 pages will be marked and the rest of the submission will be ignored.
  8. Since there is no final exam, you are advised to spend at least 15 hours on each project.
  9. The submission box (via Blackboard and Turnitin) for each project will be opentwo weeks before the deadline, and you are encouraged to submit an early draft tosee how Turnitin works on Blackboard. Only your last submission will be marked.Anything submitted after the deadline (except for those with approved extensions)will be subject to late penalties. Any late penalty will be applied by the Teaching andLearning Support Office according to the Undergraduate Student Handbook, and anyextension has to be approved from the Office too (not from the lecturer).
    WX:codehelp

仗义的火腿肠
1 声望0 粉丝