Menu

Problem 1 Number Distinct Positive Integer Solutions 25 Points Let N Positive Integer 1 Q43875908

I am completely lost and could use some help!
Problem 1 Number of distinct positive integer solutions (25 points) Let n be a positive integer. For 1 <n< 100, write a MATLAProblem 1 Number of distinct positive integer solutions (25 points) Let n be a positive integer. For 1 <n< 100, write a MATLAB script (single .m file) to compute and plot the number of distinct positive integer solutions (x,y) versus n, for the equation += 1<x,y <5000. 2472 It is obvious from symmetry that if (x*,y) is a solution, then so is (y*, x*). By “distinct solutions”, we mean that if we count (x*,y*) as a solution, then we don’t count (y,c*). For example, when n = 1, there is only one solution: (x, y) = (2,2). When n = 2, there are two distinct solutions: (x, y) = {(3,6), (4,4)}. When n = 3, again there are two distinct solutions: (x, y) = {(4, 12), (6,6)}. When n = 4, there are three distinct solutions: (x,y) = {(5,20),(6, 12), (8,8)}. In your MATLAB script, declare n-vec = 1:100, and let the variable num distinct sol count the number of distinct solutions. Your script should then use plot (n.vec, num.distinct-sol,’-bo’) to generate a figure. Save your .m file as Yourlastname Yourfirstname HW2p1.m, and submit it within the single zipped folder for your HW2 submission. Show transcribed image text Problem 1 Number of distinct positive integer solutions (25 points) Let n be a positive integer. For 1

Expert Answer


Answer to Problem 1 Number of distinct positive integer solutions (25 points) Let n be a positive integer. For 1 …

OR