{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":44684,"title":"Basic Monte Carlo Simulation","description":"Input is a matrix including service time and probability of service time. Another input is a random number. Function should transform the random number to service time.\r\n\r\nFirst column of the input1 is service time and second column is probability of that service time.\r\n  \r\n  input1 = [\r\n  2 0.4\r\n  5 0.4\r\n  9 0.2]\r\n\r\nWe can calculate cumulative probability and Random Number Assignment with this input,\r\n\r\n   Service                      Cumulative       Random Number\r\n   Time        Probability      Probability      Assignment\r\n     2             0.4              0.4          0.000 - 0.400\r\n     5             0.4              0.8          0.400 - 0.800\r\n     9             0.2              1.0          0.800 - 1.000\r\n\r\ninput2 is a random number between 0 and 1 such as;\r\n\r\n   input2 = 0.125\r\n\r\nRandom number can be transformed to service time with the table. Random number (input2) is between first line of random number assignment\r\n\r\n  0.000 \u003c Random number \u003c= 0.400\r\n\r\nas a result\r\n\r\n   serviceTime = 2\r\n\r\n*Note:* You can assume that the sum of the probabilities will be equal to one. ","description_html":"\u003cp\u003eInput is a matrix including service time and probability of service time. Another input is a random number. Function should transform the random number to service time.\u003c/p\u003e\u003cp\u003eFirst column of the input1 is service time and second column is probability of that service time.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003einput1 = [\r\n2 0.4\r\n5 0.4\r\n9 0.2]\r\n\u003c/pre\u003e\u003cp\u003eWe can calculate cumulative probability and Random Number Assignment with this input,\u003c/p\u003e\u003cpre\u003e   Service                      Cumulative       Random Number\r\n   Time        Probability      Probability      Assignment\r\n     2             0.4              0.4          0.000 - 0.400\r\n     5             0.4              0.8          0.400 - 0.800\r\n     9             0.2              1.0          0.800 - 1.000\u003c/pre\u003e\u003cp\u003einput2 is a random number between 0 and 1 such as;\u003c/p\u003e\u003cpre\u003e   input2 = 0.125\u003c/pre\u003e\u003cp\u003eRandom number can be transformed to service time with the table. Random number (input2) is between first line of random number assignment\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e0.000 \u0026lt; Random number \u0026lt;= 0.400\r\n\u003c/pre\u003e\u003cp\u003eas a result\u003c/p\u003e\u003cpre\u003e   serviceTime = 2\u003c/pre\u003e\u003cp\u003e\u003cb\u003eNote:\u003c/b\u003e You can assume that the sum of the probabilities will be equal to one.\u003c/p\u003e","function_template":"function serviceTime = rand2ServiceTime(input1,input2)\r\n \r\nend","test_suite":"%%\r\ninput1 = [\r\n2 0.4\r\n5 0.4\r\n9 0.2];\r\ninput2 = 0.125;\r\nserviceTimeCorrect = 2;\r\nassert(isequal(rand2ServiceTime(input1,input2),serviceTimeCorrect))\r\n\r\n\r\n%% on the border\r\ninput1 = [\r\n2 0.4\r\n5 0.4\r\n9 0.2];\r\ninput2 = 0.4;\r\nserviceTimeCorrect = 2;\r\nassert(isequal(rand2ServiceTime(input1,input2),serviceTimeCorrect))\r\n\r\n%%\r\ninput1 = [\r\n2 0.4\r\n5 0.4\r\n9 0.2];\r\ninput2 = 0.474;\r\nserviceTimeCorrect = 5;\r\nassert(isequal(rand2ServiceTime(input1,input2),serviceTimeCorrect))\r\n\r\n\r\n%%\r\ninput1 = [\r\n2 0.4\r\n5 0.4\r\n9 0.2];\r\ninput2 = 0.85;\r\nserviceTimeCorrect = 9;\r\nassert(isequal(rand2ServiceTime(input1,input2),serviceTimeCorrect))\r\n\r\n%%\r\ninput1 = [\r\n(45:-1:36)' repmat(0.1,10,1)];\r\ninput2 = 0.958;\r\nserviceTimeCorrect = 36;\r\nassert(isequal(rand2ServiceTime(input1,input2),serviceTimeCorrect))\r\n\r\n\r\n\r\n%% Generalize for Fair coin toss  1:Heads, 2:Tails\r\ninput1 = [\r\n1 0.5\r\n2 0.5];\r\ninput2 = 0.5;\r\nserviceTimeCorrect = 1;\r\nassert(isequal(rand2ServiceTime(input1,input2),serviceTimeCorrect))\r\n\r\n\r\n%% Generalize for Fair coin toss  1:Heads, 2:Tails\r\ninput1 = [\r\n1 0.5\r\n2 0.5];\r\ninput2 = 0.6;\r\nserviceTimeCorrect = 2;\r\nassert(isequal(rand2ServiceTime(input1,input2),serviceTimeCorrect))\r\n\r\n\r\n%%\r\ninput1 = [\r\n2 0.2\r\n3 0.2\r\n4 0.2\r\n5 0.2\r\n6 0.2];\r\nserviceTimeCorrect = 2;\r\nfor idx = 0.01:0.01:0.2\r\n    assert(isequal(rand2ServiceTime(input1,idx),serviceTimeCorrect))\r\n    assert(isequal(rand2ServiceTime(input1,idx+0.2),serviceTimeCorrect+1))\r\n    assert(isequal(rand2ServiceTime(input1,idx+0.4),serviceTimeCorrect+2))\r\n    assert(isequal(rand2ServiceTime(input1,idx+0.6),serviceTimeCorrect+3))\r\n    assert(isequal(rand2ServiceTime(input1,idx+0.8),serviceTimeCorrect+4))\r\nend","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":8703,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":27,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-06-10T20:37:53.000Z","updated_at":"2026-03-11T08:49:16.000Z","published_at":"2018-06-10T21:20:34.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInput is a matrix including service time and probability of service time. Another input is a random number. Function should transform the random number to service time.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFirst column of the input1 is service time and second column is probability of that service time.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[input1 = [\\n2 0.4\\n5 0.4\\n9 0.2]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe can calculate cumulative probability and Random Number Assignment with this input,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   Service                      Cumulative       Random Number\\n   Time        Probability      Probability      Assignment\\n     2             0.4              0.4          0.000 - 0.400\\n     5             0.4              0.8          0.400 - 0.800\\n     9             0.2              1.0          0.800 - 1.000]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003einput2 is a random number between 0 and 1 such as;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   input2 = 0.125]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRandom number can be transformed to service time with the table. Random number (input2) is between first line of random number assignment\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[0.000 \u003c Random number \u003c= 0.400]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eas a result\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   serviceTime = 2]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eNote:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e You can assume that the sum of the probabilities will be equal to one.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":2356,"title":"Simulating the selection of a state with given probabilities","description":"Lets say we have 3 different states [1,2,3] with the probabilities of occurrences of each state is given as [0.5 0.2 0.3]. Which means 50% state 1 will be selected among others. Generate randomly selected states with the probabilities given\r\n\r\nOutput array will be consisting of state numbers based on the probabilities given as input. \r\n\r\nExample:\r\n(Quick tip: The higher simulation sampling sizes the more robust results)","description_html":"\u003cp\u003eLets say we have 3 different states [1,2,3] with the probabilities of occurrences of each state is given as [0.5 0.2 0.3]. Which means 50% state 1 will be selected among others. Generate randomly selected states with the probabilities given\u003c/p\u003e\u003cp\u003eOutput array will be consisting of state numbers based on the probabilities given as input.\u003c/p\u003e\u003cp\u003eExample:\r\n(Quick tip: The higher simulation sampling sizes the more robust results)\u003c/p\u003e","function_template":"function states = select_state(probs)\r\n  states = 0;\r\nend","test_suite":"%%\r\nprobs = rand;\r\nwhile sum(probs) \u003c 1\r\n    a = rand;\r\n    if a + sum(probs) \u003e 1\r\n        probs = [probs 1-sum(probs)];\r\n        break;\r\n    else\r\n        probs = [probs a];\r\n    end\r\nend\r\n\r\nstates = 1:length(probs);\r\nfor i = 1:100\r\n    y{i,1} = select_state(probs);\r\n    [nelements,centers] = hist(y{i},states);\r\n    probs_result{i} = nelements/length(y{i});\r\n    error(i,1) = sum(abs(probs-probs_result{i}));\r\nend\r\n\r\nassert(mean(error) \u003c= 0.05 \u0026 mean(error) \u003e 0);","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":27005,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":29,"test_suite_updated_at":"2014-06-11T14:25:30.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-06-11T00:57:51.000Z","updated_at":"2025-11-21T18:44:38.000Z","published_at":"2014-06-11T01:00:06.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLets say we have 3 different states [1,2,3] with the probabilities of occurrences of each state is given as [0.5 0.2 0.3]. Which means 50% state 1 will be selected among others. Generate randomly selected states with the probabilities given\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOutput array will be consisting of state numbers based on the probabilities given as input.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample: (Quick tip: The higher simulation sampling sizes the more robust results)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44694,"title":"Monte Carlo integration:  area of a polygon","description":"The area of a polygon (or any plane shape) can be evaluated by \u003chttps://www.mathworks.com/matlabcentral/cody/problems/179 Monte Carlo integration\u003e.  The process involves 'random' sampling of (x,y) points in the xy plane, and testing whether they fall inside or outside the shape.  That is illustrated schematically below for a circle.  \r\n\r\n\u003c\u003chttps://upload.wikimedia.org/wikipedia/commons/thumb/2/20/MonteCarloIntegrationCircle.svg/247px-MonteCarloIntegrationCircle.svg.png\u003e\u003e\r\n\r\n^\r\n\r\n*Steps:*\r\n\r\n# Define a 2D region within which to sample points.  In the present problem you must choose the rectangular box (aligned to the axes) that bounds the specified polygon.  \r\n# By a 'random' process generate coordinates of a point within the bounding box.  In the present problem a basic scheme using the uniform pseudorandom distribution available in MATLAB must be employed.  _Other schemes in use include quasi-random sampling (for greater uniformity of coverage) and stratified sampling (with more attention near the edges of the polygon)._\r\n# Determine \u003chttps://www.mathworks.com/matlabcentral/cody/problems/198 whether the sampled point is inside or outside the polygon\u003e.  _Due to working in double precision, it is extremely unlikely to sample a point falling exactly on the edge of the polygon, and consequently if it does happen it doesn't really matter whether it's counted as inside or outside or null._  \r\n# Repeat steps 2–3 |N| times.  \r\n# Based upon the proportion of sampled points falling within the polygon, report the approximate area of the polygon.  \r\n\r\nInputs to your function will be |N|, the number of points to sample, and |polygonX| \u0026 |polygonY|, which together constitute \u003chttps://www.mathworks.com/matlabcentral/cody/problems/194 an ordered list of polygon vertices\u003e.  |N| will always be a positive integer.  |polygonX| \u0026 |polygonY| will always describe a single, continuous outline;  however, the polygon may be self-intersecting.  \r\n\r\nFor polygons that are self-intersecting, you must find the area of the enclosed point set. In the case of the cross-quadrilateral, it is treated as two simple triangles (cf. three triangles in the first figure below), and the clockwise/counterclockwise ordering of points is irrelevant.  A self-intersecting pentagram (left \u0026 middle of the second figure below) will therefore have the same area as a concave decagon (right).\r\n\r\n\u003c\u003chttps://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Complex_polygon.svg/288px-Complex_polygon.svg.png\u003e\u003e\r\n\r\n\u003c\u003chttps://upload.wikimedia.org/wikipedia/commons/thumb/8/80/Pentagram_interpretations.svg/320px-Pentagram_interpretations.svg.png\u003e\u003e\r\n\r\n^\r\n\r\nEXAMPLE\r\n\r\n % Input\r\n N = 1000\r\n polygonX = [1 0 -1  0]\r\n polygonY = [0 1  0 -1]\r\n % Output\r\n A = 2.036\r\n\r\nExplanation:  the above polygon is a square of side-length √2 centred on the origin, but rotated by 45°.  The exact area is hence 2.  As the value of |N| is moderate, the estimate by Monte Carlo integration is moderately accurate (an error of 0.036 in this example, corresponding to 509 of the 1000 sampled points falling within the polygon).  \r\nOf course, if the code were run again then a slightly different value of |A| would probably be returned, such as |A|=1.992 (corresponding to 498 of the 1000 sampled points falling within the polygon), due to the random qualities of the technique.  ","description_html":"\u003cp\u003eThe area of a polygon (or any plane shape) can be evaluated by \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/179\"\u003eMonte Carlo integration\u003c/a\u003e.  The process involves 'random' sampling of (x,y) points in the xy plane, and testing whether they fall inside or outside the shape.  That is illustrated schematically below for a circle.\u003c/p\u003e\u003cimg src = \"https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/MonteCarloIntegrationCircle.svg/247px-MonteCarloIntegrationCircle.svg.png\"\u003e\u003cp\u003e^\u003c/p\u003e\u003cp\u003e\u003cb\u003eSteps:\u003c/b\u003e\u003c/p\u003e\u003col\u003e\u003cli\u003eDefine a 2D region within which to sample points.  In the present problem you must choose the rectangular box (aligned to the axes) that bounds the specified polygon.\u003c/li\u003e\u003cli\u003eBy a 'random' process generate coordinates of a point within the bounding box.  In the present problem a basic scheme using the uniform pseudorandom distribution available in MATLAB must be employed.  \u003ci\u003eOther schemes in use include quasi-random sampling (for greater uniformity of coverage) and stratified sampling (with more attention near the edges of the polygon).\u003c/i\u003e\u003c/li\u003e\u003cli\u003eDetermine \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/198\"\u003ewhether the sampled point is inside or outside the polygon\u003c/a\u003e.  \u003ci\u003eDue to working in double precision, it is extremely unlikely to sample a point falling exactly on the edge of the polygon, and consequently if it does happen it doesn't really matter whether it's counted as inside or outside or null.\u003c/i\u003e\u003c/li\u003e\u003cli\u003eRepeat steps 2–3 \u003ctt\u003eN\u003c/tt\u003e times.\u003c/li\u003e\u003cli\u003eBased upon the proportion of sampled points falling within the polygon, report the approximate area of the polygon.\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eInputs to your function will be \u003ctt\u003eN\u003c/tt\u003e, the number of points to sample, and \u003ctt\u003epolygonX\u003c/tt\u003e \u0026 \u003ctt\u003epolygonY\u003c/tt\u003e, which together constitute \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/194\"\u003ean ordered list of polygon vertices\u003c/a\u003e.  \u003ctt\u003eN\u003c/tt\u003e will always be a positive integer.  \u003ctt\u003epolygonX\u003c/tt\u003e \u0026 \u003ctt\u003epolygonY\u003c/tt\u003e will always describe a single, continuous outline;  however, the polygon may be self-intersecting.\u003c/p\u003e\u003cp\u003eFor polygons that are self-intersecting, you must find the area of the enclosed point set. In the case of the cross-quadrilateral, it is treated as two simple triangles (cf. three triangles in the first figure below), and the clockwise/counterclockwise ordering of points is irrelevant.  A self-intersecting pentagram (left \u0026 middle of the second figure below) will therefore have the same area as a concave decagon (right).\u003c/p\u003e\u003cimg src = \"https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Complex_polygon.svg/288px-Complex_polygon.svg.png\"\u003e\u003cimg src = \"https://upload.wikimedia.org/wikipedia/commons/thumb/8/80/Pentagram_interpretations.svg/320px-Pentagram_interpretations.svg.png\"\u003e\u003cp\u003e^\u003c/p\u003e\u003cp\u003eEXAMPLE\u003c/p\u003e\u003cpre\u003e % Input\r\n N = 1000\r\n polygonX = [1 0 -1  0]\r\n polygonY = [0 1  0 -1]\r\n % Output\r\n A = 2.036\u003c/pre\u003e\u003cp\u003eExplanation:  the above polygon is a square of side-length √2 centred on the origin, but rotated by 45°.  The exact area is hence 2.  As the value of \u003ctt\u003eN\u003c/tt\u003e is moderate, the estimate by Monte Carlo integration is moderately accurate (an error of 0.036 in this example, corresponding to 509 of the 1000 sampled points falling within the polygon).  \r\nOf course, if the code were run again then a slightly different value of \u003ctt\u003eA\u003c/tt\u003e would probably be returned, such as \u003ctt\u003eA\u003c/tt\u003e=1.992 (corresponding to 498 of the 1000 sampled points falling within the polygon), due to the random qualities of the technique.\u003c/p\u003e","function_template":"function A = monteCarloArea(N, polygonX, polygonY)\r\n    % Fun starts here\r\nend\r\n\r\n\r\n% Note:  the Test Suite has been designed to account for variability in outputs. \r\n%        Nevertheless, it is possible that on rare occasions a valid submission \r\n%        might fail the Test Suite in one instance.  \r\n%        If your submission has narrowly failed only one of the test cases, \r\n%        then please try resubmitting it, in case it was just due to 'bad luck'.  ","test_suite":"%% No silly stuff\r\n% This Test Suite can be updated if inappropriate 'hacks' are discovered \r\n% in any submitted solutions, so your submission's status may therefore change over time.  \r\n\r\n% BEGIN EDIT (2019-06-29).  \r\n% Ensure only builtin functions will be called.  \r\n! rm -v fileread.m\r\n! rm -v assert.m\r\n% END OF EDIT (2019-06-29).  \r\n\r\nassessFunctionAbsence({'regexp', 'regexpi', 'str2num'}, 'FileName','monteCarloArea.m')\r\n\r\nRE = regexp(fileread('monteCarloArea.m'), '\\w+', 'match');\r\ntabooWords = {'ans', 'area', 'polyarea'};\r\ntestResult = cellfun( @(z) ismember(z, tabooWords), RE );\r\nmsg = ['Please do not do that in your code!' char([10 13]) ...\r\n    'Found: ' strjoin(RE(testResult)) '.' char([10 13]) ...\r\n    'Banned word.' char([10 13])];\r\nassert(~any( testResult ), msg)\r\n\r\n\r\n%% Unit square, in first quadrant\r\nNvec = 1 : 7 : 200;\r\npolygonX = [0 1 1 0];\r\npolygonY = [0 0 1 1];\r\nareaVec = arrayfun(@(N) monteCarloArea(N, polygonX, polygonY), Nvec);\r\narea_correct = 1;\r\nassert( all(areaVec==area_correct) )\r\n\r\n%% 3×3 square, offset from origin, in all four quadrants\r\nNvec = 1 : 19 : 500;\r\npolygonX = [ 1 1 -2 -2];\r\npolygonY = [-1 2  2 -1];\r\nareaVec = arrayfun(@(N) monteCarloArea(N, polygonX, polygonY), Nvec);\r\narea_correct = 9;\r\nassert( all(areaVec==area_correct) )\r\n\r\n\r\n%% Diamond, centred on origin, in all four quadrants:  small N (1)\r\nN = 1;\r\npolygonX = [1 0 -1  0];\r\npolygonY = [0 1  0 -1];\r\narea_valid = [0 4];\r\nareaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:1000);\r\nassert( all( ismember(areaVec, area_valid) ) , 'Invalid areas reported' )\r\nassert( all( ismember(area_valid, areaVec) ) , 'Not all valid areas accessible in your sampling scheme')\r\n\r\n%% Diamond, centred on origin, in all four quadrants:  small N (2)\r\nN = 2;\r\npolygonX = [1 0 -1  0];\r\npolygonY = [0 1  0 -1];\r\narea_valid = [0 2 4];\r\nareaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:1000);\r\nassert( all( ismember(areaVec, area_valid) ) , 'Invalid areas reported' )\r\nassert( all( ismember(area_valid, areaVec) ) , 'Not all valid areas accessible in your sampling scheme')\r\n\r\n%% Diamond, centred on origin, in all four quadrants:  small N (3)\r\nN = 4;\r\npolygonX = [1 0 -1  0];\r\npolygonY = [0 1  0 -1];\r\narea_valid = [0:4];\r\nareaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:1000);\r\nassert( all( ismember(areaVec, area_valid) ) , 'Invalid areas reported' )\r\nassert( all( ismember(area_valid, areaVec) ) , 'Not all valid areas accessible in your sampling scheme')\r\n\r\n%% Diamond, centred on origin, in all four quadrants:  moderate N (1)\r\nN = 100;\r\npolygonX = [1 0 -1  0];\r\npolygonY = [0 1  0 -1];\r\narea_exact = 2;\r\nfor j = 1 : 3,\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 4 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    assert( worstErrorFraction \u003e 0.05 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003c 0.40 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n%% Diamond, centred on origin, in all four quadrants:  moderate N (2)\r\nN = 1000;\r\npolygonX = [1 0 -1  0];\r\npolygonY = [0 1  0 -1];\r\narea_exact = 2;\r\nfor j = 1 : 3,\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 5 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    assert( worstErrorFraction \u003e 0.02 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003c 0.15 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n%% Diamond, centred on origin, in all four quadrants:  moderate N (3)\r\nN = 10000;\r\npolygonX = [1 0 -1  0];\r\npolygonY = [0 1  0 -1];\r\narea_exact = 2;\r\nfor j = 1 : 3,\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 6 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    assert( worstErrorFraction \u003e 0.004 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003c 0.049 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n%% Diamond, centred on origin, in all four quadrants:  large N\r\nN = 100000;\r\npolygonX = [1 0 -1  0];\r\npolygonY = [0 1  0 -1];\r\narea_exact = 2;\r\nfor j = 1 : 3,\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 7 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    assert( worstErrorFraction \u003e 0.0016 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003c 0.016 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n\r\n%% Cross-quadrilateral, centred on origin, in all four quadrants:  moderate N (1)\r\nN = 100;\r\npolygonX = [ 1 -1  1 -1];\r\npolygonY = [-1  1  1 -1];\r\narea_exact = 2;\r\n\r\nfor j = 1 : 3,\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 4 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    assert( worstErrorFraction \u003e 0.05 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003c 0.40 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n%% Cross-quadrilateral, centred on origin, in all four quadrants:  moderate N (2)\r\nN = 10000;\r\nfor j = 1 : 10,\r\n    rVec = 100 * rand(2);\r\n    polygonX = [ 1 -1  1 -1] * rVec(1,1) + rVec(1,2);\r\n    polygonY = [-1  1  1 -1] * rVec(2,1) + rVec(2,2);\r\n    area_exact = 2 * rVec(1,1) * rVec(2,1);\r\n\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 6 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    assert( worstErrorFraction \u003e 0.004 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003c 0.049 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n\r\n%% 12-cornered polygon of unit 'circumradius' centred on origin:  moderate N\r\nN = 1000;\r\npoints = 12;\r\ncentre = [0 0];\r\ncircumradius = 1;\r\npolygonX = circumradius * cos(2 * pi * [0:points-1]/points) + centre(1);\r\npolygonY = circumradius * sin(2 * pi * [0:points-1]/points) + centre(2);\r\narea_exact = polyarea(polygonX, polygonY);\r\n\r\nfor j = 1 : 3,\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 5 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    %assert( worstErrorFraction \u003e 0.02 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003e 0.01 , 'Implausibly accurate' )\r\n    %assert( worstErrorFraction \u003c 0.15 , 'Implausibly inaccurate' )\r\n    assert( worstErrorFraction \u003c 0.08 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n%% P-cornered polygon of arbitrary 'circumradius', with centre offset from  the origin:  moderate N\r\nN = 1000;\r\nfor j = 1 : 10,\r\n    points = randi([5 100]);\r\n    centre = randi([2 100], [1 2]);\r\n    circumradius = randi([2 100]);\r\n    r = rand();\r\n    polygonX = circumradius * cos(2 * pi * (r+[0:points-1])/points) + centre(1);\r\n    polygonY = circumradius * sin(2 * pi * (r+[0:points-1])/points) + centre(2);\r\n    area_exact = polyarea(polygonX, polygonY);\r\n\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 5 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    %assert( worstErrorFraction \u003e 0.02 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003e 0.01 , 'Implausibly accurate' )\r\n    %assert( worstErrorFraction \u003c 0.15 , 'Implausibly inaccurate' )\r\n    assert( worstErrorFraction \u003c 0.08 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n\r\n%% 5-pointed star of unit 'circumradius' centred on origin:  moderate N\r\nN = 1000;\r\npoints = 5;\r\ncentre = [0 0];\r\ncircumradius = 1;\r\nx = circumradius * cos(2 * pi * [0:points-1]/points) + centre(1);\r\ny = circumradius * sin(2 * pi * [0:points-1]/points) + centre(2);\r\npolygonX = x([1:2:end, 2:2:end]);\r\npolygonY = y([1:2:end, 2:2:end]);\r\narea_exact = sqrt(650 - 290* sqrt(5))/4  * ( circumradius / sqrt((5 - sqrt(5))/10) )^2;\r\n% http://mathworld.wolfram.com/Pentagram.html\r\n\r\nfor j = 1 : 3,\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 5 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    %assert( worstErrorFraction \u003e 0.02 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003e 0.03 , 'Implausibly accurate' )\r\n    %assert( worstErrorFraction \u003c 0.15 , 'Implausibly inaccurate' )\r\n    assert( worstErrorFraction \u003c 0.25 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n%% 5-pointed star of arbitrary 'circumradius', with centre offset from  the origin:  moderate N\r\nN = 1000;\r\npoints = 5;\r\nfor j = 1 : 10,\r\n    centre = randi([2 100], [1 2]);\r\n    circumradius = randi([2 100]);\r\n    r = rand();\r\n    x = circumradius * cos(2 * pi * (r+[0:points-1])/points) + centre(1);\r\n    y = circumradius * sin(2 * pi * (r+[0:points-1])/points) + centre(2);\r\n    polygonX = x([1:2:end, 2:2:end]);\r\n    polygonY = y([1:2:end, 2:2:end]);\r\n    area_exact = sqrt(650 - 290* sqrt(5))/4  * ( circumradius / sqrt((5 - sqrt(5))/10) )^2;\r\n    % http://mathworld.wolfram.com/Pentagram.html\r\n\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 5 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    %assert( worstErrorFraction \u003e 0.02 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003e 0.03 , 'Implausibly accurate' )\r\n    %assert( worstErrorFraction \u003c 0.15 , 'Implausibly inaccurate' )\r\n    assert( worstErrorFraction \u003c 0.25 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n\r\n%% P-pointed star of arbitrary 'circumradius', with centre offset from  the origin:  moderate N\r\nN = 1000;\r\nfor j = 1 : 20,\r\n    points = 3 * randi([3 10]) - 1;\r\n    centre = randi([2 100], [1 2]);\r\n    circumradius = randi([2 30]);\r\n    r = rand();\r\n    x = circumradius * cos(2 * pi * (r+[0:points-1])/points) + centre(1);\r\n    y = circumradius * sin(2 * pi * (r+[0:points-1])/points) + centre(2);\r\n    polygonX = x([1:3:end, 2:3:end, 3:3:end]);\r\n    polygonY = y([1:3:end, 2:3:end, 3:3:end]);\r\n    \r\n    area_polyarea = polyarea(polygonX, polygonY);                % Incorrect value\r\n    warning('off', 'MATLAB:polyshape:repairedBySimplify')\r\n    area_polyshapeArea1 = area( polyshape(polygonX, polygonY) ); % Incorrect value\r\n    area_polyshapeArea2 = area( polyshape(polygonX, polygonY, 'Simplify',false) );  % Incorrect value\r\n    \r\n    % REFERENCE:  http://web.sonoma.edu/users/w/wilsonst/papers/stars/a-p/default.html\r\n    % Here: a {points/3} star\r\n    k = 3;\r\n    sideLength = circumradius * sind(180/points) * secd(180*(k-1)/points);\r\n    apothem = circumradius * cosd(180*k/points);\r\n    area_exact = points * sideLength * apothem;                  % Correct value\r\n    fprintf('Area estimates from different methods:  \\r\\npolyarea = %4.1f;  polyshape.area = %4.1f or %4.1f;  geometrical analysis = %4.1f\\r\\n', ...\r\n        area_polyarea, area_polyshapeArea1, area_polyshapeArea2, area_exact);\r\n    \r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 5 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    %assert( worstErrorFraction \u003e 0.02 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003e 0.01 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003c 0.15 , 'Implausibly inaccurate' )\r\nend;\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":7,"test_suite_updated_at":"2019-06-29T13:06:05.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2018-07-02T02:19:05.000Z","updated_at":"2025-09-14T14:22:43.000Z","published_at":"2018-07-02T08:55:01.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.png\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/media/image2.png\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId3\",\"target\":\"/media/image3.png\"}],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe area of a polygon (or any plane shape) can be evaluated by\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/179\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMonte Carlo integration\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The process involves 'random' sampling of (x,y) points in the xy plane, and testing whether they fall inside or outside the shape. That is illustrated schematically below for a circle.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e^\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eSteps:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDefine a 2D region within which to sample points. In the present problem you must choose the rectangular box (aligned to the axes) that bounds the specified polygon.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBy a 'random' process generate coordinates of a point within the bounding box. In the present problem a basic scheme using the uniform pseudorandom distribution available in MATLAB must be employed. \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOther schemes in use include quasi-random sampling (for greater uniformity of coverage) and stratified sampling (with more attention near the edges of the polygon).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDetermine\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/198\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ewhether the sampled point is inside or outside the polygon\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eDue to working in double precision, it is extremely unlikely to sample a point falling exactly on the edge of the polygon, and consequently if it does happen it doesn't really matter whether it's counted as inside or outside or null.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRepeat steps 2–3\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e times.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBased upon the proportion of sampled points falling within the polygon, report the approximate area of the polygon.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInputs to your function will be\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, the number of points to sample, and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003epolygonX\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u0026amp;\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003epolygonY\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, which together constitute\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/194\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ean ordered list of polygon vertices\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e will always be a positive integer. \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003epolygonX\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u0026amp;\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003epolygonY\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e will always describe a single, continuous outline; however, the polygon may be self-intersecting.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor polygons that are self-intersecting, you must find the area of the enclosed point set. In the case of the cross-quadrilateral, it is treated as two simple triangles (cf. three triangles in the first figure below), and the clockwise/counterclockwise ordering of points is irrelevant. A self-intersecting pentagram (left \u0026amp; middle of the second figure below) will therefore have the same area as a concave decagon (right).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId2\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId3\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e^\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEXAMPLE\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ % Input\\n N = 1000\\n polygonX = [1 0 -1  0]\\n polygonY = [0 1  0 -1]\\n % Output\\n A = 2.036]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExplanation: the above polygon is a square of side-length √2 centred on the origin, but rotated by 45°. The exact area is hence 2. As the value of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is moderate, the estimate by Monte Carlo integration is moderately accurate (an error of 0.036 in this example, corresponding to 509 of the 1000 sampled points falling within the polygon). Of course, if the code were run again then a slightly different value of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e would probably be returned, such as\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e=1.992 (corresponding to 498 of the 1000 sampled points falling within the polygon), due to the random qualities of the technique.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPcAAADwCAYAAADcifLrAAAjU0lEQVR42u1dB5gV1dn+7tBdK01AsFIEESKIERULttgNiAZ77GBAorFrRESj2DU2NJYoEDF2fzuCigYj2FEjIghSpHdEYOf/3nvO6t3Zmd25e6edme99nvdhmb17p5zzzjnnO18hEggEAoFAIBAIBAKBQCAQCAQCgUAQPjozP2b+II9CIEgPTmLOYY4RcQsE6cJpzFbM00XcAkE6UZO4t2F2F8bOXswDNI924cH6d/vLs0oEO5kg7huZS5jThaHwO+Zs5jzmIuYy5irmGuY65npmOdMu4EYXOj+zgfkzc63+vuXMxcz5ur1nyrMPjXi+n5gi7mtkglMy6jA7MI9n3sB8SYv6J+bXzFeY9zIvZv6BeSCzK7M1s1GR56rLbMHchbkv8/fMPzFvZT6jjah4iSxlTmDexTxTjzgNpalKxm9F3OnG5sxDmEOZrzNXML9nPs8cxjyOuRMzF+ZF8BC+m53LPc2cZFvWffz/pgW/bqGv8RLmKOYXeqT/gHkHs59elglE3JkfmfdiDmdO0dPq9/Vo2UcLKVKwkNuxqFcz7QJ+wsfrVfNnm+pZw1/1bGKZXjrcp9f2ZdLUyRd3Sz3l+7Ne77XWbCji9o3NmCeS2k5cpBt0BPOgWkylgxe3Zd3iELYi0aFFfI3F7Ma8jPmWXrtjJnKB7i+CBIp7vsMAU8FjRdzVAiNbf712RUd/kXlqHCOzD3E/5iHuU0r4WozchzMfImWgm6iFLtP3BE7La4KIWwG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hU8Vh6NQCAQCAQCgUAgEAgEAoFAUBr8RI8lBYjIgpcQDIbIi/YUVR+lBc8wp1Hxi5Tdo7SL6MUVfqPHkgL4bcNvehdSftevM9+o5vPYBkRtsdYF3Dpl9yjtInpxhd/osSRgB/2GLwym6KiPtfX4m59IRXCZgtrco7SL6KVamHCx8Old6nIcx/q7HC/THWwk81NSgRujdeOk5R6lXUQvqbjYgaQyhTiBY4NcjrfUa8D7mF1JJURE+ONnpLKgpuEepV1ELyVHjyXhegd4dKLpRXT8Nvr79ktopwniHk285qS3S6LFbVr0mNv19iVVe8qJFXpq6Bcr9MsjiQjqHk285iS3i0zLQ8a2+u3eqeAYkiKWk3ulC0z5HnBM9Sq+o2dK7lHaRfTiCdOix5DdZJzuSNh2mcB8tuD359GvpXRRSQSZS+4nlcQQMwAkBERGkCSXkq3pHqVdRC++YFr0GDJ3jtZTOKQnepwql7J5TrMCu+uOVvF57E8mfT+1pnuUdhG9CAQCgUAgEAgEAoFAIBAIBOnB/wNopWkMeaxRlQAAAABJRU5ErkJggg==\"},{\"partUri\":\"/media/image2.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAADwCAYAAACgyrkbAAAXbElEQVR42u2dB7hU1fHAx4ogGgREUBFs2KKoaBKNBRVFYyxR/McSaxSNBVsM9kBiAf1bMPYWbLHFqEETW2zYe+9SooioCCigaIy5457jnbdv777dt7t3b/n9vm++T9nde8+dOWfeuWfOmREBAAAAAAAAAACAvNAxkAVRAwDETfdAPgzk5UB6oA4AiJNdAvnWyVjUAQBxMsI4IJUtUAkAxMXNRQ7orUAWQS0AEAevOMczyTih4agFABrNwoF85ZzOIYHc6f57biAroB4AaCRrmFnPZoGsFMgX7v/vQj0A0EhsBMyH4EeYf9sJFQFAo/DO5mPzbx0CecP9+3uBdEZNANAIbnKO5qGif9/SzILORE0A0AhedU7mwhKf3eg++zqQ/qgKAOqJjYAdWuLznoHMdJ8/Esh8qAwA6sXq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sAAAAASUVORK5CYII=\"},{\"partUri\":\"/media/image3.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAACWCAYAAACvgFEsAAA0/klEQVR42u1dB3wUxfffcne5Sy69kt5IJUB6CIQmvRNqaCJVQAQBRUEEAcVKVaQJigXsBQsIP3sXAbErCgoooNj/CneXm/+8u1nYLNfr5m6+n8/7QG53p7y38503u2/fMAwFBQUFBQUFBQUFBQUFBQUFBQUFRfPDbCx/YEFY4vxQ/14sB7Cw1BSy1Ucxlo+wvINlP5bO1EwUzQVfYnmdSCMhuvfJ32ewRGE55EcCPIzlOBbewfNPYTHIUM+utMvSNc7qwxd4ltwfuVjKsbQOEP1TBAH2if7/D7mRM8nfO2VAgCos6gC40T1FgM7qwxc46Mf7gxIghVvgbBCgcEwgwFuxHMHyE5be5Ng2LHpyfD45doocG06WRA8Qz2WkqC5bxwRMw/K7aHAtxfIf+XsxuV7cloXkuJGQ9zg7dVlr+yPEGz6HZQOWk0QHNS722Vq7orG8gWULWdqC511roy9SfQD6k/qgzR9iWYZF6YCuYrHswvI2lk2kHQOs3CPW6gBcLWrT06T/YtjqoxT29G5Nv67cF460ay5pw3tYNpPyz2L514r97ZW5RnQdjKUfiDffh/T9H2KPWEpL/oGUABkJAQ7Fkkz+/7GF4wvJwICbpZTczA+Sc54kxi+yc4yxUnec5O9e5EaRtkU609ury1LbAcJzzzZYssjg+VE08J3tsyUPJAJLPfk/T875zo7XItZHCSl/Nzk2hRy7yQFdXUf+HkT+7oClwYL+7dXB2Fkh2OujFLb0bku/zt4X9tpVS8p4i/y9iPy9xYb9HemrcN1gLGXk/zDukkQ2mUOpSJ4E2IL8bSDPB6XHs0W/XU9++5rMum9i+YzM4LaOOUqASVbaIr3R7dVlqe3CQNSL/v6VnFfkYp8tkRlPBhB4Cw9h+ZNcr3aQAOeT/68nx3qSvw84oKvR5JiReEzQdo0F/durwx4B2usj44TebenX2fvCXrsWSPrdzwoBZ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STvF97E1e0n1XyQiLmv6t2QzqQ4FG7IWxhl4c/eTciCOb6AN/YvvP7no/AKgsUNEXt1qxhxkCh2OIf8XPAmpByh8vvKYpMxM0umZpMNSAhS+G1wuIUBpmZbKgXM2kv/Dp00QlH0rmSnFga5Cmy21U9yPlWSAAFncIyk/R9S2lcToAAgcTpO0AwCBnp39bCOpB2jNRuJjL4nskSPRz04bHqBQp9SmnUXnS/XLWFhBSNvpqH1CROVI7cNKzp1OzitlLn4H6y17uWPfiZJ2WrqPpfaS6v9KEQFa078lm0l1WCgqRzrOVovO3WVD/9L7Ty46v4AGMssIeJKwOhhlE5YkkRHKyY3JSW7gnZIy4esLCIhMlCjdEQIUl2mpHEvLuheJB8RbIUBpO8X9AMO1J793sjAwxQRYRv6/lxCgtB2LyeD1p43E/Uu3YSNLellC7APR/PPJb89JCNDSPWCPAMX6tUaA4rY4ah9GQoBi+7CScxPIvbQDS1cv28sd+0rbaes+FuxljwAt6d8aAYp1WChZAovH2RoLBGhL/ztlpvMLAJf2ZtHfwrICDPGWaLmyhxjmQaKUEeQ3cLc/FClDcOPXEbaHT5EiLbjeMCNvId4L/B1tocxlFsoRzskQlXkdOZeRLLH2kJtB2s4EUT+yiHs+kdyI4vJHidoG591GyptkpR2bGO98cO+MjaJF/fvSho2E9peRY/Dv80QPoYw5w0cDOVZC7AbHs0W6E+psRx5rTCU25UXnl0j0y1hor9TuvR20j7icMol9GMm5c8k9ByuJPC/byx37StspvY8t2atAov9p5JjWgv6kj6LENpPe41NE5UjHWSFZAoNn+YqFaxkrHCEXnTfBdOItNFf0IF6LP9GW8e5nP3K2kacflgeCvXxpX1f078o14nGWRCZKhjyvbY46bwJlMyW/xcRDDAb9ydVGUk+hOUAZQG1yRf/OXiMdZ+DNrSIe65AA5xgKCgoKCgoKCgoKCgoKCgoKCgoKGeH/AS8924+Oc1GZAAAAAElFTkSuQmCC\"}]}"},{"id":42674,"title":"Cody meets Xiangqi: foresee the unseen (Part 1)","description":"This is the first part of the Xiangqi series. The second part in this series is: \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42685-cody-meets-xiangqi-foresee-the-unseen-part-2 Cody meets Xiangqi: foresee the unseen (Part 2)\u003e\r\n\r\n\u003chttps://en.wikipedia.org/wiki/Xiangqi Xiangqi\u003e, also known as *Chinese Chess* (and 象棋 in Chinese characters), is one of the most popular board games in China. The modern Xiangqi board contains a middle section which divides two players' sides and is marked the \"Chu River–Han border\", in reference to the Chu–Han Contention between \u003chttps://en.wikipedia.org/wiki/Xiang_Yu Xiang Yu\u003e and \u003chttps://de.wikipedia.org/wiki/Han_Gaozu Liu Bang\u003e, two prominent warlords and opponents who fought thousands of battles against each other for supremacy over China in the late Qin dynasty (206–202 BC). Those interested in the story of the Chu–Han Contention and its relation to Xiangqi are referred to \u003chttps://en.wikipedia.org/wiki/Chu%E2%80%93Han_Contention here\u003e.\r\n\r\nFresh to Xiangqi, Cody becomes interested in Xiangqi by raising a question: _Who is the stronger player of Xiangqi between Xiang Yu and Liu Bang_? To answer this question, Cody designs a match for Xiang Yu and Liu Bang, in which Cody serves as the referee. The smart Cody referee also sets an intelligent rule to determine the winner: \r\n\r\n_In a succession of Xiangqi games, once Xiang Yu wins Na games *consecutively*, whereas Liu Bang has not won Nb games *consecutively*, Cody immediately announces Xiang Yu as the winner. Contrarily, once Liu Bang defeats Xiang Yu Nb times *consecutively*, whereas Xiang Yu has not won Na times *consecutively*, Liu Bang becomes the winner._ \r\n\r\nCody suggests that Na \u003e 1 and Nb \u003e 1, in order to enhance, to some extent, the confidence of the result of the match. Suppose in each individual game, the probability Xiang Yu would win is p, and the probability Liu Bang would win is 1 - p, which implicitly assumes that the probability of a tie is 0 (because they both refuse to draw and will fight to death). Unfortunately, this well-designed match has never taken place. Regretfully, Cody requests us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write a function\r\n\r\n                                sol = Xiangqi(p, Na, Nb)\r\n\r\nwith input: 0 \u003c= p \u003c= 1, Na \u003e 1, Nb \u003e 1, and output: sol --- the probability that Xiang Yu wins. Your solution will be tested against its true value Q (which is computed but hided in the P-file EvaluateSolution.p) according to a hybrid absolute and relative error tolerance criterion:\r\n\r\n                      abs(sol - Q) \u003c= max(AbsTol, RelTol*abs(sol))\r\n\r\nwhere AbsTol and RelTol are absolute and relative error tolerances, respectively, which will be specified in the test suite. You are encouraged to optimize the performance (rather than the usual Cody size) of your code as much as possible, as the score of your solution will be measured based on the *speed* of your code. \r\n\r\nHave fun!\r\n","description_html":"\u003cp\u003eThis is the first part of the Xiangqi series. The second part in this series is: \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42685-cody-meets-xiangqi-foresee-the-unseen-part-2\"\u003eCody meets Xiangqi: foresee the unseen (Part 2)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Xiangqi\"\u003eXiangqi\u003c/a\u003e, also known as \u003cb\u003eChinese Chess\u003c/b\u003e (and 象棋 in Chinese characters), is one of the most popular board games in China. The modern Xiangqi board contains a middle section which divides two players' sides and is marked the \"Chu River–Han border\", in reference to the Chu–Han Contention between \u003ca href = \"https://en.wikipedia.org/wiki/Xiang_Yu\"\u003eXiang Yu\u003c/a\u003e and \u003ca href = \"https://de.wikipedia.org/wiki/Han_Gaozu\"\u003eLiu Bang\u003c/a\u003e, two prominent warlords and opponents who fought thousands of battles against each other for supremacy over China in the late Qin dynasty (206–202 BC). Those interested in the story of the Chu–Han Contention and its relation to Xiangqi are referred to \u003ca href = \"https://en.wikipedia.org/wiki/Chu%E2%80%93Han_Contention\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eFresh to Xiangqi, Cody becomes interested in Xiangqi by raising a question: \u003ci\u003eWho is the stronger player of Xiangqi between Xiang Yu and Liu Bang\u003c/i\u003e? To answer this question, Cody designs a match for Xiang Yu and Liu Bang, in which Cody serves as the referee. The smart Cody referee also sets an intelligent rule to determine the winner:\u003c/p\u003e\u003cp\u003e\u003ci\u003eIn a succession of Xiangqi games, once Xiang Yu wins Na games \u003cb\u003econsecutively\u003c/b\u003e, whereas Liu Bang has not won Nb games \u003cb\u003econsecutively\u003c/b\u003e, Cody immediately announces Xiang Yu as the winner. Contrarily, once Liu Bang defeats Xiang Yu Nb times \u003cb\u003econsecutively\u003c/b\u003e, whereas Xiang Yu has not won Na times \u003cb\u003econsecutively\u003c/b\u003e, Liu Bang becomes the winner.\u003c/i\u003e\u003c/p\u003e\u003cp\u003eCody suggests that Na \u0026gt; 1 and Nb \u0026gt; 1, in order to enhance, to some extent, the confidence of the result of the match. Suppose in each individual game, the probability Xiang Yu would win is p, and the probability Liu Bang would win is 1 - p, which implicitly assumes that the probability of a tie is 0 (because they both refuse to draw and will fight to death). Unfortunately, this well-designed match has never taken place. Regretfully, Cody requests us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write a function\u003c/p\u003e\u003cpre\u003e                                sol = Xiangqi(p, Na, Nb)\u003c/pre\u003e\u003cp\u003ewith input: 0 \u0026lt;= p \u0026lt;= 1, Na \u0026gt; 1, Nb \u0026gt; 1, and output: sol --- the probability that Xiang Yu wins. Your solution will be tested against its true value Q (which is computed but hided in the P-file EvaluateSolution.p) according to a hybrid absolute and relative error tolerance criterion:\u003c/p\u003e\u003cpre\u003e                      abs(sol - Q) \u0026lt;= max(AbsTol, RelTol*abs(sol))\u003c/pre\u003e\u003cp\u003ewhere AbsTol and RelTol are absolute and relative error tolerances, respectively, which will be specified in the test suite. You are encouraged to optimize the performance (rather than the usual Cody size) of your code as much as possible, as the score of your solution will be measured based on the \u003cb\u003espeed\u003c/b\u003e of your code.\u003c/p\u003e\u003cp\u003eHave fun!\u003c/p\u003e","function_template":"function sol = Xiangqi(p, Na, Nb)\r\n  sol = p;\r\nend","test_suite":"%%\r\n% By courtesy of Alfonso Nieto-Castanon\r\nurlwrite('https://sites.google.com/a/alfnie.com/alfnie/software/SetSolutionScore.p?attredirects=0\u0026amp;d=1','SetSolutionScore.p');\r\nrehash path;\r\n\r\n%%\r\nfh = fopen('EvaluateSolution.p','wb');\r\nfwrite(fh, hex2dec(reshape('7630312E30307630302E3030000E601C0AF25FB100000056000000A4000000D6820EB5B30514117A9E6E5DB36898AFFFCC5086DFAF59C2910AEB07B88523DABE546868AC2BDAC3795467A7BCD91A89E2F578F2EDE92D63472A3B8FCA3F216CB3B66B010B5B924A5F514E19B90225B0978A54DA881119917D211CB055361918CAA0670F6D0E8ED17B319492619F4361BFB4C3C31D68E11F4BA084C6456783C358296B3E63E16C78EF2B0279074BCB707265EB4C044BFF7F25BA0A9678B75D36B9ACEE6853',2,[]).')); rehash path; fclose(fh); \r\n\r\n%%\r\np = 0; Na = 2; Nb = 3;\r\nAbsTol = 1e-6; RelTol = 1e-5;\r\nsol = Xiangqi(p, Na, Nb);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\n\r\n%%\r\np = 1; Na = 3; Nb = 2;\r\nAbsTol = 1e-6; RelTol = 1e-5;\r\nsol = Xiangqi(p, Na, Nb);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\n\r\n%%\r\np = 0.4; Na = 2; Nb = 3;\r\nAbsTol = 5e-4; RelTol = 5e-4;\r\nsol = Xiangqi(p, Na, Nb);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\n\r\n%%\r\np = 0.7; Na = 4; Nb = 2;\r\nAbsTol = 5e-4; RelTol = 5e-4;\r\nsol = Xiangqi(p, Na, Nb);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\n\r\n%%\r\np = 0.15; Na = 4; Nb = 2;\r\nAbsTol = 5e-5; RelTol = 1e-6;\r\nt = builtin('tic');\r\nsol = Xiangqi(p, Na, Nb);\r\nscore = builtin('toc',t);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\nSetSolutionScore(round(500*score));","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":9,"test_suite_updated_at":"2015-10-30T08:18:09.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-10-30T05:02:43.000Z","updated_at":"2025-11-30T16:38:45.000Z","published_at":"2015-10-30T05:45:36.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is the first part of the Xiangqi series. The second part in this series is:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42685-cody-meets-xiangqi-foresee-the-unseen-part-2\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody meets Xiangqi: foresee the unseen (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Xiangqi\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eXiangqi\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, also known as\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eChinese Chess\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (and 象棋 in Chinese characters), is one of the most popular board games in China. The modern Xiangqi board contains a middle section which divides two players' sides and is marked the \\\"Chu River–Han border\\\", in reference to the Chu–Han Contention between\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Xiang_Yu\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eXiang Yu\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://de.wikipedia.org/wiki/Han_Gaozu\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eLiu Bang\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, two prominent warlords and opponents who fought thousands of battles against each other for supremacy over China in the late Qin dynasty (206–202 BC). Those interested in the story of the Chu–Han Contention and its relation to Xiangqi are referred to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Chu%E2%80%93Han_Contention\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehere\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFresh to Xiangqi, Cody becomes interested in Xiangqi by raising a question:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eWho is the stronger player of Xiangqi between Xiang Yu and Liu Bang\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e? To answer this question, Cody designs a match for Xiang Yu and Liu Bang, in which Cody serves as the referee. The smart Cody referee also sets an intelligent rule to determine the winner:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eIn a succession of Xiangqi games, once Xiang Yu wins Na games\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econsecutively\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, whereas Liu Bang has not won Nb games\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econsecutively\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, Cody immediately announces Xiang Yu as the winner. Contrarily, once Liu Bang defeats Xiang Yu Nb times\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econsecutively\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, whereas Xiang Yu has not won Na times\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econsecutively\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, Liu Bang becomes the winner.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCody suggests that Na \u0026gt; 1 and Nb \u0026gt; 1, in order to enhance, to some extent, the confidence of the result of the match. Suppose in each individual game, the probability Xiang Yu would win is p, and the probability Liu Bang would win is 1 - p, which implicitly assumes that the probability of a tie is 0 (because they both refuse to draw and will fight to death). Unfortunately, this well-designed match has never taken place. Regretfully, Cody requests us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write a function\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[                                sol = Xiangqi(p, Na, Nb)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewith input: 0 \u0026lt;= p \u0026lt;= 1, Na \u0026gt; 1, Nb \u0026gt; 1, and output: sol --- the probability that Xiang Yu wins. Your solution will be tested against its true value Q (which is computed but hided in the P-file EvaluateSolution.p) according to a hybrid absolute and relative error tolerance criterion:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[                      abs(sol - Q) \u003c= max(AbsTol, RelTol*abs(sol))]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewhere AbsTol and RelTol are absolute and relative error tolerances, respectively, which will be specified in the test suite. You are encouraged to optimize the performance (rather than the usual Cody size) of your code as much as possible, as the score of your solution will be measured based on the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003espeed\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of your code.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHave fun!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42503,"title":"Generating random matrix with given probability mass function","description":"Inspired by \u003chttp://www.mathworks.com/matlabcentral/cody/problems/2356-simulating-the-selection-of-a-state-with-given-probabilities Problem 2356. Simulating the selection of a state with given probabilities\u003e, let's consider a similar yet more useful problem. Write a function\r\n\r\n                             x = rndsampling(m,n,prob)\r\n\r\nto generate an m-by-n matrix x, whose entries are drawn independently from integer symbols 1:numel(prob) according to the given probability mass function prob. Specifically, symbol k occurs with probability prob(k), k = 1, 2, ..., numel(prob), where all(prob\u003e0) == 1 and sum(prob) == 1.","description_html":"\u003cp\u003eInspired by \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/2356-simulating-the-selection-of-a-state-with-given-probabilities\"\u003eProblem 2356. Simulating the selection of a state with given probabilities\u003c/a\u003e, let's consider a similar yet more useful problem. Write a function\u003c/p\u003e\u003cpre\u003e                             x = rndsampling(m,n,prob)\u003c/pre\u003e\u003cp\u003eto generate an m-by-n matrix x, whose entries are drawn independently from integer symbols 1:numel(prob) according to the given probability mass function prob. Specifically, symbol k occurs with probability prob(k), k = 1, 2, ..., numel(prob), where all(prob\u0026gt;0) == 1 and sum(prob) == 1.\u003c/p\u003e","function_template":"function x = rndsampling(m,n,prob);\r\n  x = rand(m,n)\r\nend","test_suite":"%%\r\nrnd = sort(rand(randi([10,20]),1));\r\nprob = vertcat(rnd(1,:),diff(rnd,1,1),1-rnd(end,:));\r\nsz = [1 1e5;1e5 1;1e3 1e2;randi([100 200], 100, 2)];\r\nsz = sz(randi(size(sz,1)),:);\r\nx = rndsampling(sz(1),sz(2),prob);\r\nprob_est = histcounts(x,1:numel(prob)+1,'Normalization','probability').';\r\nerr = mean(abs(prob_est - prob))\r\nassert(err \u003c 0.005 \u0026\u0026 isequal(size(x),sz) \u0026\u0026 all(~isnan(x(:))));\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":107,"test_suite_updated_at":"2015-08-13T18:44:59.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-11T19:26:49.000Z","updated_at":"2026-02-02T05:18:21.000Z","published_at":"2015-08-11T19:26:49.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInspired by\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/2356-simulating-the-selection-of-a-state-with-given-probabilities\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 2356. Simulating the selection of a state with given probabilities\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, let's consider a similar yet more useful problem. Write a function\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[                             x = rndsampling(m,n,prob)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eto generate an m-by-n matrix x, whose entries are drawn independently from integer symbols 1:numel(prob) according to the given probability mass function prob. Specifically, symbol k occurs with probability prob(k), k = 1, 2, ..., numel(prob), where all(prob\u0026gt;0) == 1 and sum(prob) == 1.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42685,"title":"Cody meets Xiangqi: foresee the unseen (Part 2)","description":"This is the second part of the Xiangqi series. The first part in this series is: \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42674-cody-meets-xiangqi-foresee-the-unseen Cody meets Xiangqi: foresee the unseen (Part 1)\u003e\r\n\r\nBeing increasingly interested in \u003chttps://en.wikipedia.org/wiki/Xiangqi Xiangqi\u003e (a.k.a., *Chinese Chess*), Mr. Cody has designed a new Xiangqi match for \u003chttps://en.wikipedia.org/wiki/Xiang_Yu Xiang Yu\u003e and \u003chttps://de.wikipedia.org/wiki/Han_Gaozu Liu Bang\u003e by taking into account the likelihood of tie games. The new rule is described as follows:\r\n\r\nOnce\r\n\r\n   1) Xiang Yu wins Na games consecutively,\r\n   2) Liu Bang wins Nb games consecutively, \r\n   3) No ties occur consecutively, \r\n\r\n*whichever comes first*, Mr. Cody announces the outcome accordingly as follows:\r\n\r\n   1) Xiang Yu is the final winner,\r\n   2) Liu Bang is the final winner, \r\n   3) They end up with a final draw.\r\n\r\nAgain, Cody asks us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write the following function\r\n\r\n                         [Pa, Pb, Pc] = Xiangqi2(a, b, Na, Nb, Nc)\r\n\r\nwhere \r\n\r\n* a: the probability that Xiang Yu wins one individual game\r\n* b: the probability that Liu Bang wins one individual game\r\n* Na: # of consecutive wins required for Xiang Yu to become the final winner\r\n* Nb: # of consecutive wins required for Liu Bang to become the final winner\r\n* Nc: # of consecutive ties required to result in a final draw\r\n* Pa: the probability that Xiang Yu wins the match\r\n* Pb: the probability that Liu Bang wins the match\r\n* Pc: the probability of a final draw\r\n\r\nThe main focus of this problem is on *Monte Carlo simulations*, rather than analytical approaches. Your provided solution Xiangqi2.m will be checked by a P-file EvaluateSolution.p, which mainly does 3 things as follows:\r\n\r\n1) Call your function [Pa, Pb, Pc] = Xiangqi2(a, b, Na, Nb, Nc) and then Check if the result P = [Pa, Pb, Pc] is within tolerance of its expected value Q. That is, If norm(P - Q) \u003c tol holds, it means that your solution is accurate enough. If this does not hold, your solution will be rejected. \r\n\r\n2) Check if your solution is based on *pure Monte Carlo simulations* or *analytical approaches*. If it is based on analytical approaches (i.e., using analytical expressions to directly compute the probabilities), then your solution will be rejected. EvaluateSolution.p accomplishes this goal by exploiting a combination of distinct features possessed by analytical solutions, but are generally not shared by Monte Carlo simulations. \r\n\r\n3) If your solution passes the above two checks, then the score of your solution will be determined based on the speed of your code. The faster your solution is, the smaller score you get. \r\n\r\nIf you have any concerns or suggestions on this problem, please feel free to leave me a comment. Thanks. \r\n\r\n ","description_html":"\u003cp\u003eThis is the second part of the Xiangqi series. The first part in this series is: \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42674-cody-meets-xiangqi-foresee-the-unseen\"\u003eCody meets Xiangqi: foresee the unseen (Part 1)\u003c/a\u003e\u003c/p\u003e\u003cp\u003eBeing increasingly interested in \u003ca href = \"https://en.wikipedia.org/wiki/Xiangqi\"\u003eXiangqi\u003c/a\u003e (a.k.a., \u003cb\u003eChinese Chess\u003c/b\u003e), Mr. Cody has designed a new Xiangqi match for \u003ca href = \"https://en.wikipedia.org/wiki/Xiang_Yu\"\u003eXiang Yu\u003c/a\u003e and \u003ca href = \"https://de.wikipedia.org/wiki/Han_Gaozu\"\u003eLiu Bang\u003c/a\u003e by taking into account the likelihood of tie games. The new rule is described as follows:\u003c/p\u003e\u003cp\u003eOnce\u003c/p\u003e\u003cpre\u003e   1) Xiang Yu wins Na games consecutively,\r\n   2) Liu Bang wins Nb games consecutively, \r\n   3) No ties occur consecutively, \u003c/pre\u003e\u003cp\u003e\u003cb\u003ewhichever comes first\u003c/b\u003e, Mr. Cody announces the outcome accordingly as follows:\u003c/p\u003e\u003cpre\u003e   1) Xiang Yu is the final winner,\r\n   2) Liu Bang is the final winner, \r\n   3) They end up with a final draw.\u003c/pre\u003e\u003cp\u003eAgain, Cody asks us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write the following function\u003c/p\u003e\u003cpre\u003e                         [Pa, Pb, Pc] = Xiangqi2(a, b, Na, Nb, Nc)\u003c/pre\u003e\u003cp\u003ewhere\u003c/p\u003e\u003cul\u003e\u003cli\u003ea: the probability that Xiang Yu wins one individual game\u003c/li\u003e\u003cli\u003eb: the probability that Liu Bang wins one individual game\u003c/li\u003e\u003cli\u003eNa: # of consecutive wins required for Xiang Yu to become the final winner\u003c/li\u003e\u003cli\u003eNb: # of consecutive wins required for Liu Bang to become the final winner\u003c/li\u003e\u003cli\u003eNc: # of consecutive ties required to result in a final draw\u003c/li\u003e\u003cli\u003ePa: the probability that Xiang Yu wins the match\u003c/li\u003e\u003cli\u003ePb: the probability that Liu Bang wins the match\u003c/li\u003e\u003cli\u003ePc: the probability of a final draw\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eThe main focus of this problem is on \u003cb\u003eMonte Carlo simulations\u003c/b\u003e, rather than analytical approaches. Your provided solution Xiangqi2.m will be checked by a P-file EvaluateSolution.p, which mainly does 3 things as follows:\u003c/p\u003e\u003cp\u003e1) Call your function [Pa, Pb, Pc] = Xiangqi2(a, b, Na, Nb, Nc) and then Check if the result P = [Pa, Pb, Pc] is within tolerance of its expected value Q. That is, If norm(P - Q) \u0026lt; tol holds, it means that your solution is accurate enough. If this does not hold, your solution will be rejected.\u003c/p\u003e\u003cp\u003e2) Check if your solution is based on \u003cb\u003epure Monte Carlo simulations\u003c/b\u003e or \u003cb\u003eanalytical approaches\u003c/b\u003e. If it is based on analytical approaches (i.e., using analytical expressions to directly compute the probabilities), then your solution will be rejected. EvaluateSolution.p accomplishes this goal by exploiting a combination of distinct features possessed by analytical solutions, but are generally not shared by Monte Carlo simulations.\u003c/p\u003e\u003cp\u003e3) If your solution passes the above two checks, then the score of your solution will be determined based on the speed of your code. The faster your solution is, the smaller score you get.\u003c/p\u003e\u003cp\u003eIf you have any concerns or suggestions on this problem, please feel free to leave me a comment. Thanks.\u003c/p\u003e","function_template":"function [Pa, Pb, Pc] = Xiangqi2(a, b, Na, Nb, Nc)\r\n% a: the probability that Xiang Yu wins one individual game\r\n% b: the probability that Liu Bang wins one individual game\r\n% Na: # of consecutive wins required for Xiang Yu to become the final winner\r\n% Nb: # of consecutive wins required for Liu Bang to become the final winner\r\n% Nc: # of consecutive ties required to result in a final draw\r\n% Pa: the probability that Xiang Yu wins the match\r\n% Pb: the probability that Liu Bang wins the match\r\n% Pc: the probability of a final draw\r\n    Pa = ;\r\n    Pb = ;\r\n    Pc = ;\r\nend","test_suite":"%%\r\n% Thanks to Alfonso Nieto-Castanon\r\nurlwrite('https://sites.google.com/a/alfnie.com/alfnie/software/SetSolutionScore.p?attredirects=0\u0026amp;d=1','SetSolutionScore.p');\r\nrehash path;\r\n\r\n%%\r\nfh = fopen('EvaluateSolution.p','wb');\r\nfwrite(fh, hex2dec(reshape('7630312E30307630302E3030000C701C97F61FB1000002D5000001CF000004E73DD68930A391F7C60A534B45A03EAF72EB08941F39EE01BF25BAE04DF43CF342FC1A763DF6B8F26BBED0BD4F2ABBB5927B1EEBAE8795E487F6E4EF2737CBB6646BC4DF145E14664B3A4DACCD7CB01C4EC2328AD76F196231D2CA02CDC2B15466FBA5BDDF9E6C0E5DE12CF07B2AAA50BD2F04FFB92E9BECBE232E01031340A8EDCA5C10DAC01BBE43685ED0AB79D9C6F2A090FB4E0E75CAA236D3D73AD659E0705C42792BC77D85951B2FC49DE856FB97AFD74C1DB66C874EDF5517BCFA14C6706CA5E61DE60F2771B64F6D634B858A1A30AD7C49778534CCCE7551C637DC53846B02140046F729C5EB2DC9C65F16C2FC4F34EA9F03A2056B8218ACAB9A9A8BC5DC8F2F3312740F86626ABA38E00903CE76846DEE175BEE04DC0815E050E4CD95BA8E5BD27A0B57F2413B71A0E4837FB0F86328AA82732C584F1F55C6CCD79CBC69D052011BA93357AAE3568E0086F159C083D665645A38584955283925F900254A6562F0C755323C40805328D04F27FD863E8B774B52E27FC3AA30CE689AC57DEFEE274DBBC2A4D9D320CF19AD873AA0AE806721EE78496F7ADA99EA48060F26FDEE7ED5E9F85B27F79AE176A6E8EAC4DD5127299122FF88139BC4B56A2ED3C5338A72676C4C99AD6DEBCD8BB5EB09',2,[]).')); rehash path; fclose(fh);\r\n\r\n%%\r\nfid = fopen('Xiangqi2.m');\r\ndelim = {' ', '\\n', ',', '.', ';', '''', '@', '+', '-', '*', '/', '\\', '^', '\u003e', '\u003c', '=', '\u0026', '|', '~', '{', '}', '[', ']', '(', ')'};\r\nfile = textscan(fid, '%s', 'CommentStyle', '%', 'MultipleDelimsAsOne', 1, 'Delimiter', delim); fclose(fid); \r\nassert(~any(ismember({'rng','RandStream','seed','state','twister','shufle','default'},file{1})));\r\n\r\n%%\r\na = 0; b = 0; Na = 2; Nb = 3; Nc = 2; tol = 1e-6;\r\nEvaluateSolution(a, b, Na, Nb, Nc, tol); \r\n\r\n%%\r\na = 0; b = 1; Na = 1; Nb = 2; Nc = 1; tol = 1e-6;\r\nEvaluateSolution(a, b, Na, Nb, Nc, tol); \r\n\r\n%%\r\na = 1; b = 0; Na = 3; Nb = 2; Nc = 1; tol = 1e-6;\r\nEvaluateSolution(a, b, Na, Nb, Nc, tol); \r\n\r\n%%\r\na = 0.15; b = 0.85; Na = 4; Nb = 2; Nc = 1; tol = 1e-4;\r\nEvaluateSolution(a, b, Na, Nb, Nc, tol);\r\n\r\n%%\r\na = 0.9; b = 0; Na = 3; Nb = 1; Nc = 2; tol = 1e-3;\r\nEvaluateSolution(a, b, Na, Nb, Nc, tol);\r\n\r\n%%\r\na = 0.65; b = 0.3; Na = 3; Nb = 2; Nc = 2; tol = 1e-3;\r\nEvaluateSolution(a, b, Na, Nb, Nc, tol);\r\n\r\n%%\r\nNa = 3; Nb = 2; Nc = 1; tol = 2e-3; \r\np = sort(rand(2,30)); \r\np = sort([p(1,:);diff(p);1-p(2,:)]);\r\nfor k = size(p,2):-1:1\r\n    a = p(3,k); b = p(2,k);\r\n    score(k) = EvaluateSolution(a, b, Na, Nb, Nc, tol);    \r\nend\r\nSetSolutionScore(round(mean(score)));","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":"2015-11-12T00:41:35.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2015-11-08T20:51:55.000Z","updated_at":"2015-11-12T03:39:15.000Z","published_at":"2015-11-10T00:22:37.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is the second part of the Xiangqi series. The first part in this series is:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42674-cody-meets-xiangqi-foresee-the-unseen\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody meets Xiangqi: foresee the unseen (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBeing increasingly interested in\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Xiangqi\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eXiangqi\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (a.k.a.,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eChinese Chess\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e), Mr. Cody has designed a new Xiangqi match for\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Xiang_Yu\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eXiang Yu\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://de.wikipedia.org/wiki/Han_Gaozu\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eLiu Bang\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e by taking into account the likelihood of tie games. The new rule is described as follows:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOnce\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   1) Xiang Yu wins Na games consecutively,\\n   2) Liu Bang wins Nb games consecutively, \\n   3) No ties occur consecutively,]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ewhichever comes first\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, Mr. Cody announces the outcome accordingly as follows:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   1) Xiang Yu is the final winner,\\n   2) Liu Bang is the final winner, \\n   3) They end up with a final draw.]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAgain, Cody asks us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write the following function\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[                         [Pa, Pb, Pc] = Xiangqi2(a, b, Na, Nb, Nc)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewhere\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ea: the probability that Xiang Yu wins one individual game\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eb: the probability that Liu Bang wins one individual game\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNa: # of consecutive wins required for Xiang Yu to become the final winner\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNb: # of consecutive wins required for Liu Bang to become the final winner\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNc: # of consecutive ties required to result in a final draw\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePa: the probability that Xiang Yu wins the match\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePb: the probability that Liu Bang wins the match\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePc: the probability of a final draw\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe main focus of this problem is on\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eMonte Carlo simulations\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, rather than analytical approaches. Your provided solution Xiangqi2.m will be checked by a P-file EvaluateSolution.p, which mainly does 3 things as follows:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1) Call your function [Pa, Pb, Pc] = Xiangqi2(a, b, Na, Nb, Nc) and then Check if the result P = [Pa, Pb, Pc] is within tolerance of its expected value Q. That is, If norm(P - Q) \u0026lt; tol holds, it means that your solution is accurate enough. If this does not hold, your solution will be rejected.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e2) Check if your solution is based on\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003epure Monte Carlo simulations\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eanalytical approaches\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. If it is based on analytical approaches (i.e., using analytical expressions to directly compute the probabilities), then your solution will be rejected. EvaluateSolution.p accomplishes this goal by exploiting a combination of distinct features possessed by analytical solutions, but are generally not shared by Monte Carlo simulations.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e3) If your solution passes the above two checks, then the score of your solution will be determined based on the speed of your code. The faster your solution is, the smaller score you get.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf you have any concerns or suggestions on this problem, please feel free to leave me a comment. Thanks.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":44684,"title":"Basic Monte Carlo Simulation","description":"Input is a matrix including service time and probability of service time. Another input is a random number. Function should transform the random number to service time.\r\n\r\nFirst column of the input1 is service time and second column is probability of that service time.\r\n  \r\n  input1 = [\r\n  2 0.4\r\n  5 0.4\r\n  9 0.2]\r\n\r\nWe can calculate cumulative probability and Random Number Assignment with this input,\r\n\r\n   Service                      Cumulative       Random Number\r\n   Time        Probability      Probability      Assignment\r\n     2             0.4              0.4          0.000 - 0.400\r\n     5             0.4              0.8          0.400 - 0.800\r\n     9             0.2              1.0          0.800 - 1.000\r\n\r\ninput2 is a random number between 0 and 1 such as;\r\n\r\n   input2 = 0.125\r\n\r\nRandom number can be transformed to service time with the table. Random number (input2) is between first line of random number assignment\r\n\r\n  0.000 \u003c Random number \u003c= 0.400\r\n\r\nas a result\r\n\r\n   serviceTime = 2\r\n\r\n*Note:* You can assume that the sum of the probabilities will be equal to one. ","description_html":"\u003cp\u003eInput is a matrix including service time and probability of service time. Another input is a random number. Function should transform the random number to service time.\u003c/p\u003e\u003cp\u003eFirst column of the input1 is service time and second column is probability of that service time.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003einput1 = [\r\n2 0.4\r\n5 0.4\r\n9 0.2]\r\n\u003c/pre\u003e\u003cp\u003eWe can calculate cumulative probability and Random Number Assignment with this input,\u003c/p\u003e\u003cpre\u003e   Service                      Cumulative       Random Number\r\n   Time        Probability      Probability      Assignment\r\n     2             0.4              0.4          0.000 - 0.400\r\n     5             0.4              0.8          0.400 - 0.800\r\n     9             0.2              1.0          0.800 - 1.000\u003c/pre\u003e\u003cp\u003einput2 is a random number between 0 and 1 such as;\u003c/p\u003e\u003cpre\u003e   input2 = 0.125\u003c/pre\u003e\u003cp\u003eRandom number can be transformed to service time with the table. Random number (input2) is between first line of random number assignment\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e0.000 \u0026lt; Random number \u0026lt;= 0.400\r\n\u003c/pre\u003e\u003cp\u003eas a result\u003c/p\u003e\u003cpre\u003e   serviceTime = 2\u003c/pre\u003e\u003cp\u003e\u003cb\u003eNote:\u003c/b\u003e You can assume that the sum of the probabilities will be equal to one.\u003c/p\u003e","function_template":"function serviceTime = rand2ServiceTime(input1,input2)\r\n \r\nend","test_suite":"%%\r\ninput1 = [\r\n2 0.4\r\n5 0.4\r\n9 0.2];\r\ninput2 = 0.125;\r\nserviceTimeCorrect = 2;\r\nassert(isequal(rand2ServiceTime(input1,input2),serviceTimeCorrect))\r\n\r\n\r\n%% on the border\r\ninput1 = [\r\n2 0.4\r\n5 0.4\r\n9 0.2];\r\ninput2 = 0.4;\r\nserviceTimeCorrect = 2;\r\nassert(isequal(rand2ServiceTime(input1,input2),serviceTimeCorrect))\r\n\r\n%%\r\ninput1 = [\r\n2 0.4\r\n5 0.4\r\n9 0.2];\r\ninput2 = 0.474;\r\nserviceTimeCorrect = 5;\r\nassert(isequal(rand2ServiceTime(input1,input2),serviceTimeCorrect))\r\n\r\n\r\n%%\r\ninput1 = [\r\n2 0.4\r\n5 0.4\r\n9 0.2];\r\ninput2 = 0.85;\r\nserviceTimeCorrect = 9;\r\nassert(isequal(rand2ServiceTime(input1,input2),serviceTimeCorrect))\r\n\r\n%%\r\ninput1 = [\r\n(45:-1:36)' repmat(0.1,10,1)];\r\ninput2 = 0.958;\r\nserviceTimeCorrect = 36;\r\nassert(isequal(rand2ServiceTime(input1,input2),serviceTimeCorrect))\r\n\r\n\r\n\r\n%% Generalize for Fair coin toss  1:Heads, 2:Tails\r\ninput1 = [\r\n1 0.5\r\n2 0.5];\r\ninput2 = 0.5;\r\nserviceTimeCorrect = 1;\r\nassert(isequal(rand2ServiceTime(input1,input2),serviceTimeCorrect))\r\n\r\n\r\n%% Generalize for Fair coin toss  1:Heads, 2:Tails\r\ninput1 = [\r\n1 0.5\r\n2 0.5];\r\ninput2 = 0.6;\r\nserviceTimeCorrect = 2;\r\nassert(isequal(rand2ServiceTime(input1,input2),serviceTimeCorrect))\r\n\r\n\r\n%%\r\ninput1 = [\r\n2 0.2\r\n3 0.2\r\n4 0.2\r\n5 0.2\r\n6 0.2];\r\nserviceTimeCorrect = 2;\r\nfor idx = 0.01:0.01:0.2\r\n    assert(isequal(rand2ServiceTime(input1,idx),serviceTimeCorrect))\r\n    assert(isequal(rand2ServiceTime(input1,idx+0.2),serviceTimeCorrect+1))\r\n    assert(isequal(rand2ServiceTime(input1,idx+0.4),serviceTimeCorrect+2))\r\n    assert(isequal(rand2ServiceTime(input1,idx+0.6),serviceTimeCorrect+3))\r\n    assert(isequal(rand2ServiceTime(input1,idx+0.8),serviceTimeCorrect+4))\r\nend","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":8703,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":27,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-06-10T20:37:53.000Z","updated_at":"2026-03-11T08:49:16.000Z","published_at":"2018-06-10T21:20:34.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInput is a matrix including service time and probability of service time. Another input is a random number. Function should transform the random number to service time.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFirst column of the input1 is service time and second column is probability of that service time.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[input1 = [\\n2 0.4\\n5 0.4\\n9 0.2]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe can calculate cumulative probability and Random Number Assignment with this input,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   Service                      Cumulative       Random Number\\n   Time        Probability      Probability      Assignment\\n     2             0.4              0.4          0.000 - 0.400\\n     5             0.4              0.8          0.400 - 0.800\\n     9             0.2              1.0          0.800 - 1.000]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003einput2 is a random number between 0 and 1 such as;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   input2 = 0.125]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRandom number can be transformed to service time with the table. Random number (input2) is between first line of random number assignment\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[0.000 \u003c Random number \u003c= 0.400]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eas a result\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   serviceTime = 2]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eNote:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e You can assume that the sum of the probabilities will be equal to one.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":2356,"title":"Simulating the selection of a state with given probabilities","description":"Lets say we have 3 different states [1,2,3] with the probabilities of occurrences of each state is given as [0.5 0.2 0.3]. Which means 50% state 1 will be selected among others. Generate randomly selected states with the probabilities given\r\n\r\nOutput array will be consisting of state numbers based on the probabilities given as input. \r\n\r\nExample:\r\n(Quick tip: The higher simulation sampling sizes the more robust results)","description_html":"\u003cp\u003eLets say we have 3 different states [1,2,3] with the probabilities of occurrences of each state is given as [0.5 0.2 0.3]. Which means 50% state 1 will be selected among others. Generate randomly selected states with the probabilities given\u003c/p\u003e\u003cp\u003eOutput array will be consisting of state numbers based on the probabilities given as input.\u003c/p\u003e\u003cp\u003eExample:\r\n(Quick tip: The higher simulation sampling sizes the more robust results)\u003c/p\u003e","function_template":"function states = select_state(probs)\r\n  states = 0;\r\nend","test_suite":"%%\r\nprobs = rand;\r\nwhile sum(probs) \u003c 1\r\n    a = rand;\r\n    if a + sum(probs) \u003e 1\r\n        probs = [probs 1-sum(probs)];\r\n        break;\r\n    else\r\n        probs = [probs a];\r\n    end\r\nend\r\n\r\nstates = 1:length(probs);\r\nfor i = 1:100\r\n    y{i,1} = select_state(probs);\r\n    [nelements,centers] = hist(y{i},states);\r\n    probs_result{i} = nelements/length(y{i});\r\n    error(i,1) = sum(abs(probs-probs_result{i}));\r\nend\r\n\r\nassert(mean(error) \u003c= 0.05 \u0026 mean(error) \u003e 0);","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":27005,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":29,"test_suite_updated_at":"2014-06-11T14:25:30.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-06-11T00:57:51.000Z","updated_at":"2025-11-21T18:44:38.000Z","published_at":"2014-06-11T01:00:06.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLets say we have 3 different states [1,2,3] with the probabilities of occurrences of each state is given as [0.5 0.2 0.3]. Which means 50% state 1 will be selected among others. Generate randomly selected states with the probabilities given\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOutput array will be consisting of state numbers based on the probabilities given as input.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample: (Quick tip: The higher simulation sampling sizes the more robust results)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44694,"title":"Monte Carlo integration:  area of a polygon","description":"The area of a polygon (or any plane shape) can be evaluated by \u003chttps://www.mathworks.com/matlabcentral/cody/problems/179 Monte Carlo integration\u003e.  The process involves 'random' sampling of (x,y) points in the xy plane, and testing whether they fall inside or outside the shape.  That is illustrated schematically below for a circle.  \r\n\r\n\u003c\u003chttps://upload.wikimedia.org/wikipedia/commons/thumb/2/20/MonteCarloIntegrationCircle.svg/247px-MonteCarloIntegrationCircle.svg.png\u003e\u003e\r\n\r\n^\r\n\r\n*Steps:*\r\n\r\n# Define a 2D region within which to sample points.  In the present problem you must choose the rectangular box (aligned to the axes) that bounds the specified polygon.  \r\n# By a 'random' process generate coordinates of a point within the bounding box.  In the present problem a basic scheme using the uniform pseudorandom distribution available in MATLAB must be employed.  _Other schemes in use include quasi-random sampling (for greater uniformity of coverage) and stratified sampling (with more attention near the edges of the polygon)._\r\n# Determine \u003chttps://www.mathworks.com/matlabcentral/cody/problems/198 whether the sampled point is inside or outside the polygon\u003e.  _Due to working in double precision, it is extremely unlikely to sample a point falling exactly on the edge of the polygon, and consequently if it does happen it doesn't really matter whether it's counted as inside or outside or null._  \r\n# Repeat steps 2–3 |N| times.  \r\n# Based upon the proportion of sampled points falling within the polygon, report the approximate area of the polygon.  \r\n\r\nInputs to your function will be |N|, the number of points to sample, and |polygonX| \u0026 |polygonY|, which together constitute \u003chttps://www.mathworks.com/matlabcentral/cody/problems/194 an ordered list of polygon vertices\u003e.  |N| will always be a positive integer.  |polygonX| \u0026 |polygonY| will always describe a single, continuous outline;  however, the polygon may be self-intersecting.  \r\n\r\nFor polygons that are self-intersecting, you must find the area of the enclosed point set. In the case of the cross-quadrilateral, it is treated as two simple triangles (cf. three triangles in the first figure below), and the clockwise/counterclockwise ordering of points is irrelevant.  A self-intersecting pentagram (left \u0026 middle of the second figure below) will therefore have the same area as a concave decagon (right).\r\n\r\n\u003c\u003chttps://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Complex_polygon.svg/288px-Complex_polygon.svg.png\u003e\u003e\r\n\r\n\u003c\u003chttps://upload.wikimedia.org/wikipedia/commons/thumb/8/80/Pentagram_interpretations.svg/320px-Pentagram_interpretations.svg.png\u003e\u003e\r\n\r\n^\r\n\r\nEXAMPLE\r\n\r\n % Input\r\n N = 1000\r\n polygonX = [1 0 -1  0]\r\n polygonY = [0 1  0 -1]\r\n % Output\r\n A = 2.036\r\n\r\nExplanation:  the above polygon is a square of side-length √2 centred on the origin, but rotated by 45°.  The exact area is hence 2.  As the value of |N| is moderate, the estimate by Monte Carlo integration is moderately accurate (an error of 0.036 in this example, corresponding to 509 of the 1000 sampled points falling within the polygon).  \r\nOf course, if the code were run again then a slightly different value of |A| would probably be returned, such as |A|=1.992 (corresponding to 498 of the 1000 sampled points falling within the polygon), due to the random qualities of the technique.  ","description_html":"\u003cp\u003eThe area of a polygon (or any plane shape) can be evaluated by \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/179\"\u003eMonte Carlo integration\u003c/a\u003e.  The process involves 'random' sampling of (x,y) points in the xy plane, and testing whether they fall inside or outside the shape.  That is illustrated schematically below for a circle.\u003c/p\u003e\u003cimg src = \"https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/MonteCarloIntegrationCircle.svg/247px-MonteCarloIntegrationCircle.svg.png\"\u003e\u003cp\u003e^\u003c/p\u003e\u003cp\u003e\u003cb\u003eSteps:\u003c/b\u003e\u003c/p\u003e\u003col\u003e\u003cli\u003eDefine a 2D region within which to sample points.  In the present problem you must choose the rectangular box (aligned to the axes) that bounds the specified polygon.\u003c/li\u003e\u003cli\u003eBy a 'random' process generate coordinates of a point within the bounding box.  In the present problem a basic scheme using the uniform pseudorandom distribution available in MATLAB must be employed.  \u003ci\u003eOther schemes in use include quasi-random sampling (for greater uniformity of coverage) and stratified sampling (with more attention near the edges of the polygon).\u003c/i\u003e\u003c/li\u003e\u003cli\u003eDetermine \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/198\"\u003ewhether the sampled point is inside or outside the polygon\u003c/a\u003e.  \u003ci\u003eDue to working in double precision, it is extremely unlikely to sample a point falling exactly on the edge of the polygon, and consequently if it does happen it doesn't really matter whether it's counted as inside or outside or null.\u003c/i\u003e\u003c/li\u003e\u003cli\u003eRepeat steps 2–3 \u003ctt\u003eN\u003c/tt\u003e times.\u003c/li\u003e\u003cli\u003eBased upon the proportion of sampled points falling within the polygon, report the approximate area of the polygon.\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eInputs to your function will be \u003ctt\u003eN\u003c/tt\u003e, the number of points to sample, and \u003ctt\u003epolygonX\u003c/tt\u003e \u0026 \u003ctt\u003epolygonY\u003c/tt\u003e, which together constitute \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/194\"\u003ean ordered list of polygon vertices\u003c/a\u003e.  \u003ctt\u003eN\u003c/tt\u003e will always be a positive integer.  \u003ctt\u003epolygonX\u003c/tt\u003e \u0026 \u003ctt\u003epolygonY\u003c/tt\u003e will always describe a single, continuous outline;  however, the polygon may be self-intersecting.\u003c/p\u003e\u003cp\u003eFor polygons that are self-intersecting, you must find the area of the enclosed point set. In the case of the cross-quadrilateral, it is treated as two simple triangles (cf. three triangles in the first figure below), and the clockwise/counterclockwise ordering of points is irrelevant.  A self-intersecting pentagram (left \u0026 middle of the second figure below) will therefore have the same area as a concave decagon (right).\u003c/p\u003e\u003cimg src = \"https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Complex_polygon.svg/288px-Complex_polygon.svg.png\"\u003e\u003cimg src = \"https://upload.wikimedia.org/wikipedia/commons/thumb/8/80/Pentagram_interpretations.svg/320px-Pentagram_interpretations.svg.png\"\u003e\u003cp\u003e^\u003c/p\u003e\u003cp\u003eEXAMPLE\u003c/p\u003e\u003cpre\u003e % Input\r\n N = 1000\r\n polygonX = [1 0 -1  0]\r\n polygonY = [0 1  0 -1]\r\n % Output\r\n A = 2.036\u003c/pre\u003e\u003cp\u003eExplanation:  the above polygon is a square of side-length √2 centred on the origin, but rotated by 45°.  The exact area is hence 2.  As the value of \u003ctt\u003eN\u003c/tt\u003e is moderate, the estimate by Monte Carlo integration is moderately accurate (an error of 0.036 in this example, corresponding to 509 of the 1000 sampled points falling within the polygon).  \r\nOf course, if the code were run again then a slightly different value of \u003ctt\u003eA\u003c/tt\u003e would probably be returned, such as \u003ctt\u003eA\u003c/tt\u003e=1.992 (corresponding to 498 of the 1000 sampled points falling within the polygon), due to the random qualities of the technique.\u003c/p\u003e","function_template":"function A = monteCarloArea(N, polygonX, polygonY)\r\n    % Fun starts here\r\nend\r\n\r\n\r\n% Note:  the Test Suite has been designed to account for variability in outputs. \r\n%        Nevertheless, it is possible that on rare occasions a valid submission \r\n%        might fail the Test Suite in one instance.  \r\n%        If your submission has narrowly failed only one of the test cases, \r\n%        then please try resubmitting it, in case it was just due to 'bad luck'.  ","test_suite":"%% No silly stuff\r\n% This Test Suite can be updated if inappropriate 'hacks' are discovered \r\n% in any submitted solutions, so your submission's status may therefore change over time.  \r\n\r\n% BEGIN EDIT (2019-06-29).  \r\n% Ensure only builtin functions will be called.  \r\n! rm -v fileread.m\r\n! rm -v assert.m\r\n% END OF EDIT (2019-06-29).  \r\n\r\nassessFunctionAbsence({'regexp', 'regexpi', 'str2num'}, 'FileName','monteCarloArea.m')\r\n\r\nRE = regexp(fileread('monteCarloArea.m'), '\\w+', 'match');\r\ntabooWords = {'ans', 'area', 'polyarea'};\r\ntestResult = cellfun( @(z) ismember(z, tabooWords), RE );\r\nmsg = ['Please do not do that in your code!' char([10 13]) ...\r\n    'Found: ' strjoin(RE(testResult)) '.' char([10 13]) ...\r\n    'Banned word.' char([10 13])];\r\nassert(~any( testResult ), msg)\r\n\r\n\r\n%% Unit square, in first quadrant\r\nNvec = 1 : 7 : 200;\r\npolygonX = [0 1 1 0];\r\npolygonY = [0 0 1 1];\r\nareaVec = arrayfun(@(N) monteCarloArea(N, polygonX, polygonY), Nvec);\r\narea_correct = 1;\r\nassert( all(areaVec==area_correct) )\r\n\r\n%% 3×3 square, offset from origin, in all four quadrants\r\nNvec = 1 : 19 : 500;\r\npolygonX = [ 1 1 -2 -2];\r\npolygonY = [-1 2  2 -1];\r\nareaVec = arrayfun(@(N) monteCarloArea(N, polygonX, polygonY), Nvec);\r\narea_correct = 9;\r\nassert( all(areaVec==area_correct) )\r\n\r\n\r\n%% Diamond, centred on origin, in all four quadrants:  small N (1)\r\nN = 1;\r\npolygonX = [1 0 -1  0];\r\npolygonY = [0 1  0 -1];\r\narea_valid = [0 4];\r\nareaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:1000);\r\nassert( all( ismember(areaVec, area_valid) ) , 'Invalid areas reported' )\r\nassert( all( ismember(area_valid, areaVec) ) , 'Not all valid areas accessible in your sampling scheme')\r\n\r\n%% Diamond, centred on origin, in all four quadrants:  small N (2)\r\nN = 2;\r\npolygonX = [1 0 -1  0];\r\npolygonY = [0 1  0 -1];\r\narea_valid = [0 2 4];\r\nareaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:1000);\r\nassert( all( ismember(areaVec, area_valid) ) , 'Invalid areas reported' )\r\nassert( all( ismember(area_valid, areaVec) ) , 'Not all valid areas accessible in your sampling scheme')\r\n\r\n%% Diamond, centred on origin, in all four quadrants:  small N (3)\r\nN = 4;\r\npolygonX = [1 0 -1  0];\r\npolygonY = [0 1  0 -1];\r\narea_valid = [0:4];\r\nareaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:1000);\r\nassert( all( ismember(areaVec, area_valid) ) , 'Invalid areas reported' )\r\nassert( all( ismember(area_valid, areaVec) ) , 'Not all valid areas accessible in your sampling scheme')\r\n\r\n%% Diamond, centred on origin, in all four quadrants:  moderate N (1)\r\nN = 100;\r\npolygonX = [1 0 -1  0];\r\npolygonY = [0 1  0 -1];\r\narea_exact = 2;\r\nfor j = 1 : 3,\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 4 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    assert( worstErrorFraction \u003e 0.05 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003c 0.40 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n%% Diamond, centred on origin, in all four quadrants:  moderate N (2)\r\nN = 1000;\r\npolygonX = [1 0 -1  0];\r\npolygonY = [0 1  0 -1];\r\narea_exact = 2;\r\nfor j = 1 : 3,\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 5 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    assert( worstErrorFraction \u003e 0.02 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003c 0.15 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n%% Diamond, centred on origin, in all four quadrants:  moderate N (3)\r\nN = 10000;\r\npolygonX = [1 0 -1  0];\r\npolygonY = [0 1  0 -1];\r\narea_exact = 2;\r\nfor j = 1 : 3,\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 6 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    assert( worstErrorFraction \u003e 0.004 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003c 0.049 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n%% Diamond, centred on origin, in all four quadrants:  large N\r\nN = 100000;\r\npolygonX = [1 0 -1  0];\r\npolygonY = [0 1  0 -1];\r\narea_exact = 2;\r\nfor j = 1 : 3,\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 7 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    assert( worstErrorFraction \u003e 0.0016 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003c 0.016 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n\r\n%% Cross-quadrilateral, centred on origin, in all four quadrants:  moderate N (1)\r\nN = 100;\r\npolygonX = [ 1 -1  1 -1];\r\npolygonY = [-1  1  1 -1];\r\narea_exact = 2;\r\n\r\nfor j = 1 : 3,\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 4 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    assert( worstErrorFraction \u003e 0.05 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003c 0.40 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n%% Cross-quadrilateral, centred on origin, in all four quadrants:  moderate N (2)\r\nN = 10000;\r\nfor j = 1 : 10,\r\n    rVec = 100 * rand(2);\r\n    polygonX = [ 1 -1  1 -1] * rVec(1,1) + rVec(1,2);\r\n    polygonY = [-1  1  1 -1] * rVec(2,1) + rVec(2,2);\r\n    area_exact = 2 * rVec(1,1) * rVec(2,1);\r\n\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 6 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    assert( worstErrorFraction \u003e 0.004 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003c 0.049 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n\r\n%% 12-cornered polygon of unit 'circumradius' centred on origin:  moderate N\r\nN = 1000;\r\npoints = 12;\r\ncentre = [0 0];\r\ncircumradius = 1;\r\npolygonX = circumradius * cos(2 * pi * [0:points-1]/points) + centre(1);\r\npolygonY = circumradius * sin(2 * pi * [0:points-1]/points) + centre(2);\r\narea_exact = polyarea(polygonX, polygonY);\r\n\r\nfor j = 1 : 3,\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 5 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    %assert( worstErrorFraction \u003e 0.02 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003e 0.01 , 'Implausibly accurate' )\r\n    %assert( worstErrorFraction \u003c 0.15 , 'Implausibly inaccurate' )\r\n    assert( worstErrorFraction \u003c 0.08 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n%% P-cornered polygon of arbitrary 'circumradius', with centre offset from  the origin:  moderate N\r\nN = 1000;\r\nfor j = 1 : 10,\r\n    points = randi([5 100]);\r\n    centre = randi([2 100], [1 2]);\r\n    circumradius = randi([2 100]);\r\n    r = rand();\r\n    polygonX = circumradius * cos(2 * pi * (r+[0:points-1])/points) + centre(1);\r\n    polygonY = circumradius * sin(2 * pi * (r+[0:points-1])/points) + centre(2);\r\n    area_exact = polyarea(polygonX, polygonY);\r\n\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 5 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    %assert( worstErrorFraction \u003e 0.02 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003e 0.01 , 'Implausibly accurate' )\r\n    %assert( worstErrorFraction \u003c 0.15 , 'Implausibly inaccurate' )\r\n    assert( worstErrorFraction \u003c 0.08 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n\r\n%% 5-pointed star of unit 'circumradius' centred on origin:  moderate N\r\nN = 1000;\r\npoints = 5;\r\ncentre = [0 0];\r\ncircumradius = 1;\r\nx = circumradius * cos(2 * pi * [0:points-1]/points) + centre(1);\r\ny = circumradius * sin(2 * pi * [0:points-1]/points) + centre(2);\r\npolygonX = x([1:2:end, 2:2:end]);\r\npolygonY = y([1:2:end, 2:2:end]);\r\narea_exact = sqrt(650 - 290* sqrt(5))/4  * ( circumradius / sqrt((5 - sqrt(5))/10) )^2;\r\n% http://mathworld.wolfram.com/Pentagram.html\r\n\r\nfor j = 1 : 3,\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 5 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    %assert( worstErrorFraction \u003e 0.02 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003e 0.03 , 'Implausibly accurate' )\r\n    %assert( worstErrorFraction \u003c 0.15 , 'Implausibly inaccurate' )\r\n    assert( worstErrorFraction \u003c 0.25 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n%% 5-pointed star of arbitrary 'circumradius', with centre offset from  the origin:  moderate N\r\nN = 1000;\r\npoints = 5;\r\nfor j = 1 : 10,\r\n    centre = randi([2 100], [1 2]);\r\n    circumradius = randi([2 100]);\r\n    r = rand();\r\n    x = circumradius * cos(2 * pi * (r+[0:points-1])/points) + centre(1);\r\n    y = circumradius * sin(2 * pi * (r+[0:points-1])/points) + centre(2);\r\n    polygonX = x([1:2:end, 2:2:end]);\r\n    polygonY = y([1:2:end, 2:2:end]);\r\n    area_exact = sqrt(650 - 290* sqrt(5))/4  * ( circumradius / sqrt((5 - sqrt(5))/10) )^2;\r\n    % http://mathworld.wolfram.com/Pentagram.html\r\n\r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 5 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    %assert( worstErrorFraction \u003e 0.02 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003e 0.03 , 'Implausibly accurate' )\r\n    %assert( worstErrorFraction \u003c 0.15 , 'Implausibly inaccurate' )\r\n    assert( worstErrorFraction \u003c 0.25 , 'Implausibly inaccurate' )\r\nend;\r\n\r\n\r\n%% P-pointed star of arbitrary 'circumradius', with centre offset from  the origin:  moderate N\r\nN = 1000;\r\nfor j = 1 : 20,\r\n    points = 3 * randi([3 10]) - 1;\r\n    centre = randi([2 100], [1 2]);\r\n    circumradius = randi([2 30]);\r\n    r = rand();\r\n    x = circumradius * cos(2 * pi * (r+[0:points-1])/points) + centre(1);\r\n    y = circumradius * sin(2 * pi * (r+[0:points-1])/points) + centre(2);\r\n    polygonX = x([1:3:end, 2:3:end, 3:3:end]);\r\n    polygonY = y([1:3:end, 2:3:end, 3:3:end]);\r\n    \r\n    area_polyarea = polyarea(polygonX, polygonY);                % Incorrect value\r\n    warning('off', 'MATLAB:polyshape:repairedBySimplify')\r\n    area_polyshapeArea1 = area( polyshape(polygonX, polygonY) ); % Incorrect value\r\n    area_polyshapeArea2 = area( polyshape(polygonX, polygonY, 'Simplify',false) );  % Incorrect value\r\n    \r\n    % REFERENCE:  http://web.sonoma.edu/users/w/wilsonst/papers/stars/a-p/default.html\r\n    % Here: a {points/3} star\r\n    k = 3;\r\n    sideLength = circumradius * sind(180/points) * secd(180*(k-1)/points);\r\n    apothem = circumradius * cosd(180*k/points);\r\n    area_exact = points * sideLength * apothem;                  % Correct value\r\n    fprintf('Area estimates from different methods:  \\r\\npolyarea = %4.1f;  polyshape.area = %4.1f or %4.1f;  geometrical analysis = %4.1f\\r\\n', ...\r\n        area_polyarea, area_polyshapeArea1, area_polyshapeArea2, area_exact);\r\n    \r\n    areaVec = arrayfun(@(dummy) monteCarloArea(N, polygonX, polygonY), 1:10);\r\n    assert( length(unique(areaVec)) \u003e 5 , 'Cannot have so many identical outputs')\r\n    worstErrorFraction = max( abs(area_exact - areaVec) ) / area_exact\r\n    %assert( worstErrorFraction \u003e 0.02 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003e 0.01 , 'Implausibly accurate' )\r\n    assert( worstErrorFraction \u003c 0.15 , 'Implausibly inaccurate' )\r\nend;\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":7,"test_suite_updated_at":"2019-06-29T13:06:05.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2018-07-02T02:19:05.000Z","updated_at":"2025-09-14T14:22:43.000Z","published_at":"2018-07-02T08:55:01.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.png\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/media/image2.png\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId3\",\"target\":\"/media/image3.png\"}],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe area of a polygon (or any plane shape) can be evaluated by\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/179\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMonte Carlo integration\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The process involves 'random' sampling of (x,y) points in the xy plane, and testing whether they fall inside or outside the shape. That is illustrated schematically below for a circle.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e^\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eSteps:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDefine a 2D region within which to sample points. In the present problem you must choose the rectangular box (aligned to the axes) that bounds the specified polygon.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBy a 'random' process generate coordinates of a point within the bounding box. In the present problem a basic scheme using the uniform pseudorandom distribution available in MATLAB must be employed. \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOther schemes in use include quasi-random sampling (for greater uniformity of coverage) and stratified sampling (with more attention near the edges of the polygon).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDetermine\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/198\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ewhether the sampled point is inside or outside the polygon\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eDue to working in double precision, it is extremely unlikely to sample a point falling exactly on the edge of the polygon, and consequently if it does happen it doesn't really matter whether it's counted as inside or outside or null.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRepeat steps 2–3\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e times.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBased upon the proportion of sampled points falling within the polygon, report the approximate area of the polygon.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInputs to your function will be\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, the number of points to sample, and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003epolygonX\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u0026amp;\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003epolygonY\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, which together constitute\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/194\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ean ordered list of polygon vertices\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e will always be a positive integer. \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003epolygonX\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u0026amp;\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003epolygonY\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e will always describe a single, continuous outline; however, the polygon may be self-intersecting.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor polygons that are self-intersecting, you must find the area of the enclosed point set. In the case of the cross-quadrilateral, it is treated as two simple triangles (cf. three triangles in the first figure below), and the clockwise/counterclockwise ordering of points is irrelevant. A self-intersecting pentagram (left \u0026amp; middle of the second figure below) will therefore have the same area as a concave decagon (right).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId2\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId3\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e^\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEXAMPLE\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ % Input\\n N = 1000\\n polygonX = [1 0 -1  0]\\n polygonY = [0 1  0 -1]\\n % Output\\n A = 2.036]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExplanation: the above polygon is a square of side-length √2 centred on the origin, but rotated by 45°. The exact area is hence 2. As the value of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is moderate, the estimate by Monte Carlo integration is moderately accurate (an error of 0.036 in this example, corresponding to 509 of the 1000 sampled points falling within the polygon). Of course, if the code were run again then a slightly different value of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e would probably be returned, such as\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e=1.992 (corresponding to 498 of the 1000 sampled points falling within the polygon), due to the random qualities of the technique.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPcAAADwCAYAAADcifLrAAAjU0lEQVR42u1dB5gV1dn+7tBdK01AsFIEESKIERULttgNiAZ77GBAorFrRESj2DU2NJYoEDF2fzuCigYj2FEjIghSpHdEYOf/3nvO6t3Zmd25e6edme99nvdhmb17p5z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kq3pHqVdRC++YFr0GDJ3jtZTOKQnepwql7J5TrMCu+uOVvF57E8mfT+1pnuUdhG9CAQCgUAgEAgEAoFAIBAIBOnB/wNopWkMeaxRlQAAAABJRU5ErkJggg==\"},{\"partUri\":\"/media/image2.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAADwCAYAAACgyrkbAAAXbElEQVR42u2dB7hU1fHAx4ogGgREUBFs2KKoaBKNBRVFYyxR/McSaxSNBVsM9kBiAf1bMPYWbLHFqEETW2zYe+9SooioCCigaIy5457jnbdv777dt7t3b/n9vm++T9nde8+dOWfeuWfOmREBAAAAAAAAAACAvNAxkAVRAwDETfdAPgzk5UB6oA4AiJNdAvnWyVjUAQBxMsI4IJUtUAkAxMXNRQ7orUAWQS0AEAevOMczyTih4agFABrNwoF85ZzOIYHc6f57biAroB4AaCRrmFnPZoGsFMgX7v/vQj0A0EhsBMyH4EeYf9sJFQFAo/DO5mPzbx0CecP9+3uBdEZNANAIbnKO5qGif9/SzILORE0A0AhedU7mwhKf3eg++zqQ/qgKAOqJjYAdWuLznoHMdJ8/Esh8qAwA6sXq5jVr84jvHGG+sx8qA4B6YSNgS0V8Z4FAnnPfmR7IkqgNAOrB76V1BKwU6wfyjfvuZagNAOqBX2R+uILvXuK++99ANkR1AFAr/gzYRRV8t2sg09z3NW/QQqgPANqLOhAfATuswt/sI+Ga0VGoEADay2pSff4fDcPf737zWSDLokYAaA9DjAPqWcXv1jAzp5tRIwC0h5MlDK1Xy2jjvLZFlQBQLTc4BzK+Hb/tFMhE9/t3pFBRAwCgYl52DuTidv5+RzMLGok6AaBStP7XPOc8htVwnb+7a+i1VkWtAFAJq0p9KmAsF8hsd517USsAVMLOxgH1qvFax5tr7YpqAaAtaomAFaMpPV5z15saSBfUCwDlqCUCVopNpHBGTK85BvUCQDlecs7ikjpe8xp3zf8Esi4qBoBS2AjY4XW8ruYT+tRd92kp5BECAGiBjYANqvO1DzbXPghVA0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LNmcYJ3SPxVNr4QIiAAYAUcklfYpyQ5mZuZKUNImAA0AKtqnGdcQzXSOMqbfzU3GcAqgcARStt3GScw5XSmEobQ4UIGACUQCtt3Gmc0JgG3ONcd+13UTcAFKMn0x80Tmhkna9/j7vuOFQNAKVYPJCnjBM6to7XnuKuOQo1A0AUXSSstKFyVB2uaSNge6FiACiHVtp4TcJKGwfUeD0bAVsP9QJAW2iljQkSVtrYrYZrHSBEwACgSrTSxmQJK21s387rnOOuMQGVAkA19JOWlTa2acc1fATsDtQJANWyViDTJay0sWmVv3/f/XY0qgSA9vBjaVlpY/0Kf9dFwgXovVEjALQXjWbNds5khlRW12tD44DWR4UAUAtbBvKlcygfBbJaG9/fX8JwfmfUBwC1smMgX0tllTbOdt+biNoAoF5oXXef5L5cpY273XfuRGUAUE/2da9WvtJGzxLfec99fgbqAoB6M0zCReYXpWWlDRsB2wdVAUAjOElKV9rYQIiAAUAMnC6tK20QAQOA2DhLWlbauMD99yRUAwCNpjjJvQ/V/xPVAEAcaGmfW40T+tbNjAAAYkGLHN5lHNB+qAQA4kQTj10VyAPSMjQPAAAAAAAAAAAAAAAA9eR/oeqV3auxALsAAAAASUVORK5CYII=\"},{\"partUri\":\"/media/image3.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAACWCAYAAACvgFEsAAA0/klEQVR42u1dB3wUxfffcne5Sy69kt5IJUB6CIQmvRNqaCJVQAQBRUEEAcVKVaQJigXsBQsIP3sXAbErCgoooNj/CneXm/+8u1nYLNfr5m6+n8/7QG53p7y38503u2/fMAwFBQUFBQUFBQUFBQUFBQUFBQUFRfPDbCx/YEFY4vxQ/14sB7Cw1BSy1Ucxlo+wvINlP5bO1EwUzQVfYnmdSCMhuvfJ32ewRGE55EcCPIzlOBbewfNPYTHIUM+utMvSNc7qwxd4ltwfuVjKsbQOEP1TBAH2if7/D7mRM8nfO2VAgCos6gC40T1FgM7qwxc46Mf7gxIghVvgbB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PJb89JCNDSPWCPAMX6tUaA4rY4ah9GQoBi+7CScxPIvbQDS1cv28sd+0rbaes+FuxljwAt6d8aAYp1WChZAovH2RoLBGhL/ztlpvMLAJf2ZtHfwrICDPGWaLmyhxjmQaKUEeQ3cLc/FClDcOPXEbaHT5EiLbjeMCNvId4L/B1tocxlFsoRzskQlXkdOZeRLLH2kJtB2s4EUT+yiHs+kdyI4vJHidoG591GyptkpR2bGO98cO+MjaJF/fvSho2E9peRY/Dv80QPoYw5w0cDOVZC7AbHs0W6E+psRx5rTCU25UXnl0j0y1hor9TuvR20j7icMol9GMm5c8k9ByuJPC/byx37StspvY8t2atAov9p5JjWgv6kj6LENpPe41NE5UjHWSFZAoNn+YqFaxkrHCEXnTfBdOItNFf0IF6LP9GW8e5nP3K2kacflgeCvXxpX1f078o14nGWRCZKhjyvbY46bwJlMyW/xcRDDAb9ydVGUk+hOUAZQG1yRf/OXiMdZ+DNrSIe65AA5xgKCgoKCgoKCgoKCgoKCgoKCgoKGeH/AS8924+Oc1GZAAAAAElFTkSuQmCC\"}]}"},{"id":42674,"title":"Cody meets Xiangqi: foresee the unseen (Part 1)","description":"This is the first part of the Xiangqi series. The second part in this series is: \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42685-cody-meets-xiangqi-foresee-the-unseen-part-2 Cody meets Xiangqi: foresee the unseen (Part 2)\u003e\r\n\r\n\u003chttps://en.wikipedia.org/wiki/Xiangqi Xiangqi\u003e, also known as *Chinese Chess* (and 象棋 in Chinese characters), is one of the most popular board games in China. The modern Xiangqi board contains a middle section which divides two players' sides and is marked the \"Chu River–Han border\", in reference to the Chu–Han Contention between \u003chttps://en.wikipedia.org/wiki/Xiang_Yu Xiang Yu\u003e and \u003chttps://de.wikipedia.org/wiki/Han_Gaozu Liu Bang\u003e, two prominent warlords and opponents who fought thousands of battles against each other for supremacy over China in the late Qin dynasty (206–202 BC). Those interested in the story of the Chu–Han Contention and its relation to Xiangqi are referred to \u003chttps://en.wikipedia.org/wiki/Chu%E2%80%93Han_Contention here\u003e.\r\n\r\nFresh to Xiangqi, Cody becomes interested in Xiangqi by raising a question: _Who is the stronger player of Xiangqi between Xiang Yu and Liu Bang_? To answer this question, Cody designs a match for Xiang Yu and Liu Bang, in which Cody serves as the referee. The smart Cody referee also sets an intelligent rule to determine the winner: \r\n\r\n_In a succession of Xiangqi games, once Xiang Yu wins Na games *consecutively*, whereas Liu Bang has not won Nb games *consecutively*, Cody immediately announces Xiang Yu as the winner. Contrarily, once Liu Bang defeats Xiang Yu Nb times *consecutively*, whereas Xiang Yu has not won Na times *consecutively*, Liu Bang becomes the winner._ \r\n\r\nCody suggests that Na \u003e 1 and Nb \u003e 1, in order to enhance, to some extent, the confidence of the result of the match. Suppose in each individual game, the probability Xiang Yu would win is p, and the probability Liu Bang would win is 1 - p, which implicitly assumes that the probability of a tie is 0 (because they both refuse to draw and will fight to death). Unfortunately, this well-designed match has never taken place. Regretfully, Cody requests us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write a function\r\n\r\n                                sol = Xiangqi(p, Na, Nb)\r\n\r\nwith input: 0 \u003c= p \u003c= 1, Na \u003e 1, Nb \u003e 1, and output: sol --- the probability that Xiang Yu wins. Your solution will be tested against its true value Q (which is computed but hided in the P-file EvaluateSolution.p) according to a hybrid absolute and relative error tolerance criterion:\r\n\r\n                      abs(sol - Q) \u003c= max(AbsTol, RelTol*abs(sol))\r\n\r\nwhere AbsTol and RelTol are absolute and relative error tolerances, respectively, which will be specified in the test suite. You are encouraged to optimize the performance (rather than the usual Cody size) of your code as much as possible, as the score of your solution will be measured based on the *speed* of your code. \r\n\r\nHave fun!\r\n","description_html":"\u003cp\u003eThis is the first part of the Xiangqi series. The second part in this series is: \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42685-cody-meets-xiangqi-foresee-the-unseen-part-2\"\u003eCody meets Xiangqi: foresee the unseen (Part 2)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Xiangqi\"\u003eXiangqi\u003c/a\u003e, also known as \u003cb\u003eChinese Chess\u003c/b\u003e (and 象棋 in Chinese characters), is one of the most popular board games in China. The modern Xiangqi board contains a middle section which divides two players' sides and is marked the \"Chu River–Han border\", in reference to the Chu–Han Contention between \u003ca href = \"https://en.wikipedia.org/wiki/Xiang_Yu\"\u003eXiang Yu\u003c/a\u003e and \u003ca href = \"https://de.wikipedia.org/wiki/Han_Gaozu\"\u003eLiu Bang\u003c/a\u003e, two prominent warlords and opponents who fought thousands of battles against each other for supremacy over China in the late Qin dynasty (206–202 BC). Those interested in the story of the Chu–Han Contention and its relation to Xiangqi are referred to \u003ca href = \"https://en.wikipedia.org/wiki/Chu%E2%80%93Han_Contention\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eFresh to Xiangqi, Cody becomes interested in Xiangqi by raising a question: \u003ci\u003eWho is the stronger player of Xiangqi between Xiang Yu and Liu Bang\u003c/i\u003e? To answer this question, Cody designs a match for Xiang Yu and Liu Bang, in which Cody serves as the referee. The smart Cody referee also sets an intelligent rule to determine the winner:\u003c/p\u003e\u003cp\u003e\u003ci\u003eIn a succession of Xiangqi games, once Xiang Yu wins Na games \u003cb\u003econsecutively\u003c/b\u003e, whereas Liu Bang has not won Nb games \u003cb\u003econsecutively\u003c/b\u003e, Cody immediately announces Xiang Yu as the winner. Contrarily, once Liu Bang defeats Xiang Yu Nb times \u003cb\u003econsecutively\u003c/b\u003e, whereas Xiang Yu has not won Na times \u003cb\u003econsecutively\u003c/b\u003e, Liu Bang becomes the winner.\u003c/i\u003e\u003c/p\u003e\u003cp\u003eCody suggests that Na \u0026gt; 1 and Nb \u0026gt; 1, in order to enhance, to some extent, the confidence of the result of the match. Suppose in each individual game, the probability Xiang Yu would win is p, and the probability Liu Bang would win is 1 - p, which implicitly assumes that the probability of a tie is 0 (because they both refuse to draw and will fight to death). Unfortunately, this well-designed match has never taken place. Regretfully, Cody requests us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write a function\u003c/p\u003e\u003cpre\u003e                                sol = Xiangqi(p, Na, Nb)\u003c/pre\u003e\u003cp\u003ewith input: 0 \u0026lt;= p \u0026lt;= 1, Na \u0026gt; 1, Nb \u0026gt; 1, and output: sol --- the probability that Xiang Yu wins. Your solution will be tested against its true value Q (which is computed but hided in the P-file EvaluateSolution.p) according to a hybrid absolute and relative error tolerance criterion:\u003c/p\u003e\u003cpre\u003e                      abs(sol - Q) \u0026lt;= max(AbsTol, RelTol*abs(sol))\u003c/pre\u003e\u003cp\u003ewhere AbsTol and RelTol are absolute and relative error tolerances, respectively, which will be specified in the test suite. You are encouraged to optimize the performance (rather than the usual Cody size) of your code as much as possible, as the score of your solution will be measured based on the \u003cb\u003espeed\u003c/b\u003e of your code.\u003c/p\u003e\u003cp\u003eHave fun!\u003c/p\u003e","function_template":"function sol = Xiangqi(p, Na, Nb)\r\n  sol = p;\r\nend","test_suite":"%%\r\n% By courtesy of Alfonso Nieto-Castanon\r\nurlwrite('https://sites.google.com/a/alfnie.com/alfnie/software/SetSolutionScore.p?attredirects=0\u0026amp;d=1','SetSolutionScore.p');\r\nrehash path;\r\n\r\n%%\r\nfh = fopen('EvaluateSolution.p','wb');\r\nfwrite(fh, hex2dec(reshape('7630312E30307630302E3030000E601C0AF25FB100000056000000A4000000D6820EB5B30514117A9E6E5DB36898AFFFCC5086DFAF59C2910AEB07B88523DABE546868AC2BDAC3795467A7BCD91A89E2F578F2EDE92D63472A3B8FCA3F216CB3B66B010B5B924A5F514E19B90225B0978A54DA881119917D211CB055361918CAA0670F6D0E8ED17B319492619F4361BFB4C3C31D68E11F4BA084C6456783C358296B3E63E16C78EF2B0279074BCB707265EB4C044BFF7F25BA0A9678B75D36B9ACEE6853',2,[]).')); rehash path; fclose(fh); \r\n\r\n%%\r\np = 0; Na = 2; Nb = 3;\r\nAbsTol = 1e-6; RelTol = 1e-5;\r\nsol = Xiangqi(p, Na, Nb);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\n\r\n%%\r\np = 1; Na = 3; Nb = 2;\r\nAbsTol = 1e-6; RelTol = 1e-5;\r\nsol = Xiangqi(p, Na, Nb);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\n\r\n%%\r\np = 0.4; Na = 2; Nb = 3;\r\nAbsTol = 5e-4; RelTol = 5e-4;\r\nsol = Xiangqi(p, Na, Nb);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\n\r\n%%\r\np = 0.7; Na = 4; Nb = 2;\r\nAbsTol = 5e-4; RelTol = 5e-4;\r\nsol = Xiangqi(p, Na, Nb);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\n\r\n%%\r\np = 0.15; Na = 4; Nb = 2;\r\nAbsTol = 5e-5; RelTol = 1e-6;\r\nt = builtin('tic');\r\nsol = Xiangqi(p, Na, Nb);\r\nscore = builtin('toc',t);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\nSetSolutionScore(round(500*score));","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":9,"test_suite_updated_at":"2015-10-30T08:18:09.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-10-30T05:02:43.000Z","updated_at":"2025-11-30T16:38:45.000Z","published_at":"2015-10-30T05:45:36.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is the first part of the Xiangqi series. The second part in this series is:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42685-cody-meets-xiangqi-foresee-the-unseen-part-2\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody meets Xiangqi: foresee the unseen (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Xiangqi\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eXiangqi\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, also known as\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eChinese Chess\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (and 象棋 in Chinese characters), is one of the most popular board games in China. The modern Xiangqi board contains a middle section which divides two players' sides and is marked the \\\"Chu River–Han border\\\", in reference to the Chu–Han Contention between\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Xiang_Yu\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eXiang Yu\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://de.wikipedia.org/wiki/Han_Gaozu\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eLiu Bang\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, two prominent warlords and opponents who fought thousands of battles against each other for supremacy over China in the late Qin dynasty (206–202 BC). Those interested in the story of the Chu–Han Contention and its relation to Xiangqi are referred to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Chu%E2%80%93Han_Contention\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehere\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFresh to Xiangqi, Cody becomes interested in Xiangqi by raising a question:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eWho is the stronger player of Xiangqi between Xiang Yu and Liu Bang\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e? To answer this question, Cody designs a match for Xiang Yu and Liu Bang, in which Cody serves as the referee. The smart Cody referee also sets an intelligent rule to determine the winner:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eIn a succession of Xiangqi games, once Xiang Yu wins Na games\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econsecutively\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, whereas Liu Bang has not won Nb games\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econsecutively\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, Cody immediately announces Xiang Yu as the winner. Contrarily, once Liu Bang defeats Xiang Yu Nb times\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econsecutively\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, whereas Xiang Yu has not won Na times\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econsecutively\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, Liu Bang becomes the winner.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCody suggests that Na \u0026gt; 1 and Nb \u0026gt; 1, in order to enhance, to some extent, the confidence of the result of the match. Suppose in each individual game, the probability Xiang Yu would win is p, and the probability Liu Bang would win is 1 - p, which implicitly assumes that the probability of a tie is 0 (because they both refuse to draw and will fight to death). Unfortunately, this well-designed match has never taken place. Regretfully, Cody requests us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write a function\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[                                sol = Xiangqi(p, Na, Nb)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewith input: 0 \u0026lt;= p \u0026lt;= 1, Na \u0026gt; 1, Nb \u0026gt; 1, and output: sol --- the probability that Xiang Yu wins. Your solution will be tested against its true value Q (which is computed but hided in the P-file EvaluateSolution.p) according to a hybrid absolute and relative error tolerance criterion:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[                      abs(sol - Q) \u003c= max(AbsTol, RelTol*abs(sol))]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewhere AbsTol and RelTol are absolute and relative error tolerances, respectively, which will be specified in the test suite. You are encouraged to optimize the performance (rather than the usual Cody size) of your code as much as possible, as the score of your solution will be measured based on the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003espeed\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of your code.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHave fun!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42503,"title":"Generating random matrix with given probability mass function","description":"Inspired by \u003chttp://www.mathworks.com/matlabcentral/cody/problems/2356-simulating-the-selection-of-a-state-with-given-probabilities Problem 2356. Simulating the selection of a state with given probabilities\u003e, let's consider a similar yet more useful problem. Write a function\r\n\r\n                             x = rndsampling(m,n,prob)\r\n\r\nto generate an m-by-n matrix x, whose entries are drawn independently from integer symbols 1:numel(prob) according to the given probability mass function prob. Specifically, symbol k occurs with probability prob(k), k = 1, 2, ..., numel(prob), where all(prob\u003e0) == 1 and sum(prob) == 1.","description_html":"\u003cp\u003eInspired by \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/2356-simulating-the-selection-of-a-state-with-given-probabilities\"\u003eProblem 2356. Simulating the selection of a state with given probabilities\u003c/a\u003e, let's consider a similar yet more useful problem. Write a function\u003c/p\u003e\u003cpre\u003e                             x = rndsampling(m,n,prob)\u003c/pre\u003e\u003cp\u003eto generate an m-by-n matrix x, whose entries are drawn independently from integer symbols 1:numel(prob) according to the given probability mass function prob. Specifically, symbol k occurs with probability prob(k), k = 1, 2, ..., numel(prob), where all(prob\u0026gt;0) == 1 and sum(prob) == 1.\u003c/p\u003e","function_template":"function x = rndsampling(m,n,prob);\r\n  x = rand(m,n)\r\nend","test_suite":"%%\r\nrnd = sort(rand(randi([10,20]),1));\r\nprob = vertcat(rnd(1,:),diff(rnd,1,1),1-rnd(end,:));\r\nsz = [1 1e5;1e5 1;1e3 1e2;randi([100 200], 100, 2)];\r\nsz = sz(randi(size(sz,1)),:);\r\nx = rndsampling(sz(1),sz(2),prob);\r\nprob_est = histcounts(x,1:numel(prob)+1,'Normalization','probability').';\r\nerr = mean(abs(prob_est - prob))\r\nassert(err \u003c 0.005 \u0026\u0026 isequal(size(x),sz) \u0026\u0026 all(~isnan(x(:))));\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":107,"test_suite_updated_at":"2015-08-13T18:44:59.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-11T19:26:49.000Z","updated_at":"2026-02-02T05:18:21.000Z","published_at":"2015-08-11T19:26:49.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInspired by\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/2356-simulating-the-selection-of-a-state-with-given-probabilities\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 2356. Simulating the selection of a state with given probabilities\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, let's consider a similar yet more useful problem. Write a function\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[                             x = rndsampling(m,n,prob)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eto generate an m-by-n matrix x, whose entries are drawn independently from integer symbols 1:numel(prob) according to the given probability mass function prob. Specifically, symbol k occurs with probability prob(k), k = 1, 2, ..., numel(prob), where all(prob\u0026gt;0) == 1 and sum(prob) == 1.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42685,"title":"Cody meets Xiangqi: foresee the unseen (Part 2)","description":"This is the second part of the Xiangqi series. The first part in this series is: \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42674-cody-meets-xiangqi-foresee-the-unseen Cody meets Xiangqi: foresee the unseen (Part 1)\u003e\r\n\r\nBeing increasingly interested in \u003chttps://en.wikipedia.org/wiki/Xiangqi Xiangqi\u003e (a.k.a., *Chinese Chess*), Mr. Cody has designed a new Xiangqi match for \u003chttps://en.wikipedia.org/wiki/Xiang_Yu Xiang Yu\u003e and \u003chttps://de.wikipedia.org/wiki/Han_Gaozu Liu Bang\u003e by taking into account the likelihood of tie games. The new rule is described as follows:\r\n\r\nOnce\r\n\r\n   1) Xiang Yu wins Na games consecutively,\r\n   2) Liu Bang wins Nb games consecutively, \r\n   3) No ties occur consecutively, \r\n\r\n*whichever comes first*, Mr. Cody announces the outcome accordingly as follows:\r\n\r\n   1) Xiang Yu is the final winner,\r\n   2) Liu Bang is the final winner, \r\n   3) They end up with a final draw.\r\n\r\nAgain, Cody asks us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write the following function\r\n\r\n                         [Pa, Pb, Pc] = Xiangqi2(a, b, Na, Nb, Nc)\r\n\r\nwhere \r\n\r\n* a: the probability that Xiang Yu wins one individual game\r\n* b: the probability that Liu Bang wins one individual game\r\n* Na: # of consecutive wins required for Xiang Yu to become the final winner\r\n* Nb: # of consecutive wins required for Liu Bang to become the final winner\r\n* Nc: # of consecutive ties required to result in a final draw\r\n* Pa: the probability that Xiang Yu wins the match\r\n* Pb: the probability that Liu Bang wins the match\r\n* Pc: the probability of a final draw\r\n\r\nThe main focus of this problem is on *Monte Carlo simulations*, rather than analytical approaches. Your provided solution Xiangqi2.m will be checked by a P-file EvaluateSolution.p, which mainly does 3 things as follows:\r\n\r\n1) Call your function [Pa, Pb, Pc] = Xiangqi2(a, b, Na, Nb, Nc) and then Check if the result P = [Pa, Pb, Pc] is within tolerance of its expected value Q. That is, If norm(P - Q) \u003c tol holds, it means that your solution is accurate enough. If this does not hold, your solution will be rejected. \r\n\r\n2) Check if your solution is based on *pure Monte Carlo simulations* or *analytical approaches*. If it is based on analytical approaches (i.e., using analytical expressions to directly compute the probabilities), then your solution will be rejected. EvaluateSolution.p accomplishes this goal by exploiting a combination of distinct features possessed by analytical solutions, but are generally not shared by Monte Carlo simulations. \r\n\r\n3) If your solution passes the above two checks, then the score of your solution will be determined based on the speed of your code. The faster your solution is, the smaller score you get. \r\n\r\nIf you have any concerns or suggestions on this problem, please feel free to leave me a comment. Thanks. \r\n\r\n ","description_html":"\u003cp\u003eThis is the second part of the Xiangqi series. The first part in this series is: \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42674-cody-meets-xiangqi-foresee-the-unseen\"\u003eCody meets Xiangqi: foresee the unseen (Part 1)\u003c/a\u003e\u003c/p\u003e\u003cp\u003eBeing increasingly interested in \u003ca href = \"https://en.wikipedia.org/wiki/Xiangqi\"\u003eXiangqi\u003c/a\u003e (a.k.a., \u003cb\u003eChinese Chess\u003c/b\u003e), Mr. Cody has designed a new Xiangqi match for \u003ca href = \"https://en.wikipedia.org/wiki/Xiang_Yu\"\u003eXiang Yu\u003c/a\u003e and \u003ca href = \"https://de.wikipedia.org/wiki/Han_Gaozu\"\u003eLiu Bang\u003c/a\u003e by taking into account the likelihood of tie games. The new rule is described as follows:\u003c/p\u003e\u003cp\u003eOnce\u003c/p\u003e\u003cpre\u003e   1) Xiang Yu wins Na games consecutively,\r\n   2) Liu Bang wins Nb games consecutively, \r\n   3) No ties occur consecutively, \u003c/pre\u003e\u003cp\u003e\u003cb\u003ewhichever comes first\u003c/b\u003e, Mr. Cody announces the outcome accordingly as follows:\u003c/p\u003e\u003cpre\u003e   1) Xiang Yu is the final winner,\r\n   2) Liu Bang is the final winner, \r\n   3) They end up with a final draw.\u003c/pre\u003e\u003cp\u003eAgain, Cody asks us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write the following function\u003c/p\u003e\u003cpre\u003e                         [Pa, Pb, Pc] = Xiangqi2(a, b, Na, Nb, Nc)\u003c/pre\u003e\u003cp\u003ewhere\u003c/p\u003e\u003cul\u003e\u003cli\u003ea: the probability that Xiang Yu wins one individual game\u003c/li\u003e\u003cli\u003eb: the probability that Liu Bang wins one individual game\u003c/li\u003e\u003cli\u003eNa: # of consecutive wins required for Xiang Yu to become the final winner\u003c/li\u003e\u003cli\u003eNb: # of consecutive wins required for Liu Bang to become the final winner\u003c/li\u003e\u003cli\u003eNc: # of consecutive ties required to result in a final draw\u003c/li\u003e\u003cli\u003ePa: the probability that Xiang Yu wins the match\u003c/li\u003e\u003cli\u003ePb: the probability that Liu Bang wins the match\u003c/li\u003e\u003cli\u003ePc: the probability of a final draw\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eThe main focus of this problem is on \u003cb\u003eMonte Carlo simulations\u003c/b\u003e, rather than analytical approaches. Your provided solution Xiangqi2.m will be checked by a P-file EvaluateSolution.p, which mainly does 3 things as follows:\u003c/p\u003e\u003cp\u003e1) Call your function [Pa, Pb, Pc] = Xiangqi2(a, b, Na, Nb, Nc) and then Check if the result P = [Pa, Pb, Pc] is within tolerance of its expected value Q. That is, If norm(P - Q) \u0026lt; tol holds, it means that your solution is accurate enough. If this does not hold, your solution will be rejected.\u003c/p\u003e\u003cp\u003e2) Check if your solution is based on \u003cb\u003epure Monte Carlo simulations\u003c/b\u003e or \u003cb\u003eanalytical approaches\u003c/b\u003e. If it is based on analytical approaches (i.e., using analytical expressions to directly compute the probabilities), then your solution will be rejected. EvaluateSolution.p accomplishes this goal by exploiting a combination of distinct features possessed by analytical solutions, but are generally not shared by Monte Carlo simulations.\u003c/p\u003e\u003cp\u003e3) If your solution passes the above two checks, then the score of your solution will be determined based on the speed of your code. The faster your solution is, the smaller score you get.\u003c/p\u003e\u003cp\u003eIf you have any concerns or suggestions on this problem, please feel free to leave me a comment. Thanks.\u003c/p\u003e","function_template":"function [Pa, Pb, Pc] = Xiangqi2(a, b, Na, Nb, Nc)\r\n% a: the probability that Xiang Yu wins one individual game\r\n% b: the probability that Liu Bang wins one individual game\r\n% Na: # of consecutive wins required for Xiang Yu to become the final winner\r\n% Nb: # of consecutive wins required for Liu Bang to become the final winner\r\n% Nc: # of consecutive ties required to result in a final draw\r\n% Pa: the probability that Xiang Yu wins the match\r\n% Pb: the probability that Liu Bang wins the match\r\n% Pc: the probability of a final draw\r\n    Pa = ;\r\n    Pb = ;\r\n    Pc = ;\r\nend","test_suite":"%%\r\n% Thanks to Alfonso Nieto-Castanon\r\nurlwrite('https://sites.google.com/a/alfnie.com/alfnie/software/SetSolutionScore.p?attredirects=0\u0026amp;d=1','SetSolutionScore.p');\r\nrehash path;\r\n\r\n%%\r\nfh = fopen('EvaluateSolution.p','wb');\r\nfwrite(fh, hex2dec(reshape('7630312E30307630302E3030000C701C97F61FB1000002D5000001CF000004E73DD68930A391F7C60A534B45A03EAF72EB08941F39EE01BF25BAE04DF43CF342FC1A763DF6B8F26BBED0BD4F2ABBB5927B1EEBAE8795E487F6E4EF2737CBB6646BC4DF145E14664B3A4DACCD7CB01C4EC2328AD76F196231D2CA02CDC2B15466FBA5BDDF9E6C0E5DE12CF07B2AAA50BD2F04FFB92E9BECBE232E01031340A8EDCA5C10DAC01BBE43685ED0AB79D9C6F2A090FB4E0E75CAA236D3D73AD659E0705C42792BC77D85951B2FC49DE856FB97AFD74C1DB66C874EDF5517BCFA14C6706CA5E61DE60F2771B64F6D634B858A1A30AD7C49778534CCCE7551C637DC53846B02140046F729C5EB2DC9C65F16C2FC4F34EA9F03A2056B8218ACAB9A9A8BC5DC8F2F3312740F86626ABA38E00903CE76846DEE175BEE04DC0815E050E4CD95BA8E5BD27A0B57F2413B71A0E4837FB0F86328AA82732C584F1F55C6CCD79CBC69D052011BA93357AAE3568E0086F159C083D665645A38584955283925F900254A6562F0C755323C40805328D04F27FD863E8B774B52E27FC3AA30CE689AC57DEFEE274DBBC2A4D9D320CF19AD873AA0AE806721EE78496F7ADA99EA48060F26FDEE7ED5E9F85B27F79AE176A6E8EAC4DD5127299122FF88139BC4B56A2ED3C5338A72676C4C99AD6DEBCD8BB5EB09',2,[]).')); rehash path; fclose(fh);\r\n\r\n%%\r\nfid = fopen('Xiangqi2.m');\r\ndelim = {' ', '\\n', ',', '.', ';', '''', '@', '+', '-', '*', '/', '\\', '^', '\u003e', '\u003c', '=', '\u0026', '|', '~', '{', '}', '[', ']', '(', ')'};\r\nfile = textscan(fid, '%s', 'CommentStyle', '%', 'MultipleDelimsAsOne', 1, 'Delimiter', delim); fclose(fid); \r\nassert(~any(ismember({'rng','RandStream','seed','state','twister','shufle','default'},file{1})));\r\n\r\n%%\r\na = 0; b = 0; Na = 2; Nb = 3; Nc = 2; tol = 1e-6;\r\nEvaluateSolution(a, b, Na, Nb, Nc, tol); \r\n\r\n%%\r\na = 0; b = 1; Na = 1; Nb = 2; Nc = 1; tol = 1e-6;\r\nEvaluateSolution(a, b, Na, Nb, Nc, tol); \r\n\r\n%%\r\na = 1; b = 0; Na = 3; Nb = 2; Nc = 1; tol = 1e-6;\r\nEvaluateSolution(a, b, Na, Nb, Nc, tol); \r\n\r\n%%\r\na = 0.15; b = 0.85; Na = 4; Nb = 2; Nc = 1; tol = 1e-4;\r\nEvaluateSolution(a, b, Na, Nb, Nc, tol);\r\n\r\n%%\r\na = 0.9; b = 0; Na = 3; Nb = 1; Nc = 2; tol = 1e-3;\r\nEvaluateSolution(a, b, Na, Nb, Nc, tol);\r\n\r\n%%\r\na = 0.65; b = 0.3; Na = 3; Nb = 2; Nc = 2; tol = 1e-3;\r\nEvaluateSolution(a, b, Na, Nb, Nc, tol);\r\n\r\n%%\r\nNa = 3; Nb = 2; Nc = 1; tol = 2e-3; \r\np = sort(rand(2,30)); \r\np = sort([p(1,:);diff(p);1-p(2,:)]);\r\nfor k = size(p,2):-1:1\r\n    a = p(3,k); b = p(2,k);\r\n    score(k) = EvaluateSolution(a, b, Na, Nb, Nc, tol);    \r\nend\r\nSetSolutionScore(round(mean(score)));","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":"2015-11-12T00:41:35.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2015-11-08T20:51:55.000Z","updated_at":"2015-11-12T03:39:15.000Z","published_at":"2015-11-10T00:22:37.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is the second part of the Xiangqi series. The first part in this series is:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42674-cody-meets-xiangqi-foresee-the-unseen\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody meets Xiangqi: foresee the unseen (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBeing increasingly interested in\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Xiangqi\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eXiangqi\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (a.k.a.,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eChinese Chess\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e), Mr. Cody has designed a new Xiangqi match for\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Xiang_Yu\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eXiang Yu\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://de.wikipedia.org/wiki/Han_Gaozu\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eLiu Bang\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e by taking into account the likelihood of tie games. The new rule is described as follows:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOnce\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   1) Xiang Yu wins Na games consecutively,\\n   2) Liu Bang wins Nb games consecutively, \\n   3) No ties occur consecutively,]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ewhichever comes first\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, Mr. Cody announces the outcome accordingly as follows:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   1) Xiang Yu is the final winner,\\n   2) Liu Bang is the final winner, \\n   3) They end up with a final draw.]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAgain, Cody asks us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write the following function\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[                         [Pa, Pb, Pc] = Xiangqi2(a, b, Na, Nb, Nc)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewhere\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ea: the probability that Xiang Yu wins one individual game\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eb: the probability that Liu Bang wins one individual game\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNa: # of consecutive wins required for Xiang Yu to become the final winner\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNb: # of consecutive wins required for Liu Bang to become the final winner\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNc: # of consecutive ties required to result in a final draw\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePa: the probability that Xiang Yu wins the match\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePb: the probability that Liu Bang wins the match\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePc: the probability of a final draw\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe main focus of this problem is on\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eMonte Carlo simulations\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, rather than analytical approaches. Your provided solution Xiangqi2.m will be checked by a P-file EvaluateSolution.p, which mainly does 3 things as follows:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1) Call your function [Pa, Pb, Pc] = Xiangqi2(a, b, Na, Nb, Nc) and then Check if the result P = [Pa, Pb, Pc] is within tolerance of its expected value Q. That is, If norm(P - Q) \u0026lt; tol holds, it means that your solution is accurate enough. If this does not hold, your solution will be rejected.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e2) Check if your solution is based on\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003epure Monte Carlo simulations\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eanalytical approaches\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. If it is based on analytical approaches (i.e., using analytical expressions to directly compute the probabilities), then your solution will be rejected. EvaluateSolution.p accomplishes this goal by exploiting a combination of distinct features possessed by analytical solutions, but are generally not shared by Monte Carlo simulations.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e3) If your solution passes the above two checks, then the score of your solution will be determined based on the speed of your code. The faster your solution is, the smaller score you get.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf you have any concerns or suggestions on this problem, please feel free to leave me a comment. Thanks.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"term":"tag:\"monte carlo\"","current_player_id":null,"fields":[{"name":"page","type":"integer","callback":null,"default":1,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"per_page","type":"integer","callback":null,"default":50,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"sort","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"body","type":"text","callback":null,"default":"*:*","directive":null,"facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":false},{"name":"group","type":"string","callback":null,"default":null,"directive":"group","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"difficulty_rating_bin","type":"string","callback":null,"default":null,"directive":"difficulty_rating_bin","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"id","type":"integer","callback":null,"default":null,"directive":"id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"tag","type":"string","callback":null,"default":null,"directive":"tag","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"product","type":"string","callback":null,"default":null,"directive":"product","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_at","type":"timeframe","callback":{},"default":null,"directive":"created_at","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"profile_id","type":"integer","callback":null,"default":null,"directive":"author_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_by","type":"string","callback":null,"default":null,"directive":"author","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player_id","type":"integer","callback":null,"default":null,"directive":"solver_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player","type":"string","callback":null,"default":null,"directive":"solver","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"solvers_count","type":"integer","callback":null,"default":null,"directive":"solvers_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"comments_count","type":"integer","callback":null,"default":null,"directive":"comments_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"likes_count","type":"integer","callback":null,"default":null,"directive":"likes_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leader_id","type":"integer","callback":null,"default":null,"directive":"leader_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leading_solution","type":"integer","callback":null,"default":null,"directive":"leading_solution","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true}],"filters":[{"name":"asset_type","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":"\"cody:problem\"","prepend":true},{"name":"profile_id","type":"integer","callback":{},"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":"author_id","static":null,"prepend":true}],"query":{"params":{"per_page":50,"term":"tag:\"monte carlo\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"monte carlo\"","","\"","monte carlo","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f1051797940\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f10517974e0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f1051792620\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f1051797c60\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f1051797b20\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f1051797a80\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f10517979e0\u003e":"tag:\"monte carlo\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f10517979e0\u003e":"tag:\"monte carlo\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"search","password":"J3bGPZzQ7asjJcCk","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"monte carlo\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"monte carlo\"","","\"","monte carlo","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f1051797940\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f10517974e0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f1051792620\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f1051797c60\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f1051797b20\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f1051797a80\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f10517979e0\u003e":"tag:\"monte carlo\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f10517979e0\u003e":"tag:\"monte carlo\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":44684,"difficulty_rating":"easy"},{"id":2356,"difficulty_rating":"easy-medium"},{"id":44694,"difficulty_rating":"medium"},{"id":42674,"difficulty_rating":"medium"},{"id":42503,"difficulty_rating":"medium-hard"},{"id":42685,"difficulty_rating":"unrated"}]}}