{"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":2831,"title":"Radiation Heat Transfer — View Factors (4)","description":"View factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates between surfaces. In particular, the thermal energy leaving a given surface is applied to other surfaces, as appropriate, based on how much the hot surface \"sees\" the other surfaces. As such, view factors are purely geometrical in nature. A range of view factor formulae are available \u003chttp://www.thermalradiation.net/tablecon.html here\u003e.\r\n\r\nFor this problem, calculate the view factor from surface 1 (an infinitely long plate) to surfaces 2 (n rows of in-line pipes):\r\n\r\n\u003c\u003chttp://www.thermalradiation.net/images/C-7fig.gif\u003e\u003e\r\n\r\nThe view factor for one row of pipes is F_1-2 (the first equation):\r\n\r\n\u003c\u003chttp://www.thermalradiation.net/images/C-7eq.gif\u003e\u003e\r\n\r\nThe second equation is utilized for more than one row of pipes. Any of the variables can be a vector. Also, note that D = d/b, where d is the pipe diameter and b is the center-to-center spacing between pipes.","description_html":"\u003cp\u003eView factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates between surfaces. In particular, the thermal energy leaving a given surface is applied to other surfaces, as appropriate, based on how much the hot surface \"sees\" the other surfaces. As such, view factors are purely geometrical in nature. A range of view factor formulae are available \u003ca href = \"http://www.thermalradiation.net/tablecon.html\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eFor this problem, calculate the view factor from surface 1 (an infinitely long plate) to surfaces 2 (n rows of in-line pipes):\u003c/p\u003e\u003cimg src = \"http://www.thermalradiation.net/images/C-7fig.gif\"\u003e\u003cp\u003eThe view factor for one row of pipes is F_1-2 (the first equation):\u003c/p\u003e\u003cimg src = \"http://www.thermalradiation.net/images/C-7eq.gif\"\u003e\u003cp\u003eThe second equation is utilized for more than one row of pipes. Any of the variables can be a vector. Also, note that D = d/b, where d is the pipe diameter and b is the center-to-center spacing between pipes.\u003c/p\u003e","function_template":"function F = view_factor4(d,b,n)\r\n  F = 1;\r\nend","test_suite":"%%\r\nd = 1;   b = 2;   n = 1;\r\ny_correct = 0.6576;\r\nF = view_factor4(d,b,n);\r\nassert(F \u003c (y_correct + 1e-4))\r\nassert(F \u003e (y_correct - 1e-4))\r\n\r\n%%\r\nd = 2;   b = 10;   n = [1 2 4 8 16 32];\r\ny_correct = [0.2941    0.5017    0.7517    0.9383    0.9962    1.0000];\r\nF = view_factor4(d,b,n);\r\nfor i = 1:numel(y_correct)\r\n assert(F(i) \u003c (y_correct(i) + 1e-4))\r\n assert(F(i) \u003e (y_correct(i) - 1e-4))\r\nend\r\n\r\n%%\r\nd = [0.25 0.5 1 1.25 2.5 4 5];\r\nb = [4 10 2.5 2 3 10 11];\r\nn = [1 2 2 1 1 5 5];\r\ny_correct = [0.0962    0.1486    0.7950    0.7792    0.9353    0.9810    0.9908];\r\nF = view_factor4(d,b,n);\r\nfor i = 1:numel(y_correct)\r\n assert(F(i) \u003c (y_correct(i) + 1e-4))\r\n assert(F(i) \u003e (y_correct(i) - 1e-4))\r\nend","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":26769,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":39,"test_suite_updated_at":"2015-01-16T02:04:37.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2015-01-15T01:47:46.000Z","updated_at":"2026-02-08T12:38:27.000Z","published_at":"2015-01-15T01:47:45.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.gif\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/media/image2.gif\"}],\"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\u003eView factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates between surfaces. In particular, the thermal energy leaving a given surface is applied to other surfaces, as appropriate, based on how much the hot surface \\\"sees\\\" the other surfaces. As such, view factors are purely geometrical in nature. A range of view factor formulae are available\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.thermalradiation.net/tablecon.html\\\"\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\u003eFor this problem, calculate the view factor from surface 1 (an infinitely long plate) to surfaces 2 (n rows of in-line pipes):\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\u003eThe view factor for one row of pipes is F_1-2 (the first equation):\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:r\u003e\u003cw:t\u003eThe second equation is utilized for more than one row of pipes. Any of the variables can be a vector. Also, note that D = d/b, where d is the pipe diameter and b is the center-to-center spacing between pipes.\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.gif\",\"contentType\":\"image/gif\",\"content\":\"data:image/gif;base64,R0lGODlhfQAAAYAAAP///wAAACH5BAEAAAAALAAAAAB9AAABQAL/hI+py+0Po5y02ouz3rynEECgZ4EmiabqYbbtCl9hDIz0PbmxjXf88ut9ZkIMMfdBHFHBIlLhWkanUU/TKZzCrrsk67ZUcbGNMJkyPpfRap5ZDWUPT9u34W2HM6h0Zj6uFKj38OdTOEgSkraxiLin46C10oh46HVZ5yiRRrljqQn6GDpa8klK2llZmCpm2lZyxnoaKjs7yGebq1Sr23tryusrPExcbHwc4Vrzikxb1bwJplyM2wqNFrw5jcXKmdnbmc24DZYCOUmeoSi4nMiXLop6LF5E1ERvCF7xXs1xn3vPjiRr+9rdMTgLngiFwo4whPIw4TuCusKFOUfRVreI/9iuOfMICh9IKxxHqis5CRYZkT0asZSB0mQyfjFlPsJoMyfJSDV1+vwJNKjQoUSL+gRmdBxEVT2LDkxq6KlOlDSbxqKCTqhUd0T7ZDX2jEVVnCd9WWxj1YdKQS+HgAN28U7Ntl04peWp0U9Tuv7QeTV3F1BLrBlbfhEsRpqju1b5JqIWWENkpWZXTXZbca2TEZcLet61V4rEhUBefEMMrZ8fEagPAlSM7W/nz6f75nUstyu71VBrTyUMeJjd0mR3VoQLMbQ+2vVml9KGdl7xq719Vzd+nXd2rtu5d89HLKAqs3JWOi//hNt59Kyph7+4Pvd38PMp1y+l+v7C6fp5/v/tn957pgEYD2kEIhTNgQouyGCDDj4IYYQSTkghE5rpt5GCZzE4nIRh/RKfSf9NyJ+DWz2YX04x8QPUihPJxKI/NNmUIn0/nWjjUR9q1+KAhd2Im3xDNRbiPvCNV5mB7mUWIBDWycNcbnMVSciFDj05ijKiHfbjKUiVhqB3xylp3nJCioVkQu4o5yVgbNLSyojYLeaXjzzW0xyO9m2WXJw7zplFmK6RVOOeg/23F2yBspMWkYvZ+Z6akOUV6WsNURlJcnKWWVkeQc6UJKhLaoQcp5aylwWma0S5KXiqYgbdHDT88CqaooIW5D9eemqGnoYOKhGkuJZY1h4gFforJlzgHodssZkGIkWtynb5LILS7vZVgste29xjlM7KbXCC5ngjtoACCeydFdYQ7qQ9+uqsjvAa0e5SsGraqmT1nlngsJ6Q16Rcb34bcL7JZmnkWAbHemrAgwGsrXqXkilxpbukuS6/636aFMdGeezUvhNnbCvJ7JqscYUgdyVyqCav7ObCD4/cr6kAWQLzvaPlMFvORlyYqpkO4+AzTB3ZTCrDFbsMJhxFRyUz0S2/hfLJKD+tY9VYi/gihDFG2OyC84otrIdb03g2je5ejKJlHKJ6n5ZVz0133XbfjXfeeu9tdwEAOw==\"},{\"partUri\":\"/media/image2.gif\",\"contentType\":\"image/gif\",\"content\":\"data:image/gif;base64,R0lGODdhQAGPAPcAAAAAAP///wECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECA8/UQQCAKVAAZgAAAKxdUAABAAAAcCH1v0jsbwCQGVAAgClQAEwAAAAQCwAAAABfLYApUAAAAAAAAAAAAAEAAACUGlAABAEAAAAAAAAAAAAAkBlQACjsbwBsAAgAKAAuAAAAAACsXVAAoNpEAFjJRwBPcGVuAAAAAFUAAAD3Bf5V/iL3BXwAbwCu728AAAAAAEU6XEZhY3RvcnMgV2ViIFBhZ2VzXHB1YmxpY19odG1sXGltYWdlcwBjLTZlcS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sGGaE5TI6PK6EkvatJgp0QZdP6jt6d98kf88mN7RllHRabQlqQSzPT4c7hZ1e2GH3OaLcd3/8SrNU2SUwPjGNPnGKG9qVy6YqJpiFnMDaqNal9bo2hWmBpgvuVpfRQkLrXJmz+Ss2rezCNJNGVBPKIrktdb52XU6EZOxXCJmTRlKVt4zX2282X8RNNtgni2gA4tnW00qBatqVBH0bChEI2oRCdKURgeMFwJHRFCHXpHi86xoszc6NkwRU1+Rs1zvCzYww5jIs4Bzomjg5yARverbskFcL3Rk00Jxa7CYK6kAs0bJ+F10VZuLqXS45vgVuW+nIWukyYTHVRzKFIV1rCX6ouY+25a1E4mNHx2A2uHJjlUxpVOisvqYyNPladc0clMQkymosAyJA92sK5r/V2vSPcclQEW2BKkz1wfYN1mV7sO9rCITaxiFwtYAjEWbuWp6mOrGTQTSnayypxgu8SJ2Vhd6rKdLVs3QZsmNsbHsO1K5vMCmb/ZUehFpOzeJP2Jv3B2p4sMFFeSbJtN+7m2eDGJIlsJmjz+ARVvbtwtKFvLyONO0JypRa1fCkvCYP7PufWqmOGUeF0K7k1DKfXl57AENe1mlrv+26tRf6U40ZUnqe8aqV9ny1n9BQ6ttNqqY/8qyYvp8qcNTNxh5JooukZ3ZRASsNlIG9oGfwe3Do6whCdM4Qpb+MIYjltAAAA7\"}]}"},{"id":43601,"title":"Find the sines of an isosceles triangle when given its area and height","description":"Find the sines of an isosceles triangle when given its area and height.\r\nFor example, when A=12 and h=4, the result is [0.8 0.8 0.96].","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 25.5px; transform-origin: 407px 25.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 219.5px 8px; transform-origin: 219.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFind the sines of an isosceles triangle when given its area and height.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 192.5px 8px; transform-origin: 192.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor example, when A=12 and h=4, the result is [0.8 0.8 0.96].\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = theSineOfAnglesOfATriangle(A,h)\r\n  y = x;\r\nend","test_suite":"%%\r\nA = 12;\r\nh = 4;\r\ny_correct = [0.8, 0.8, 0.96];\r\ny = theSineOfAnglesOfATriangle(A,h);\r\ntolerance = 1e-4;\r\nassert(abs(y(1)-y_correct(1))\u003ctolerance)\r\nassert(abs(y(2)-y_correct(2))\u003ctolerance)\r\nassert(abs(y(3)-y_correct(3))\u003ctolerance)\r\n\r\n%%\r\nA = 48;\r\nh = 8;\r\ny_correct = [0.8, 0.8, 0.96];\r\ny = theSineOfAnglesOfATriangle(A,h);\r\ntolerance = 1e-4;\r\nassert(abs(y(1)-y_correct(1))\u003ctolerance)\r\nassert(abs(y(2)-y_correct(2))\u003ctolerance)\r\nassert(abs(y(3)-y_correct(3))\u003ctolerance)\r\n\r\n%%\r\nA = 40;\r\nh = 10;\r\ny_correct = [0.9285, 0.9285, 0.6897];\r\ny = theSineOfAnglesOfATriangle(A,h);\r\ntolerance = 1e-4;\r\nassert(abs(y(1)-y_correct(1))\u003ctolerance)\r\nassert(abs(y(2)-y_correct(2))\u003ctolerance)\r\nassert(abs(y(3)-y_correct(3))\u003ctolerance)\r\n\r\n%%\r\nA = 11;\r\nh = 7;\r\ny_correct = [0.9757, 0.9757, 0.4274];\r\ny = theSineOfAnglesOfATriangle(A,h);\r\ntolerance = 1e-4;\r\nassert(abs(y(1)-y_correct(1))\u003ctolerance)\r\nassert(abs(y(2)-y_correct(2))\u003ctolerance)\r\nassert(abs(y(3)-y_correct(3))\u003ctolerance)\r\n\r\n%%\r\nA = 10;\r\nh = 7;\r\ny_correct = [0.9798, 0.9798, 0.3918];\r\ny = theSineOfAnglesOfATriangle(A,h);\r\ntolerance = 1e-4;\r\nassert(abs(y(1)-y_correct(1))\u003ctolerance)\r\nassert(abs(y(2)-y_correct(2))\u003ctolerance)\r\nassert(abs(y(3)-y_correct(3))\u003ctolerance)\r\n\r\n%%\r\nA = 100;\r\nh = 90;\r\ny_correct = [0.9999, 0.9999, 0.0247];\r\ny = theSineOfAnglesOfATriangle(A,h);\r\ntolerance = 1e-4;\r\nassert(abs(y(1)-y_correct(1))\u003ctolerance)\r\nassert(abs(y(2)-y_correct(2))\u003ctolerance)\r\nassert(abs(y(3)-y_correct(3))\u003ctolerance)\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":15,"created_by":90467,"edited_by":223089,"edited_at":"2023-02-04T06:18:22.000Z","deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":"2023-02-04T06:18:22.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2016-10-23T10:38:22.000Z","updated_at":"2026-02-08T11:35:41.000Z","published_at":"2016-10-23T10:38:22.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the sines of an isosceles triangle when given its area and height.\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\u003eFor example, when A=12 and h=4, the result is [0.8 0.8 0.96].\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42493,"title":"Pancakes for everyone!","description":"Accordingly to the \u003chttp://nl.mathworks.com/matlabcentral/cody/problems/42460-the-cake-is-a-lie problem 42460\u003e. All the children have eaten the cake and they were playing in the garden. You was trying to make barbecue, but someone spoken \"maybe pancakes?\" and all the children want pancakes. They want it now! Grab a frying pan and make a big pancake, then use minimum number of cuts to serve pancake to all the children at the same time.","description_html":"\u003cp\u003eAccordingly to the \u003ca href = \"http://nl.mathworks.com/matlabcentral/cody/problems/42460-the-cake-is-a-lie\"\u003eproblem 42460\u003c/a\u003e. All the children have eaten the cake and they were playing in the garden. You was trying to make barbecue, but someone spoken \"maybe pancakes?\" and all the children want pancakes. They want it now! Grab a frying pan and make a big pancake, then use minimum number of cuts to serve pancake to all the children at the same time.\u003c/p\u003e","function_template":"function y = pancake(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;y_correct = 0;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 2;y_correct = 1;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 4;y_correct = 2;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 7;y_correct = 3;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 12;y_correct = 5;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 27;y_correct = 7;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 127;y_correct = 16;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 2015;y_correct = 63;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 4060225;y_correct = 2850;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 1234567890;y_correct = 49690;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 1362067890;y_correct = 52193;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 2030000;y_correct = 2015;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 11581428900;y_correct = 152193;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 9007199187632129; y_correct = 134217727;\r\nassert(isequal(pancake(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":14358,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":41,"test_suite_updated_at":"2015-08-07T07:58:07.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2015-08-06T09:41:35.000Z","updated_at":"2026-03-14T18:55:26.000Z","published_at":"2015-08-06T09:44:29.000Z","restored_at":"2018-02-06T15:11:34.000Z","restored_by":null,"spam":false,"simulink":false,"admin_reviewed":true,"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\u003eAccordingly to the\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://nl.mathworks.com/matlabcentral/cody/problems/42460-the-cake-is-a-lie\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eproblem 42460\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. All the children have eaten the cake and they were playing in the garden. You was trying to make barbecue, but someone spoken \\\"maybe pancakes?\\\" and all the children want pancakes. They want it now! Grab a frying pan and make a big pancake, then use minimum number of cuts to serve pancake to all the children at the same time.\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":44070,"title":"Under the sea: Snell's law \u0026 total internal reflection","description":"\u003chttps://en.wikipedia.org/wiki/Snell's_law\u003e\r\n\r\nWhen a light travels from one medium to another medium, depending on the refractive index, the light will bend with a certain angle. For certain combination of materials, it might be that light cannot escape one medium at all from a certain angle (greater than critical angle). It is called total internal reflection. If you point a flashlight from \"under the sea\" the light won't leave the water at all. \r\n\r\nFor given refractive indices, find critical angle where total internal reflection happens. If total internal reflection does not happen for any angle, then return \"-1\".\r\n\r\nExample1: n_in = 1.333, n_out = 1, theta_crit = 48.6 degrees;\r\nExample2: n_out = 1, n_in = 1.333, theta_crit = -1 (total internal reflection does not occur, if you are in the air, and beaming light at the water.)\r\n\r\nInput of function: n_in, n_out (refractive index, positive) \r\nOutput: critical angle (rounded to nearest integer), if total internal reflection occurs. Else return -1.","description_html":"\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Snell's_law\"\u003ehttps://en.wikipedia.org/wiki/Snell's_law\u003c/a\u003e\u003c/p\u003e\u003cp\u003eWhen a light travels from one medium to another medium, depending on the refractive index, the light will bend with a certain angle. For certain combination of materials, it might be that light cannot escape one medium at all from a certain angle (greater than critical angle). It is called total internal reflection. If you point a flashlight from \"under the sea\" the light won't leave the water at all.\u003c/p\u003e\u003cp\u003eFor given refractive indices, find critical angle where total internal reflection happens. If total internal reflection does not happen for any angle, then return \"-1\".\u003c/p\u003e\u003cp\u003eExample1: n_in = 1.333, n_out = 1, theta_crit = 48.6 degrees;\r\nExample2: n_out = 1, n_in = 1.333, theta_crit = -1 (total internal reflection does not occur, if you are in the air, and beaming light at the water.)\u003c/p\u003e\u003cp\u003eInput of function: n_in, n_out (refractive index, positive) \r\nOutput: critical angle (rounded to nearest integer), if total internal reflection occurs. Else return -1.\u003c/p\u003e","function_template":"function theta_crit = totalInternalReflection(n_in,n_out)\r\n  theta_crit = -1;\r\nend","test_suite":"%%\r\nn_in = 3; n_out = 3;\r\ntheta_crit_correct = -1;\r\nassert(isequal(totalInternalReflection(n_in,n_out),theta_crit_correct))\r\n\r\n%%\r\nn_in = 1; n_out = 1.333;\r\ntheta_crit_correct = -1;\r\nassert(isequal(totalInternalReflection(n_in,n_out),theta_crit_correct))\r\n\r\n%%\r\nn_in = 1.333; n_out = 1;\r\ntheta_crit_correct = 49;\r\nassert(isequal(totalInternalReflection(n_in,n_out),theta_crit_correct))\r\n\r\n%%\r\nn_in = 4; n_out = 3;\r\ntheta_crit_correct = 49;\r\nassert(isequal(totalInternalReflection(n_in,n_out),theta_crit_correct))\r\n\r\n%%\r\nn_in = 4; n_out = 2;\r\ntheta_crit_correct = 30;\r\nassert(isequal(totalInternalReflection(n_in,n_out),theta_crit_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":6,"created_by":115733,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":"2017-02-16T21:45:07.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2017-02-14T00:59:14.000Z","updated_at":"2026-02-08T13:00:17.000Z","published_at":"2017-02-14T00:59:14.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:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Snell's_law\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Snell's_law\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\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\u003eWhen a light travels from one medium to another medium, depending on the refractive index, the light will bend with a certain angle. For certain combination of materials, it might be that light cannot escape one medium at all from a certain angle (greater than critical angle). It is called total internal reflection. If you point a flashlight from \\\"under the sea\\\" the light won't leave the water at all.\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 given refractive indices, find critical angle where total internal reflection happens. If total internal reflection does not happen for any angle, then return \\\"-1\\\".\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\u003eExample1: n_in = 1.333, n_out = 1, theta_crit = 48.6 degrees; Example2: n_out = 1, n_in = 1.333, theta_crit = -1 (total internal reflection does not occur, if you are in the air, and beaming light at the water.)\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\u003eInput of function: n_in, n_out (refractive index, positive) Output: critical angle (rounded to nearest integer), if total internal reflection occurs. Else return -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":44059,"title":"Convex Hull Capture","description":"Imagine four points in uv that form a square.\r\n\r\n uv = [ ...\r\n    0,0;\r\n    0,2;\r\n    2,2;\r\n    2,0];\r\n\r\nNow we have two more points in xy: one at [1,1] and the other at [1,3]. The first one is in the square, and the second is outside it.\r\n\r\n xy = [ ...\r\n    1,1;\r\n    3,1];\r\n\r\nHere is the challenge. Consider the \u003chttps://en.wikipedia.org/wiki/Convex_hull convex hull\u003e formed by the points in uv. Which points in xy lie inside this hull?\r\n\r\nIn this case, the answer would be the logical vector [1,0], since the first row of xy is in the box defined by uv, whereas the second row is not.\r\n\r\nExample\r\n\r\n uv = [13,12;10,18;8,4;12,10;16,4;13,2;];\r\n xy = [12,15;9,7;9,13;13,8;];\r\n\r\n in_correct = [0;1;0;1;];\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 1090px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 332px 545px; transform-origin: 332px 545px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 10.5px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eImagine four points in uv that form a square.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 100px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 329px 50px; transform-origin: 329px 50px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e uv = [ \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(14, 0, 255); border-block-start-color: rgb(14, 0, 255); border-bottom-color: rgb(14, 0, 255); border-inline-end-color: rgb(14, 0, 255); border-inline-start-color: rgb(14, 0, 255); border-left-color: rgb(14, 0, 255); border-right-color: rgb(14, 0, 255); border-top-color: rgb(14, 0, 255); caret-color: rgb(14, 0, 255); color: rgb(14, 0, 255); column-rule-color: rgb(14, 0, 255); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(14, 0, 255); text-decoration: none; text-decoration-color: rgb(14, 0, 255); \"\u003e...\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e    0,0;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e    0,2;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e    2,2;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e    2,0];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 309px 21px; text-align: left; transform-origin: 309px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eNow we have two more points in xy: one at [1,1] and the other at [1,3]. The first one is in the square, and the second is outside it.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 60px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 329px 30px; transform-origin: 329px 30px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e xy = [ \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(14, 0, 255); border-block-start-color: rgb(14, 0, 255); border-bottom-color: rgb(14, 0, 255); border-inline-end-color: rgb(14, 0, 255); border-inline-start-color: rgb(14, 0, 255); border-left-color: rgb(14, 0, 255); border-right-color: rgb(14, 0, 255); border-top-color: rgb(14, 0, 255); caret-color: rgb(14, 0, 255); color: rgb(14, 0, 255); column-rule-color: rgb(14, 0, 255); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(14, 0, 255); text-decoration: none; text-decoration-color: rgb(14, 0, 255); \"\u003e...\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e    1,1;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e    3,1];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 309px 21px; text-align: left; transform-origin: 309px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eHere is the challenge. Consider the\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Convex_hull\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003econvex hull\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e formed by the points in uv. Which points in xy lie inside this hull?\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 270px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 135px; text-align: left; transform-origin: 309px 135px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAT0AAAEICAYAAAAtLCODAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AgfFC8L5+oVdQAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInAAAUPUlEQVR4nO3cf0xV9/3H8VevNN6udrvc+ovv12UXue1V19io0yx+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rLkznv0UcfHdbV29Q8/Iojj8ejDRs2aNWqVQoGg9q3b5+effZZjR492u3RcBVVVVX66KOP9Nhjjw1Y/s1vflPFxcUuTeWMO+64Q0899ZRyc3M1Y8YMvf322yosLOx7xQXuvXXUxx9/LK/Xm/In/5H4uru71dbWpvT0dI0YMcLtcRIK0QNgFA5JABiF6AEwCtEDYBSiB8AoRA+AUYgeAKMQPQBGIXoAjEL0ABiF6AEwCtEDYJT/Bxf/CT9z1h80AAAAAElFTkSuQmCC\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 21px; text-align: left; transform-origin: 309px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIn this case, the answer would be the logical vector [1,0], since the first row of xy is in the box defined by uv, whereas the second row is not.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 10.5px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eExample\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 80px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 329px 40px; transform-origin: 329px 40px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e uv = [13,12;10,18;8,4;12,10;16,4;13,2;];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e xy = [12,15;9,7;9,13;13,8;];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e in_correct = [0;1;0;1;];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 325px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 309px 162.5px; text-align: left; transform-origin: 309px 162.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cimg class=\"imageNode\" width=\"248\" height=\"319\" style=\"vertical-align: baseline;width: 248px;height: 319px\" src=\"data:image/png;base64,iVBORw0KGgo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CfPbZZ7LWFU020f1+Py5cuIDt27fD6/ViYGAAq1evxo4dO7R4e0Opra1FVlZW+OSgkFQm7phJos/FqutOfn4+8vPzwz93d3ejubkZVVVVOHPmjOR1RZMK3tfXhyVLluCFF15Aa2srmpubcezYMRw4cECLtzeU2Mk5IVafuJPoc+G6E/wMnE4ntmzZglmzZslaVzQJeEFBARoaGlBQUAAAmDJlCpYuXYqTJ09q8fYZgRN3xFl93Tl16hRWrVqFBx98EFVVVQDkrSuaBLy7uxuvvPJK1LLBwUGMGzdOi7fPCJy4I87K605rayseeugh1NfXo7KyMrxczrqiScB9Ph/q6urQ2dkJILjJcfToUaxYsUKLt88InLgjzqrrTk9PDx555BE888wzKC8vx9DQEIaGhuD3+2G8TYwAAACdSURBVGWtK5ps/5WUlKC6uhpr167FzTffjFOnTuFnP/uZ6fuYcmRlZWH37t1RE3d27dqFSZMm6T00XVl13dm/fz++/vprbN68OWr5Aw88gNraWsnriqaTTYaHh+Hz+ZCTk5PwoAoB//znP/kZxeC6I26sdYWzyYhMjF+FRCbGgBOZGANOZGIMOJGJMeBEJsaAE5kYA05kYgw4kYn9f4A4I0KW22kHAAAAAElFTkSuQmCC\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function in = inHull(uv,xy)\r\n    in = 1;\r\nend","test_suite":"%%\r\nuv = [0,0;0,2;2,2;2,0];\r\nxy = [1,1;3,1];\r\nin_correct = [1;0];\r\n\r\nin = inHull(uv,xy);\r\nassert(isequal(in,in_correct))\r\n\r\n%%\r\nuv = [5,5;5,10;10,10;15,15;15,5;10,15;10,10;15,5;10,15;];\r\nxy = [12,20;4,6;10,12;9,7;18,2;];\r\nin_correct = [0;0;1;1;0;];\r\n\r\nin = inHull(uv,xy);\r\nassert(isequal(in,in_correct))\r\n\r\n%%\r\nuv = [-6,-13;-3,-9;-9,-2;-12,7;25,-14;16,-24;3,15;];\r\nxy = [8,6;15,1;4,-11;-3,9;];\r\nin_correct = [1;0;1;1;];\r\n\r\nin = inHull(uv,xy);\r\nassert(isequal(in,in_correct))\r\n\r\n%%\r\nuv = [4,2;1,3;2,4;4,5;5,0;2,2;6,8;7,0;2,9;1,7;];\r\nxy = [4,6;5,3;2,3;4,9;9,0;5,8;5,9;2,7;4,0;6,2;];\r\nin_correct = [1;1;1;0;0;1;0;1;0;1;];\r\n\r\nin = inHull(uv,xy);\r\nassert(isequal(in,in_correct))\r\n\r\n%%\r\nuv = [10,7;8,3;13,9;12,6;5,19;8,18;0,5;19,14;3,5;2,8;];\r\nxy = [5,5;9,8;4,6;9,1;3,3;7,4;6,9;5,1;6,8;6,6;1,3;1,1;9,4;1,4;0,1;];\r\nin_correct = [1;1;1;0;0;1;1;0;1;1;0;0;1;0;0;];\r\n\r\nin = inHull(uv,xy);\r\nassert(isequal(in,in_correct))\r\n\r\n%%\r\n\r\nuv = [13,12;10,18;8,4;12,10;16,4;13,2;];\r\nxy = [12,15;9,7;9,13;13,8;];\r\nin_correct = [0;1;0;1;];\r\n\r\nin = inHull(uv,xy);\r\nassert(isequal(in,in_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":7,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":37,"created_at":"2017-01-31T22:57:12.000Z","updated_at":"2026-02-08T11:34:19.000Z","published_at":"2017-01-31T23:05:51.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eImagine four points in uv that form a square.\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[ uv = [ ...\\n    0,0;\\n    0,2;\\n    2,2;\\n    2,0];]]\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNow we have two more points in xy: one at [1,1] and the other at [1,3]. The first one is in the square, and the second is outside it.\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[ xy = [ ...\\n    1,1;\\n    3,1];]]\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHere is the challenge. Consider the\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/Convex_hull\\\"\u003e\u003cw:r\u003e\u003cw:t\u003econvex hull\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e formed by the points in uv. Which points in xy lie inside this hull?\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:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"264\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"317\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn this case, the answer would be the logical vector [1,0], since the first row of xy is in the box defined by uv, whereas the second row is not.\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\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[ uv = [13,12;10,18;8,4;12,10;16,4;13,2;];\\n xy = [12,15;9,7;9,13;13,8;];\\n\\n in_correct = [0;1;0;1;];]]\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"319\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"248\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId2\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.png\",\"relationshipId\":\"rId1\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image2.png\",\"relationshipId\":\"rId2\"}]},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAT0AAAEICAYAAAAtLCODAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AgfFC8L5+oVdQAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInAAAUPUlEQVR4nO3cf0xV9/3H8VevNN6udrvc+ovv12UXue1V19io0yx+bUHXamLtmpH9oB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29Q8/Iojj8ejDRs2aNWqVQoGg9q3b5+effZZjR492u3RcBVVVVX66KOP9Nhjjw1Y/s1vflPFxcUuTeWMO+64Q0899ZRyc3M1Y8YMvf322yosLOx7xQXuvXXUxx9/LK/Xm/In/5H4uru71dbWpvT0dI0YMcLtcRIK0QNgFA5JABiF6AEwCtEDYBSiB8AoRA+AUYgeAKMQPQBGIXoAjEL0ABiF6AEwCtEDYJT/Bxf/CT9z1h80AAAAAElFTkSuQmCC\",\"relationship\":null},{\"partUri\":\"/media/image2.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPgAAAE/CAYAAABrSw6zAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AgfFC84WDp0YwAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInAAAgAElEQVR4nO3df3AU9f0/8KfBbxML5hNOCibCh0uTD4F+sAgYBb9ILhVUKpRCGb6IYC5+mZFQqy3j51vHTH4wIBWHMphx0uq0c5eiwFQd7eCnFr9gLmLzERGtxQQCwWwIGDPKJcWP9b4Jl/v+cbnL/di77N7u7e7tPh8zDGbvcvf22Oe9dve1791rAoFAAERkSll6D4CI0ocBJzIxBpzIxBhwIhNjwIlMjAEnMjEGnMjErpX6xM7OTgiCAJvNhnnz5kU91tPTg46ODkybNg0lJSWqD5KIUiMp4Dt27MDbb7+N+fPn4+zZsxg/fjxcLheys7Nx6NAhPP3007jjjjtw8uRJrFy5Eo899li6x01EUgTG0N7eHpg9e3agv78/v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7lYed3p7OyEIAiw2WyYN29e1GNS1hXNAv7aa69hz549yM7ODi9raGjAokWLtBqCoTQ2NuLAgQM4duxYeNmhQ4fw9NNP44477sDJkyexcuVKPPbYYzqOUntin4tV150dO3bg7bffxvz583H27FmMHz8eLpcL2dnZ0teVNJ0PH+cXv/hF4KWXXtLq7Qyrv78/8MQTTwTmzp0bWLRoUXh5KhN3zCTR5xIIWHPdaW9vD8yePTvQ398fXrZ8+fLAyy+/LGtd0WwfvL29HUVFRfB6vRgaGtLqbQ1n7969sNls2LlzZ9TyZBN3rCDR5wJYc93Jy8vD888/j7y8vPCywsJCfPbZZ7LWFU020f1+Py5cuIDt27fD6/ViYGAAq1evxo4dO7R4e0Opra1FVlZW+OSgkFQm7phJos/FqutOfn4+8vPzwz93d3ejubkZVVVVOHPmjOR1RZMK3tfXhyVLluCFF15Aa2srmpubcezYMRw4cECLtzeU2Mk5IVafuJPoc+G6E/wMnE4ntmzZglmzZslaVzQJeEFBARoaGlBQUAAAmDJlCpYuXYqTJ09q8fYZgRN3xFl93Tl16hRWrVqFBx98EFVVVQDkrSuaBLy7uxuvvPJK1LLBwUGMGzdOi7fPCJy4I87K605rayseeugh1NfXo7KyMrxczrqiScB9Ph/q6urQ2dkJILjJcfToUaxYsUKLt88InLgjzqrrTk9PDx555BE888wzKC8vx9DQEIaGhuD3+2G8TYwAAACdSURBVGWtK5ps/5WUlKC6uhpr167FzTffjFOnTuFnP/uZ6fuYcmRlZWH37t1RE3d27dqFSZMm6T00XVl13dm/fz++/vprbN68OWr5Aw88gNraWsnriqaTTYaHh+Hz+ZCTk5PwoAoB//znP/kZxeC6I26sdYWzyYhMjF+FRCbGgBOZGANOZGIMOJGJMeBEJsaAE5kYA05kYgw4kYn9f4A4I0KW22kHAAAAAElFTkSuQmCC\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42699,"title":"Find the Area of a Polygon","description":"Consider 2-D geometry and assume that the points are given in form of rows of a matrix. Find the area of polygon enclosed by the points. \r\n\r\n*Example:*\r\n\r\nA = [1 2;4 5; 6 7], represents points (1,2),(4,5) and (6,7)\r\n\r\n*Note :*\r\n\r\n# There are no repeated rows in matrix.\r\n# There are at least 3 rows in matrix.\r\n# Coordinates in matrix are arranged in counter-clockwise direction. ","description_html":"\u003cp\u003eConsider 2-D geometry and assume that the points are given in form of rows of a matrix. Find the area of polygon enclosed by the points.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eA = [1 2;4 5; 6 7], represents points (1,2),(4,5) and (6,7)\u003c/p\u003e\u003cp\u003e\u003cb\u003eNote :\u003c/b\u003e\u003c/p\u003e\u003col\u003e\u003cli\u003eThere are no repeated rows in matrix.\u003c/li\u003e\u003cli\u003eThere are at least 3 rows in matrix.\u003c/li\u003e\u003cli\u003eCoordinates in matrix are arranged in counter-clockwise direction.\u003c/li\u003e\u003c/ol\u003e","function_template":"function y = area_of_polygon(A)\r\n  y = abcxyz;\r\nend","test_suite":"%%\r\nA = [0 0; 120 120; 120 0];\r\ny_correct = 7200;\r\nassert(isequal(area_of_polygon(A),y_correct))\r\n\r\n%%\r\nA = [1 2; 12 3; 6 7];\r\ny_correct = 25;\r\nassert(isequal(area_of_polygon(A),y_correct))\r\n\r\n%%\r\nA = [0 0; 0 100; 100 100; 100 0];\r\ny_correct = 10000;\r\nassert(isequal(area_of_polygon(A),y_correct))\r\n\r\n%%\r\nA = [0 0; 0 200; 200 200; 200 0];\r\ny_correct = 40000;\r\nassert(isequal(area_of_polygon(A),y_correct))\r\n\r\n%%\r\nA = [0 0; 0 50; 100 100; 100 0];\r\ny_correct = 7500;\r\nassert(isequal(area_of_polygon(A),y_correct))\r\n\r\n%%\r\nA = [0 0; 200 100; 500 500; 400 1000; 100 300; -100 100; -300 -200];\r\ny_correct = 230000;\r\nassert(isequal(area_of_polygon(A),y_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":3,"created_by":45073,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":87,"test_suite_updated_at":"2018-01-02T17:41:34.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2015-12-30T20:42:38.000Z","updated_at":"2026-02-27T10:12:10.000Z","published_at":"2015-12-30T20:45:33.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\u003eConsider 2-D geometry and assume that the points are given in form of rows of a matrix. Find the area of polygon enclosed by the points.\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\u003eExample:\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\u003eA = [1 2;4 5; 6 7], represents points (1,2),(4,5) and (6,7)\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\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\u003eThere are no repeated rows in matrix.\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\u003eThere are at least 3 rows in matrix.\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\u003eCoordinates in matrix are arranged in counter-clockwise direction.\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":42789,"title":"Regular polygon bounded by and bounding a circle","description":"As the number of sides (or vertices) of a regular polygon goes to infinity, its perimeter and area go to the perimeter and area of the circle bounding it, while the radius of the circle bounded by the polygon goes to the radius of the bounding circle.\r\n\r\nGiven the radius of the bounding circle, R, and the number of sides of a regular polygon, n, return the polygon's perimeter, p, and area, a, as well as the radius of the circle bounded by it, r.\r\n\r\nNote: n will always be an integer greater than 2. R will always be a real number greater than zero.\r\n\r\nExample (square):\r\n\r\nR = 1\r\n\r\nn = 4\r\n\r\np = 5.6568\r\n\r\na = 2\r\n\r\nr = 0.7071","description_html":"\u003cp\u003eAs the number of sides (or vertices) of a regular polygon goes to infinity, its perimeter and area go to the perimeter and area of the circle bounding it, while the radius of the circle bounded by the polygon goes to the radius of the bounding circle.\u003c/p\u003e\u003cp\u003eGiven the radius of the bounding circle, R, and the number of sides of a regular polygon, n, return the polygon's perimeter, p, and area, a, as well as the radius of the circle bounded by it, r.\u003c/p\u003e\u003cp\u003eNote: n will always be an integer greater than 2. R will always be a real number greater than zero.\u003c/p\u003e\u003cp\u003eExample (square):\u003c/p\u003e\u003cp\u003eR = 1\u003c/p\u003e\u003cp\u003en = 4\u003c/p\u003e\u003cp\u003ep = 5.6568\u003c/p\u003e\u003cp\u003ea = 2\u003c/p\u003e\u003cp\u003er = 0.7071\u003c/p\u003e","function_template":"function [p,a,r]=BoundedPolygon(R,n)\r\n  p = R * n;\r\n  a = p ^ 2;\r\n  r = R / 2;\r\nend","test_suite":"%%\r\nR = sqrt(2);\r\nn = 4;\r\n[p,a,r] = BoundedPolygon(R,n)\r\np_correct = 8;\r\na_correct = 4;\r\nr_correct = 1;\r\nassert(abs(p_correct-p)\u003c0.0001 \u0026\u0026 abs(a_correct-a)\u003c0.0001 \u0026\u0026 abs(r_correct-r)\u003c0.0001);\r\n\r\n%%\r\nR = sqrt(3);\r\nn = 6;\r\n[p,a,r] = BoundedPolygon(R,n)\r\np_correct = 10.3923;\r\na_correct = 7.7942;\r\nr_correct = 1.5;\r\nassert(abs(p_correct-p)\u003c0.0001 \u0026\u0026 abs(a_correct-a)\u003c0.0001 \u0026\u0026 abs(r_correct-r)\u003c0.0001);\r\n\r\n%%\r\nR = 2;\r\nn = 12;\r\n[p,a,r] = BoundedPolygon(R,n)\r\np_correct = 12.4233;\r\na_correct = 12;\r\nr_correct = 1.9319;\r\nassert(abs(p_correct-p)\u003c0.0001 \u0026\u0026 abs(a_correct-a)\u003c0.0001 \u0026\u0026 abs(r_correct-r)\u003c0.0001);\r\n\r\n%%\r\nR = 3;\r\nn = 3;\r\n[p,a,r] = BoundedPolygon(R,n)\r\np_correct = 15.5885;\r\na_correct = 11.6913;\r\nr_correct = 1.5;\r\nassert(abs(p_correct-p)\u003c0.0001 \u0026\u0026 abs(a_correct-a)\u003c0.0001 \u0026\u0026 abs(r_correct-r)\u003c0.0001);\r\n\r\n%%\r\nR = 9;\r\nn = 56;\r\n[p,a,r] = BoundedPolygon(R,n)\r\np_correct = 56.519;\r\na_correct = 253.9354;\r\nr_correct = 8.9858;\r\nassert(abs(p_correct-p)\u003c0.0001 \u0026\u0026 abs(a_correct-a)\u003c0.0001 \u0026\u0026 abs(r_correct-r)\u003c0.0001);\r\n\r\n%%\r\nR = 2;\r\nn = 99;\r\n[p,a,r] = BoundedPolygon(R,n)\r\np_correct = 12.5643;\r\na_correct = 12.5579;\r\nr_correct = 1.999;\r\nassert(abs(p_correct-p)\u003c0.0001 \u0026\u0026 abs(a_correct-a)\u003c0.0001 \u0026\u0026 abs(r_correct-r)\u003c0.0001);","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":15521,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":43,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":37,"created_at":"2016-03-27T20:48:51.000Z","updated_at":"2026-02-08T12:55:54.000Z","published_at":"2016-03-27T20:49:05.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\u003eAs the number of sides (or vertices) of a regular polygon goes to infinity, its perimeter and area go to the perimeter and area of the circle bounding it, while the radius of the circle bounded by the polygon goes to the radius of the bounding 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven the radius of the bounding circle, R, and the number of sides of a regular polygon, n, return the polygon's perimeter, p, and area, a, as well as the radius of the circle bounded by it, r.\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\u003eNote: n will always be an integer greater than 2. R will always be a real number greater than zero.\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 (square):\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\u003eR = 1\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\u003en = 4\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\u003ep = 5.6568\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\u003ea = 2\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\u003er = 0.7071\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":42755,"title":"Angle bisectors","description":"Given 2 direction vectors, calculate the *_two_ (2) normalized angle bisectors* (which are perpendicular between them).\r\n\r\nInput vectors can be 2-D or 3-D.\r\n\r\nThe two output vectors must have a norm equal to 1 (unit vectors).\r\n\r\nYou may find some help here:\r\n\u003chttps://proofwiki.org/wiki/Angle_Bisector_Vector\u003e","description_html":"\u003cp\u003eGiven 2 direction vectors, calculate the \u003cb\u003e\u003ci\u003etwo\u003c/i\u003e (2) normalized angle bisectors\u003c/b\u003e (which are perpendicular between them).\u003c/p\u003e\u003cp\u003eInput vectors can be 2-D or 3-D.\u003c/p\u003e\u003cp\u003eThe two output vectors must have a norm equal to 1 (unit vectors).\u003c/p\u003e\u003cp\u003eYou may find some help here: \u003ca href = \"https://proofwiki.org/wiki/Angle_Bisector_Vector\"\u003ehttps://proofwiki.org/wiki/Angle_Bisector_Vector\u003c/a\u003e\u003c/p\u003e","function_template":"function [b1,b2] = bisectors(v1,v2)\r\n  b1 = cross(v1,v2);\r\n  b2 = cross(v1,-v2);\r\nend","test_suite":"%%\r\nv1 = [1 0];\r\nv2 = [0 1];\r\n[b1,b2] = bisectors(v1,v2);\r\n\r\nb1ok = [1 1]/sqrt(2);\r\nb2ok = [-1 1]/sqrt(2);\r\n\r\n% Tests performed\r\nt1 = (abs(norm(b1)-1)\u003c1e-6); % Unit b1\r\nt2 = (abs(norm(b2)-1)\u003c1e-6); % Unit b2\r\nt3 = (abs(b1*b2') \u003c 1e-12); % b1 and b2 are perpendicular\r\nt4 = (abs(sum((b1-b1ok)))\u003c1e-12);  % b1 is equal to [1/sqrt(2) 1/sqrt(2)]\r\nt5 = (abs(sum((b1+b1ok)))\u003c1e-12); % or its opposite\r\nt6 = (abs(sum((b2-b2ok)))\u003c1e-12); % b2 is equal to [1/sqrt(2) -1/sqrt(2)]\r\nt7 = (abs(sum((b2+b2ok)))\u003c1e-12); % or its opposite\r\ntest = (t1 \u0026\u0026 t2 \u0026\u0026 t3 \u0026\u0026 xor(t4,t5) \u0026\u0026 xor(t6,t7));\r\n\r\n%%\r\nv1 = [4 0 3];\r\nv2 = [-2 2 1];\r\n[b1,b2] = bisectors(v1,v2);\r\n\r\nb1ok=[0.2 1 1.4]/sqrt(3);\r\nb2ok=[2.2 -1 0.4]/sqrt(6);\r\n  \r\n% Tests performed\r\nt1 = (abs(norm(b1)-1)\u003c1e-6); % Unit b1\r\nt2 = (abs(norm(b2)-1)\u003c1e-6); % Unit b2\r\nt3 = (abs(b1*b2') \u003c 1e-12); % b1 and b2 are perpendicular\r\nt4 = (abs(sum((b1-b1ok)))\u003c1e-12);  % b1 is equal to [1/sqrt(2) 1/sqrt(2)]\r\nt5 = (abs(sum((b1+b1ok)))\u003c1e-12); % or its opposite\r\nt6 = (abs(sum((b2-b2ok)))\u003c1e-12); % b2 is equal to [1/sqrt(2) -1/sqrt(2)]\r\nt7 = (abs(sum((b2+b2ok)))\u003c1e-12); % or its opposite\r\nassert(t1 \u0026\u0026 t2 \u0026\u0026 t3 \u0026\u0026 xor(t4,t5) \u0026\u0026 xor(t6,t7));\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":12767,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":35,"test_suite_updated_at":"2016-04-27T12:55:46.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2016-02-25T17:55:08.000Z","updated_at":"2026-02-27T10:16:23.000Z","published_at":"2016-02-25T17:57:35.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\u003eGiven 2 direction vectors, calculate 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\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\u003etwo\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e (2) normalized angle bisectors\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (which are perpendicular between them).\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\u003eInput vectors can be 2-D or 3-D.\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 two output vectors must have a norm equal to 1 (unit vectors).\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\u003eYou may find some help here:\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://proofwiki.org/wiki/Angle_Bisector_Vector\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://proofwiki.org/wiki/Angle_Bisector_Vector\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\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":43599,"title":"Find the sides of an isosceles triangle when given its area and height from its base to apex","description":"Find the sides of an isosceles triangle when given its area and the height from its base to apex.\r\nFor example, with A=12 and h=4, the result will be [5 5 6].","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 25.5px; transform-origin: 407px 25.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 299px 8px; transform-origin: 299px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFind the sides of an isosceles triangle when given its area and the height from its base to apex.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 180px 8px; transform-origin: 180px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor example, with A=12 and h=4, the result will be [5 5 6].\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = sidesOfTheTriangle(A,h)\r\n  y = h;\r\nend","test_suite":"filetext = fileread('sidesOfTheTriangle.m');\r\nillegal = contains(filetext, 'regexp') || contains(filetext, 'assert') || ...\r\n          contains(filetext, 'elseif');\r\nassert(~illegal)\r\n\r\n%%\r\nA = 12;\r\nh = 4;\r\ny_correct = [5 5 6];\r\nassert(sum(abs(sidesOfTheTriangle(A,h)-y_correct))\u003c1e-3)\r\n\r\n%%\r\nA = 60;\r\nh = 5;\r\ny_correct = [13 13 24];\r\nassert(sum(abs(sidesOfTheTriangle(A,h)-y_correct))\u003c1e-3)\r\n\r\n%%\r\nA = 120;\r\nh = 8;\r\ny_correct = [17 17 30];\r\nassert(sum(abs(sidesOfTheTriangle(A,h)-y_correct))\u003c1e-3)\r\n\r\n%%\r\nA = 50;\r\nh = 11;\r\ny_correct = [11.9021492607341 11.9021492607341 9.09090909090909];\r\nassert(sum(abs(sidesOfTheTriangle(A,h)-y_correct))\u003c1e-3)\r\n\r\n%%\r\nA = 5;\r\nh = 3;\r\ny_correct = [3.43187671366233 3.43187671366233 10/3];\r\nassert(sum(abs(sidesOfTheTriangle(A,h)-y_correct))\u003c1e-3)\r\n\r\n%%\r\nA = 150;\r\nh = 10;\r\ny_correct = [18.0277563773199 18.0277563773199 30];\r\nassert(sum(abs(sidesOfTheTriangle(A,h)-y_correct))\u003c1e-3)\r\n\r\n%%\r\nA = 5;\r\nh = 0.5;\r\ny_correct = [10.0124921972504 10.0124921972504 20];\r\nassert(sum(abs(sidesOfTheTriangle(A,h)-y_correct))\u003c1e-3)\r\n\r\n%%\r\nA = 42;\r\nh = pi;\r\ny_correct = [13.7331777948941 13.7331777948941 26.7380304394384];\r\nassert(sum(abs(sidesOfTheTriangle(A,h)-y_correct))\u003c1e-3)\r\n","published":true,"deleted":false,"likes_count":12,"comments_count":3,"created_by":90467,"edited_by":223089,"edited_at":"2023-02-02T06:57:50.000Z","deleted_by":null,"deleted_at":null,"solvers_count":2147,"test_suite_updated_at":"2023-02-02T06:57:50.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2016-10-22T23:50:43.000Z","updated_at":"2026-04-04T19:12:10.000Z","published_at":"2016-12-02T18:59:27.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the sides of an isosceles triangle when given its area and the height from its base to apex.\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\u003eFor example, with A=12 and h=4, the result will be [5 5 6].\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":2833,"title":"Radiation Heat Transfer — View Factors (5)","description":"View factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates between surfaces. In particular, the thermal energy leaving a given surface is applied to other surfaces, as appropriate, based on how much the hot surface \"sees\" the other surfaces. As such, view factors are purely geometrical in nature. A range of view factor formulae are available \u003chttp://www.thermalradiation.net/tablecon.html here\u003e.\r\n\r\nFor this problem, calculate the view factor from surface 1 (an infinitely long plate) to surfaces 2 (n rows of in-line pipes):\r\n\r\n\u003c\u003chttp://www.thermalradiation.net/images/C-7fig.gif\u003e\u003e\r\n\r\nThe view factor for one row of pipes is F_1-2 (the first equation):\r\n\r\n\u003c\u003chttp://www.thermalradiation.net/images/C-7eq.gif\u003e\u003e\r\n\r\nThe second equation is utilized for more than one row of pipes. Any of the variables can be a vector. Also, note that D = d/b, where d is the pipe diameter and b is the center-to-center spacing between pipes.\r\n\r\n*Note: This problem is identical to the previous problem (4) except that the variables will be provided in vectors of varying sizes.* The variables will need to be combined to produce all the applicable combinations. For example, if the sizes of d, b, and n are 2, 5, and 1, respectively, there will be ten total variable combinations (and answers). As another example, if the sizes of d, b, and n are 4, 3, and 2, respectively, there will be 24 total variable combinations. This simulates a parametric design study. Also, because all possible combinations can be generated in various orders, the answers will be sorted; the order that you output answers does not matter.","description_html":"\u003cp\u003eView factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates between surfaces. In particular, the thermal energy leaving a given surface is applied to other surfaces, as appropriate, based on how much the hot surface \"sees\" the other surfaces. As such, view factors are purely geometrical in nature. A range of view factor formulae are available \u003ca href = \"http://www.thermalradiation.net/tablecon.html\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eFor this problem, calculate the view factor from surface 1 (an infinitely long plate) to surfaces 2 (n rows of in-line pipes):\u003c/p\u003e\u003cimg src = \"http://www.thermalradiation.net/images/C-7fig.gif\"\u003e\u003cp\u003eThe view factor for one row of pipes is F_1-2 (the first equation):\u003c/p\u003e\u003cimg src = \"http://www.thermalradiation.net/images/C-7eq.gif\"\u003e\u003cp\u003eThe second equation is utilized for more than one row of pipes. Any of the variables can be a vector. Also, note that D = d/b, where d is the pipe diameter and b is the center-to-center spacing between pipes.\u003c/p\u003e\u003cp\u003e\u003cb\u003eNote: This problem is identical to the previous problem (4) except that the variables will be provided in vectors of varying sizes.\u003c/b\u003e The variables will need to be combined to produce all the applicable combinations. For example, if the sizes of d, b, and n are 2, 5, and 1, respectively, there will be ten total variable combinations (and answers). As another example, if the sizes of d, b, and n are 4, 3, and 2, respectively, there will be 24 total variable combinations. This simulates a parametric design study. Also, because all possible combinations can be generated in various orders, the answers will be sorted; the order that you output answers does not matter.\u003c/p\u003e","function_template":"function F = view_factor5(d,b,n)\r\n  F = 1;\r\nend","test_suite":"%%\r\nd = [1 2];\r\nb = [3 5 6 7 8];\r\nn = 1;\r\ny_correct = [0.1885    0.2142    0.2479    0.2941    0.3613    0.4077    0.4675    0.4675    0.5472    0.8154];\r\nF = sort(view_factor5(d,b,n));\r\nfor i = 1:numel(y_correct)\r\n assert(F(i) \u003c (y_correct(i) + 1e-4))\r\n assert(F(i) \u003e (y_correct(i) - 1e-4))\r\nend\r\n\r\n%%\r\nd = [2 2.2 2.4 2.5];\r\nb = [3.2 3.4 3.6];\r\nn = 2;\r\ny_correct = [0.9182    0.9352    0.9455    0.9512    0.9594    0.9659    0.9720    0.9738    0.9767    0.9831    0.9857    0.9905];\r\nF = sort(view_factor5(d,b,n));\r\nfor i = 1:numel(y_correct)\r\n assert(F(i) \u003c (y_correct(i) + 1e-4))\r\n assert(F(i) \u003e (y_correct(i) - 1e-4))\r\nend\r\n\r\n%%\r\nd = [1 1.1 1.2];\r\nb = [3 3.2];\r\nn = 1:5;\r\ny_correct = [0.4416    0.4675    0.4803    0.5080    0.5179    0.5472    0.6882    0.7165    0.7299    0.7579    0.7676    0.7950    0.8259    0.8490    0.8596    0.8809    0.8879    0.9028    0.9072    0.9196    0.9270    0.9414    0.9457    0.9460    0.9572    0.9580    0.9621    0.9712    0.9740    0.9810];\r\nF = sort(view_factor5(d,b,n));\r\nfor i = 1:numel(y_correct)\r\n assert(F(i) \u003c (y_correct(i) + 1e-4))\r\n assert(F(i) \u003e (y_correct(i) - 1e-4))\r\nend","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":26769,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":37,"test_suite_updated_at":"2015-01-16T02:08:47.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2015-01-15T02:16:48.000Z","updated_at":"2026-02-08T12:40:09.000Z","published_at":"2015-01-15T02:16:48.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.gif\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/media/image2.gif\"}],\"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\u003eView factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates between surfaces. In particular, the thermal energy leaving a given surface is applied to other surfaces, as appropriate, based on how much the hot surface \\\"sees\\\" the other surfaces. As such, view factors are purely geometrical in nature. A range of view factor formulae are available\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.thermalradiation.net/tablecon.html\\\"\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\u003eFor this problem, calculate the view factor from surface 1 (an infinitely long plate) to surfaces 2 (n rows of in-line pipes):\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\u003eThe view factor for one row of pipes is F_1-2 (the first equation):\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:r\u003e\u003cw:t\u003eThe second equation is utilized for more than one row of pipes. Any of the variables can be a vector. Also, note that D = d/b, where d is the pipe diameter and b is the center-to-center spacing between pipes.\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: This problem is identical to the previous problem (4) except that the variables will be provided in vectors of varying sizes.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e The variables will need to be combined to produce all the applicable combinations. For example, if the sizes of d, b, and n are 2, 5, and 1, respectively, there will be ten total variable combinations (and answers). As another example, if the sizes of d, b, and n are 4, 3, and 2, respectively, there will be 24 total variable combinations. This simulates a parametric design study. Also, because all possible combinations can be generated in various orders, the answers will be sorted; the order that you output answers does not matter.\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.gif\",\"contentType\":\"image/gif\",\"content\":\"data:image/gif;base64,R0lGODlhfQAAAYAAAP///wAAACH5BAEAAAAALAAAAAB9AAABQAL/hI+py+0Po5y02ouz3rynEECgZ4EmiabqYbbtCl9hDIz0PbmxjXf88ut9ZkIMMfdBHFHBIlLhWkanUU/TKZzCrrsk67ZUcbGNMJkyPpfRap5ZDWUPT9u34W2HM6h0Zj6uFKj38OdTOEgSkraxiLin46C10oh46HVZ5yiRRrljqQn6GDpa8klK2llZmCpm2lZyxnoaKjs7yGebq1Sr23tryusrPExcbHwc4Vrzikxb1bwJplyM2wqNFrw5jcXKmdnbmc24DZYCOUmeoSi4nMiXLop6LF5E1ERvCF7xXs1xn3vPjiRr+9rdMTgLngiFwo4whPIw4TuCusKFOUfRVreI/9iuOfMICh9IKxxHqis5CRYZkT0asZSB0mQyfjFlPsJoMyfJSDV1+vwJNKjQoUSL+gRmdBxEVT2LDkxq6KlOlDSbxqKCTqhUd0T7ZDX2jEVVnCd9WWxj1YdKQS+HgAN28U7Ntl04peWp0U9Tuv7QeTV3F1BLrBlbfhEsRpqju1b5JqIWWENkpWZXTXZbca2TEZcLet61V4rEhUBefEMMrZ8fEagPAlSM7W/nz6f75nUstyu71VBrTyUMeJjd0mR3VoQLMbQ+2vVml9KGdl7xq719Vzd+nXd2rtu5d89HLKAqs3JWOi//hNt59Kyph7+4Pvd38PMp1y+l+v7C6fp5/v/tn957pgEYD2kEIhTNgQouyGCDDj4IYYQSTkghE5rpt5GCZzE4nIRh/RKfSf9NyJ+DWz2YX04x8QPUihPJxKI/NNmUIn0/nWjjUR9q1+KAhd2Im3xDNRbiPvCNV5mB7mUWIBDWycNcbnMVSciFDj05ijKiHfbjKUiVhqB3xylp3nJCioVkQu4o5yVgbNLSyojYLeaXjzzW0xyO9m2WXJw7zplFmK6RVOOeg/23F2yBspMWkYvZ+Z6akOUV6WsNURlJcnKWWVkeQc6UJKhLaoQcp5aylwWma0S5KXiqYgbdHDT88CqaooIW5D9eemqGnoYOKhGkuJZY1h4gFforJlzgHodssZkGIkWtynb5LILS7vZVgste29xjlM7KbXCC5ngjtoACCeydFdYQ7qQ9+uqsjvAa0e5SsGraqmT1nlngsJ6Q16Rcb34bcL7JZmnkWAbHemrAgwGsrXqXkilxpbukuS6/636aFMdGeezUvhNnbCvJ7JqscYUgdyVyqCav7ObCD4/cr6kAWQLzvaPlMFvORlyYqpkO4+AzTB3ZTCrDFbsMJhxFRyUz0S2/hfLJKD+tY9VYi/gihDFG2OyC84otrIdb03g2je5ejKJlHKJ6n5ZVz0133XbfjXfeeu9tdwEAOw==\"},{\"partUri\":\"/media/image2.gif\",\"contentType\":\"image/gif\",\"content\":\"data:image/gif;base64,R0lGODdhQAGPAPcAAAAAAP///wECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECA8/UQQCAKVAAZgAAAKxdUAABAAAAcCH1v0jsbwCQGVAAgClQAEwAAAAQCwAAAABfLYApUAAAAAAAAAAAAAEAAACUGlAABAEAAAAAAAAAAAAAkBlQACjsbwBsAAgAKAAuAAAAAACsXVAAoNpEAFjJRwBPcGVuAAAAAFUAAAD3Bf5V/iL3BXwAbwCu728AAAAAAEU6XEZhY3RvcnMgV2ViIFBhZ2VzXHB1YmxpY19odG1sXGltYWdlcwBjLTZlcS5naWYAxwUFAAAA31T+IncB3HwgAKcBmHwnRgUAAAABAAMAXQETAAAAAAAiECIAywIAAKQKxwVwbYcEFO1vACzxbwDEJve/cx3yvwBwbwAAAFYAAQAAACAAAAC1IAAAAAAAAAEAAAAFAAAAHO5vANBHt7/+IgAAAgAAAAQAAAAGAAAAfO9vANiUAIAFAAAAAAAAAFrubwCsC10A/iIAAFJlYWR5Kve//iIAAAAAAABeARQAAAAAADcnXwEBgAAEAADwAAAAACAAcG8ADQAAAPJJdxeXFgAARTpcRmFjdG9ycyB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As0bJ+F10VZuLqXS45vgVuW+nIWukyYTHVRzKFIV1rCX6ouY+25a1E4mNHx2A2uHJjlUxpVOisvqYyNPladc0clMQkymosAyJA92sK5r/V2vSPcclQEW2BKkz1wfYN1mV7sO9rCITaxiFwtYAjEWbuWp6mOrGTQTSnayypxgu8SJ2Vhd6rKdLVs3QZsmNsbHsO1K5vMCmb/ZUehFpOzeJP2Jv3B2p4sMFFeSbJtN+7m2eDGJIlsJmjz+ARVvbtwtKFvLyONO0JypRa1fCkvCYP7PufWqmOGUeF0K7k1DKfXl57AENe1mlrv+26tRf6U40ZUnqe8aqV9ny1n9BQ6ttNqqY/8qyYvp8qcNTNxh5JooukZ3ZRASsNlIG9oGfwe3Do6whCdM4Qpb+MIYjltAAAA7\"}]}"},{"id":42825,"title":"solid of revolution","description":"Given an real polynomial P and two real numbers a,b with 0\u003c=a\u003c=b. Calculate the volume of the solid of revolution made by rotating P around the x-axis in the intervall [a,b]! Return the volume in multiples of pi!","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 42px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 21px; transform-origin: 407px 21px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 379.5px 8px; transform-origin: 379.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven an real polynomial P and two real numbers a,b with 0\u0026lt;=a\u0026lt;=b. Calculate the volume of the solid of revolution made by rotating P around the x-axis in the intervall [a,b]! Return the volume in multiples of pi!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function V = solid_of_revolution(P,a,b)\r\nV=0;\r\nend","test_suite":"%%\r\nP=0;\r\na=0;\r\nb=1;\r\nV_correct=0;\r\nassert(abs(solid_of_revolution(P,a,b) - V_correct) \u003c 1e-8);\r\n\r\n%%\r\nP=1;\r\na=0;\r\nb=1;\r\nV_correct=1;\r\nassert(abs(solid_of_revolution(P,a,b) - V_correct) \u003c 1e-8);\r\n\r\n%%\r\nP=[1 0];\r\na=0;\r\nb=1;\r\nV_correct=1/3;\r\nassert(abs(solid_of_revolution(P,a,b) - V_correct) \u003c 1e-8);\r\n\r\n%%\r\nP=[1 1 1];\r\na=1;\r\nb=4;\r\nV_correct=4131/10;\r\nassert(abs(solid_of_revolution(P,a,b) - V_correct) \u003c 1e-8);","published":true,"deleted":false,"likes_count":1,"comments_count":5,"created_by":73322,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":42,"test_suite_updated_at":"2021-12-12T12:07:22.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2016-04-24T18:14:15.000Z","updated_at":"2026-02-08T12:34:10.000Z","published_at":"2016-04-24T18:14:15.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven an real polynomial P and two real numbers a,b with 0\u0026lt;=a\u0026lt;=b. Calculate the volume of the solid of revolution made by rotating P around the x-axis in the intervall [a,b]! Return the volume in multiples of pi!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42855,"title":"Height of a right-angled triangle","description":"Given numbers a, b and c, find the height of the right angled triangle with sides a and b and hypotenuse c, for the base c. If a right angled triangle with sides a and b and hypotenuse c does not exist, return NaN (not-a-number).","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 42px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.5px 21px; transform-origin: 406.5px 21px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 383.5px 21px; text-align: left; transform-origin: 383.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 383.017px 7.81667px; transform-origin: 383.017px 7.81667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven numbers a, b and c, find the height of the right angled triangle with sides a and b and hypotenuse c, for the base c. If a right angled triangle with sides a and b and hypotenuse c does not exist, return NaN (not-a-number).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = triangle_height(a, b, c)\r\n  h = a+b+c;\r\nend","test_suite":"%%\r\nfiletext = fileread('triangle_height.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'regexp');\r\nassert(~illegal)\r\n\r\n%%\r\na = 3;\r\nb = 4;\r\nc = 5;\r\n\r\ny_correct = 2.4;\r\nassert(abs(triangle_height(a, b, c) - y_correct) \u003c 1e-4);\r\n\r\n%%\r\na = 1;\r\nb = 2;\r\nc = 3;\r\n\r\ny_correct = NaN;\r\nassert(isequaln(triangle_height(a, b, c), y_correct));\r\n\r\n%%\r\na = 0;\r\nb = 1;\r\nc = 1;\r\n\r\ny_correct = NaN;\r\nassert(isequaln(triangle_height(a, b, c), y_correct));\r\n\r\n%%\r\na = -3;\r\nb = -4;\r\nc = -5;\r\n\r\ny_correct = NaN;\r\nassert(isequaln(triangle_height(a, b, c), y_correct));\r\n\r\n%%\r\na = 7;\r\nb = 24;\r\nc = 25;\r\n\r\ny_correct = 6.72;\r\nassert(isequaln(triangle_height(a, b, c), y_correct));","published":true,"deleted":false,"likes_count":11,"comments_count":2,"created_by":18882,"edited_by":223089,"edited_at":"2024-11-04T15:53:05.000Z","deleted_by":null,"deleted_at":null,"solvers_count":2021,"test_suite_updated_at":"2024-11-04T15:53:05.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2016-05-19T09:41:53.000Z","updated_at":"2026-04-04T19:11:32.000Z","published_at":"2016-05-19T09:41:53.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven numbers a, b and c, find the height of the right angled triangle with sides a and b and hypotenuse c, for the base c. If a right angled triangle with sides a and b and hypotenuse c does not exist, return NaN (not-a-number).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42705,"title":"Is It a Snake?","description":"Given an m-by-n matrix, return true if the elements of the matrix are a connected \"snake\" shape from 1 to m*n. Otherwise return false.\r\n\r\nSnakes are vectors that move through the grid of a matrix in a 4-connected sense. So the number 1 can be anywhere, but the number 2 must be north, south, east, or west of 1. And the number 3 must be north, south, east, or west of 2. And so on.\r\n\r\nExamples\r\n\r\n [ 1 2 3 4 5 ]    is a snake\r\n\r\n [ 2 1 3 4 ]      is NOT a snake\r\n \r\n [ 1 2 3 2 1 ]    is NOT a snake\r\n\r\n [ 6 5 4 3 ]      is NOT a snake\r\n\r\n [ 6 1 2 \r\n   5 4 3 ]        is a snake\r\n\r\n [ 1 2\r\n   3 4 ]          is NOT a snake\r\n\r\n [  7  8  9 10\r\n    6  1  2 11\r\n    5  4  3 12\r\n   16 15 14 13 ]  is a snake\r\n\r\nNOTE: Answers to this problem helped me write the test suite for Cody Problem 42708, \u003chttps://www.mathworks.com/matlabcentral/cody/problems/42708-placing-beads-neatly-in-a-box Placing Beads Neatly in a Box\u003e. Thanks!\r\n","description_html":"\u003cp\u003eGiven an m-by-n matrix, return true if the elements of the matrix are a connected \"snake\" shape from 1 to m*n. Otherwise return false.\u003c/p\u003e\u003cp\u003eSnakes are vectors that move through the grid of a matrix in a 4-connected sense. So the number 1 can be anywhere, but the number 2 must be north, south, east, or west of 1. And the number 3 must be north, south, east, or west of 2. And so on.\u003c/p\u003e\u003cp\u003eExamples\u003c/p\u003e\u003cpre\u003e [ 1 2 3 4 5 ]    is a snake\u003c/pre\u003e\u003cpre\u003e [ 2 1 3 4 ]      is NOT a snake\u003c/pre\u003e\u003cpre\u003e [ 1 2 3 2 1 ]    is NOT a snake\u003c/pre\u003e\u003cpre\u003e [ 6 5 4 3 ]      is NOT a snake\u003c/pre\u003e\u003cpre\u003e [ 6 1 2 \r\n   5 4 3 ]        is a snake\u003c/pre\u003e\u003cpre\u003e [ 1 2\r\n   3 4 ]          is NOT a snake\u003c/pre\u003e\u003cpre\u003e [  7  8  9 10\r\n    6  1  2 11\r\n    5  4  3 12\r\n   16 15 14 13 ]  is a snake\u003c/pre\u003e\u003cp\u003eNOTE: Answers to this problem helped me write the test suite for Cody Problem 42708, \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/42708-placing-beads-neatly-in-a-box\"\u003ePlacing Beads Neatly in a Box\u003c/a\u003e. Thanks!\u003c/p\u003e","function_template":"function tf = isItSnaky(a)\r\n  tf = true;\r\nend","test_suite":"a = [ 1 2 3 4 5 ]    \r\ntf_correct = true;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n%%\r\n\r\na = [ 2 1 3 4 ]     \r\ntf_correct = false;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n%%\r\n\r\na = [ 6 1 2 \r\n      5 4 3 ]      \r\ntf_correct = true;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n%%\r\n\r\na = [ 1 2\r\n      3 4 ]         \r\ntf_correct = false;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n%%\r\n\r\na = [  7  8  9 10\r\n       6  1  2 11\r\n       5  4  3 12\r\n      16 15 14 13 ]  \r\ntf_correct = true;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n%%\r\n\r\na =  [ 1 2 3 2 1 ]   \r\ntf_correct = false;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n%%\r\n\r\na =  [ 6 5 4 3 ]   \r\ntf_correct = false;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n%%\r\n\r\na =  [ 1 2 3\r\n       4 5 6\r\n       7 8 9 ]   \r\ntf_correct = false;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n%%\r\n\r\na =  [ 2 1 1 1 ];\r\ntf_correct = false;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":7,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":"2016-01-27T17:47:03.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2016-01-05T21:09:15.000Z","updated_at":"2026-02-08T12:52:52.000Z","published_at":"2016-01-05T21:26:23.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\u003eGiven an m-by-n matrix, return true if the elements of the matrix are a connected \\\"snake\\\" shape from 1 to m*n. Otherwise return false.\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\u003eSnakes are vectors that move through the grid of a matrix in a 4-connected sense. So the number 1 can be anywhere, but the number 2 must be north, south, east, or west of 1. And the number 3 must be north, south, east, or west of 2. And so on.\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\u003eExamples\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 2 3 4 5 ]    is a snake\\n\\n [ 2 1 3 4 ]      is NOT a snake\\n\\n [ 1 2 3 2 1 ]    is NOT a snake\\n\\n [ 6 5 4 3 ]      is NOT a snake\\n\\n [ 6 1 2 \\n   5 4 3 ]        is a snake\\n\\n [ 1 2\\n   3 4 ]          is NOT a snake\\n\\n [  7  8  9 10\\n    6  1  2 11\\n    5  4  3 12\\n   16 15 14 13 ]  is a snake]]\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\u003eNOTE: Answers to this problem helped me write the test suite for Cody Problem 42708,\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/42708-placing-beads-neatly-in-a-box\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ePlacing Beads Neatly in a Box\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. 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\"}]}"},{"id":42698,"title":"Why the heck are they blinking!?!?","description":"Merry Christmas everyone!  Sadly, the lights you've had on your tree for so many years burned out, and it's time to get a new set.  Being a skilled (and cheap!) mathematician, you realize that you can estimate the total length of the strings of lights you'll need for your tree with two simple parameters:\r\n\r\n* The radius of the base of the tree (in feet)\r\n* The Number of rows of lights you want on your tree, from top to bottom.\r\n\r\nThe rows of lights are equally spaced vertically around the tree.  Given these two variables, calculate how long your string of lights has to be in order to wrap around your tree.  You want to buy the minimum possible length of lights, because NOBODY likes having to untangle any more lights than they have to!\r\n\r\nHelpful hints - The answers calculated below model the lights on your tree as a two-dimensional Spiral of Archimedes, so the number of rows of lights is equal to the number of times your spiral makes a full 360-degree loop.  The final Cartesian coordinate of your spiral should be (width, 0).  If someone far smarter than I am wants to make the full three-dimensional version of this problem, knock yourself out!","description_html":"\u003cp\u003eMerry Christmas everyone!  Sadly, the lights you've had on your tree for so many years burned out, and it's time to get a new set.  Being a skilled (and cheap!) mathematician, you realize that you can estimate the total length of the strings of lights you'll need for your tree with two simple parameters:\u003c/p\u003e\u003cul\u003e\u003cli\u003eThe radius of the base of the tree (in feet)\u003c/li\u003e\u003cli\u003eThe Number of rows of lights you want on your tree, from top to bottom.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eThe rows of lights are equally spaced vertically around the tree.  Given these two variables, calculate how long your string of lights has to be in order to wrap around your tree.  You want to buy the minimum possible length of lights, because NOBODY likes having to untangle any more lights than they have to!\u003c/p\u003e\u003cp\u003eHelpful hints - The answers calculated below model the lights on your tree as a two-dimensional Spiral of Archimedes, so the number of rows of lights is equal to the number of times your spiral makes a full 360-degree loop.  The final Cartesian coordinate of your spiral should be (width, 0).  If someone far smarter than I am wants to make the full three-dimensional version of this problem, knock yourself out!\u003c/p\u003e","function_template":"function l = Length_of_Lights(w,n)\r\n  y = w*n;\r\nend","test_suite":"%%\r\nw=1;n=1;\r\nLOL=Length_of_Lights(w,n)\r\ntest=abs(LOL-3.3830)\r\nassert(test\u003c=0.001)\r\n%%\r\nw=4;n=5;\r\nLOL=Length_of_Lights(w,n)\r\ntest=abs(LOL-63.1273)\r\nassert(test\u003c=0.001)\r\n%%\r\nw=20;n=15;\r\nLOL=Length_of_Lights(w,n)\r\ntest=abs(LOL-943.086)\r\nassert(test\u003c=0.01)\r\n%%\r\nr=[31.4584 62.9167 94.3751 125.8335 157.2919 188.7502 220.2086 251.6670 283.1253 314.5837];\r\nk=ceil(10*rand)\r\nLOL=Length_of_Lights(k,10)\r\ntest=abs(LOL-r(k))\r\nassert(test\u003c=0.001)\r\n%%\r\nr=[23.6813 45.0198 66.7403 88.5798 110.4727 132.3946 154.3341 176.2850 198.2439 220.2086];\r\nk=ceil(10*rand)\r\nLOL=Length_of_Lights(7,k)\r\ntest=abs(LOL-r(k))\r\nassert(test\u003c=0.001)\r\n%%\r\nw = floor(sqrt(Length_of_Lights(9,4)))\r\nn=floor(sqrt(Length_of_Lights(5,8)))\r\nLOL=Length_of_Lights(w,n)\r\ntest=abs(LOL-345.9679)\r\nassert(test\u003c=0.01)","published":true,"deleted":false,"likes_count":2,"comments_count":9,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":34,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":37,"created_at":"2015-12-29T16:44:33.000Z","updated_at":"2026-02-27T09:52:37.000Z","published_at":"2015-12-29T16:44:33.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\u003eMerry Christmas everyone! Sadly, the lights you've had on your tree for so many years burned out, and it's time to get a new set. Being a skilled (and cheap!) mathematician, you realize that you can estimate the total length of the strings of lights you'll need for your tree with two simple parameters:\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\u003eThe radius of the base of the tree (in feet)\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\u003eThe Number of rows of lights you want on your tree, from top to bottom.\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 rows of lights are equally spaced vertically around the tree. Given these two variables, calculate how long your string of lights has to be in order to wrap around your tree. You want to buy the minimum possible length of lights, because NOBODY likes having to untangle any more lights than they have to!\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\u003eHelpful hints - The answers calculated below model the lights on your tree as a two-dimensional Spiral of Archimedes, so the number of rows of lights is equal to the number of times your spiral makes a full 360-degree loop. The final Cartesian coordinate of your spiral should be (width, 0). If someone far smarter than I am wants to make the full three-dimensional version of this problem, knock yourself out!\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":2174,"title":"Minimal cost","description":"A power house, P, is on one bank of a straight river W meters wide, and a factory, F, is on the opposite bank L meters downstream from P. The cable has to be taken across the river, under water at a cost of $CW/m. On land the cost is $CL/m. What is the minimum cost?","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 63px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 31.5px; transform-origin: 407px 31.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 370px 8px; transform-origin: 370px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA power house, P, is on one bank of a straight river W meters wide, and a factory, F, is on the opposite bank L meters downstream from P. The cable has to be taken across the river, under water at a cost of $CW/m. On land the cost is $CL/m. What is the minimum cost?\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = minimumdist(W,L,CW,CL)\r\n  W=Width\r\n%L=length\r\n%CW=cost of underwater cabling\r\n%CL=cost of Land cabling\r\nend","test_suite":"%%\r\nW=200;\r\nL=400;\r\nCL=3;\r\nCW=6;\r\ny_correct = 2239;\r\nassert(isequal(floor(minimumdist(W,L,CW,CL)),y_correct))\r\n\r\n%%\r\nW=200;\r\nL=200;\r\nCL=3;\r\nCW=5;\r\ny_correct = 1400;\r\nassert(isequal(floor(minimumdist(W,L,CW,CL)),y_correct))\r\n\r\n%%\r\nW=100;\r\nL=200;\r\nCL=2;\r\nCW=3;\r\ny_correct = 623;\r\nassert(isequal(floor(minimumdist(W,L,CW,CL)),y_correct))\r\n\r\n%%\r\nW=48;\r\nL=36;\r\nCL=3;\r\nCW=5;\r\ny_correct = 300;\r\nassert(isequal(floor(minimumdist(W,L,CW,CL)),y_correct))","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":17228,"edited_by":223089,"edited_at":"2023-01-07T18:11:17.000Z","deleted_by":null,"deleted_at":null,"solvers_count":66,"test_suite_updated_at":"2023-01-07T18:11:17.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2014-02-11T13:54:22.000Z","updated_at":"2026-02-27T10:10:33.000Z","published_at":"2014-02-11T13:54:22.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA power house, P, is on one bank of a straight river W meters wide, and a factory, F, is on the opposite bank L meters downstream from P. The cable has to be taken across the river, under water at a cost of $CW/m. On land the cost is $CL/m. What is the minimum cost?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42460,"title":"The cake is a lie...","description":"You're hosting a birthday party with a large number of screaming children.  Fortunately, you have a gigantic sheet cake in front of you that can be cut a large number of times.  Given the number of kids at the party, find the minimum number of cuts you need to make to give all of them at least one piece.  There can be pieces left over, but you need to make sure that everyone gets at least one piece.  Fortunately, the pieces of cake don't have to be the same size.\r\n\r\nGood luck!","description_html":"\u003cp\u003eYou're hosting a birthday party with a large number of screaming children.  Fortunately, you have a gigantic sheet cake in front of you that can be cut a large number of times.  Given the number of kids at the party, find the minimum number of cuts you need to make to give all of them at least one piece.  There can be pieces left over, but you need to make sure that everyone gets at least one piece.  Fortunately, the pieces of cake don't have to be the same size.\u003c/p\u003e\u003cp\u003eGood luck!\u003c/p\u003e","function_template":"function y = birthday_cake(x)\r\n  y = i_want_a_flower_on_my_piece;\r\nend","test_suite":"%%\r\nx = 1;y_correct = 0;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 2;y_correct = 1;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 4;y_correct = 2;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 7;y_correct = 3;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 12;y_correct = 4;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 27;y_correct = 6;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 127;y_correct = 9;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 2015;y_correct = 23;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 4060225;y_correct = 290;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 1234567890;y_correct = 1950;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 1362067890;y_correct = 2015;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\ny=arrayfun(@(x) birthday_cake(x),1:1000);\r\nassert(isequal(sum(y),13965))\r\n[x1,y1]=hist(y,unique(y));\r\n[m1,m2]=max(x1);\r\nassert(isequal(m1,154))\r\nassert(isequal(x1(isprime(x1)),[2 7 11 29 37 67 79 137]))","published":true,"deleted":false,"likes_count":1,"comments_count":4,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":35,"test_suite_updated_at":"2018-02-21T17:32:33.000Z","rescore_all_solutions":true,"group_id":37,"created_at":"2015-07-21T16:58:22.000Z","updated_at":"2026-03-10T20:07:26.000Z","published_at":"2015-07-21T17:00:13.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\u003eYou're hosting a birthday party with a large number of screaming children. Fortunately, you have a gigantic sheet cake in front of you that can be cut a large number of times. Given the number of kids at the party, find the minimum number of cuts you need to make to give all of them at least one piece. There can be pieces left over, but you need to make sure that everyone gets at least one piece. Fortunately, the pieces of cake don't have to be the same size.\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\u003eGood luck!\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":42721,"title":"Fun with a compass","description":"Each night for the past week, you have been having the same nightmare: You find yourself back in your junior high school geometry class, armed with nothing but a compass and a straight edge. Your teacher gives you a number, and asks you if it is possible to construct a regular polygon with that many sides inside the unit circle using nothing but the compass and straight edge.\r\nAfter waking up in a cold sweat again, you decide to write a MATLAB script to see if you can solve your nightmare. The dream is burned into your memory, so you remember all of the numbers that your teacher gave to you. Write a script that will allow you to solve this problem, and sleep peacefully once again.\r\nNote - You don't actually have to construct the n-sided polygon. You just need to determine if it's possible to do so. You can assume that all of the numbers are integers greater than 2.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 207px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 103.5px; transform-origin: 407px 103.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 84px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 42px; text-align: left; transform-origin: 384px 42px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eEach night for the past week, you have been having the same nightmare: You find yourself back in your junior high school geometry class, armed with nothing but a compass and a straight edge. Your teacher gives you a number, and asks you if it is possible to construct a regular polygon with that many sides inside the unit circle using nothing but the compass and straight edge.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 374px 8px; transform-origin: 374px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAfter waking up in a cold sweat again, you decide to write a MATLAB script to see if you can solve your nightmare. The dream is burned into your memory, so you remember all of the numbers that your teacher gave to you. Write a script that will allow you to solve this problem, and sleep peacefully once again.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 375.5px 8px; transform-origin: 375.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNote - You don't actually have to construct the n-sided polygon. You just need to determine if it's possible to do so. You can assume that all of the numbers are integers greater than 2.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = compass_construction(x)\r\n  y = x;\r\nend","test_suite":"x = 3; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 5; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 6; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 7; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 9; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 13; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 17; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 21; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 51; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 257; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 258; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 640; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 1234; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 2016; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 2056; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 65535; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 65536; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 65537; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 65538; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 1e5; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 196611; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 327685; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":42,"test_suite_updated_at":"2022-01-04T06:41:03.000Z","rescore_all_solutions":true,"group_id":37,"created_at":"2016-02-11T19:32:52.000Z","updated_at":"2026-02-27T10:14:32.000Z","published_at":"2016-02-11T19:32:52.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEach night for the past week, you have been having the same nightmare: You find yourself back in your junior high school geometry class, armed with nothing but a compass and a straight edge. Your teacher gives you a number, and asks you if it is possible to construct a regular polygon with that many sides inside the unit circle using nothing but the compass and straight edge.\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\u003eAfter waking up in a cold sweat again, you decide to write a MATLAB script to see if you can solve your nightmare. The dream is burned into your memory, so you remember all of the numbers that your teacher gave to you. Write a script that will allow you to solve this problem, and sleep peacefully once again.\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\u003eNote - You don't actually have to construct the n-sided polygon. You just need to determine if it's possible to do so. You can assume that all of the numbers are integers greater than 2.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":43642,"title":"Euclidean distance from a point to a polynomial","description":"A not uncommon problem in the area of computational geometry is to find the closest point to a straight line from a given point, or the distance from a point to a line. As you might expect, there is a simple formula for those things.\r\n\r\nAs an extension, I decided one day to write a tool that would compute the distance from a point to a general polynomial function in the (x,y) plane. That is your problem here:\r\n\r\nGiven a point (x0,y0), and a polynomial in the form y=P(x) where the function P is defined by the coefficients of a polynomial, you need to compute the minimum \u003chttps://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance\u003e to that polynomial. So you need to find and return the minimum distance in the (x,y) plane between the point (x0,y0), and the function y=P(x).\r\n\r\nThe function P will be passed in as the coefficients of a polynomial in standard MATLAB form, thus with the highest order coefficient first in a vector, like that generated by polyfit, and used by polyval. (P might be as simple as a constant function.) The point in question will be passed in as a vector of length 2, thus [x0,y0].\r\n\r\nAs test case for you to check your code, the distance from the point (-2,-5) to the curve y=x^2/2+3*x-5 should be:\r\n\r\n  x0y0 = [-2 -5];\r\n  P = [0.5 3 -5];\r\n  D = distance2polynomial(P,xy)\r\n  D =\r\n          1.89013819497707\r\n\r\n(Be careful plotting these curves in case you want to plot your solution. The command \"axis equal\" is a good idea.)\r\n\r\nThe symbolic TB tells me the distance is 1.8901381949770695260066523338279..., but I'll allow some slop in your solution, since you may have chosen a different algorithm than the one I chose. You should expect to provide at least 13 correct significant digits in the solution.\r\n\r\nDisclaimer: I'm not really sure why anyone needs such a code, which is why I've not posted my solution on the FEX. Anyway, my solution is a pretty one that I thought might make a fun Cody problem, and I wanted to see how others might approach the problem. I expect that my reference solution will score poorly for Cody purposes, since it is carefully coded, complete with error checks, and returns more than just the minimum distance.","description_html":"\u003cp\u003eA not uncommon problem in the area of computational geometry is to find the closest point to a straight line from a given point, or the distance from a point to a line. As you might expect, there is a simple formula for those things.\u003c/p\u003e\u003cp\u003eAs an extension, I decided one day to write a tool that would compute the distance from a point to a general polynomial function in the (x,y) plane. That is your problem here:\u003c/p\u003e\u003cp\u003eGiven a point (x0,y0), and a polynomial in the form y=P(x) where the function P is defined by the coefficients of a polynomial, you need to compute the minimum \u003ca href = \"https://en.wikipedia.org/wiki/Euclidean_distance\"\u003eEuclidean distance\u003c/a\u003e to that polynomial. So you need to find and return the minimum distance in the (x,y) plane between the point (x0,y0), and the function y=P(x).\u003c/p\u003e\u003cp\u003eThe function P will be passed in as the coefficients of a polynomial in standard MATLAB form, thus with the highest order coefficient first in a vector, like that generated by polyfit, and used by polyval. (P might be as simple as a constant function.) The point in question will be passed in as a vector of length 2, thus [x0,y0].\u003c/p\u003e\u003cp\u003eAs test case for you to check your code, the distance from the point (-2,-5) to the curve y=x^2/2+3*x-5 should be:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex0y0 = [-2 -5];\r\nP = [0.5 3 -5];\r\nD = distance2polynomial(P,xy)\r\nD =\r\n        1.89013819497707\r\n\u003c/pre\u003e\u003cp\u003e(Be careful plotting these curves in case you want to plot your solution. The command \"axis equal\" is a good idea.)\u003c/p\u003e\u003cp\u003eThe symbolic TB tells me the distance is 1.8901381949770695260066523338279..., but I'll allow some slop in your solution, since you may have chosen a different algorithm than the one I chose. You should expect to provide at least 13 correct significant digits in the solution.\u003c/p\u003e\u003cp\u003eDisclaimer: I'm not really sure why anyone needs such a code, which is why I've not posted my solution on the FEX. Anyway, my solution is a pretty one that I thought might make a fun Cody problem, and I wanted to see how others might approach the problem. I expect that my reference solution will score poorly for Cody purposes, since it is carefully coded, complete with error checks, and returns more than just the minimum distance.\u003c/p\u003e","function_template":"function D = distance2polynomial(P,x0y0)\r\n  % compute the minimum Euclidean distance between a point and a polynomial\r\n  D = rand;\r\nend\r\n","test_suite":"%%\r\nx0y0 = [-2 5];\r\nP = [0.5 3 -5];\r\ny_correct = 4.3093988461280149175163000679048;\r\ntol = 5e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [pi, pi];\r\nP = [10];\r\ny_correct = 6.8584073464102067615373566167205;\r\ntol = 7e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [0.25,50];\r\nP = [1 2 3 4 5];\r\ny_correct = 1.6470039192886012020234097061626;\r\ntol = 5e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [-3 -3];\r\nP = [-2 1];\r\ny_correct = 4.4721359549995793928183473374626;\r\ntol = 5e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [0 5];\r\nP = [1 0 1];\r\ny_correct = 1.9364916731037084425896326998912;\r\ntol = 2e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [-2 -5];\r\nP = [0.5 3 -5];\r\ny_correct = 1.8901381949770695260066523338279;\r\ntol = 2e-13;\r\n(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":544,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":37,"created_at":"2016-10-28T21:00:14.000Z","updated_at":"2026-02-08T12:58:41.000Z","published_at":"2016-10-28T21:08:10.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\u003eA not uncommon problem in the area of computational geometry is to find the closest point to a straight line from a given point, or the distance from a point to a line. As you might expect, there is a simple formula for those things.\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 an extension, I decided one day to write a tool that would compute the distance from a point to a general polynomial function in the (x,y) plane. That is your problem here:\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\u003eGiven a point (x0,y0), and a polynomial in the form y=P(x) where the function P is defined by the coefficients of a polynomial, you need to compute the minimum\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/Euclidean_distance\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eEuclidean distance\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e to that polynomial. So you need to find and return the minimum distance in the (x,y) plane between the point (x0,y0), and the function y=P(x).\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 function P will be passed in as the coefficients of a polynomial in standard MATLAB form, thus with the highest order coefficient first in a vector, like that generated by polyfit, and used by polyval. (P might be as simple as a constant function.) The point in question will be passed in as a vector of length 2, thus [x0,y0].\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 test case for you to check your code, the distance from the point (-2,-5) to the curve y=x^2/2+3*x-5 should be:\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[x0y0 = [-2 -5];\\nP = [0.5 3 -5];\\nD = distance2polynomial(P,xy)\\nD =\\n        1.89013819497707]]\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\u003e(Be careful plotting these curves in case you want to plot your solution. The command \\\"axis equal\\\" is a good idea.)\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 symbolic TB tells me the distance is 1.8901381949770695260066523338279..., but I'll allow some slop in your solution, since you may have chosen a different algorithm than the one I chose. You should expect to provide at least 13 correct significant digits in the solution.\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\u003eDisclaimer: I'm not really sure why anyone needs such a code, which is why I've not posted my solution on the FEX. Anyway, my solution is a pretty one that I thought might make a fun Cody problem, and I wanted to see how others might approach the problem. I expect that my reference solution will score poorly for Cody purposes, since it is carefully coded, complete with error checks, and returns more than just the minimum distance.\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":42580,"title":"Conic equation","description":"A conic of revolution (around the |z| axis) can be defined by the equation\r\n\r\n   s^2 – 2*R*z + (k+1)*z^2 = 0\r\n\r\nwhere |s^2=x^2+y^2|, |R| is the vertex radius of curvature, and |k| is the conic constant: |k\u003c-1| for a hyperbola, |k=-1| for a parabola, |-1\u003ck\u003c0| for a tall ellipse, |k=0| for a sphere, and |k\u003e0| for a short ellipse.\r\n\r\nWrite a function |z=conic(s,R,k)| to calculate height |z| as a function of radius |s| for given |R| and |k|.  Choose the branch of the solution that gives |z=s^2/(2*R)+...| for small values of |s|.  This defines a concave surface for |R\u003e0| and a convex surface for |R\u003c0|.  \r\n\r\nThe trick is to get full machine precision for all values of |s| and |R|.  The test suite will require a relative error less than |4*eps|, where |eps| is the machine precision.\r\n\r\nHint (added 2015/09/03): the straightforward solution is \r\n\r\n   z = (R-sqrt(R^2-(k+1)*s^2))/(k+1), \r\n\r\nbut this does not work if |k=-1|, gives the wrong branch of the solution if |R\u003c0|, and is subject to severe roundoff error if |s^2| is small compared to |R^2|.  It is possible, however, to find a mathematically equivalent form of the solution that solves all three problems at once.\r\n","description_html":"\u003cp\u003eA conic of revolution (around the \u003ctt\u003ez\u003c/tt\u003e axis) can be defined by the equation\u003c/p\u003e\u003cpre\u003e   s^2 – 2*R*z + (k+1)*z^2 = 0\u003c/pre\u003e\u003cp\u003ewhere \u003ctt\u003es^2=x^2+y^2\u003c/tt\u003e, \u003ctt\u003eR\u003c/tt\u003e is the vertex radius of curvature, and \u003ctt\u003ek\u003c/tt\u003e is the conic constant: \u003ctt\u003ek\u0026lt;-1\u003c/tt\u003e for a hyperbola, \u003ctt\u003ek=-1\u003c/tt\u003e for a parabola, \u003ctt\u003e-1\u0026lt;k\u0026lt;0\u003c/tt\u003e for a tall ellipse, \u003ctt\u003ek=0\u003c/tt\u003e for a sphere, and \u003ctt\u003ek\u0026gt;0\u003c/tt\u003e for a short ellipse.\u003c/p\u003e\u003cp\u003eWrite a function \u003ctt\u003ez=conic(s,R,k)\u003c/tt\u003e to calculate height \u003ctt\u003ez\u003c/tt\u003e as a function of radius \u003ctt\u003es\u003c/tt\u003e for given \u003ctt\u003eR\u003c/tt\u003e and \u003ctt\u003ek\u003c/tt\u003e.  Choose the branch of the solution that gives \u003ctt\u003ez=s^2/(2*R)+...\u003c/tt\u003e for small values of \u003ctt\u003es\u003c/tt\u003e.  This defines a concave surface for \u003ctt\u003eR\u0026gt;0\u003c/tt\u003e and a convex surface for \u003ctt\u003eR\u0026lt;0\u003c/tt\u003e.\u003c/p\u003e\u003cp\u003eThe trick is to get full machine precision for all values of \u003ctt\u003es\u003c/tt\u003e and \u003ctt\u003eR\u003c/tt\u003e.  The test suite will require a relative error less than \u003ctt\u003e4*eps\u003c/tt\u003e, where \u003ctt\u003eeps\u003c/tt\u003e is the machine precision.\u003c/p\u003e\u003cp\u003eHint (added 2015/09/03): the straightforward solution is\u003c/p\u003e\u003cpre\u003e   z = (R-sqrt(R^2-(k+1)*s^2))/(k+1), \u003c/pre\u003e\u003cp\u003ebut this does not work if \u003ctt\u003ek=-1\u003c/tt\u003e, gives the wrong branch of the solution if \u003ctt\u003eR\u0026lt;0\u003c/tt\u003e, and is subject to severe roundoff error if \u003ctt\u003es^2\u003c/tt\u003e is small compared to \u003ctt\u003eR^2\u003c/tt\u003e.  It is possible, however, to find a mathematically equivalent form of the solution that solves all three problems at once.\u003c/p\u003e","function_template":"function z=conic(s,R,k)\r\nz=0;\r\nend","test_suite":"%%\r\nR=5;\r\nk=-1;\r\ns=-5:5;\r\nz=[25 16 9 4 1 0 1 4 9 16 25]/10;\r\nt=arrayfun(@(x)conic(x,R,k),s);\r\nassert(all(abs(t-z)\u003c=4*eps*abs(z)))\r\n%%\r\nR=-5;\r\nk=-1;\r\ns=-5:5;\r\nz=-[25 16 9 4 1 0 1 4 9 16 25]/10;\r\nt=arrayfun(@(x)conic(x,R,k),s);\r\nassert(all(abs(t-z)\u003c=4*eps*abs(z)))\r\n%%\r\nR=6;\r\nk=0;\r\ns=0:0.125:2;\r\nz=[0 0.001302224649086391 0.005210595859100573 ...\r\n   0.01173021649825800 0.02086962844930099 ...\r\n   0.03264086885999461 0.04705955010467117 ...\r\n   0.06414496470811713 0.08392021690038396 ...\r\n   0.1064123829368584 0.1316527028472488 ...\r\n   0.1596768068881667 0.1905249806888747 ...\r\n   0.2242424739260392 0.2608798583755018 ...\r\n   0.3004934424110011 0.3431457505076198];\r\nt=arrayfun(@(x)conic(x,R,k),s);\r\nassert(all(abs(t-z)\u003c=4*eps*abs(z)))\r\n%%\r\nR=6800;\r\nk=-2;\r\ns=10.^(-9:9);\r\nz=[7.352941176470588e-23 7.352941176470588e-21 ...\r\n   7.352941176470588e-19 7.352941176470588e-17 ...\r\n   7.352941176470588e-15 7.352941176470588e-13 ...\r\n   7.352941176470548e-11 7.352941176466613e-9 ...\r\n   7.352941176073046e-7 0.00007352941136716365 ...\r\n   0.007352937201052538 0.7352543677216725 ...\r\n   73.13611097583313 5292.973166264779 93430.93334894173 ...\r\n   993223.1197327390 9.993202311999733e6 9.99932002312e7 ...\r\n   9.9999320002312e8];\r\nt=arrayfun(@(x)conic(x,R,k),s);\r\nassert(all(abs(t-z)\u003c=4*eps*abs(z)))\r\n%%\r\nR=exp(1);\r\nk=pi;\r\ns=10.^(-7:0);\r\nz=[1.839397205857214e-15 1.839397205857469e-13 ...\r\n   1.839397205882986e-11 1.839397208434684e-09 ...\r\n   1.839397463604480e-07 0.00001839422981299153 ...\r\n   0.001841981926630790 0.2212216213343403];\r\nt=arrayfun(@(x)conic(x,R,k),s);\r\nassert(all(abs(t-z)\u003c=4*eps*abs(z)))\r\n%%\r\nt=fileread('conic.m');\r\nassert(isempty(findstr(t,'roots')))\r\nassert(isempty(findstr(t,'fzero')))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":245,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":21,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":37,"created_at":"2015-08-26T21:39:35.000Z","updated_at":"2026-02-08T12:47:36.000Z","published_at":"2015-08-26T22:21:10.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\u003eA conic of revolution (around 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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ez\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e axis) can be defined by the equation\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[   s^2 – 2*R*z + (k+1)*z^2 = 0]]\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\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\u003es^2=x^2+y^2\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: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\u003eR\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the vertex radius of curvature, 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\u003ek\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the conic constant:\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\u003ek\u0026lt;-1\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for a hyperbola,\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\u003ek=-1\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for a parabola,\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\u003e-1\u0026lt;k\u0026lt;0\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for a tall ellipse,\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\u003ek=0\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for a sphere, 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\u003ek\u0026gt;0\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for a short ellipse.\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\u003eWrite a function\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\u003ez=conic(s,R,k)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to calculate height\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\u003ez\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e as a function of radius\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\u003es\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for given\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\u003eR\u003c/w:t\u003e\u003c/w:r\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:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ek\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Choose the branch of the solution that gives\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\u003ez=s^2/(2*R)+...\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for small values 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\u003es\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. This defines a concave surface for\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\u003eR\u0026gt;0\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and a convex surface for\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\u003eR\u0026lt;0\u003c/w:t\u003e\u003c/w:r\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\u003eThe trick is to get full machine precision for all values 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\u003es\u003c/w:t\u003e\u003c/w:r\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:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eR\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. The test suite will require a relative error less than\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\u003e4*eps\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, where\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\u003eeps\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the machine precision.\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\u003eHint (added 2015/09/03): the straightforward solution is\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[   z = (R-sqrt(R^2-(k+1)*s^2))/(k+1),]]\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\u003ebut this does not work if\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\u003ek=-1\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, gives the wrong branch of the solution if\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\u003eR\u0026lt;0\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, and is subject to severe roundoff error if\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\u003es^2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is small compared to\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\u003eR^2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. It is possible, however, to find a mathematically equivalent form of the solution that solves all three problems at once.\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":42708,"title":"Placing Beads Neatly in a Box","description":"You are given a string of n black and white beads. Your job is to pack them neatly into a square box. \"Neatly\" in this case means that all the black beads are at the bottom, and all the white beads are at the top.\r\n\r\n\u003c\u003chttp://starchamber.com/matlab/images/beads.png\u003e\u003e\r\n\r\nHalf the beads are black, and half are white. The number of beads n will always be an even number perfect square (4, 16, 36, ...). Black beads are 1, and white beads are 0, so a string might look like this.\r\n\r\n str = [0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1]\r\n \r\nReturn a square matrix bx that indexes into str such that\r\n\r\n str(bx) = [ 0 0 0 0\r\n             0 0 0 0\r\n             1 1 1 1\r\n             1 1 1 1 ]\r\n\r\nThe matrix bx consists of the numbers 1 through n snaking through the box in a 4-connected sense (see Cody Problem 42705, \u003chttps://www.mathworks.com/matlabcentral/cody/problems/42705-is-it-a-snake Is It a Snake?\u003e). \r\n\r\nHere's one solution for the string shown above.\r\n\r\n bx = [ 1  8  9 10 \r\n        2  7 12 11\r\n        3  6 13 14\r\n        4  5 16 15 ]\r\n \r\nIn general the answers are not unique. I will be checking that bx contains the numbers 1 through n, that they form a snake, and that when used with the string of beads, they result in a tidy ones-on-the-bottom formation.\r\n\r\n_I am grateful to the solvers of problem 42705 for giving me nice short code to use in my test suite for this problem!_","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 923.92px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 331.989px 461.96px; transform-origin: 331.996px 461.96px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 62.7273px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 308.991px 31.3636px; text-align: left; transform-origin: 308.999px 31.3636px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eYou are given a string of n black and white beads. Your job is to pack them neatly into a square box. \"Neatly\" in this case means that all the black beads are at the bottom, and all the white beads are at the top.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 127.443px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 308.991px 63.7216px; text-align: left; transform-origin: 308.999px 63.7216px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH0AAAB6CAYAAACShVydAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AcdFRE4MGRacwAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInAAAKZElEQVR4nO2dwW7juhWG/wwKzEsUNj1A0dW9T+CJ6ACz6uA+gAtMlLtr0QfILFrFUxSdRdeZXWRPgUHRdWZVIJJzsyi6jPchbXTR+xTswmGuxrFl8pDS6Ib8AC8CyDn+9YuSeMhDHiilFCJB8exr/4BI+0TTAySaHiDR9ACJpgdIND1AoukBEk0PkGh6gETTAySaHiC/8PnP5EJg+mkGAFiulgCAZHgIPuRg3wy8x1muluj3+liuljgevwH/zch7DKA9LZpkeIj0dyfeYmzipaXLhcDZ2zOMvjsCngN4DiSvEiSvEsz/c43R6yOc/PYEciGc4pSfCwz6g4c4yasE7NcMyasEk7+9w6A/wNnbM2c9Z2/PMPj2BZb/WzamRS7EIy36M/vnRwz6A0w/5M5atqIcEbd3Kh2nKk3T3ccIobIsU6zHlLi9I8XJzy8UY0wVRVEbhzGmstOMFEPc3ik+5K1pyfO8No6LljqcTedDXvvjq+R5TjpZxeWVYowZHSuEUJxz0slqU0vdxatx0VKHk+n7Wvg2siyzFgHA6CRphBCKH3JVXF6Z/67TTHHOrX5XlmWKD+2+w3pmhmt0i7fRsg8n0ylPByHEWrihCMqFpdS6JdoYAkAJIaxi2BqSn1+0omUfZNOpApRSKk1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nMcXLKFu1OKDJq/VhbbcdF5mPkanqenh1RrgWPOwbdOn0KFsVXYFSFeOzIqQao/o+4XvhwM04ejG/JrQUl1dfaGl64UClYoVLJ4gVLpHGiaYHSDQ9QKLpARJND5BoeoBE0wMkmm5A3M5jBzp9uZm79r1Oi1KPc9e+t/Oo0+Jza5Jt6Ws9dtBkwsmL6SYjRz7SiyaDIa55cRMtPvLiJoMuTezqoJQH022HPV22wDCNQT1ZtsOeXdZSh/OKkTYnSX8oqyzaxqCsGEnRYnsbpkw86dSKkRQzbEVQzbA15Clp2YfTKtBUATatnTolC7CbgNB1LR3ZzkNSvwoAVltgUDHdzsO0QmUXppUrrlp8bedBbukuVy1gPpPGJcZT+/iaHNnp5MyTS4p0BPLtPRkeYvpp6vGnPMb1VsZ6DMfjY6PtPFy08CE3mtM+ef/O6bHYie084HCrstkCwyWOCS5z67umxQTyf7KZLuwioOtdtra0dGY7D2qRvc0LCfXiais5Y2tGG1r24WU7DxsBLltgNHVhPUUtdXh5UJi2eNctMExOluv6LKbGuxRvmN69XLcm2UUj23lsO0E+fvyuIU9ttq/nXt3SYr4W/aluTdKklm0cKKUUPKL71rprYpJ1o8ZpIwbwNLRU8W56pPt0OiMXaYZoeoBE0wMkmh4g0fQAiaYHSDQ9QKLpARJND5BoeoBE0wMkmh4g0fQAiaYHSDQ9QP4P+LATkboVR38AAAAASUVORK5CYII=\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 62.7273px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 308.991px 31.3636px; text-align: left; transform-origin: 308.999px 31.3636px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eHalf the beads are black, and half are white. The number of beads n will always be an even number perfect square (4, 16, 36, ...). Black beads are 1, and white beads are 0, so a string might look like this.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 20px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e str = [0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 54.446px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 308.991px 27.2159px; text-align: left; transform-origin: 308.999px 27.223px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbAAAAAxCAYAAAC71fzjAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AcdFREcDGe+ogAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInAAAH+UlEQVR4nO2dTXIjuRGFcyZ8DhJ9AN+AIUELr3wDTYQbWs4NtINm5RvIO0HtxZxAs1VRjj6BZq8q8iBOLyTQ1WqyiEyg0ET3+yK4UbCUfIXMfKg/1E/MzAQAAAA0xs/f+gcAAAAAGmBgAA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tfnLh46Ps4JVcjPzb42iLZp2VqwHP3WaqWuVejL7WyfmyW47GP419ay74ci6vR52oZ14u19istc6xGv09LqVXP/bXfrfF4SEuJFdwP9RjnXLEeE27vjuZyKS1TddnSyvo1tIwp8iDzPuK7muL7gOK7Z3IeWjsUZ9gOb58NmcVylvcOjd87NaeW9/tsjnf1jGPEOO7yY/F3aH3PWojKjv+30BJ1EJXXMmwHWn9+fewh1kyNeiGaR8un3/+9+1uNXJ6rx+x7t1mL9RKZzcAAAACAOfn5W/8AAAAAQAMMDAAAQJPAwAAAADQJDAwAAECTwMAAAAA0CQwMAABAk8DAAAAANAkMDAAAQJPAwAAAADQJDAwAAECTwMAAAAA0CQwMAABAk8DAAAAANAkMDAAAQJPAwAAAADTJ/wAewOoB4sX+EwAAAABJRU5ErkJggg==\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9091px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 308.991px 10.4545px; text-align: left; transform-origin: 308.999px 10.4545px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eReturn a square matrix bx that indexes into str such that\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 80px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 328.991px 40px; transform-origin: 328.999px 40px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e str(bx) = [ 0 0 0 0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e             0 0 0 0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e             1 1 1 1\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e             1 1 1 1 ]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 41.8182px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 308.991px 20.9091px; text-align: left; transform-origin: 308.999px 20.9091px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThe matrix bx consists of the numbers 1 through n snaking through the box in a 4-connected sense (see Cody Problem 42705,\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/42705-is-it-a-snake\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eIs It a Snake?\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9091px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 308.991px 10.4545px; text-align: left; transform-origin: 308.999px 10.4545px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eHere's one solution for the string shown above.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 80px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 328.991px 40px; transform-origin: 328.999px 40px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e bx = [ 1  8  9 10 \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        2  7 12 11\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        3  6 13 14\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        4  5 16 15 ]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 134.446px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 308.991px 67.2159px; text-align: left; transform-origin: 308.999px 67.223px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIMAAACBCAYAAADjVQltAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AcdFREW7LJXvAAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInAAAKYUlEQVR4nO2dzW4byRHHS0YAvURANg0EOe0+Aa1pGtApi30ABrBGvmWRB5BPI20QJIec5ZuG3ABGkLN8CqAhvToEOUp3dZPYw+5TVA5091K0SFb1x5iS6wfMbajSf+Y/H1091bWHiAiCAADPPvc/IOwOYgbBI2YQPGIGwSNmEDxiBsEjZhA8YgbBI2YQPGIGwSNmEDxiBsEjZhA8YgbBI2YQPGIGwfObnH/c3hoYvRsDAMBsPgMAgKJ/ALqvQX3VSx5nNp9Bt9OF2XwGR8NXoP8wSB4DoD0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BEzCB4xg+ARMwgeMYPgETMInv8D6IpVdzZvffcAAAAASUVORK5CYII=\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 62.7273px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 308.991px 31.3636px; text-align: left; transform-origin: 308.999px 31.3636px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIn general the answers are not unique. I will be checking that bx contains the numbers 1 through n, that they form a snake, and that when used with the string of beads, they result in a tidy ones-on-the-bottom formation.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 41.8182px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 308.991px 20.9091px; text-align: left; transform-origin: 308.999px 20.9091px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eI am grateful to the solvers of problem 42705 for giving me nice short code to use in my test suite for this problem!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function bx = beadBox(str)\r\n  bx = 1;\r\nend","test_suite":"str = [0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1];\r\nbx = beadBox(str);\r\n\r\n% Is bx the right size?\r\nassert(isequal(size(bx),sqrt(length(str))*[1 1]))\r\n% Does it use all the numbers?\r\nassert(isequal(unique(bx),find(bx)))\r\n% Is it snaky?\r\n[I,J]=arrayfun(@(f) find(bx==f),1:numel(bx));\r\nassert(all(abs(diff(complex(I,J)))==1))\r\n% Are all the 1's on the bottom?\r\nbeads = str(bx);\r\nassert(all(find(beads')\u003ennz(beads)))\r\n\r\n%%\r\n\r\nstr = [1 1 0 0 0 0 0 0 1 1 1 1 1 0 0 1];\r\nbx = beadBox(str);\r\n\r\n% Is bx the right size?\r\nassert(isequal(size(bx),sqrt(length(str))*[1 1]))\r\n% Does it use all the numbers?\r\nassert(isequal(unique(bx),find(bx)))\r\n% Is it snaky?\r\n[I,J]=arrayfun(@(f) find(bx==f),1:numel(bx));\r\nassert(all(abs(diff(complex(I,J)))==1))\r\n% Are all the 1's on the bottom?\r\nbeads = str(bx);\r\nassert(all(find(beads')\u003ennz(beads)))\r\n\r\n%%\r\n\r\nstr = [1 1 0 0];\r\nbx = beadBox(str);\r\n\r\n% Is bx the right size?\r\nassert(isequal(size(bx),sqrt(length(str))*[1 1]))\r\n% Does it use all the numbers?\r\nassert(isequal(unique(bx),find(bx)))\r\n% Is it snaky?\r\n[I,J]=arrayfun(@(f) find(bx==f),1:numel(bx));\r\nassert(all(abs(diff(complex(I,J)))==1))\r\n% Are all the 1's on the bottom?\r\nbeads = str(bx);\r\nassert(all(find(beads')\u003ennz(beads)))\r\n\r\n%%\r\n\r\nstr = [0 1 1 0 0 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0];\r\nbx = beadBox(str);\r\n\r\n% Is bx the right size?\r\nassert(isequal(size(bx),sqrt(length(str))*[1 1]))\r\n% Does it use all the numbers?\r\nassert(isequal(unique(bx),find(bx)))\r\n% Is it snaky?\r\n[I,J]=arrayfun(@(f) find(bx==f),1:numel(bx));\r\nassert(all(abs(diff(complex(I,J)))==1))\r\n% Are all the 1's on the bottom?\r\nbeads = str(bx);\r\nassert(all(find(beads')\u003ennz(beads)))\r\n\r\n","published":true,"deleted":false,"likes_count":8,"comments_count":5,"created_by":7,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":16,"test_suite_updated_at":"2016-01-25T16:08:14.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2016-01-07T18:58:38.000Z","updated_at":"2026-02-08T10:50:52.000Z","published_at":"2016-01-07T19:00:25.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou are given a string of n black and white beads. Your job is to pack them neatly into a square box. \\\"Neatly\\\" in this case means that all the black beads are at the bottom, and all the white beads are at the top.\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:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"122\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"125\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHalf the beads are black, and half are white. The number of beads n will always be an even number perfect square (4, 16, 36, ...). Black beads are 1, and white beads are 0, so a string might look like this.\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[ str = [0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1]]]\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"49\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"432\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eReturn a square matrix bx that indexes into str such that\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[ str(bx) = [ 0 0 0 0\\n             0 0 0 0\\n             1 1 1 1\\n             1 1 1 1 ]]]\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe matrix bx consists of the numbers 1 through n snaking through the box in a 4-connected sense (see Cody Problem 42705,\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/42705-is-it-a-snake\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eIs It a Snake?\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHere's one solution for the string shown above.\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[ bx = [ 1  8  9 10 \\n        2  7 12 11\\n        3  6 13 14\\n        4  5 16 15 ]]]\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\u003cw:jc w:val=\\\"left\\\"/\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=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn general the answers are not unique. I will be checking that bx contains the numbers 1 through n, that they form a snake, and that when used with the string of beads, they result in a tidy ones-on-the-bottom formation.\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:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eI am grateful to the solvers of problem 42705 for giving me nice short code to use in my test suite for this problem!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.png\",\"relationshipId\":\"rId1\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image2.png\",\"relationshipId\":\"rId2\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image3.png\",\"relationshipId\":\"rId3\"}]},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH0AAAB6CAYAAACShVydAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AcdFRE4MGRacwAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInAAAKZElEQVR4nO2dwW7juhWG/wwKzEsUNj1A0dW9T+CJ6ACz6uA+gAtMlLtr0QfILFrFUxSdRdeZXWRPgUHRdWZVIJJzsyi6jPchbXTR+xTswmGuxrFl8pDS6Ib8AC8CyDn+9YuSeMhDHiilFCJB8exr/4BI+0TTAySaHiDR9ACJpgdIND1AoukBEk0PkGh6gETTAySaHiC/8PnP5EJg+mkGAFiulgCAZHgIPuRg3wy8x1muluj3+liuljgevwH/zch7DKA9LZpkeIj0dyfeYmzipaXLhcDZ2zOMvjsCngN4DiSvEiSvEsz/c43R6yOc/PYEciGc4pSfCwz6g4c4yasE7NcMyasEk7+9w6A/wNnbM2c9Z2/PMPj2BZb/WzamRS7EIy36M/vnRwz6A0w/5M5atqIcEbd3Kh2nKk3T3ccIobIsU6zHlLi9I8XJzy8UY0wVRVEbhzGmstOMFEPc3ik+5K1pyfO8No6LljqcTedDXvvjq+R5TjpZxeWVYowZHSuEUJxz0slqU0vdxatx0VKHk+n7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XE+yKTbbedBjpOTvPsLl1d80e7X5sd0CgxIDFl0ppehdQ5uulJ7z3rSWfXjZzsPmx1O3wLA9SZTtPCiGtJGR8727g7ftPJoyXGPaEvWSXFQtNuMILtt5NHEnMcXLKFu1OKDJq/VhbbcdF5mPkanqenh1RrgWPOwbdOn0KFsVXYFSFeOzIqQao/o+4XvhwM04ejG/JrQUl1dfaGl64UClYoVLJ4gVLpHGiaYHSDQ9QKLpARJND5BoeoBE0wMkmm5A3M5jBzp9uZm79r1Oi1KPc9e+t/Oo0+Jza5Jt6Ws9dtBkwsmL6SYjRz7SiyaDIa55cRMtPvLiJoMuTezqoJQH022HPV22wDCNQT1ZtsOeXdZSh/OKkTYnSX8oqyzaxqCsGEnRYnsbpkw86dSKkRQzbEVQzbA15Clp2YfTKtBUATatnTolC7CbgNB1LR3ZzkNSvwoAVltgUDHdzsO0QmUXppUrrlp8bedBbukuVy1gPpPGJcZT+/iaHNnp5MyTS4p0BPLtPRkeYvpp6vGnPMb1VsZ6DMfjY6PtPFy08CE3mtM+ef/O6bHYie084HCrstkCwyWOCS5z67umxQTyf7KZLuwioOtdtra0dGY7D2qRvc0LCfXiais5Y2tGG1r24WU7DxsBLltgNHVhPUUtdXh5UJi2eNctMExOluv6LKbGuxRvmN69XLcm2UUj23lsO0E+fvyuIU9ttq/nXt3SYr4W/aluTdKklm0cKKUUPKL71rprYpJ1o8ZpIwbwNLRU8W56pPt0OiMXaYZoeoBE0wMkmh4g0fQAiaYHSDQ9QKLpARJND5BoeoBE0wMkmh4g0fQAiaYHSDQ9QP4P+LATkboVR38AAAAASUVORK5CYII=\",\"relationship\":null},{\"partUri\":\"/media/image2.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbAAAAAxCAYAAAC71fzjAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AcdFREcDGe+ogAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB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12XVdcgNjPm0tfd+LtczdjHN7TA0tp9ZjDvHNnwOTPtdwbAWOr7Z5S+Aaz06JtXwnz4HV1CJtYlJjiauWSBuyxCSZdVpqPjt1qs+BSY/CNFrmNpaoZU6TZM4zyh/uObDYxFITTHIL7ZhY+Km302tW4pAsvRQ/mtUrNOZSQ4vUWJjrrioiyTHN6hVxoiTJMW0uS1YV0YyLdNLnnFNpkZwdydWSasg5WuauF82kT5tjNbRo+mUJiq+FeMzESqxTN14seCqOMUbt8pIEy9Uy94yl1lqIkmLRFGPUEpctmjIY772qGMdaUnJMa17MXy58PaeW2Pjn1pKyRmkIIVtLXMT34HcKjUtqLmuv40h7jJZT1HKSayEyf1mUzrndKtFx1WjtzHtfnLh46Ps4JVcjPzb42iLZp2VqwHP3WaqWuVejL7WyfmyW47GP419ay74ci6vR52oZ14u19istc6xGv09LqVXP/bXfrfF4SEuJFdwP9RjnXLEeE27vjuZyKS1TddnSyvo1tIwp8iDzPuK7muL7gOK7Z3IeWjsUZ9gOb58NmcVylvcOjd87NaeW9/tsjnf1jGPEOO7yY/F3aH3PWojKjv+30BJ1EJXXMmwHWn9+fewh1kyNeiGaR8un3/+9+1uNXJ6rx+x7t1mL9RKZzcAAAACAOfn5W/8AAAAAQAMMDAAAQJPAwAAAADQJDAwAAECTwMAAAAA0CQwMAABAk8DAAAAANAkMDAAAQJPAwAAAADQJDAwAAECTwMAAAAA0CQwMAABAk8DAAAAANAkMDAAAQJPAwAAAADTJ/wAewOoB4sX+EwAAAABJRU5ErkJggg==\",\"relationship\":null},{\"partUri\":\"/media/image3.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIMAAACBCAYAAADjVQltAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AcdFREW7LJXvAAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFW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5FmpUwixc4bULSkmDegTFbl7EKDmMEM3OnlmFY+1BihB5E7vbzLWigkXyGWc/DcFrKqKjdGyAqxIVq4t/OQD4IexQqxod/0cddbDonBPVFPSQuVnfkgltPKJzQG58OQXdey422JbNTvOa18QqH+jzHVYQDtaUndlijZnSHG5W1ulKs2pp5z17Rw+OKSTjlXdn3sJHtMFP0DcpOuh6C28jn+7nVwjLaMwGpLFPF4lYqqFqqQYiuqdkkLh2R/kfNZeYywXR9atqVl59sShS4+wXkRCjVdW0kn7klqQwuVLG2JOMJiWvnkMtxT1EIhy0QV9Q4R28qHchBj1z+iGiKmKIh6t4ttsbSNVtoSPXTgUohaN7XsTJDqubppCcBUi20tt1jKqWUTe4iIkBH3IYgbQuVa6dSt4Jo7BsDT0PIQ2c0gPB6+uAyksB4xg+ARMwgeMYPgETMIHjGD4BEzCB4xg+ARMwgeMYPgETMIHjGD4BEzCB4xg+ARMwgeMYPgETMInv8D6IpVdzZvffcAAAAASUVORK5CYII=\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":2831,"title":"Radiation Heat Transfer — View Factors (4)","description":"View factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates between surfaces. In particular, the thermal energy leaving a given surface is applied to other surfaces, as appropriate, based on how much the hot surface \"sees\" the other surfaces. As such, view factors are purely geometrical in nature. A range of view factor formulae are available \u003chttp://www.thermalradiation.net/tablecon.html here\u003e.\r\n\r\nFor this problem, calculate the view factor from surface 1 (an infinitely long plate) to surfaces 2 (n rows of in-line pipes):\r\n\r\n\u003c\u003chttp://www.thermalradiation.net/images/C-7fig.gif\u003e\u003e\r\n\r\nThe view factor for one row of pipes is F_1-2 (the first equation):\r\n\r\n\u003c\u003chttp://www.thermalradiation.net/images/C-7eq.gif\u003e\u003e\r\n\r\nThe second equation is utilized for more than one row of pipes. Any of the variables can be a vector. Also, note that D = d/b, where d is the pipe diameter and b is the center-to-center spacing between pipes.","description_html":"\u003cp\u003eView factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates between surfaces. In particular, the thermal energy leaving a given surface is applied to other surfaces, as appropriate, based on how much the hot surface \"sees\" the other surfaces. As such, view factors are purely geometrical in nature. A range of view factor formulae are available \u003ca href = \"http://www.thermalradiation.net/tablecon.html\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eFor this problem, calculate the view factor from surface 1 (an infinitely long plate) to surfaces 2 (n rows of in-line pipes):\u003c/p\u003e\u003cimg src = \"http://www.thermalradiation.net/images/C-7fig.gif\"\u003e\u003cp\u003eThe view factor for one row of pipes is F_1-2 (the first equation):\u003c/p\u003e\u003cimg src = \"http://www.thermalradiation.net/images/C-7eq.gif\"\u003e\u003cp\u003eThe second equation is utilized for more than one row of pipes. Any of the variables can be a vector. Also, note that D = d/b, where d is the pipe diameter and b is the center-to-center spacing between pipes.\u003c/p\u003e","function_template":"function F = view_factor4(d,b,n)\r\n  F = 1;\r\nend","test_suite":"%%\r\nd = 1;   b = 2;   n = 1;\r\ny_correct = 0.6576;\r\nF = view_factor4(d,b,n);\r\nassert(F \u003c (y_correct + 1e-4))\r\nassert(F \u003e (y_correct - 1e-4))\r\n\r\n%%\r\nd = 2;   b = 10;   n = [1 2 4 8 16 32];\r\ny_correct = [0.2941    0.5017    0.7517    0.9383    0.9962    1.0000];\r\nF = view_factor4(d,b,n);\r\nfor i = 1:numel(y_correct)\r\n assert(F(i) \u003c (y_correct(i) + 1e-4))\r\n assert(F(i) \u003e (y_correct(i) - 1e-4))\r\nend\r\n\r\n%%\r\nd = [0.25 0.5 1 1.25 2.5 4 5];\r\nb = [4 10 2.5 2 3 10 11];\r\nn = [1 2 2 1 1 5 5];\r\ny_correct = [0.0962    0.1486    0.7950    0.7792    0.9353    0.9810    0.9908];\r\nF = view_factor4(d,b,n);\r\nfor i = 1:numel(y_correct)\r\n assert(F(i) \u003c (y_correct(i) + 1e-4))\r\n assert(F(i) \u003e (y_correct(i) - 1e-4))\r\nend","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":26769,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":39,"test_suite_updated_at":"2015-01-16T02:04:37.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2015-01-15T01:47:46.000Z","updated_at":"2026-02-08T12:38:27.000Z","published_at":"2015-01-15T01:47:45.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.gif\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/media/image2.gif\"}],\"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\u003eView factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates between surfaces. In particular, the thermal energy leaving a given surface is applied to other surfaces, as appropriate, based on how much the hot surface \\\"sees\\\" the other surfaces. As such, view factors are purely geometrical in nature. A range of view factor formulae are available\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.thermalradiation.net/tablecon.html\\\"\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\u003eFor this problem, calculate the view factor from surface 1 (an infinitely long plate) to surfaces 2 (n rows of in-line pipes):\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\u003eThe view factor for one row of pipes is F_1-2 (the first equation):\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:r\u003e\u003cw:t\u003eThe second equation is utilized for more than one row of pipes. Any of the variables can be a vector. Also, note that D = d/b, where d is the pipe diameter and b is the center-to-center spacing between pipes.\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.gif\",\"contentType\":\"image/gif\",\"content\":\"data:image/gif;base64,R0lGODlhfQAAAYAAAP///wAAACH5BAEAAAAALAAAAAB9AAABQAL/hI+py+0Po5y02ouz3rynEECgZ4EmiabqYbbtCl9hDIz0PbmxjXf88ut9ZkIMMfdBHFHBIlLhWkanUU/TKZzCrrsk67ZUcbGNMJkyPpfRap5ZDWUPT9u34W2HM6h0Zj6uFKj38OdTOEgSkraxiLin46C10oh46HVZ5yiRRrljqQn6GDpa8klK2llZmCpm2lZyxnoaKjs7yGebq1Sr23tryusrPExcbHwc4Vrzikxb1bwJplyM2wqNFrw5jcXKmdnbmc24DZYCOUmeoSi4nMiXLop6LF5E1ERvCF7xXs1xn3vPjiRr+9rdMTgLngiFwo4whPIw4TuCusKFOUfRVreI/9iuOfMICh9IKxxHqis5CRYZkT0asZSB0mQyfjFlPsJoMyfJSDV1+vwJNKjQoUSL+gRmdBxEVT2LDkxq6KlOlDSbxqKCTqhUd0T7ZDX2jEVVnCd9WWxj1YdKQS+HgAN28U7Ntl04peWp0U9Tuv7QeTV3F1BLrBlbfhEsRpqju1b5JqIWWENkpWZXTXZbca2TEZcLet61V4rEhUBefEMMrZ8fEagPAlSM7W/nz6f75nUstyu71VBrTyUMeJjd0mR3VoQLMbQ+2vVml9KGdl7xq719Vzd+nXd2rtu5d89HLKAqs3JWOi//hNt59Kyph7+4Pvd38PMp1y+l+v7C6fp5/v/tn957pgEYD2kEIhTNgQouyGCDDj4IYYQSTkghE5rpt5GCZzE4nIRh/RKfSf9NyJ+DWz2YX04x8QPUihPJxKI/NNmUIn0/nWjjUR9q1+KAhd2Im3xDNRbiPvCNV5mB7mUWIBDWycNcbnMVSciFDj05ijKiHfbjKUiVhqB3xylp3nJCioVkQu4o5yVgbNLSyojYLeaXjzzW0xyO9m2WXJw7zplFmK6RVOOeg/23F2yBspMWkYvZ+Z6akOUV6WsNURlJcnKWWVkeQc6UJKhLaoQcp5aylwWma0S5KXiqYgbdHDT88CqaooIW5D9eemqGnoYOKhGkuJZY1h4gFforJlzgHodssZkGIkWtynb5LILS7vZVgste29xjlM7KbXCC5ngjtoACCeydFdYQ7qQ9+uqsjvAa0e5SsGraqmT1nlngsJ6Q16Rcb34bcL7JZmnkWAbHemrAgwGsrXqXkilxpbukuS6/636aFMdGeezUvhNnbCvJ7JqscYUgdyVyqCav7ObCD4/cr6kAWQLzvaPlMFvORlyYqpkO4+AzTB3ZTCrDFbsMJhxFRyUz0S2/hfLJKD+tY9VYi/gihDFG2OyC84otrIdb03g2je5ejKJlHKJ6n5ZVz0133XbfjXfeeu9tdwEAOw==\"},{\"partUri\":\"/media/image2.gif\",\"contentType\":\"image/gif\",\"content\":\"data:image/g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AAAA7\"}]}"},{"id":43601,"title":"Find the sines of an isosceles triangle when given its area and height","description":"Find the sines of an isosceles triangle when given its area and height.\r\nFor example, when A=12 and h=4, the result is [0.8 0.8 0.96].","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 25.5px; transform-origin: 407px 25.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 219.5px 8px; transform-origin: 219.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFind the sines of an isosceles triangle when given its area and height.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 192.5px 8px; transform-origin: 192.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor example, when A=12 and h=4, the result is [0.8 0.8 0.96].\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = theSineOfAnglesOfATriangle(A,h)\r\n  y = x;\r\nend","test_suite":"%%\r\nA = 12;\r\nh = 4;\r\ny_correct = [0.8, 0.8, 0.96];\r\ny = theSineOfAnglesOfATriangle(A,h);\r\ntolerance = 1e-4;\r\nassert(abs(y(1)-y_correct(1))\u003ctolerance)\r\nassert(abs(y(2)-y_correct(2))\u003ctolerance)\r\nassert(abs(y(3)-y_correct(3))\u003ctolerance)\r\n\r\n%%\r\nA = 48;\r\nh = 8;\r\ny_correct = [0.8, 0.8, 0.96];\r\ny = theSineOfAnglesOfATriangle(A,h);\r\ntolerance = 1e-4;\r\nassert(abs(y(1)-y_correct(1))\u003ctolerance)\r\nassert(abs(y(2)-y_correct(2))\u003ctolerance)\r\nassert(abs(y(3)-y_correct(3))\u003ctolerance)\r\n\r\n%%\r\nA = 40;\r\nh = 10;\r\ny_correct = [0.9285, 0.9285, 0.6897];\r\ny = theSineOfAnglesOfATriangle(A,h);\r\ntolerance = 1e-4;\r\nassert(abs(y(1)-y_correct(1))\u003ctolerance)\r\nassert(abs(y(2)-y_correct(2))\u003ctolerance)\r\nassert(abs(y(3)-y_correct(3))\u003ctolerance)\r\n\r\n%%\r\nA = 11;\r\nh = 7;\r\ny_correct = [0.9757, 0.9757, 0.4274];\r\ny = theSineOfAnglesOfATriangle(A,h);\r\ntolerance = 1e-4;\r\nassert(abs(y(1)-y_correct(1))\u003ctolerance)\r\nassert(abs(y(2)-y_correct(2))\u003ctolerance)\r\nassert(abs(y(3)-y_correct(3))\u003ctolerance)\r\n\r\n%%\r\nA = 10;\r\nh = 7;\r\ny_correct = [0.9798, 0.9798, 0.3918];\r\ny = theSineOfAnglesOfATriangle(A,h);\r\ntolerance = 1e-4;\r\nassert(abs(y(1)-y_correct(1))\u003ctolerance)\r\nassert(abs(y(2)-y_correct(2))\u003ctolerance)\r\nassert(abs(y(3)-y_correct(3))\u003ctolerance)\r\n\r\n%%\r\nA = 100;\r\nh = 90;\r\ny_correct = [0.9999, 0.9999, 0.0247];\r\ny = theSineOfAnglesOfATriangle(A,h);\r\ntolerance = 1e-4;\r\nassert(abs(y(1)-y_correct(1))\u003ctolerance)\r\nassert(abs(y(2)-y_correct(2))\u003ctolerance)\r\nassert(abs(y(3)-y_correct(3))\u003ctolerance)\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":15,"created_by":90467,"edited_by":223089,"edited_at":"2023-02-04T06:18:22.000Z","deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":"2023-02-04T06:18:22.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2016-10-23T10:38:22.000Z","updated_at":"2026-02-08T11:35:41.000Z","published_at":"2016-10-23T10:38:22.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the sines of an isosceles triangle when given its area and height.\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\u003eFor example, when A=12 and h=4, the result is [0.8 0.8 0.96].\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42493,"title":"Pancakes for everyone!","description":"Accordingly to the \u003chttp://nl.mathworks.com/matlabcentral/cody/problems/42460-the-cake-is-a-lie problem 42460\u003e. All the children have eaten the cake and they were playing in the garden. You was trying to make barbecue, but someone spoken \"maybe pancakes?\" and all the children want pancakes. They want it now! Grab a frying pan and make a big pancake, then use minimum number of cuts to serve pancake to all the children at the same time.","description_html":"\u003cp\u003eAccordingly to the \u003ca href = \"http://nl.mathworks.com/matlabcentral/cody/problems/42460-the-cake-is-a-lie\"\u003eproblem 42460\u003c/a\u003e. All the children have eaten the cake and they were playing in the garden. You was trying to make barbecue, but someone spoken \"maybe pancakes?\" and all the children want pancakes. They want it now! Grab a frying pan and make a big pancake, then use minimum number of cuts to serve pancake to all the children at the same time.\u003c/p\u003e","function_template":"function y = pancake(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;y_correct = 0;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 2;y_correct = 1;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 4;y_correct = 2;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 7;y_correct = 3;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 12;y_correct = 5;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 27;y_correct = 7;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 127;y_correct = 16;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 2015;y_correct = 63;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 4060225;y_correct = 2850;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 1234567890;y_correct = 49690;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 1362067890;y_correct = 52193;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 2030000;y_correct = 2015;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 11581428900;y_correct = 152193;\r\nassert(isequal(pancake(x),y_correct))\r\n%%\r\nx = 9007199187632129; y_correct = 134217727;\r\nassert(isequal(pancake(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":14358,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":41,"test_suite_updated_at":"2015-08-07T07:58:07.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2015-08-06T09:41:35.000Z","updated_at":"2026-03-14T18:55:26.000Z","published_at":"2015-08-06T09:44:29.000Z","restored_at":"2018-02-06T15:11:34.000Z","restored_by":null,"spam":false,"simulink":false,"admin_reviewed":true,"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\u003eAccordingly to the\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://nl.mathworks.com/matlabcentral/cody/problems/42460-the-cake-is-a-lie\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eproblem 42460\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. All the children have eaten the cake and they were playing in the garden. You was trying to make barbecue, but someone spoken \\\"maybe pancakes?\\\" and all the children want pancakes. They want it now! Grab a frying pan and make a big pancake, then use minimum number of cuts to serve pancake to all the children at the same time.\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":44070,"title":"Under the sea: Snell's law \u0026 total internal reflection","description":"\u003chttps://en.wikipedia.org/wiki/Snell's_law\u003e\r\n\r\nWhen a light travels from one medium to another medium, depending on the refractive index, the light will bend with a certain angle. For certain combination of materials, it might be that light cannot escape one medium at all from a certain angle (greater than critical angle). It is called total internal reflection. If you point a flashlight from \"under the sea\" the light won't leave the water at all. \r\n\r\nFor given refractive indices, find critical angle where total internal reflection happens. If total internal reflection does not happen for any angle, then return \"-1\".\r\n\r\nExample1: n_in = 1.333, n_out = 1, theta_crit = 48.6 degrees;\r\nExample2: n_out = 1, n_in = 1.333, theta_crit = -1 (total internal reflection does not occur, if you are in the air, and beaming light at the water.)\r\n\r\nInput of function: n_in, n_out (refractive index, positive) \r\nOutput: critical angle (rounded to nearest integer), if total internal reflection occurs. Else return -1.","description_html":"\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Snell's_law\"\u003ehttps://en.wikipedia.org/wiki/Snell's_law\u003c/a\u003e\u003c/p\u003e\u003cp\u003eWhen a light travels from one medium to another medium, depending on the refractive index, the light will bend with a certain angle. For certain combination of materials, it might be that light cannot escape one medium at all from a certain angle (greater than critical angle). It is called total internal reflection. If you point a flashlight from \"under the sea\" the light won't leave the water at all.\u003c/p\u003e\u003cp\u003eFor given refractive indices, find critical angle where total internal reflection happens. If total internal reflection does not happen for any angle, then return \"-1\".\u003c/p\u003e\u003cp\u003eExample1: n_in = 1.333, n_out = 1, theta_crit = 48.6 degrees;\r\nExample2: n_out = 1, n_in = 1.333, theta_crit = -1 (total internal reflection does not occur, if you are in the air, and beaming light at the water.)\u003c/p\u003e\u003cp\u003eInput of function: n_in, n_out (refractive index, positive) \r\nOutput: critical angle (rounded to nearest integer), if total internal reflection occurs. Else return -1.\u003c/p\u003e","function_template":"function theta_crit = totalInternalReflection(n_in,n_out)\r\n  theta_crit = -1;\r\nend","test_suite":"%%\r\nn_in = 3; n_out = 3;\r\ntheta_crit_correct = -1;\r\nassert(isequal(totalInternalReflection(n_in,n_out),theta_crit_correct))\r\n\r\n%%\r\nn_in = 1; n_out = 1.333;\r\ntheta_crit_correct = -1;\r\nassert(isequal(totalInternalReflection(n_in,n_out),theta_crit_correct))\r\n\r\n%%\r\nn_in = 1.333; n_out = 1;\r\ntheta_crit_correct = 49;\r\nassert(isequal(totalInternalReflection(n_in,n_out),theta_crit_correct))\r\n\r\n%%\r\nn_in = 4; n_out = 3;\r\ntheta_crit_correct = 49;\r\nassert(isequal(totalInternalReflection(n_in,n_out),theta_crit_correct))\r\n\r\n%%\r\nn_in = 4; n_out = 2;\r\ntheta_crit_correct = 30;\r\nassert(isequal(totalInternalReflection(n_in,n_out),theta_crit_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":6,"created_by":115733,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":"2017-02-16T21:45:07.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2017-02-14T00:59:14.000Z","updated_at":"2026-02-08T13:00:17.000Z","published_at":"2017-02-14T00:59:14.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:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Snell's_law\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Snell's_law\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\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\u003eWhen a light travels from one medium to another medium, depending on the refractive index, the light will bend with a certain angle. For certain combination of materials, it might be that light cannot escape one medium at all from a certain angle (greater than critical angle). It is called total internal reflection. If you point a flashlight from \\\"under the sea\\\" the light won't leave the water at all.\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 given refractive indices, find critical angle where total internal reflection happens. If total internal reflection does not happen for any angle, then return \\\"-1\\\".\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\u003eExample1: n_in = 1.333, n_out = 1, theta_crit = 48.6 degrees; Example2: n_out = 1, n_in = 1.333, theta_crit = -1 (total internal reflection does not occur, if you are in the air, and beaming light at the water.)\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\u003eInput of function: n_in, n_out (refractive index, positive) Output: critical angle (rounded to nearest integer), if total internal reflection occurs. Else return -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":44059,"title":"Convex Hull Capture","description":"Imagine four points in uv that form a square.\r\n\r\n uv = [ ...\r\n    0,0;\r\n    0,2;\r\n    2,2;\r\n    2,0];\r\n\r\nNow we have two more points in xy: one at [1,1] and the other at [1,3]. The first one is in the square, and the second is outside it.\r\n\r\n xy = [ ...\r\n    1,1;\r\n    3,1];\r\n\r\nHere is the challenge. Consider the \u003chttps://en.wikipedia.org/wiki/Convex_hull convex hull\u003e formed by the points in uv. Which points in xy lie inside this hull?\r\n\r\nIn this case, the answer would be the logical vector [1,0], since the first row of xy is in the box defined by uv, whereas the second row is not.\r\n\r\nExample\r\n\r\n uv = [13,12;10,18;8,4;12,10;16,4;13,2;];\r\n xy = [12,15;9,7;9,13;13,8;];\r\n\r\n in_correct = [0;1;0;1;];\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 1090px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 332px 545px; transform-origin: 332px 545px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 10.5px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eImagine four points in uv that form a square.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 100px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 329px 50px; transform-origin: 329px 50px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e uv = [ \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(14, 0, 255); border-block-start-color: rgb(14, 0, 255); border-bottom-color: rgb(14, 0, 255); border-inline-end-color: rgb(14, 0, 255); border-inline-start-color: rgb(14, 0, 255); border-left-color: rgb(14, 0, 255); border-right-color: rgb(14, 0, 255); border-top-color: rgb(14, 0, 255); caret-color: rgb(14, 0, 255); color: rgb(14, 0, 255); column-rule-color: rgb(14, 0, 255); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(14, 0, 255); text-decoration: none; text-decoration-color: rgb(14, 0, 255); \"\u003e...\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e    0,0;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e    0,2;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e    2,2;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e    2,0];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 309px 21px; text-align: left; transform-origin: 309px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eNow we have two more points in xy: one at [1,1] and the other at [1,3]. The first one is in the square, and the second is outside it.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 60px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 329px 30px; transform-origin: 329px 30px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e xy = [ \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(14, 0, 255); border-block-start-color: rgb(14, 0, 255); border-bottom-color: rgb(14, 0, 255); border-inline-end-color: rgb(14, 0, 255); border-inline-start-color: rgb(14, 0, 255); border-left-color: rgb(14, 0, 255); border-right-color: rgb(14, 0, 255); border-top-color: rgb(14, 0, 255); caret-color: rgb(14, 0, 255); color: rgb(14, 0, 255); column-rule-color: rgb(14, 0, 255); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(14, 0, 255); text-decoration: none; text-decoration-color: rgb(14, 0, 255); \"\u003e...\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e    1,1;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e    3,1];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 309px 21px; text-align: left; transform-origin: 309px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eHere is the challenge. Consider the\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Convex_hull\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003econvex hull\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e formed by the points in uv. Which points in xy lie inside this hull?\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 270px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 135px; text-align: left; transform-origin: 309px 135px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAT0AAAEICAYAAAAtLCODAAAACXBIWXM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WrdP06dM1ffp03XPPPbH8Ua4ZOXKkIpHIgGXd3d3copcE3n33XX3lK1/R4sWLU+Ior78xY8Zo8eLF+tWvfiWv16vy8nK3R4raT3/6U02ZMkVHjhxRXV2d2tratG/fvht+x0RMfzNNuE937Nixeu+99wYsa29v18KFC12aCNdj9+7dWrlypdavX6/58+e7PY5jDh8+rN27dys/P79v2fjx43Xq1CkXp3LGmDFjtH//flVVVUmSjh8/rrq6On3605++sf8+KwYXV65LbW1tSlwNjEQi9pw5c+za2lrbtnuunk2dOtU+ffq0y5M5K1X2l23b9tGjR+1p06bZb7zxhn3hwoW+j66uLrdHi1pTU5M9ZcoU+9ChQ7Zt2/bp06ft2bNn26+//rrLkznv0UcfHdbV29Q8/Iojj8ejDRs2aNWqVQoGg9q3b5+effZZjR492u3RcBVVVVX66KOP9Nhjjw1Y/s1vflPFxcUuTeWMO+64Q0899ZRyc3M1Y8YMvf322yosLOx7xQXuvXXUxx9/LK/Xm/In/5H4uru71dbWpvT0dI0YMcLtcRIK0QNgFA5JABiF6AEwCtEDYBSiB8AoRA+AUYgeAKMQPQBGIXoAjEL0ABiF6AEwCtEDYJT/Bxf/CT9z1h80AAAAAElFTkSuQmCC\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 21px; text-align: left; transform-origin: 309px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIn this case, the answer would be the logical vector [1,0], since the first row of xy is in the box defined by uv, whereas the second row is not.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 10.5px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eExample\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 80px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 329px 40px; transform-origin: 329px 40px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e uv = [13,12;10,18;8,4;12,10;16,4;13,2;];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e xy = [12,15;9,7;9,13;13,8;];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e in_correct = [0;1;0;1;];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 325px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 309px 162.5px; text-align: left; transform-origin: 309px 162.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cimg class=\"imageNode\" width=\"248\" height=\"319\" style=\"vertical-align: baseline;width: 248px;height: 319px\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPgAAAE/CAYAAABrSw6zAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AgfFC84WDp0YwAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInAAAgAElEQVR4nO3df3AU9f0/8KfBbxML5hNOCibCh0uTD4F+sAgYBb9ILhVUKpRCGb6IYC5+mZFQqy3j51vHTH4wIBWHMphx0uq0c5eiwFQd7eCnFr9gLmLzERGtxQQCwWwIGDPKJcWP9b4Jl/v+cbnL/di77N7u7e7tPh8zDGbvcvf22Oe9dve1791rAoFAAERkSll6D4CI0ocBJzIxBpzIxBhwIhNjwIlMjAEnMjEGnMjErpX6xM7OTgiCAJvNhnnz5kU91tPTg46ODkybNg0lJSWqD5KIUiMp4Dt27MDbb7+N+fPn4+zZsxg/fjxcLheys7Nx6NAhPP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YMQO5ublaDcFwjh07hjvvvDNqWU9PDzo6OjBt2jTLnsUV+7lYed3p7OyEIAiw2WyYN29e1GNS1hXNAv7aa69hz549yM7ODi9raGjAokWLtBqCoTQ2NuLAgQM4duxYeNmhQ4fw9NNP44477sDJkyexcuVKPPbYYzqOUntin4tV150dO3bg7bffxvz583H27FmMHz8eLpcL2dnZ0teVNJ0PH+cXv/hF4KWXXtLq7Qyrv78/8MQTTwTmzp0bWLRoUXh5KhN3zCTR5xIIWHPdaW9vD8yePTvQ398fXrZ8+fLAyy+/LGtd0WwfvL29HUVFRfB6vRgaGtLqbQ1n7969sNls2LlzZ9TyZBN3rCDR5wJYc93Jy8vD888/j7y8vPCywsJCfPbZZ7LWFU020f1+Py5cuIDt27fD6/ViYGAAq1evxo4dO7R4e0Opra1FVlZW+OSgkFQm7phJos/FqutOfn4+8vPzwz93d3ejubkZVVVVOHPmjOR1RZMK3tfXhyVLluCFF15Aa2srmpubcezYMRw4cECLtzeU2Mk5IVafuJPoc+G6E/wMnE4ntmzZglmzZslaVzQJeEFBARoaGlBQUAAAmDJlCpYuXYqTJ09q8fYZgRN3xFl93Tl16hRWrVqFBx98EFVVVQDkrSuaBLy7uxuvvPJK1LLBwUGMGzdOi7fPCJy4I87K605rayseeugh1NfXo7KyMrxczrqiScB9Ph/q6urQ2dkJILjJcfToUaxYsUKLt88InLgjzqrrTk9PDx555BE888wzKC8vx9DQEIaGhuD3+2G8TYwAAACdSURBVGWtK5ps/5WUlKC6uhpr167FzTffjFOnTuFnP/uZ6fuYcmRlZWH37t1RE3d27dqFSZMm6T00XVl13dm/fz++/vprbN68OWr5Aw88gNraWsnriqaTTYaHh+Hz+ZCTk5PwoAoB//znP/kZxeC6I26sdYWzyYhMjF+FRCbGgBOZGANOZGIMOJGJMeBEJsaAE5kYA05kYgw4kYn9f4A4I0KW22kHAAAAAElFTkSuQmCC\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function in = inHull(uv,xy)\r\n    in = 1;\r\nend","test_suite":"%%\r\nuv = [0,0;0,2;2,2;2,0];\r\nxy = [1,1;3,1];\r\nin_correct = [1;0];\r\n\r\nin = inHull(uv,xy);\r\nassert(isequal(in,in_correct))\r\n\r\n%%\r\nuv = [5,5;5,10;10,10;15,15;15,5;10,15;10,10;15,5;10,15;];\r\nxy = [12,20;4,6;10,12;9,7;18,2;];\r\nin_correct = [0;0;1;1;0;];\r\n\r\nin = inHull(uv,xy);\r\nassert(isequal(in,in_correct))\r\n\r\n%%\r\nuv = [-6,-13;-3,-9;-9,-2;-12,7;25,-14;16,-24;3,15;];\r\nxy = [8,6;15,1;4,-11;-3,9;];\r\nin_correct = [1;0;1;1;];\r\n\r\nin = inHull(uv,xy);\r\nassert(isequal(in,in_correct))\r\n\r\n%%\r\nuv = [4,2;1,3;2,4;4,5;5,0;2,2;6,8;7,0;2,9;1,7;];\r\nxy = [4,6;5,3;2,3;4,9;9,0;5,8;5,9;2,7;4,0;6,2;];\r\nin_correct = [1;1;1;0;0;1;0;1;0;1;];\r\n\r\nin = inHull(uv,xy);\r\nassert(isequal(in,in_correct))\r\n\r\n%%\r\nuv = [10,7;8,3;13,9;12,6;5,19;8,18;0,5;19,14;3,5;2,8;];\r\nxy = [5,5;9,8;4,6;9,1;3,3;7,4;6,9;5,1;6,8;6,6;1,3;1,1;9,4;1,4;0,1;];\r\nin_correct = [1;1;1;0;0;1;1;0;1;1;0;0;1;0;0;];\r\n\r\nin = inHull(uv,xy);\r\nassert(isequal(in,in_correct))\r\n\r\n%%\r\n\r\nuv = [13,12;10,18;8,4;12,10;16,4;13,2;];\r\nxy = [12,15;9,7;9,13;13,8;];\r\nin_correct = [0;1;0;1;];\r\n\r\nin = inHull(uv,xy);\r\nassert(isequal(in,in_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":7,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":37,"created_at":"2017-01-31T22:57:12.000Z","updated_at":"2026-02-08T11:34:19.000Z","published_at":"2017-01-31T23:05:51.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eImagine four points in uv that form a square.\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[ uv = [ ...\\n    0,0;\\n    0,2;\\n    2,2;\\n    2,0];]]\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNow we have two more points in xy: one at [1,1] and the other at [1,3]. The first one is in the square, and the second is outside it.\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[ xy = [ ...\\n    1,1;\\n    3,1];]]\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHere is the challenge. Consider the\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/Convex_hull\\\"\u003e\u003cw:r\u003e\u003cw:t\u003econvex hull\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e formed by the points in uv. Which points in xy lie inside this hull?\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:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"264\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"317\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn this case, the answer would be the logical vector [1,0], since the first row of xy is in the box defined by uv, whereas the second row is not.\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\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[ uv = [13,12;10,18;8,4;12,10;16,4;13,2;];\\n xy = [12,15;9,7;9,13;13,8;];\\n\\n in_correct = [0;1;0;1;];]]\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"319\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"248\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId2\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.png\",\"relationshipId\":\"rId1\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image2.png\",\"relationshipId\":\"rId2\"}]},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAT0AAAEICAYAAAAtLCODAAAACXBIWXMAAA7EAAAOxAGV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jED0ARiF6AIxC9AAYhegBMArRA2AUogfAKEQPgFGIHgCjED0ARnE8ejt37nR6lQDgGEejt3HjRj355JNOrjKpVFRUuD1CzLBtySmVt224HIleR0eHnnjiCW3evNmJ1SWtyspKt0eIGbYtOaXytg2XI9F74YUX5Pf79cwzzzixOgCImTQnVlJcXCyPx6O6urrrevysWbMUCoWc+NEJJ1W3S2LbklUqbtusWbOG/VxHoufx3NgBI+cZALjlhqO3bt06bdu2TZJ06623crUWQFK54eg98sgjmjdvXs+T0xw5UASAuLnhak2cOFETJ06MxSwAEHPckQHAKDfZtm27PQQAxAtHegCM4mr0UunK77Fjx1RdXa3Gxka3R4mZVNpfktTc3Kzq6mq98847bo/iuMbGRlVXV8uyLLdHiZm9e/fq9OnTN/w816KXSvfpbt++XXl5edqxY4cKCwv14osvuj2S41Jpf0k9b7169NFHtWPHDpWWluqRRx7R+fPn3R7LEc8//7y+//3v6/XXX9d3vvMdbdq0ye2RHNfc3Kz8/Hzt3bv3xp9sx1l7e7v9ox/9yJ42bZo9Z86ceP94x3V1ddnTpk2zDx48aNu2bZ85c8a+++677ZaWFncHc0iq7S/btu39+/fbd911l93e3t63bNGiRfYf//hHF6dyRlNT04Bt+9e//mVPnjzZPnPmjMuTOefChQv2l7/8ZTsnJ8f+61//esPPj/uRXqrdp/vmm2/K5/MpGAxKkvx+v+69917V19e7PJkzUm1/SZLP59OmTZvk8/n6lmVmZurEiRMuTuWMrKwsvfLKK33bdvPNNysSiejixYsuT+ac5557Tl/60pd05513Duv5cX938Y3ep5voOjo6NGnSpAHLRo0apaamJpcmclaq7S9JysjIUEZGRt/XR44cUU1NjQoLC12cyhkej0fBYFCRSERbt25VVVWVVqxYoXHjxrk9miPeeust/e1vf9O2bdu0bNmyYa0j7kd6N3qfbqKLRCKDtsnj8ai7u9uliZyVavvrSu+//77C4bCWL1+uyZMnuz2OY9ra2nT+/HmNHTtWu3btUkdHh9sjRe2DDz5QcXGxnnvuuajWE9N/0evWrdP06dM1ffp03XPPPbH8Ua4ZOXKkIpHIgGXd3d3copcE3n33XX3lK1/R4sWLU+Ior78xY8Zo8eLF+tWvfiWv16vy8nK3R4raT3/6U02ZMkVHjhxRXV2d2tratG/fvht+x0RMfzNNuE937Nixeu+99wYsa29v18KFC12aCNdj9+7dWrlypdavX6/58+e7PY5jDh8+rN27dys/P79v2fjx43Xq1CkXp3LGmDFjtH//flVVVUmSjh8/rrq6On3605++sf8+KwYXV65LbW1tSlwNjEQi9pw5c+za2lrbtnuunk2dOtU+ffq0y5M5K1X2l23b9tGjR+1p06bZb7zxhn3hwoW+j66uLrdHi1pTU5M9ZcoU+9ChQ7Zt2/bp06ft2bNn26+//rrLkznv0UcfHdbV29Q8/Iojj8ejDRs2aNWqVQoGg9q3b5+effZZjR492u3RcBVVVVX66KOP9Nhjjw1Y/s1vflPFxcUuTeWMO+64Q0899ZRyc3M1Y8YMvf322yosLOx7xQXuvXXUxx9/LK/Xm/In/5H4uru71dbWpvT0dI0YMcLtcRIK0QNgFA5JABiF6AEwCtEDYBSiB8AoRA+AUYgeAKMQPQBGIXoAjEL0ABiF6AEwCtEDYJT/Bxf/CT9z1h80AAAAAElFTkSuQmCC\",\"relationship\":null},{\"partUri\":\"/media/image2.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPgAAAE/CAYAAABrSw6zAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AgfFC84WDp0YwAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInA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PDx555BE888wzKC8vx9DQEIaGhuD3+2G8TYwAAACdSURBVGWtK5ps/5WUlKC6uhpr167FzTffjFOnTuFnP/uZ6fuYcmRlZWH37t1RE3d27dqFSZMm6T00XVl13dm/fz++/vprbN68OWr5Aw88gNraWsnriqaTTYaHh+Hz+ZCTk5PwoAoB//znP/kZxeC6I26sdYWzyYhMjF+FRCbGgBOZGANOZGIMOJGJMeBEJsaAE5kYA05kYgw4kYn9f4A4I0KW22kHAAAAAElFTkSuQmCC\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42699,"title":"Find the Area of a Polygon","description":"Consider 2-D geometry and assume that the points are given in form of rows of a matrix. Find the area of polygon enclosed by the points. \r\n\r\n*Example:*\r\n\r\nA = [1 2;4 5; 6 7], represents points (1,2),(4,5) and (6,7)\r\n\r\n*Note :*\r\n\r\n# There are no repeated rows in matrix.\r\n# There are at least 3 rows in matrix.\r\n# Coordinates in matrix are arranged in counter-clockwise direction. ","description_html":"\u003cp\u003eConsider 2-D geometry and assume that the points are given in form of rows of a matrix. Find the area of polygon enclosed by the points.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eA = [1 2;4 5; 6 7], represents points (1,2),(4,5) and (6,7)\u003c/p\u003e\u003cp\u003e\u003cb\u003eNote :\u003c/b\u003e\u003c/p\u003e\u003col\u003e\u003cli\u003eThere are no repeated rows in matrix.\u003c/li\u003e\u003cli\u003eThere are at least 3 rows in matrix.\u003c/li\u003e\u003cli\u003eCoordinates in matrix are arranged in counter-clockwise direction.\u003c/li\u003e\u003c/ol\u003e","function_template":"function y = area_of_polygon(A)\r\n  y = abcxyz;\r\nend","test_suite":"%%\r\nA = [0 0; 120 120; 120 0];\r\ny_correct = 7200;\r\nassert(isequal(area_of_polygon(A),y_correct))\r\n\r\n%%\r\nA = [1 2; 12 3; 6 7];\r\ny_correct = 25;\r\nassert(isequal(area_of_polygon(A),y_correct))\r\n\r\n%%\r\nA = [0 0; 0 100; 100 100; 100 0];\r\ny_correct = 10000;\r\nassert(isequal(area_of_polygon(A),y_correct))\r\n\r\n%%\r\nA = [0 0; 0 200; 200 200; 200 0];\r\ny_correct = 40000;\r\nassert(isequal(area_of_polygon(A),y_correct))\r\n\r\n%%\r\nA = [0 0; 0 50; 100 100; 100 0];\r\ny_correct = 7500;\r\nassert(isequal(area_of_polygon(A),y_correct))\r\n\r\n%%\r\nA = [0 0; 200 100; 500 500; 400 1000; 100 300; -100 100; -300 -200];\r\ny_correct = 230000;\r\nassert(isequal(area_of_polygon(A),y_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":3,"created_by":45073,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":87,"test_suite_updated_at":"2018-01-02T17:41:34.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2015-12-30T20:42:38.000Z","updated_at":"2026-02-27T10:12:10.000Z","published_at":"2015-12-30T20:45:33.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\u003eConsider 2-D geometry and assume that the points are given in form of rows of a matrix. Find the area of polygon enclosed by the points.\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\u003eExample:\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\u003eA = [1 2;4 5; 6 7], represents points (1,2),(4,5) and (6,7)\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\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\u003eThere are no repeated rows in matrix.\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\u003eThere are at least 3 rows in matrix.\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\u003eCoordinates in matrix are arranged in counter-clockwise direction.\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":42789,"title":"Regular polygon bounded by and bounding a circle","description":"As the number of sides (or vertices) of a regular polygon goes to infinity, its perimeter and area go to the perimeter and area of the circle bounding it, while the radius of the circle bounded by the polygon goes to the radius of the bounding circle.\r\n\r\nGiven the radius of the bounding circle, R, and the number of sides of a regular polygon, n, return the polygon's perimeter, p, and area, a, as well as the radius of the circle bounded by it, r.\r\n\r\nNote: n will always be an integer greater than 2. R will always be a real number greater than zero.\r\n\r\nExample (square):\r\n\r\nR = 1\r\n\r\nn = 4\r\n\r\np = 5.6568\r\n\r\na = 2\r\n\r\nr = 0.7071","description_html":"\u003cp\u003eAs the number of sides (or vertices) of a regular polygon goes to infinity, its perimeter and area go to the perimeter and area of the circle bounding it, while the radius of the circle bounded by the polygon goes to the radius of the bounding circle.\u003c/p\u003e\u003cp\u003eGiven the radius of the bounding circle, R, and the number of sides of a regular polygon, n, return the polygon's perimeter, p, and area, a, as well as the radius of the circle bounded by it, r.\u003c/p\u003e\u003cp\u003eNote: n will always be an integer greater than 2. R will always be a real number greater than zero.\u003c/p\u003e\u003cp\u003eExample (square):\u003c/p\u003e\u003cp\u003eR = 1\u003c/p\u003e\u003cp\u003en = 4\u003c/p\u003e\u003cp\u003ep = 5.6568\u003c/p\u003e\u003cp\u003ea = 2\u003c/p\u003e\u003cp\u003er = 0.7071\u003c/p\u003e","function_template":"function [p,a,r]=BoundedPolygon(R,n)\r\n  p = R * n;\r\n  a = p ^ 2;\r\n  r = R / 2;\r\nend","test_suite":"%%\r\nR = sqrt(2);\r\nn = 4;\r\n[p,a,r] = BoundedPolygon(R,n)\r\np_correct = 8;\r\na_correct = 4;\r\nr_correct = 1;\r\nassert(abs(p_correct-p)\u003c0.0001 \u0026\u0026 abs(a_correct-a)\u003c0.0001 \u0026\u0026 abs(r_correct-r)\u003c0.0001);\r\n\r\n%%\r\nR = sqrt(3);\r\nn = 6;\r\n[p,a,r] = BoundedPolygon(R,n)\r\np_correct = 10.3923;\r\na_correct = 7.7942;\r\nr_correct = 1.5;\r\nassert(abs(p_correct-p)\u003c0.0001 \u0026\u0026 abs(a_correct-a)\u003c0.0001 \u0026\u0026 abs(r_correct-r)\u003c0.0001);\r\n\r\n%%\r\nR = 2;\r\nn = 12;\r\n[p,a,r] = BoundedPolygon(R,n)\r\np_correct = 12.4233;\r\na_correct = 12;\r\nr_correct = 1.9319;\r\nassert(abs(p_correct-p)\u003c0.0001 \u0026\u0026 abs(a_correct-a)\u003c0.0001 \u0026\u0026 abs(r_correct-r)\u003c0.0001);\r\n\r\n%%\r\nR = 3;\r\nn = 3;\r\n[p,a,r] = BoundedPolygon(R,n)\r\np_correct = 15.5885;\r\na_correct = 11.6913;\r\nr_correct = 1.5;\r\nassert(abs(p_correct-p)\u003c0.0001 \u0026\u0026 abs(a_correct-a)\u003c0.0001 \u0026\u0026 abs(r_correct-r)\u003c0.0001);\r\n\r\n%%\r\nR = 9;\r\nn = 56;\r\n[p,a,r] = BoundedPolygon(R,n)\r\np_correct = 56.519;\r\na_correct = 253.9354;\r\nr_correct = 8.9858;\r\nassert(abs(p_correct-p)\u003c0.0001 \u0026\u0026 abs(a_correct-a)\u003c0.0001 \u0026\u0026 abs(r_correct-r)\u003c0.0001);\r\n\r\n%%\r\nR = 2;\r\nn = 99;\r\n[p,a,r] = BoundedPolygon(R,n)\r\np_correct = 12.5643;\r\na_correct = 12.5579;\r\nr_correct = 1.999;\r\nassert(abs(p_correct-p)\u003c0.0001 \u0026\u0026 abs(a_correct-a)\u003c0.0001 \u0026\u0026 abs(r_correct-r)\u003c0.0001);","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":15521,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":43,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":37,"created_at":"2016-03-27T20:48:51.000Z","updated_at":"2026-02-08T12:55:54.000Z","published_at":"2016-03-27T20:49:05.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\u003eAs the number of sides (or vertices) of a regular polygon goes to infinity, its perimeter and area go to the perimeter and area of the circle bounding it, while the radius of the circle bounded by the polygon goes to the radius of the bounding 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven the radius of the bounding circle, R, and the number of sides of a regular polygon, n, return the polygon's perimeter, p, and area, a, as well as the radius of the circle bounded by it, r.\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\u003eNote: n will always be an integer greater than 2. R will always be a real number greater than zero.\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 (square):\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\u003eR = 1\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\u003en = 4\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\u003ep = 5.6568\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\u003ea = 2\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\u003er = 0.7071\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":42755,"title":"Angle bisectors","description":"Given 2 direction vectors, calculate the *_two_ (2) normalized angle bisectors* (which are perpendicular between them).\r\n\r\nInput vectors can be 2-D or 3-D.\r\n\r\nThe two output vectors must have a norm equal to 1 (unit vectors).\r\n\r\nYou may find some help here:\r\n\u003chttps://proofwiki.org/wiki/Angle_Bisector_Vector\u003e","description_html":"\u003cp\u003eGiven 2 direction vectors, calculate the \u003cb\u003e\u003ci\u003etwo\u003c/i\u003e (2) normalized angle bisectors\u003c/b\u003e (which are perpendicular between them).\u003c/p\u003e\u003cp\u003eInput vectors can be 2-D or 3-D.\u003c/p\u003e\u003cp\u003eThe two output vectors must have a norm equal to 1 (unit vectors).\u003c/p\u003e\u003cp\u003eYou may find some help here: \u003ca href = \"https://proofwiki.org/wiki/Angle_Bisector_Vector\"\u003ehttps://proofwiki.org/wiki/Angle_Bisector_Vector\u003c/a\u003e\u003c/p\u003e","function_template":"function [b1,b2] = bisectors(v1,v2)\r\n  b1 = cross(v1,v2);\r\n  b2 = cross(v1,-v2);\r\nend","test_suite":"%%\r\nv1 = [1 0];\r\nv2 = [0 1];\r\n[b1,b2] = bisectors(v1,v2);\r\n\r\nb1ok = [1 1]/sqrt(2);\r\nb2ok = [-1 1]/sqrt(2);\r\n\r\n% Tests performed\r\nt1 = (abs(norm(b1)-1)\u003c1e-6); % Unit b1\r\nt2 = (abs(norm(b2)-1)\u003c1e-6); % Unit b2\r\nt3 = (abs(b1*b2') \u003c 1e-12); % b1 and b2 are perpendicular\r\nt4 = (abs(sum((b1-b1ok)))\u003c1e-12);  % b1 is equal to [1/sqrt(2) 1/sqrt(2)]\r\nt5 = (abs(sum((b1+b1ok)))\u003c1e-12); % or its opposite\r\nt6 = (abs(sum((b2-b2ok)))\u003c1e-12); % b2 is equal to [1/sqrt(2) -1/sqrt(2)]\r\nt7 = (abs(sum((b2+b2ok)))\u003c1e-12); % or its opposite\r\ntest = (t1 \u0026\u0026 t2 \u0026\u0026 t3 \u0026\u0026 xor(t4,t5) \u0026\u0026 xor(t6,t7));\r\n\r\n%%\r\nv1 = [4 0 3];\r\nv2 = [-2 2 1];\r\n[b1,b2] = bisectors(v1,v2);\r\n\r\nb1ok=[0.2 1 1.4]/sqrt(3);\r\nb2ok=[2.2 -1 0.4]/sqrt(6);\r\n  \r\n% Tests performed\r\nt1 = (abs(norm(b1)-1)\u003c1e-6); % Unit b1\r\nt2 = (abs(norm(b2)-1)\u003c1e-6); % Unit b2\r\nt3 = (abs(b1*b2') \u003c 1e-12); % b1 and b2 are perpendicular\r\nt4 = (abs(sum((b1-b1ok)))\u003c1e-12);  % b1 is equal to [1/sqrt(2) 1/sqrt(2)]\r\nt5 = (abs(sum((b1+b1ok)))\u003c1e-12); % or its opposite\r\nt6 = (abs(sum((b2-b2ok)))\u003c1e-12); % b2 is equal to [1/sqrt(2) -1/sqrt(2)]\r\nt7 = (abs(sum((b2+b2ok)))\u003c1e-12); % or its opposite\r\nassert(t1 \u0026\u0026 t2 \u0026\u0026 t3 \u0026\u0026 xor(t4,t5) \u0026\u0026 xor(t6,t7));\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":12767,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":35,"test_suite_updated_at":"2016-04-27T12:55:46.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2016-02-25T17:55:08.000Z","updated_at":"2026-02-27T10:16:23.000Z","published_at":"2016-02-25T17:57:35.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\u003eGiven 2 direction vectors, calculate 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\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\u003etwo\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e (2) normalized angle bisectors\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (which are perpendicular between them).\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\u003eInput vectors can be 2-D or 3-D.\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 two output vectors must have a norm equal to 1 (unit vectors).\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\u003eYou may find some help here:\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://proofwiki.org/wiki/Angle_Bisector_Vector\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://proofwiki.org/wiki/Angle_Bisector_Vector\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\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":43599,"title":"Find the sides of an isosceles triangle when given its area and height from its base to apex","description":"Find the sides of an isosceles triangle when given its area and the height from its base to apex.\r\nFor example, with A=12 and h=4, the result will be [5 5 6].","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 25.5px; transform-origin: 407px 25.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 299px 8px; transform-origin: 299px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFind the sides of an isosceles triangle when given its area and the height from its base to apex.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 180px 8px; transform-origin: 180px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor example, with A=12 and h=4, the result will be [5 5 6].\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = sidesOfTheTriangle(A,h)\r\n  y = h;\r\nend","test_suite":"filetext = fileread('sidesOfTheTriangle.m');\r\nillegal = contains(filetext, 'regexp') || contains(filetext, 'assert') || ...\r\n          contains(filetext, 'elseif');\r\nassert(~illegal)\r\n\r\n%%\r\nA = 12;\r\nh = 4;\r\ny_correct = [5 5 6];\r\nassert(sum(abs(sidesOfTheTriangle(A,h)-y_correct))\u003c1e-3)\r\n\r\n%%\r\nA = 60;\r\nh = 5;\r\ny_correct = [13 13 24];\r\nassert(sum(abs(sidesOfTheTriangle(A,h)-y_correct))\u003c1e-3)\r\n\r\n%%\r\nA = 120;\r\nh = 8;\r\ny_correct = [17 17 30];\r\nassert(sum(abs(sidesOfTheTriangle(A,h)-y_correct))\u003c1e-3)\r\n\r\n%%\r\nA = 50;\r\nh = 11;\r\ny_correct = [11.9021492607341 11.9021492607341 9.09090909090909];\r\nassert(sum(abs(sidesOfTheTriangle(A,h)-y_correct))\u003c1e-3)\r\n\r\n%%\r\nA = 5;\r\nh = 3;\r\ny_correct = [3.43187671366233 3.43187671366233 10/3];\r\nassert(sum(abs(sidesOfTheTriangle(A,h)-y_correct))\u003c1e-3)\r\n\r\n%%\r\nA = 150;\r\nh = 10;\r\ny_correct = [18.0277563773199 18.0277563773199 30];\r\nassert(sum(abs(sidesOfTheTriangle(A,h)-y_correct))\u003c1e-3)\r\n\r\n%%\r\nA = 5;\r\nh = 0.5;\r\ny_correct = [10.0124921972504 10.0124921972504 20];\r\nassert(sum(abs(sidesOfTheTriangle(A,h)-y_correct))\u003c1e-3)\r\n\r\n%%\r\nA = 42;\r\nh = pi;\r\ny_correct = [13.7331777948941 13.7331777948941 26.7380304394384];\r\nassert(sum(abs(sidesOfTheTriangle(A,h)-y_correct))\u003c1e-3)\r\n","published":true,"deleted":false,"likes_count":12,"comments_count":3,"created_by":90467,"edited_by":223089,"edited_at":"2023-02-02T06:57:50.000Z","deleted_by":null,"deleted_at":null,"solvers_count":2147,"test_suite_updated_at":"2023-02-02T06:57:50.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2016-10-22T23:50:43.000Z","updated_at":"2026-04-04T19:12:10.000Z","published_at":"2016-12-02T18:59:27.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the sides of an isosceles triangle when given its area and the height from its base to apex.\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\u003eFor example, with A=12 and h=4, the result will be [5 5 6].\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":2833,"title":"Radiation Heat Transfer — View Factors (5)","description":"View factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates between surfaces. In particular, the thermal energy leaving a given surface is applied to other surfaces, as appropriate, based on how much the hot surface \"sees\" the other surfaces. As such, view factors are purely geometrical in nature. A range of view factor formulae are available \u003chttp://www.thermalradiation.net/tablecon.html here\u003e.\r\n\r\nFor this problem, calculate the view factor from surface 1 (an infinitely long plate) to surfaces 2 (n rows of in-line pipes):\r\n\r\n\u003c\u003chttp://www.thermalradiation.net/images/C-7fig.gif\u003e\u003e\r\n\r\nThe view factor for one row of pipes is F_1-2 (the first equation):\r\n\r\n\u003c\u003chttp://www.thermalradiation.net/images/C-7eq.gif\u003e\u003e\r\n\r\nThe second equation is utilized for more than one row of pipes. Any of the variables can be a vector. Also, note that D = d/b, where d is the pipe diameter and b is the center-to-center spacing between pipes.\r\n\r\n*Note: This problem is identical to the previous problem (4) except that the variables will be provided in vectors of varying sizes.* The variables will need to be combined to produce all the applicable combinations. For example, if the sizes of d, b, and n are 2, 5, and 1, respectively, there will be ten total variable combinations (and answers). As another example, if the sizes of d, b, and n are 4, 3, and 2, respectively, there will be 24 total variable combinations. This simulates a parametric design study. Also, because all possible combinations can be generated in various orders, the answers will be sorted; the order that you output answers does not matter.","description_html":"\u003cp\u003eView factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates between surfaces. In particular, the thermal energy leaving a given surface is applied to other surfaces, as appropriate, based on how much the hot surface \"sees\" the other surfaces. As such, view factors are purely geometrical in nature. A range of view factor formulae are available \u003ca href = \"http://www.thermalradiation.net/tablecon.html\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eFor this problem, calculate the view factor from surface 1 (an infinitely long plate) to surfaces 2 (n rows of in-line pipes):\u003c/p\u003e\u003cimg src = \"http://www.thermalradiation.net/images/C-7fig.gif\"\u003e\u003cp\u003eThe view factor for one row of pipes is F_1-2 (the first equation):\u003c/p\u003e\u003cimg src = \"http://www.thermalradiation.net/images/C-7eq.gif\"\u003e\u003cp\u003eThe second equation is utilized for more than one row of pipes. Any of the variables can be a vector. Also, note that D = d/b, where d is the pipe diameter and b is the center-to-center spacing between pipes.\u003c/p\u003e\u003cp\u003e\u003cb\u003eNote: This problem is identical to the previous problem (4) except that the variables will be provided in vectors of varying sizes.\u003c/b\u003e The variables will need to be combined to produce all the applicable combinations. For example, if the sizes of d, b, and n are 2, 5, and 1, respectively, there will be ten total variable combinations (and answers). As another example, if the sizes of d, b, and n are 4, 3, and 2, respectively, there will be 24 total variable combinations. This simulates a parametric design study. Also, because all possible combinations can be generated in various orders, the answers will be sorted; the order that you output answers does not matter.\u003c/p\u003e","function_template":"function F = view_factor5(d,b,n)\r\n  F = 1;\r\nend","test_suite":"%%\r\nd = [1 2];\r\nb = [3 5 6 7 8];\r\nn = 1;\r\ny_correct = [0.1885    0.2142    0.2479    0.2941    0.3613    0.4077    0.4675    0.4675    0.5472    0.8154];\r\nF = sort(view_factor5(d,b,n));\r\nfor i = 1:numel(y_correct)\r\n assert(F(i) \u003c (y_correct(i) + 1e-4))\r\n assert(F(i) \u003e (y_correct(i) - 1e-4))\r\nend\r\n\r\n%%\r\nd = [2 2.2 2.4 2.5];\r\nb = [3.2 3.4 3.6];\r\nn = 2;\r\ny_correct = [0.9182    0.9352    0.9455    0.9512    0.9594    0.9659    0.9720    0.9738    0.9767    0.9831    0.9857    0.9905];\r\nF = sort(view_factor5(d,b,n));\r\nfor i = 1:numel(y_correct)\r\n assert(F(i) \u003c (y_correct(i) + 1e-4))\r\n assert(F(i) \u003e (y_correct(i) - 1e-4))\r\nend\r\n\r\n%%\r\nd = [1 1.1 1.2];\r\nb = [3 3.2];\r\nn = 1:5;\r\ny_correct = [0.4416    0.4675    0.4803    0.5080    0.5179    0.5472    0.6882    0.7165    0.7299    0.7579    0.7676    0.7950    0.8259    0.8490    0.8596    0.8809    0.8879    0.9028    0.9072    0.9196    0.9270    0.9414    0.9457    0.9460    0.9572    0.9580    0.9621    0.9712    0.9740    0.9810];\r\nF = sort(view_factor5(d,b,n));\r\nfor i = 1:numel(y_correct)\r\n assert(F(i) \u003c (y_correct(i) + 1e-4))\r\n assert(F(i) \u003e (y_correct(i) - 1e-4))\r\nend","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":26769,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":37,"test_suite_updated_at":"2015-01-16T02:08:47.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2015-01-15T02:16:48.000Z","updated_at":"2026-02-08T12:40:09.000Z","published_at":"2015-01-15T02:16:48.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.gif\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/media/image2.gif\"}],\"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\u003eView factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates between surfaces. In particular, the thermal energy leaving a given surface is applied to other surfaces, as appropriate, based on how much the hot surface \\\"sees\\\" the other surfaces. As such, view factors are purely geometrical in nature. A range of view factor formulae are available\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.thermalradiation.net/tablecon.html\\\"\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\u003eFor this problem, calculate the view factor from surface 1 (an infinitely long plate) to surfaces 2 (n rows of in-line pipes):\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\u003eThe view factor for one row of pipes is F_1-2 (the first equation):\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:r\u003e\u003cw:t\u003eThe second equation is utilized for more than one row of pipes. Any of the variables can be a vector. Also, note that D = d/b, where d is the pipe diameter and b is the center-to-center spacing between pipes.\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: This problem is identical to the previous problem (4) except that the variables will be provided in vectors of varying sizes.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e The variables will need to be combined to produce all the applicable combinations. For example, if the sizes of d, b, and n are 2, 5, and 1, respectively, there will be ten total variable combinations (and answers). As another example, if the sizes of d, b, and n are 4, 3, and 2, respectively, there will be 24 total variable combinations. This simulates a parametric design study. Also, because all possible combinations can be generated in various orders, the answers will be sorted; the order that you output answers does not matter.\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.gif\",\"contentType\":\"image/gif\",\"content\":\"data:image/gif;base64,R0lGODlhfQAAAYAAAP///wAAACH5BAEAAAAALAAAAAB9AAABQAL/hI+py+0Po5y02ouz3rynEECgZ4EmiabqYbbtCl9hDIz0PbmxjXf88ut9ZkIMMfdBHFHBIlLhWkanUU/TKZzCrrsk67ZUcbGNMJkyPpfRap5ZDWUPT9u34W2HM6h0Zj6uFKj38OdTOEgSkraxiLin46C10oh46HVZ5yiRRrljqQn6GDpa8klK2llZmCpm2lZyxnoaKjs7yGebq1Sr23tryusrPExcbHwc4Vrzikxb1bwJplyM2wqNFrw5jcXKmdnbmc24DZYCOUmeoSi4nMiXLop6LF5E1ERvCF7xXs1xn3vPjiRr+9rdMTgLngiFwo4whPIw4TuCusKFOUfRVreI/9iuOfMICh9IKxxHqis5CRYZkT0asZSB0mQyfjFlPsJoMyfJSDV1+vwJNKjQoUSL+gRmdBxEVT2LDkxq6KlOlDSbxqKCTqhUd0T7ZDX2jEVVnCd9WWxj1YdKQS+HgAN28U7Ntl04peWp0U9Tuv7QeTV3F1BLrBlbfhEsRpqju1b5JqIWWENkpWZXTXZbca2TEZcLet61V4rEhUBefEMMrZ8fEagPAlSM7W/nz6f75nUstyu71VBrTyUMeJjd0mR3VoQLMbQ+2vVml9KGdl7xq719Vzd+nXd2rtu5d89HLKAqs3JWOi//hNt59Kyph7+4Pvd38PMp1y+l+v7C6fp5/v/tn957pgEYD2kEIhTNgQouyGCDDj4IYYQSTkghE5rpt5GCZzE4nIRh/RKfSf9NyJ+DWz2YX04x8QPUihPJxKI/NNmUIn0/nWjjUR9q1+KAhd2Im3xDNRbiPvCNV5mB7mUWIBDWycNcbnMVSciFDj05ijKiHfbjKUiVhqB3xylp3nJCioVkQu4o5yVgbNLSyojYLeaXjzzW0xyO9m2WXJw7zplFmK6RVOOeg/23F2yBspMWkYvZ+Z6akOUV6WsNURlJcnKWWVkeQc6UJKhLaoQcp5aylwWma0S5KXiqYgbdHDT88CqaooIW5D9eemqGnoYOKhGkuJZY1h4gFforJlzgHodssZkGIkWtynb5LILS7vZVgste29xjlM7KbXCC5ngjtoACCeydFdYQ7qQ9+uqsjvAa0e5SsGraqmT1nlngsJ6Q16Rcb34bcL7JZmnkWAbHemrAgwGsrXqXkilxpbukuS6/636aFMdGeezUvhNnbCvJ7JqscYUgdyVyqCav7ObCD4/cr6kAWQLzvaPlMFvORlyYqpkO4+AzTB3ZTCrDFbsMJhxFRyUz0S2/hfLJKD+tY9VYi/gihDFG2OyC84otrIdb03g2je5ejKJlHKJ6n5ZVz0133XbfjXfeeu9tdwEAOw==\"},{\"partUri\":\"/media/image2.gif\",\"contentType\":\"image/gif\",\"content\":\"data:image/gif;base64,R0lGODdhQAGPAPcAAAAAAP///wECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECA8/UQQCAKVAAZgAAAKxdUAABAAAAcCH1v0jsbwCQGVAAgClQAEwAAAAQCwAAAABfLYApUAAAAAAAAAAAAAEAAACUGlAABAEAAAAAAAAAAAAAkBlQACjsbwBsAAgAKAAuAAAAAACsXVAAoNpEAFjJRwBPcGVuAAAAAFUAAAD3Bf5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vZCpjG3vIaEScFREvQZJXGDWTOHPtjnwye6NN6Dg98tnljGaBI0wad6g62e2JzYsjD3+2Nce5CJDxIluJGDc5HsGGaE5TI6PK6EkvatJgp0QZdP6jt6d98kf88mN7RllHRabQlqQSzPT4c7hZ1e2GH3OaLcd3/8SrNU2SUwPjGNPnGKG9qVy6YqJpiFnMDaqNal9bo2hWmBpgvuVpfRQkLrXJmz+Ss2rezCNJNGVBPKIrktdb52XU6EZOxXCJmTRlKVt4zX2282X8RNNtgni2gA4tnW00qBatqVBH0bChEI2oRCdKURgeMFwJHRFCHXpHi86xoszc6NkwRU1+Rs1zvCzYww5jIs4Bzomjg5yARverbskFcL3Rk00Jxa7CYK6kAs0bJ+F10VZuLqXS45vgVuW+nIWukyYTHVRzKFIV1rCX6ouY+25a1E4mNHx2A2uHJjlUxpVOisvqYyNPladc0clMQkymosAyJA92sK5r/V2vSPcclQEW2BKkz1wfYN1mV7sO9rCITaxiFwtYAjEWbuWp6mOrGTQTSnayypxgu8SJ2Vhd6rKdLVs3QZsmNsbHsO1K5vMCmb/ZUehFpOzeJP2Jv3B2p4sMFFeSbJtN+7m2eDGJIlsJmjz+ARVvbtwtKFvLyONO0JypRa1fCkvCYP7PufWqmOGUeF0K7k1DKfXl57AENe1mlrv+26tRf6U40ZUnqe8aqV9ny1n9BQ6ttNqqY/8qyYvp8qcNTNxh5JooukZ3ZRASsNlIG9oGfwe3Do6whCdM4Qpb+MIYjltAAAA7\"}]}"},{"id":42825,"title":"solid of revolution","description":"Given an real polynomial P and two real numbers a,b with 0\u003c=a\u003c=b. Calculate the volume of the solid of revolution made by rotating P around the x-axis in the intervall [a,b]! Return the volume in multiples of pi!","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 42px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 21px; transform-origin: 407px 21px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 379.5px 8px; transform-origin: 379.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven an real polynomial P and two real numbers a,b with 0\u0026lt;=a\u0026lt;=b. Calculate the volume of the solid of revolution made by rotating P around the x-axis in the intervall [a,b]! Return the volume in multiples of pi!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function V = solid_of_revolution(P,a,b)\r\nV=0;\r\nend","test_suite":"%%\r\nP=0;\r\na=0;\r\nb=1;\r\nV_correct=0;\r\nassert(abs(solid_of_revolution(P,a,b) - V_correct) \u003c 1e-8);\r\n\r\n%%\r\nP=1;\r\na=0;\r\nb=1;\r\nV_correct=1;\r\nassert(abs(solid_of_revolution(P,a,b) - V_correct) \u003c 1e-8);\r\n\r\n%%\r\nP=[1 0];\r\na=0;\r\nb=1;\r\nV_correct=1/3;\r\nassert(abs(solid_of_revolution(P,a,b) - V_correct) \u003c 1e-8);\r\n\r\n%%\r\nP=[1 1 1];\r\na=1;\r\nb=4;\r\nV_correct=4131/10;\r\nassert(abs(solid_of_revolution(P,a,b) - V_correct) \u003c 1e-8);","published":true,"deleted":false,"likes_count":1,"comments_count":5,"created_by":73322,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":42,"test_suite_updated_at":"2021-12-12T12:07:22.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2016-04-24T18:14:15.000Z","updated_at":"2026-02-08T12:34:10.000Z","published_at":"2016-04-24T18:14:15.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven an real polynomial P and two real numbers a,b with 0\u0026lt;=a\u0026lt;=b. Calculate the volume of the solid of revolution made by rotating P around the x-axis in the intervall [a,b]! Return the volume in multiples of pi!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42855,"title":"Height of a right-angled triangle","description":"Given numbers a, b and c, find the height of the right angled triangle with sides a and b and hypotenuse c, for the base c. If a right angled triangle with sides a and b and hypotenuse c does not exist, return NaN (not-a-number).","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 42px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.5px 21px; transform-origin: 406.5px 21px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 383.5px 21px; text-align: left; transform-origin: 383.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 383.017px 7.81667px; transform-origin: 383.017px 7.81667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven numbers a, b and c, find the height of the right angled triangle with sides a and b and hypotenuse c, for the base c. If a right angled triangle with sides a and b and hypotenuse c does not exist, return NaN (not-a-number).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = triangle_height(a, b, c)\r\n  h = a+b+c;\r\nend","test_suite":"%%\r\nfiletext = fileread('triangle_height.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'regexp');\r\nassert(~illegal)\r\n\r\n%%\r\na = 3;\r\nb = 4;\r\nc = 5;\r\n\r\ny_correct = 2.4;\r\nassert(abs(triangle_height(a, b, c) - y_correct) \u003c 1e-4);\r\n\r\n%%\r\na = 1;\r\nb = 2;\r\nc = 3;\r\n\r\ny_correct = NaN;\r\nassert(isequaln(triangle_height(a, b, c), y_correct));\r\n\r\n%%\r\na = 0;\r\nb = 1;\r\nc = 1;\r\n\r\ny_correct = NaN;\r\nassert(isequaln(triangle_height(a, b, c), y_correct));\r\n\r\n%%\r\na = -3;\r\nb = -4;\r\nc = -5;\r\n\r\ny_correct = NaN;\r\nassert(isequaln(triangle_height(a, b, c), y_correct));\r\n\r\n%%\r\na = 7;\r\nb = 24;\r\nc = 25;\r\n\r\ny_correct = 6.72;\r\nassert(isequaln(triangle_height(a, b, c), y_correct));","published":true,"deleted":false,"likes_count":11,"comments_count":2,"created_by":18882,"edited_by":223089,"edited_at":"2024-11-04T15:53:05.000Z","deleted_by":null,"deleted_at":null,"solvers_count":2021,"test_suite_updated_at":"2024-11-04T15:53:05.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2016-05-19T09:41:53.000Z","updated_at":"2026-04-04T19:11:32.000Z","published_at":"2016-05-19T09:41:53.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven numbers a, b and c, find the height of the right angled triangle with sides a and b and hypotenuse c, for the base c. If a right angled triangle with sides a and b and hypotenuse c does not exist, return NaN (not-a-number).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42705,"title":"Is It a Snake?","description":"Given an m-by-n matrix, return true if the elements of the matrix are a connected \"snake\" shape from 1 to m*n. Otherwise return false.\r\n\r\nSnakes are vectors that move through the grid of a matrix in a 4-connected sense. So the number 1 can be anywhere, but the number 2 must be north, south, east, or west of 1. And the number 3 must be north, south, east, or west of 2. And so on.\r\n\r\nExamples\r\n\r\n [ 1 2 3 4 5 ]    is a snake\r\n\r\n [ 2 1 3 4 ]      is NOT a snake\r\n \r\n [ 1 2 3 2 1 ]    is NOT a snake\r\n\r\n [ 6 5 4 3 ]      is NOT a snake\r\n\r\n [ 6 1 2 \r\n   5 4 3 ]        is a snake\r\n\r\n [ 1 2\r\n   3 4 ]          is NOT a snake\r\n\r\n [  7  8  9 10\r\n    6  1  2 11\r\n    5  4  3 12\r\n   16 15 14 13 ]  is a snake\r\n\r\nNOTE: Answers to this problem helped me write the test suite for Cody Problem 42708, \u003chttps://www.mathworks.com/matlabcentral/cody/problems/42708-placing-beads-neatly-in-a-box Placing Beads Neatly in a Box\u003e. Thanks!\r\n","description_html":"\u003cp\u003eGiven an m-by-n matrix, return true if the elements of the matrix are a connected \"snake\" shape from 1 to m*n. Otherwise return false.\u003c/p\u003e\u003cp\u003eSnakes are vectors that move through the grid of a matrix in a 4-connected sense. So the number 1 can be anywhere, but the number 2 must be north, south, east, or west of 1. And the number 3 must be north, south, east, or west of 2. And so on.\u003c/p\u003e\u003cp\u003eExamples\u003c/p\u003e\u003cpre\u003e [ 1 2 3 4 5 ]    is a snake\u003c/pre\u003e\u003cpre\u003e [ 2 1 3 4 ]      is NOT a snake\u003c/pre\u003e\u003cpre\u003e [ 1 2 3 2 1 ]    is NOT a snake\u003c/pre\u003e\u003cpre\u003e [ 6 5 4 3 ]      is NOT a snake\u003c/pre\u003e\u003cpre\u003e [ 6 1 2 \r\n   5 4 3 ]        is a snake\u003c/pre\u003e\u003cpre\u003e [ 1 2\r\n   3 4 ]          is NOT a snake\u003c/pre\u003e\u003cpre\u003e [  7  8  9 10\r\n    6  1  2 11\r\n    5  4  3 12\r\n   16 15 14 13 ]  is a snake\u003c/pre\u003e\u003cp\u003eNOTE: Answers to this problem helped me write the test suite for Cody Problem 42708, \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/42708-placing-beads-neatly-in-a-box\"\u003ePlacing Beads Neatly in a Box\u003c/a\u003e. Thanks!\u003c/p\u003e","function_template":"function tf = isItSnaky(a)\r\n  tf = true;\r\nend","test_suite":"a = [ 1 2 3 4 5 ]    \r\ntf_correct = true;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n%%\r\n\r\na = [ 2 1 3 4 ]     \r\ntf_correct = false;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n%%\r\n\r\na = [ 6 1 2 \r\n      5 4 3 ]      \r\ntf_correct = true;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n%%\r\n\r\na = [ 1 2\r\n      3 4 ]         \r\ntf_correct = false;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n%%\r\n\r\na = [  7  8  9 10\r\n       6  1  2 11\r\n       5  4  3 12\r\n      16 15 14 13 ]  \r\ntf_correct = true;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n%%\r\n\r\na =  [ 1 2 3 2 1 ]   \r\ntf_correct = false;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n%%\r\n\r\na =  [ 6 5 4 3 ]   \r\ntf_correct = false;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n%%\r\n\r\na =  [ 1 2 3\r\n       4 5 6\r\n       7 8 9 ]   \r\ntf_correct = false;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n%%\r\n\r\na =  [ 2 1 1 1 ];\r\ntf_correct = false;\r\nassert(isequal(isItSnaky(a),tf_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":7,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":"2016-01-27T17:47:03.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2016-01-05T21:09:15.000Z","updated_at":"2026-02-08T12:52:52.000Z","published_at":"2016-01-05T21:26:23.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\u003eGiven an m-by-n matrix, return true if the elements of the matrix are a connected \\\"snake\\\" shape from 1 to m*n. Otherwise return false.\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\u003eSnakes are vectors that move through the grid of a matrix in a 4-connected sense. So the number 1 can be anywhere, but the number 2 must be north, south, east, or west of 1. And the number 3 must be north, south, east, or west of 2. And so on.\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\u003eExamples\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 2 3 4 5 ]    is a snake\\n\\n [ 2 1 3 4 ]      is NOT a snake\\n\\n [ 1 2 3 2 1 ]    is NOT a snake\\n\\n [ 6 5 4 3 ]      is NOT a snake\\n\\n [ 6 1 2 \\n   5 4 3 ]        is a snake\\n\\n [ 1 2\\n   3 4 ]          is NOT a snake\\n\\n [  7  8  9 10\\n    6  1  2 11\\n    5  4  3 12\\n   16 15 14 13 ]  is a snake]]\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\u003eNOTE: Answers to this problem helped me write the test suite for Cody Problem 42708,\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/42708-placing-beads-neatly-in-a-box\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ePlacing Beads Neatly in a Box\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. 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\"}]}"},{"id":42698,"title":"Why the heck are they blinking!?!?","description":"Merry Christmas everyone!  Sadly, the lights you've had on your tree for so many years burned out, and it's time to get a new set.  Being a skilled (and cheap!) mathematician, you realize that you can estimate the total length of the strings of lights you'll need for your tree with two simple parameters:\r\n\r\n* The radius of the base of the tree (in feet)\r\n* The Number of rows of lights you want on your tree, from top to bottom.\r\n\r\nThe rows of lights are equally spaced vertically around the tree.  Given these two variables, calculate how long your string of lights has to be in order to wrap around your tree.  You want to buy the minimum possible length of lights, because NOBODY likes having to untangle any more lights than they have to!\r\n\r\nHelpful hints - The answers calculated below model the lights on your tree as a two-dimensional Spiral of Archimedes, so the number of rows of lights is equal to the number of times your spiral makes a full 360-degree loop.  The final Cartesian coordinate of your spiral should be (width, 0).  If someone far smarter than I am wants to make the full three-dimensional version of this problem, knock yourself out!","description_html":"\u003cp\u003eMerry Christmas everyone!  Sadly, the lights you've had on your tree for so many years burned out, and it's time to get a new set.  Being a skilled (and cheap!) mathematician, you realize that you can estimate the total length of the strings of lights you'll need for your tree with two simple parameters:\u003c/p\u003e\u003cul\u003e\u003cli\u003eThe radius of the base of the tree (in feet)\u003c/li\u003e\u003cli\u003eThe Number of rows of lights you want on your tree, from top to bottom.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eThe rows of lights are equally spaced vertically around the tree.  Given these two variables, calculate how long your string of lights has to be in order to wrap around your tree.  You want to buy the minimum possible length of lights, because NOBODY likes having to untangle any more lights than they have to!\u003c/p\u003e\u003cp\u003eHelpful hints - The answers calculated below model the lights on your tree as a two-dimensional Spiral of Archimedes, so the number of rows of lights is equal to the number of times your spiral makes a full 360-degree loop.  The final Cartesian coordinate of your spiral should be (width, 0).  If someone far smarter than I am wants to make the full three-dimensional version of this problem, knock yourself out!\u003c/p\u003e","function_template":"function l = Length_of_Lights(w,n)\r\n  y = w*n;\r\nend","test_suite":"%%\r\nw=1;n=1;\r\nLOL=Length_of_Lights(w,n)\r\ntest=abs(LOL-3.3830)\r\nassert(test\u003c=0.001)\r\n%%\r\nw=4;n=5;\r\nLOL=Length_of_Lights(w,n)\r\ntest=abs(LOL-63.1273)\r\nassert(test\u003c=0.001)\r\n%%\r\nw=20;n=15;\r\nLOL=Length_of_Lights(w,n)\r\ntest=abs(LOL-943.086)\r\nassert(test\u003c=0.01)\r\n%%\r\nr=[31.4584 62.9167 94.3751 125.8335 157.2919 188.7502 220.2086 251.6670 283.1253 314.5837];\r\nk=ceil(10*rand)\r\nLOL=Length_of_Lights(k,10)\r\ntest=abs(LOL-r(k))\r\nassert(test\u003c=0.001)\r\n%%\r\nr=[23.6813 45.0198 66.7403 88.5798 110.4727 132.3946 154.3341 176.2850 198.2439 220.2086];\r\nk=ceil(10*rand)\r\nLOL=Length_of_Lights(7,k)\r\ntest=abs(LOL-r(k))\r\nassert(test\u003c=0.001)\r\n%%\r\nw = floor(sqrt(Length_of_Lights(9,4)))\r\nn=floor(sqrt(Length_of_Lights(5,8)))\r\nLOL=Length_of_Lights(w,n)\r\ntest=abs(LOL-345.9679)\r\nassert(test\u003c=0.01)","published":true,"deleted":false,"likes_count":2,"comments_count":9,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":34,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":37,"created_at":"2015-12-29T16:44:33.000Z","updated_at":"2026-02-27T09:52:37.000Z","published_at":"2015-12-29T16:44:33.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\u003eMerry Christmas everyone! Sadly, the lights you've had on your tree for so many years burned out, and it's time to get a new set. Being a skilled (and cheap!) mathematician, you realize that you can estimate the total length of the strings of lights you'll need for your tree with two simple parameters:\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\u003eThe radius of the base of the tree (in feet)\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\u003eThe Number of rows of lights you want on your tree, from top to bottom.\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 rows of lights are equally spaced vertically around the tree. Given these two variables, calculate how long your string of lights has to be in order to wrap around your tree. You want to buy the minimum possible length of lights, because NOBODY likes having to untangle any more lights than they have to!\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\u003eHelpful hints - The answers calculated below model the lights on your tree as a two-dimensional Spiral of Archimedes, so the number of rows of lights is equal to the number of times your spiral makes a full 360-degree loop. The final Cartesian coordinate of your spiral should be (width, 0). If someone far smarter than I am wants to make the full three-dimensional version of this problem, knock yourself out!\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":2174,"title":"Minimal cost","description":"A power house, P, is on one bank of a straight river W meters wide, and a factory, F, is on the opposite bank L meters downstream from P. The cable has to be taken across the river, under water at a cost of $CW/m. On land the cost is $CL/m. What is the minimum cost?","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 63px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 31.5px; transform-origin: 407px 31.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 370px 8px; transform-origin: 370px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA power house, P, is on one bank of a straight river W meters wide, and a factory, F, is on the opposite bank L meters downstream from P. The cable has to be taken across the river, under water at a cost of $CW/m. On land the cost is $CL/m. What is the minimum cost?\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = minimumdist(W,L,CW,CL)\r\n  W=Width\r\n%L=length\r\n%CW=cost of underwater cabling\r\n%CL=cost of Land cabling\r\nend","test_suite":"%%\r\nW=200;\r\nL=400;\r\nCL=3;\r\nCW=6;\r\ny_correct = 2239;\r\nassert(isequal(floor(minimumdist(W,L,CW,CL)),y_correct))\r\n\r\n%%\r\nW=200;\r\nL=200;\r\nCL=3;\r\nCW=5;\r\ny_correct = 1400;\r\nassert(isequal(floor(minimumdist(W,L,CW,CL)),y_correct))\r\n\r\n%%\r\nW=100;\r\nL=200;\r\nCL=2;\r\nCW=3;\r\ny_correct = 623;\r\nassert(isequal(floor(minimumdist(W,L,CW,CL)),y_correct))\r\n\r\n%%\r\nW=48;\r\nL=36;\r\nCL=3;\r\nCW=5;\r\ny_correct = 300;\r\nassert(isequal(floor(minimumdist(W,L,CW,CL)),y_correct))","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":17228,"edited_by":223089,"edited_at":"2023-01-07T18:11:17.000Z","deleted_by":null,"deleted_at":null,"solvers_count":66,"test_suite_updated_at":"2023-01-07T18:11:17.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2014-02-11T13:54:22.000Z","updated_at":"2026-02-27T10:10:33.000Z","published_at":"2014-02-11T13:54:22.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA power house, P, is on one bank of a straight river W meters wide, and a factory, F, is on the opposite bank L meters downstream from P. The cable has to be taken across the river, under water at a cost of $CW/m. On land the cost is $CL/m. What is the minimum cost?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42460,"title":"The cake is a lie...","description":"You're hosting a birthday party with a large number of screaming children.  Fortunately, you have a gigantic sheet cake in front of you that can be cut a large number of times.  Given the number of kids at the party, find the minimum number of cuts you need to make to give all of them at least one piece.  There can be pieces left over, but you need to make sure that everyone gets at least one piece.  Fortunately, the pieces of cake don't have to be the same size.\r\n\r\nGood luck!","description_html":"\u003cp\u003eYou're hosting a birthday party with a large number of screaming children.  Fortunately, you have a gigantic sheet cake in front of you that can be cut a large number of times.  Given the number of kids at the party, find the minimum number of cuts you need to make to give all of them at least one piece.  There can be pieces left over, but you need to make sure that everyone gets at least one piece.  Fortunately, the pieces of cake don't have to be the same size.\u003c/p\u003e\u003cp\u003eGood luck!\u003c/p\u003e","function_template":"function y = birthday_cake(x)\r\n  y = i_want_a_flower_on_my_piece;\r\nend","test_suite":"%%\r\nx = 1;y_correct = 0;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 2;y_correct = 1;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 4;y_correct = 2;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 7;y_correct = 3;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 12;y_correct = 4;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 27;y_correct = 6;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 127;y_correct = 9;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 2015;y_correct = 23;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 4060225;y_correct = 290;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 1234567890;y_correct = 1950;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\nx = 1362067890;y_correct = 2015;\r\nassert(isequal(birthday_cake(x),y_correct))\r\n%%\r\ny=arrayfun(@(x) birthday_cake(x),1:1000);\r\nassert(isequal(sum(y),13965))\r\n[x1,y1]=hist(y,unique(y));\r\n[m1,m2]=max(x1);\r\nassert(isequal(m1,154))\r\nassert(isequal(x1(isprime(x1)),[2 7 11 29 37 67 79 137]))","published":true,"deleted":false,"likes_count":1,"comments_count":4,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":35,"test_suite_updated_at":"2018-02-21T17:32:33.000Z","rescore_all_solutions":true,"group_id":37,"created_at":"2015-07-21T16:58:22.000Z","updated_at":"2026-03-10T20:07:26.000Z","published_at":"2015-07-21T17:00:13.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\u003eYou're hosting a birthday party with a large number of screaming children. Fortunately, you have a gigantic sheet cake in front of you that can be cut a large number of times. Given the number of kids at the party, find the minimum number of cuts you need to make to give all of them at least one piece. There can be pieces left over, but you need to make sure that everyone gets at least one piece. Fortunately, the pieces of cake don't have to be the same size.\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\u003eGood luck!\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":42721,"title":"Fun with a compass","description":"Each night for the past week, you have been having the same nightmare: You find yourself back in your junior high school geometry class, armed with nothing but a compass and a straight edge. Your teacher gives you a number, and asks you if it is possible to construct a regular polygon with that many sides inside the unit circle using nothing but the compass and straight edge.\r\nAfter waking up in a cold sweat again, you decide to write a MATLAB script to see if you can solve your nightmare. The dream is burned into your memory, so you remember all of the numbers that your teacher gave to you. Write a script that will allow you to solve this problem, and sleep peacefully once again.\r\nNote - You don't actually have to construct the n-sided polygon. You just need to determine if it's possible to do so. You can assume that all of the numbers are integers greater than 2.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 207px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 103.5px; transform-origin: 407px 103.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 84px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 42px; text-align: left; transform-origin: 384px 42px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eEach night for the past week, you have been having the same nightmare: You find yourself back in your junior high school geometry class, armed with nothing but a compass and a straight edge. Your teacher gives you a number, and asks you if it is possible to construct a regular polygon with that many sides inside the unit circle using nothing but the compass and straight edge.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 374px 8px; transform-origin: 374px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAfter waking up in a cold sweat again, you decide to write a MATLAB script to see if you can solve your nightmare. The dream is burned into your memory, so you remember all of the numbers that your teacher gave to you. Write a script that will allow you to solve this problem, and sleep peacefully once again.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 375.5px 8px; transform-origin: 375.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNote - You don't actually have to construct the n-sided polygon. You just need to determine if it's possible to do so. You can assume that all of the numbers are integers greater than 2.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = compass_construction(x)\r\n  y = x;\r\nend","test_suite":"x = 3; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 5; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 6; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 7; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 9; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 13; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 17; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 21; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 51; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 257; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 258; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 640; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 1234; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 2016; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 2056; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 65535; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 65536; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 65537; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 65538; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 1e5; y_correct = 0;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 196611; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n%%\r\nx = 327685; y_correct = 1;\r\nassert(isequal(compass_construction(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":42,"test_suite_updated_at":"2022-01-04T06:41:03.000Z","rescore_all_solutions":true,"group_id":37,"created_at":"2016-02-11T19:32:52.000Z","updated_at":"2026-02-27T10:14:32.000Z","published_at":"2016-02-11T19:32:52.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEach night for the past week, you have been having the same nightmare: You find yourself back in your junior high school geometry class, armed with nothing but a compass and a straight edge. Your teacher gives you a number, and asks you if it is possible to construct a regular polygon with that many sides inside the unit circle using nothing but the compass and straight edge.\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\u003eAfter waking up in a cold sweat again, you decide to write a MATLAB script to see if you can solve your nightmare. The dream is burned into your memory, so you remember all of the numbers that your teacher gave to you. Write a script that will allow you to solve this problem, and sleep peacefully once again.\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\u003eNote - You don't actually have to construct the n-sided polygon. You just need to determine if it's possible to do so. You can assume that all of the numbers are integers greater than 2.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":43642,"title":"Euclidean distance from a point to a polynomial","description":"A not uncommon problem in the area of computational geometry is to find the closest point to a straight line from a given point, or the distance from a point to a line. As you might expect, there is a simple formula for those things.\r\n\r\nAs an extension, I decided one day to write a tool that would compute the distance from a point to a general polynomial function in the (x,y) plane. That is your problem here:\r\n\r\nGiven a point (x0,y0), and a polynomial in the form y=P(x) where the function P is defined by the coefficients of a polynomial, you need to compute the minimum \u003chttps://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance\u003e to that polynomial. So you need to find and return the minimum distance in the (x,y) plane between the point (x0,y0), and the function y=P(x).\r\n\r\nThe function P will be passed in as the coefficients of a polynomial in standard MATLAB form, thus with the highest order coefficient first in a vector, like that generated by polyfit, and used by polyval. (P might be as simple as a constant function.) The point in question will be passed in as a vector of length 2, thus [x0,y0].\r\n\r\nAs test case for you to check your code, the distance from the point (-2,-5) to the curve y=x^2/2+3*x-5 should be:\r\n\r\n  x0y0 = [-2 -5];\r\n  P = [0.5 3 -5];\r\n  D = distance2polynomial(P,xy)\r\n  D =\r\n          1.89013819497707\r\n\r\n(Be careful plotting these curves in case you want to plot your solution. The command \"axis equal\" is a good idea.)\r\n\r\nThe symbolic TB tells me the distance is 1.8901381949770695260066523338279..., but I'll allow some slop in your solution, since you may have chosen a different algorithm than the one I chose. You should expect to provide at least 13 correct significant digits in the solution.\r\n\r\nDisclaimer: I'm not really sure why anyone needs such a code, which is why I've not posted my solution on the FEX. Anyway, my solution is a pretty one that I thought might make a fun Cody problem, and I wanted to see how others might approach the problem. I expect that my reference solution will score poorly for Cody purposes, since it is carefully coded, complete with error checks, and returns more than just the minimum distance.","description_html":"\u003cp\u003eA not uncommon problem in the area of computational geometry is to find the closest point to a straight line from a given point, or the distance from a point to a line. As you might expect, there is a simple formula for those things.\u003c/p\u003e\u003cp\u003eAs an extension, I decided one day to write a tool that would compute the distance from a point to a general polynomial function in the (x,y) plane. That is your problem here:\u003c/p\u003e\u003cp\u003eGiven a point (x0,y0), and a polynomial in the form y=P(x) where the function P is defined by the coefficients of a polynomial, you need to compute the minimum \u003ca href = \"https://en.wikipedia.org/wiki/Euclidean_distance\"\u003eEuclidean distance\u003c/a\u003e to that polynomial. So you need to find and return the minimum distance in the (x,y) plane between the point (x0,y0), and the function y=P(x).\u003c/p\u003e\u003cp\u003eThe function P will be passed in as the coefficients of a polynomial in standard MATLAB form, thus with the highest order coefficient first in a vector, like that generated by polyfit, and used by polyval. (P might be as simple as a constant function.) The point in question will be passed in as a vector of length 2, thus [x0,y0].\u003c/p\u003e\u003cp\u003eAs test case for you to check your code, the distance from the point (-2,-5) to the curve y=x^2/2+3*x-5 should be:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex0y0 = [-2 -5];\r\nP = [0.5 3 -5];\r\nD = distance2polynomial(P,xy)\r\nD =\r\n        1.89013819497707\r\n\u003c/pre\u003e\u003cp\u003e(Be careful plotting these curves in case you want to plot your solution. The command \"axis equal\" is a good idea.)\u003c/p\u003e\u003cp\u003eThe symbolic TB tells me the distance is 1.8901381949770695260066523338279..., but I'll allow some slop in your solution, since you may have chosen a different algorithm than the one I chose. You should expect to provide at least 13 correct significant digits in the solution.\u003c/p\u003e\u003cp\u003eDisclaimer: I'm not really sure why anyone needs such a code, which is why I've not posted my solution on the FEX. Anyway, my solution is a pretty one that I thought might make a fun Cody problem, and I wanted to see how others might approach the problem. I expect that my reference solution will score poorly for Cody purposes, since it is carefully coded, complete with error checks, and returns more than just the minimum distance.\u003c/p\u003e","function_template":"function D = distance2polynomial(P,x0y0)\r\n  % compute the minimum Euclidean distance between a point and a polynomial\r\n  D = rand;\r\nend\r\n","test_suite":"%%\r\nx0y0 = [-2 5];\r\nP = [0.5 3 -5];\r\ny_correct = 4.3093988461280149175163000679048;\r\ntol = 5e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [pi, pi];\r\nP = [10];\r\ny_correct = 6.8584073464102067615373566167205;\r\ntol = 7e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [0.25,50];\r\nP = [1 2 3 4 5];\r\ny_correct = 1.6470039192886012020234097061626;\r\ntol = 5e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [-3 -3];\r\nP = [-2 1];\r\ny_correct = 4.4721359549995793928183473374626;\r\ntol = 5e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [0 5];\r\nP = [1 0 1];\r\ny_correct = 1.9364916731037084425896326998912;\r\ntol = 2e-13;\r\nassert(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n%%\r\nx0y0 = [-2 -5];\r\nP = [0.5 3 -5];\r\ny_correct = 1.8901381949770695260066523338279;\r\ntol = 2e-13;\r\n(abs(distance2polynomial(P,x0y0)-y_correct) \u003c tol)\r\n\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":544,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":37,"created_at":"2016-10-28T21:00:14.000Z","updated_at":"2026-02-08T12:58:41.000Z","published_at":"2016-10-28T21:08:10.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\u003eA not uncommon problem in the area of computational geometry is to find the closest point to a straight line from a given point, or the distance from a point to a line. As you might expect, there is a simple formula for those things.\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 an extension, I decided one day to write a tool that would compute the distance from a point to a general polynomial function in the (x,y) plane. That is your problem here:\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\u003eGiven a point (x0,y0), and a polynomial in the form y=P(x) where the function P is defined by the coefficients of a polynomial, you need to compute the minimum\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/Euclidean_distance\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eEuclidean distance\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e to that polynomial. So you need to find and return the minimum distance in the (x,y) plane between the point (x0,y0), and the function y=P(x).\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 function P will be passed in as the coefficients of a polynomial in standard MATLAB form, thus with the highest order coefficient first in a vector, like that generated by polyfit, and used by polyval. (P might be as simple as a constant function.) The point in question will be passed in as a vector of length 2, thus [x0,y0].\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 test case for you to check your code, the distance from the point (-2,-5) to the curve y=x^2/2+3*x-5 should be:\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[x0y0 = [-2 -5];\\nP = [0.5 3 -5];\\nD = distance2polynomial(P,xy)\\nD =\\n        1.89013819497707]]\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\u003e(Be careful plotting these curves in case you want to plot your solution. The command \\\"axis equal\\\" is a good idea.)\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 symbolic TB tells me the distance is 1.8901381949770695260066523338279..., but I'll allow some slop in your solution, since you may have chosen a different algorithm than the one I chose. You should expect to provide at least 13 correct significant digits in the solution.\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\u003eDisclaimer: I'm not really sure why anyone needs such a code, which is why I've not posted my solution on the FEX. Anyway, my solution is a pretty one that I thought might make a fun Cody problem, and I wanted to see how others might approach the problem. I expect that my reference solution will score poorly for Cody purposes, since it is carefully coded, complete with error checks, and returns more than just the minimum distance.\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":42580,"title":"Conic equation","description":"A conic of revolution (around the |z| axis) can be defined by the equation\r\n\r\n   s^2 – 2*R*z + (k+1)*z^2 = 0\r\n\r\nwhere |s^2=x^2+y^2|, |R| is the vertex radius of curvature, and |k| is the conic constant: |k\u003c-1| for a hyperbola, |k=-1| for a parabola, |-1\u003ck\u003c0| for a tall ellipse, |k=0| for a sphere, and |k\u003e0| for a short ellipse.\r\n\r\nWrite a function |z=conic(s,R,k)| to calculate height |z| as a function of radius |s| for given |R| and |k|.  Choose the branch of the solution that gives |z=s^2/(2*R)+...| for small values of |s|.  This defines a concave surface for |R\u003e0| and a convex surface for |R\u003c0|.  \r\n\r\nThe trick is to get full machine precision for all values of |s| and |R|.  The test suite will require a relative error less than |4*eps|, where |eps| is the machine precision.\r\n\r\nHint (added 2015/09/03): the straightforward solution is \r\n\r\n   z = (R-sqrt(R^2-(k+1)*s^2))/(k+1), \r\n\r\nbut this does not work if |k=-1|, gives the wrong branch of the solution if |R\u003c0|, and is subject to severe roundoff error if |s^2| is small compared to |R^2|.  It is possible, however, to find a mathematically equivalent form of the solution that solves all three problems at once.\r\n","description_html":"\u003cp\u003eA conic of revolution (around the \u003ctt\u003ez\u003c/tt\u003e axis) can be defined by the equation\u003c/p\u003e\u003cpre\u003e   s^2 – 2*R*z + (k+1)*z^2 = 0\u003c/pre\u003e\u003cp\u003ewhere \u003ctt\u003es^2=x^2+y^2\u003c/tt\u003e, \u003ctt\u003eR\u003c/tt\u003e is the vertex radius of curvature, and \u003ctt\u003ek\u003c/tt\u003e is the conic constant: \u003ctt\u003ek\u0026lt;-1\u003c/tt\u003e for a hyperbola, \u003ctt\u003ek=-1\u003c/tt\u003e for a parabola, \u003ctt\u003e-1\u0026lt;k\u0026lt;0\u003c/tt\u003e for a tall ellipse, \u003ctt\u003ek=0\u003c/tt\u003e for a sphere, and \u003ctt\u003ek\u0026gt;0\u003c/tt\u003e for a short ellipse.\u003c/p\u003e\u003cp\u003eWrite a function \u003ctt\u003ez=conic(s,R,k)\u003c/tt\u003e to calculate height \u003ctt\u003ez\u003c/tt\u003e as a function of radius \u003ctt\u003es\u003c/tt\u003e for given \u003ctt\u003eR\u003c/tt\u003e and \u003ctt\u003ek\u003c/tt\u003e.  Choose the branch of the solution that gives \u003ctt\u003ez=s^2/(2*R)+...\u003c/tt\u003e for small values of \u003ctt\u003es\u003c/tt\u003e.  This defines a concave surface for \u003ctt\u003eR\u0026gt;0\u003c/tt\u003e and a convex surface for \u003ctt\u003eR\u0026lt;0\u003c/tt\u003e.\u003c/p\u003e\u003cp\u003eThe trick is to get full machine precision for all values of \u003ctt\u003es\u003c/tt\u003e and \u003ctt\u003eR\u003c/tt\u003e.  The test suite will require a relative error less than \u003ctt\u003e4*eps\u003c/tt\u003e, where \u003ctt\u003eeps\u003c/tt\u003e is the machine precision.\u003c/p\u003e\u003cp\u003eHint (added 2015/09/03): the straightforward solution is\u003c/p\u003e\u003cpre\u003e   z = (R-sqrt(R^2-(k+1)*s^2))/(k+1), \u003c/pre\u003e\u003cp\u003ebut this does not work if \u003ctt\u003ek=-1\u003c/tt\u003e, gives the wrong branch of the solution if \u003ctt\u003eR\u0026lt;0\u003c/tt\u003e, and is subject to severe roundoff error if \u003ctt\u003es^2\u003c/tt\u003e is small compared to \u003ctt\u003eR^2\u003c/tt\u003e.  It is possible, however, to find a mathematically equivalent form of the solution that solves all three problems at once.\u003c/p\u003e","function_template":"function z=conic(s,R,k)\r\nz=0;\r\nend","test_suite":"%%\r\nR=5;\r\nk=-1;\r\ns=-5:5;\r\nz=[25 16 9 4 1 0 1 4 9 16 25]/10;\r\nt=arrayfun(@(x)conic(x,R,k),s);\r\nassert(all(abs(t-z)\u003c=4*eps*abs(z)))\r\n%%\r\nR=-5;\r\nk=-1;\r\ns=-5:5;\r\nz=-[25 16 9 4 1 0 1 4 9 16 25]/10;\r\nt=arrayfun(@(x)conic(x,R,k),s);\r\nassert(all(abs(t-z)\u003c=4*eps*abs(z)))\r\n%%\r\nR=6;\r\nk=0;\r\ns=0:0.125:2;\r\nz=[0 0.001302224649086391 0.005210595859100573 ...\r\n   0.01173021649825800 0.02086962844930099 ...\r\n   0.03264086885999461 0.04705955010467117 ...\r\n   0.06414496470811713 0.08392021690038396 ...\r\n   0.1064123829368584 0.1316527028472488 ...\r\n   0.1596768068881667 0.1905249806888747 ...\r\n   0.2242424739260392 0.2608798583755018 ...\r\n   0.3004934424110011 0.3431457505076198];\r\nt=arrayfun(@(x)conic(x,R,k),s);\r\nassert(all(abs(t-z)\u003c=4*eps*abs(z)))\r\n%%\r\nR=6800;\r\nk=-2;\r\ns=10.^(-9:9);\r\nz=[7.352941176470588e-23 7.352941176470588e-21 ...\r\n   7.352941176470588e-19 7.352941176470588e-17 ...\r\n   7.352941176470588e-15 7.352941176470588e-13 ...\r\n   7.352941176470548e-11 7.352941176466613e-9 ...\r\n   7.352941176073046e-7 0.00007352941136716365 ...\r\n   0.007352937201052538 0.7352543677216725 ...\r\n   73.13611097583313 5292.973166264779 93430.93334894173 ...\r\n   993223.1197327390 9.993202311999733e6 9.99932002312e7 ...\r\n   9.9999320002312e8];\r\nt=arrayfun(@(x)conic(x,R,k),s);\r\nassert(all(abs(t-z)\u003c=4*eps*abs(z)))\r\n%%\r\nR=exp(1);\r\nk=pi;\r\ns=10.^(-7:0);\r\nz=[1.839397205857214e-15 1.839397205857469e-13 ...\r\n   1.839397205882986e-11 1.839397208434684e-09 ...\r\n   1.839397463604480e-07 0.00001839422981299153 ...\r\n   0.001841981926630790 0.2212216213343403];\r\nt=arrayfun(@(x)conic(x,R,k),s);\r\nassert(all(abs(t-z)\u003c=4*eps*abs(z)))\r\n%%\r\nt=fileread('conic.m');\r\nassert(isempty(findstr(t,'roots')))\r\nassert(isempty(findstr(t,'fzero')))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":245,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":21,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":37,"created_at":"2015-08-26T21:39:35.000Z","updated_at":"2026-02-08T12:47:36.000Z","published_at":"2015-08-26T22:21:10.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\u003eA conic of revolution (around 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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ez\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e axis) can be defined by the equation\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[   s^2 – 2*R*z + (k+1)*z^2 = 0]]\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\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\u003es^2=x^2+y^2\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: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\u003eR\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the vertex radius of curvature, 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\u003ek\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the conic constant:\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\u003ek\u0026lt;-1\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for a hyperbola,\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\u003ek=-1\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for a parabola,\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\u003e-1\u0026lt;k\u0026lt;0\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for a tall ellipse,\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\u003ek=0\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for a sphere, 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\u003ek\u0026gt;0\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for a short ellipse.\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\u003eWrite a function\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\u003ez=conic(s,R,k)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to calculate height\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\u003ez\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e as a function of radius\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\u003es\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for given\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\u003eR\u003c/w:t\u003e\u003c/w:r\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:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ek\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Choose the branch of the solution that gives\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\u003ez=s^2/(2*R)+...\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for small values 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\u003es\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. This defines a concave surface for\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\u003eR\u0026gt;0\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and a convex surface for\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\u003eR\u0026lt;0\u003c/w:t\u003e\u003c/w:r\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\u003eThe trick is to get full machine precision for all values 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\u003es\u003c/w:t\u003e\u003c/w:r\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:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eR\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. The test suite will require a relative error less than\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\u003e4*eps\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, where\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\u003eeps\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the machine precision.\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\u003eHint (added 2015/09/03): the straightforward solution is\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[   z = (R-sqrt(R^2-(k+1)*s^2))/(k+1),]]\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\u003ebut this does not work if\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\u003ek=-1\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, gives the wrong branch of the solution if\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\u003eR\u0026lt;0\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, and is subject to severe roundoff error if\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\u003es^2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is small compared to\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\u003eR^2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. It is possible, however, to find a mathematically equivalent form of the solution that solves all three problems at once.\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":42708,"title":"Placing Beads Neatly in a Box","description":"You are given a string of n black and white beads. Your job is to pack them neatly into a square box. \"Neatly\" in this case means that all the black beads are at the bottom, and all the white beads are at the top.\r\n\r\n\u003c\u003chttp://starchamber.com/matlab/images/beads.png\u003e\u003e\r\n\r\nHalf the beads are black, and half are white. The number of beads n will always be an even number perfect square (4, 16, 36, ...). Black beads are 1, and white beads are 0, so a string might look like this.\r\n\r\n str = [0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1]\r\n \r\nReturn a square matrix bx that indexes into str such that\r\n\r\n str(bx) = [ 0 0 0 0\r\n             0 0 0 0\r\n             1 1 1 1\r\n             1 1 1 1 ]\r\n\r\nThe matrix bx consists of the numbers 1 through n snaking through the box in a 4-connected sense (see Cody Problem 42705, \u003chttps://www.mathworks.com/matlabcentral/cody/problems/42705-is-it-a-snake Is It a Snake?\u003e). \r\n\r\nHere's one solution for the string shown above.\r\n\r\n bx = [ 1  8  9 10 \r\n        2  7 12 11\r\n        3  6 13 14\r\n        4  5 16 15 ]\r\n \r\nIn general the answers are not unique. I will be checking that bx contains the numbers 1 through n, that they form a snake, and that when used with the string of beads, they result in a tidy ones-on-the-bottom formation.\r\n\r\n_I am grateful to the solvers of problem 42705 for giving me nice short code to use in my test suite for this problem!_","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 923.92px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 331.989px 461.96px; transform-origin: 331.996px 461.96px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 62.7273px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 308.991px 31.3636px; text-align: left; transform-origin: 308.999px 31.3636px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eYou are given a string of n black and white beads. Your job is to pack them neatly into a square box. \"Neatly\" in this case means that all the black beads are at the bottom, and all the white beads are at the top.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 127.443px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 308.991px 63.7216px; text-align: left; transform-origin: 308.999px 63.7216px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH0AAAB6CAYAAACShVydAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AcdFRE4MGRacwAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInAAAKZElEQVR4nO2dwW7juhWG/wwKzEsUNj1A0dW9T+CJ6ACz6uA+gAtMlLtr0QfILFrFUxSdRdeZXWRPgUHRdWZVIJJzsyi6jPchbXTR+xTswmGuxrFl8pDS6Ib8AC8CyDn+9YuSeMhDHiilFCJB8exr/4BI+0TTAySaHiDR9ACJpgdIND1AoukBEk0PkGh6gETTAySaHiC/8PnP5EJg+mkGAFiulgCAZHgIPuRg3wy8x1muluj3+liuljgevwH/zch7DKA9LZpkeIj0dyfeYmzipa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E0wMkmh4g0fQAiaYHSDQ9QP4P+LATkboVR38AAAAASUVORK5CYII=\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 62.7273px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 308.991px 31.3636px; text-align: left; transform-origin: 308.999px 31.3636px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eHalf the beads are black, and half are white. The number of beads n will always be an even number perfect square (4, 16, 36, ...). Black beads are 1, and white beads are 0, so a string might look like this.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 20px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e str = [0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 54.446px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 308.991px 27.2159px; text-align: left; transform-origin: 308.999px 27.223px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbAAAAAxCAYAAAC71fzjAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AcdFREcDGe+ogAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISM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0tfd+LtczdjHN7TA0tp9ZjDvHNnwOTPtdwbAWOr7Z5S+Aaz06JtXwnz4HV1CJtYlJjiauWSBuyxCSZdVpqPjt1qs+BSY/CNFrmNpaoZU6TZM4zyh/uObDYxFITTHIL7ZhY+Km302tW4pAsvRQ/mtUrNOZSQ4vUWJjrrioiyTHN6hVxoiTJMW0uS1YV0YyLdNLnnFNpkZwdydWSasg5WuauF82kT5tjNbRo+mUJiq+FeMzESqxTN14seCqOMUbt8pIEy9Uy94yl1lqIkmLRFGPUEpctmjIY772qGMdaUnJMa17MXy58PaeW2Pjn1pKyRmkIIVtLXMT34HcKjUtqLmuv40h7jJZT1HKSayEyf1mUzrndKtFx1WjtzHtfnLh46Ps4JVcjPzb42iLZp2VqwHP3WaqWuVejL7WyfmyW47GP419ay74ci6vR52oZ14u19istc6xGv09LqVXP/bXfrfF4SEuJFdwP9RjnXLEeE27vjuZyKS1TddnSyvo1tIwp8iDzPuK7muL7gOK7Z3IeWjsUZ9gOb58NmcVylvcOjd87NaeW9/tsjnf1jGPEOO7yY/F3aH3PWojKjv+30BJ1EJXXMmwHWn9+fewh1kyNeiGaR8un3/+9+1uNXJ6rx+x7t1mL9RKZzcAAAACAOfn5W/8AAAAAQAMMDAAAQJPAwAAAADQJDAwAAECTwMAAAAA0CQwMAABAk8DAAAAANAkMDAAAQJPAwAAAADQJDAwAAECTwMAAAAA0CQwMAABAk8DAAAAANAkMDAAAQJPAwAAAADTJ/wAewOoB4sX+EwAAAABJRU5ErkJggg==\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9091px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 308.991px 10.4545px; text-align: left; transform-origin: 308.999px 10.4545px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eReturn a square matrix bx that indexes into str such that\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 80px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 328.991px 40px; transform-origin: 328.999px 40px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e str(bx) = [ 0 0 0 0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e             0 0 0 0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e             1 1 1 1\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e             1 1 1 1 ]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 41.8182px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 308.991px 20.9091px; text-align: left; transform-origin: 308.999px 20.9091px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThe matrix bx consists of the numbers 1 through n snaking through the box in a 4-connected sense (see Cody Problem 42705,\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/42705-is-it-a-snake\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eIs It a Snake?\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9091px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 308.991px 10.4545px; text-align: left; transform-origin: 308.999px 10.4545px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eHere's one solution for the string shown above.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 80px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 328.991px 40px; transform-origin: 328.999px 40px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e bx = [ 1  8  9 10 \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        2  7 12 11\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        3  6 13 14\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.994318px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.994318px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.994318px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.994318px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 328.991px 10px; transform-origin: 328.999px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        4  5 16 15 ]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 134.446px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 308.991px 67.2159px; text-align: left; transform-origin: 308.999px 67.223px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIMAAACBCAYAAADjVQltAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AcdFREW7LJXvAAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwD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uVnfkgltPKJzQG58OQXdey422JbNTvOa18QqH+jzHVYQDtaUndlijZnSHG5W1ulKs2pp5z17Rw+OKSTjlXdn3sJHtMFP0DcpOuh6C28jn+7nVwjLaMwGpLFPF4lYqqFqqQYiuqdkkLh2R/kfNZeYywXR9atqVl59sShS4+wXkRCjVdW0kn7klqQwuVLG2JOMJiWvnkMtxT1EIhy0QV9Q4R28qHchBj1z+iGiKmKIh6t4ttsbSNVtoSPXTgUohaN7XsTJDqubppCcBUi20tt1jKqWUTe4iIkBH3IYgbQuVa6dSt4Jo7BsDT0PIQ2c0gPB6+uAyksB4xg+ARMwgeMYPgETMIHjGD4BEzCB4xg+ARMwgeMYPgETMIHjGD4BEzCB4xg+ARMwgeMYPgETMInv8D6IpVdzZvffcAAAAASUVORK5CYII=\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 62.7273px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 308.991px 31.3636px; text-align: left; transform-origin: 308.999px 31.3636px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIn general the answers are not unique. I will be checking that bx contains the numbers 1 through n, that they form a snake, and that when used with the string of beads, they result in a tidy ones-on-the-bottom formation.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 41.8182px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 308.991px 20.9091px; text-align: left; transform-origin: 308.999px 20.9091px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eI am grateful to the solvers of problem 42705 for giving me nice short code to use in my test suite for this problem!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function bx = beadBox(str)\r\n  bx = 1;\r\nend","test_suite":"str = [0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1];\r\nbx = beadBox(str);\r\n\r\n% Is bx the right size?\r\nassert(isequal(size(bx),sqrt(length(str))*[1 1]))\r\n% Does it use all the numbers?\r\nassert(isequal(unique(bx),find(bx)))\r\n% Is it snaky?\r\n[I,J]=arrayfun(@(f) find(bx==f),1:numel(bx));\r\nassert(all(abs(diff(complex(I,J)))==1))\r\n% Are all the 1's on the bottom?\r\nbeads = str(bx);\r\nassert(all(find(beads')\u003ennz(beads)))\r\n\r\n%%\r\n\r\nstr = [1 1 0 0 0 0 0 0 1 1 1 1 1 0 0 1];\r\nbx = beadBox(str);\r\n\r\n% Is bx the right size?\r\nassert(isequal(size(bx),sqrt(length(str))*[1 1]))\r\n% Does it use all the numbers?\r\nassert(isequal(unique(bx),find(bx)))\r\n% Is it snaky?\r\n[I,J]=arrayfun(@(f) find(bx==f),1:numel(bx));\r\nassert(all(abs(diff(complex(I,J)))==1))\r\n% Are all the 1's on the bottom?\r\nbeads = str(bx);\r\nassert(all(find(beads')\u003ennz(beads)))\r\n\r\n%%\r\n\r\nstr = [1 1 0 0];\r\nbx = beadBox(str);\r\n\r\n% Is bx the right size?\r\nassert(isequal(size(bx),sqrt(length(str))*[1 1]))\r\n% Does it use all the numbers?\r\nassert(isequal(unique(bx),find(bx)))\r\n% Is it snaky?\r\n[I,J]=arrayfun(@(f) find(bx==f),1:numel(bx));\r\nassert(all(abs(diff(complex(I,J)))==1))\r\n% Are all the 1's on the bottom?\r\nbeads = str(bx);\r\nassert(all(find(beads')\u003ennz(beads)))\r\n\r\n%%\r\n\r\nstr = [0 1 1 0 0 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0];\r\nbx = beadBox(str);\r\n\r\n% Is bx the right size?\r\nassert(isequal(size(bx),sqrt(length(str))*[1 1]))\r\n% Does it use all the numbers?\r\nassert(isequal(unique(bx),find(bx)))\r\n% Is it snaky?\r\n[I,J]=arrayfun(@(f) find(bx==f),1:numel(bx));\r\nassert(all(abs(diff(complex(I,J)))==1))\r\n% Are all the 1's on the bottom?\r\nbeads = str(bx);\r\nassert(all(find(beads')\u003ennz(beads)))\r\n\r\n","published":true,"deleted":false,"likes_count":8,"comments_count":5,"created_by":7,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":16,"test_suite_updated_at":"2016-01-25T16:08:14.000Z","rescore_all_solutions":false,"group_id":37,"created_at":"2016-01-07T18:58:38.000Z","updated_at":"2026-02-08T10:50:52.000Z","published_at":"2016-01-07T19:00:25.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou are given a string of n black and white beads. Your job is to pack them neatly into a square box. \\\"Neatly\\\" in this case means that all the black beads are at the bottom, and all the white beads are at the top.\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:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"122\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"125\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHalf the beads are black, and half are white. The number of beads n will always be an even number perfect square (4, 16, 36, ...). Black beads are 1, and white beads are 0, so a string might look like this.\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[ str = [0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1]]]\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"49\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"432\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eReturn a square matrix bx that indexes into str such that\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[ str(bx) = [ 0 0 0 0\\n             0 0 0 0\\n             1 1 1 1\\n             1 1 1 1 ]]]\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe matrix bx consists of the numbers 1 through n snaking through the box in a 4-connected sense (see Cody Problem 42705,\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/42705-is-it-a-snake\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eIs It a Snake?\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHere's one solution for the string shown above.\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[ bx = [ 1  8  9 10 \\n        2  7 12 11\\n        3  6 13 14\\n        4  5 16 15 ]]]\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\u003cw:jc w:val=\\\"left\\\"/\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=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn general the answers are not unique. I will be checking that bx contains the numbers 1 through n, that they form a snake, and that when used with the string of beads, they result in a tidy ones-on-the-bottom formation.\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:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eI am grateful to the solvers of problem 42705 for giving me nice short code to use in my test suite for this problem!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.png\",\"relationshipId\":\"rId1\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image2.png\",\"relationshipId\":\"rId2\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image3.png\",\"relationshipId\":\"rId3\"}]},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH0AAAB6CAYAAACShVydAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AcdFRE4MGRacwAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInAAAKZElEQVR4nO2dwW7juhWG/wwKzEsUNj1A0dW9T+CJ6ACz6uA+gAtMlLtr0QfILFrFUxSdRdeZXWRPgUHRdWZVIJJzsyi6jPchbXTR+xTswmGuxrFl8pDS6Ib8AC8CyDn+9YuSeMhDHiilFCJB8exr/4B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0E+fvyuIU9ttq/nXt3SYr4W/aluTdKklm0cKKUUPKL71rprYpJ1o8ZpIwbwNLRU8W56pPt0OiMXaYZoeoBE0wMkmh4g0fQAiaYHSDQ9QKLpARJND5BoeoBE0wMkmh4g0fQAiaYHSDQ9QP4P+LATkboVR38AAAAASUVORK5CYII=\",\"relationship\":null},{\"partUri\":\"/media/image2.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbAAAAAxCAYAAAC71fzjAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AcdFREcDGe+ogAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInAAAH+UlEQVR4nO2dTXIjuRGFcyZ8DhJ9AN+AIUELr3wDTYQbWs4NtINm5RvIO0HtxZxAs1VRjj6BZq8q8iBOLyTQ1WqyiEyg0ET3+yK4UbCUfIXMfKg/1E/MzAQAAAA0xs/f+gcAAAAAGmBgAAAAmgQGBgAAoElgYAAAAJoEBgYAAKBJYGAAAACaBAYGAACgSWBgAAAAmgQGBgAAoElgYAAAAJoEBgYAAKBJYGAAAACaBAYGAACgSWBgAAAAmgQGBgAAoEn+Mtc/Hv7s6f73T0REtNluiIjofHVGdmXJ/PVD8Tib7YaWiyVtthv6ePkPsn+/KB6DqJ6WyPnqjNyvV8VjEH2pxSzMLPtsbi3rz2satpvq41I6x4iI7v8VvtIy17gQ0a5mzGJZdFyIiNZ/dDRsB3r6/B8iqqMlxplDy/rz0y7GcrEkuzpvUsv7fklE1bSUr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ECTwMAAAAA0CQwMAABAk8DAAAAANAkMDAAAQJPAwAAAADQJDAwAAECTwMAAAAA0CQwMAABAk8DAAAAANAkMDAAAQJPAwAAAADTJ/wAewOoB4sX+EwAAAABJRU5ErkJggg==\",\"relationship\":null},{\"partUri\":\"/media/image3.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIMAAACBCAYAAADjVQltAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AcdFREW7LJXvAAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInAAAKYUlEQVR4nO2dzW4byRHHS0YAvURANg0EOe0+Aa1pGtApi30ABrBGvmWRB5BPI20QJIec5ZuG3ABGkLN8CqAhvToEOUp3dZPYw+5TVA5091K0SFb1x5iS6wfMbajSf+Y/H1091bWHiAiCAADPPvc/IOwOYgbBI2YQPGIGwSNmEDxiBsEjZhA8YgbBI2YQPGIGwSNmEDxiBsEjZhA8YgbBI2YQPGIGwfObnH/c3hoYvRsDAMBsPgMAgKJ/ALqvQX3VSx5nNp9Bt9OF2XwGR8NXoP8wSB4DoD0tjqJ/AOWfjpPFWEeWO4O9NXD65hQG374E2AeAfYDisIDisIDp/z7A4JuXcPzHY7C3JirO5H0DvW7PxykOC1C/V1AcFnD2j++h1+3B6ZvTaD2nb06h9/VzmP08y6bF3ppPtLht/O8foNftwehtHa1lI5gYc3OH5bDEsizX72MMVlWFqqPQ3NwFxanPL1AphU3TbIyjlMLqpAqKYW7uUPd1a1rqut4YJ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hm17FzWuFJrJZW2hIRtbBI9fIRMkRa3jiFJ6ExqMPYkKHr8sZpSxQTJzVJ2xLFoPuatF/RL7LHiIXTlig8Rhn827WkdBY1W7e6cVv5hMQAxpAPMXwIyxnyuZqJ3FqoZGlLxBEV2sqHe/BC2hKFnKg2MpC5utFka0uUywgO6pXrls4L1cKZZ4lpS5TjzsMly6zlajeVXO72azOuMV+Kmb7l9Sw3naDYGodtk1WPctZymXVtiVIWh7gYy+8rqRcEXY3jFunMoaW5vLqnpa0FQRGlomonkbZEwmdHzCB4xAyCR8wgeMQMgkfMIHjEDIJHzBCAtCVi4tK4q7n91OsgIX6a20/dlmiTlpQtlh5K47u5lTYSaVnMQJmJS5FmpUwixc4bULSkmDegTFbl7EKDmMEM3OnlmFY+1BihB5E7vbzLWigkXyGWc/DcFrKqKjdGyAqxIVq4t/OQD4IexQqxod/0cddbDonBPVFPSQuVnfkgltPKJzQG58OQXdey422JbNTvOa18QqH+jzHVYQDtaUndlijZnSHG5W1ulKs2pp5z17Rw+OKSTjlXdn3sJHtMFP0DcpOuh6C28jn+7nVwjLaMwGpLFPF4lYqqFqqQYiuqdkkLh2R/kfNZeYywXR9atqVl59sShS4+wXkRCjVdW0kn7klqQwuVLG2JOMJiWvnkMtxT1EIhy0QV9Q4R28qHchBj1z+iGiKmKIh6t4ttsbSNVtoSPXTgUohaN7XsTJDqubppCcBUi20tt1jKqWUTe4iIkBH3IYgbQuVa6dSt4Jo7BsDT0PIQ2c0gPB6+uAyksB4xg+ARMwgeMYPgETMIHjGD4BEzCB4xg+ARMwgeMYPgETMIHjGD4BEzCB4xg+ARMwgeMYPgETMInv8D6IpVdzZvffcAAAAASUVORK5CYII=\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"term":"group:\"Computational Geometry IV\"","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":"group:\"Computational Geometry IV\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"group":[["group:\"Computational Geometry IV\"","","\"","Computational Geometry IV","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f4a00c40828\u003e":["Computational Geometry IV"],"#\u003cMathWorks::Search::Field:0x00007f4a00c40788\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f4a00c5fe80\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f4a00c40aa8\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f4a00c40a08\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f4a00c40968\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f4a00c408c8\u003e":"group:\"Computational Geometry IV\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f4a00c408c8\u003e":"group:\"Computational Geometry IV\""},"queried_facets":{"#\u003cMathWorks::Search::Field:0x00007f4a00c40828\u003e":["Computational Geometry IV"]}},"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":"group:\"Computational Geometry IV\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"group":[["group:\"Computational Geometry IV\"","","\"","Computational Geometry IV","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f4a00c40828\u003e":["Computational Geometry IV"],"#\u003cMathWorks::Search::Field:0x00007f4a00c40788\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f4a00c5fe80\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f4a00c40aa8\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f4a00c40a08\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f4a00c40968\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f4a00c408c8\u003e":"group:\"Computational Geometry IV\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f4a00c408c8\u003e":"group:\"Computational Geometry IV\""},"queried_facets":{"#\u003cMathWorks::Search::Field:0x00007f4a00c40828\u003e":["Computational Geometry IV"]}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":2831,"difficulty_rating":"easy"},{"id":43601,"difficulty_rating":"easy-medium"},{"id":42493,"difficulty_rating":"easy-medium"},{"id":44070,"difficulty_rating":"easy-medium"},{"id":44059,"difficulty_rating":"easy-medium"},{"id":42699,"difficulty_rating":"easy-medium"},{"id":42789,"difficulty_rating":"easy-medium"},{"id":42755,"difficulty_rating":"easy-medium"},{"id":43599,"difficulty_rating":"easy-medium"},{"id":2833,"difficulty_rating":"easy-medium"},{"id":42825,"difficulty_rating":"easy-medium"},{"id":42855,"difficulty_rating":"easy-medium"},{"id":42705,"difficulty_rating":"medium"},{"id":42698,"difficulty_rating":"medium"},{"id":2174,"difficulty_rating":"medium"},{"id":42460,"difficulty_rating":"medium"},{"id":42721,"difficulty_rating":"medium"},{"id":43642,"difficulty_rating":"medium"},{"id":42580,"difficulty_rating":"medium-hard"},{"id":42708,"difficulty_rating":"medium-hard"}]}}