{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-04-06T14:01:22.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":"2026-04-06T00: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":56583,"title":"Slope intercept application","description":"Find y given slope (m), x, and y intercept (b).","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.440000534057617px; 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; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; 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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eFind y given slope (m), x, and y intercept (b).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(m, x, b)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isequal(your_fcn_name(1, 2, 0),2));\r\n%%\r\nassert(isequal(your_fcn_name(5, 0, 0),0));\r\n%%\r\nassert(isequal(your_fcn_name(3, 5, 5),20));\r\n%%\r\nassert(isequal(your_fcn_name(2, 1, 1),3));\r\n%%\r\nassert(isequal(your_fcn_name(0, 5, 1),1));\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":2797253,"edited_by":26769,"edited_at":"2022-11-22T22:10:31.000Z","deleted_by":null,"deleted_at":null,"solvers_count":110,"test_suite_updated_at":"2022-11-22T22:10:31.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2022-11-10T21:15:08.000Z","updated_at":"2026-02-06T11:51:28.000Z","published_at":"2022-11-10T21:15:08.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 y given slope (m), x, and y intercept (b).\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":2376,"title":"Find the Nth Root of a Given Number","description":"Find the Nth root of a given number x.\r\n\r\nExamples\r\n\r\n x = 4096\r\n n = 4\r\n y = 8\r\n\r\n x = 625\r\n n = 5\r\n y = 3.6239","description_html":"\u003cp\u003eFind the Nth root of a given number x.\u003c/p\u003e\u003cp\u003eExamples\u003c/p\u003e\u003cpre\u003e x = 4096\r\n n = 4\r\n y = 8\u003c/pre\u003e\u003cpre\u003e x = 625\r\n n = 5\r\n y = 3.6239\u003c/pre\u003e","function_template":"function y = nth_root(x,n)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 4096;n=4;\r\ny_correct = 8;\r\n\r\nassert(isequal(nth_root(x,n),y_correct))\r\n\r\n%%\r\nx = 256;n=4;\r\ny_correct = 4;\r\n\r\nassert(isequal(nth_root(x,n),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":22553,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":364,"test_suite_updated_at":"2014-08-26T16:11:50.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-06-18T15:50:59.000Z","updated_at":"2026-03-23T11:17:06.000Z","published_at":"2014-06-18T15:52:17.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\u003eFind the Nth root of a given number 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\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[ x = 4096\\n n = 4\\n y = 8\\n\\n x = 625\\n n = 5\\n y = 3.6239]]\u003e\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":43158,"title":"Solve system of equation!","description":"Given provided system of equation, and find x and y.\r\n\r\nSystem of equation can be expressed as each term's coefficient. For example,\r\n\r\n2*x+1*y=3\r\n1*x+1*y=2\r\n\r\ncan be\r\n\r\n[2 1 3; 1 1 2]\r\n\r\nMake function that use above matrix as a input to find solution x and y.","description_html":"\u003cp\u003eGiven provided system of equation, and find x and y.\u003c/p\u003e\u003cp\u003eSystem of equation can be expressed as each term's coefficient. For example,\u003c/p\u003e\u003cp\u003e2*x+1*y=3\r\n1*x+1*y=2\u003c/p\u003e\u003cp\u003ecan be\u003c/p\u003e\u003cp\u003e[2 1 3; 1 1 2]\u003c/p\u003e\u003cp\u003eMake function that use above matrix as a input to find solution x and y.\u003c/p\u003e","function_template":"function y = solvesystem(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [2 1 3; 1 1 2];\r\ny_correct = x(:,1:end-1)\\x(:,end);\r\nassert(isequal(solvesystem(x),y_correct))\r\n\r\n%%\r\nx = [1 1 0; 1 -1 0];\r\ny_correct = x(:,1:end-1)\\x(:,end);\r\nassert(isequal(solvesystem(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":66,"test_suite_updated_at":"2016-10-21T06:42:33.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T13:53:09.000Z","updated_at":"2026-02-26T22:49:23.000Z","published_at":"2016-10-07T13:54:04.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\u003eGiven provided system of equation, and find x and y.\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\u003eSystem of equation can be expressed as each term's coefficient. For example,\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\u003e2*x+1*y=3 1*x+1*y=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\u003ecan be\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[2 1 3; 1 1 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\u003eMake function that use above matrix as a input to find solution x and y.\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":46648,"title":"Factorial","description":null,"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: 20.8px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.4px; transform-origin: 407px 10.4px; 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 10.4px; text-align: left; transform-origin: 384px 10.4px; 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=\"\"\u003eFind the Factorial of a given number, x, that is the multiplication of all integer numbers from 1 to x.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = F(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 0;\r\ny_correct = 1;\r\nassert(isequal(F(x),y_correct))\r\n\r\n%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(F(x),y_correct))\r\n\r\n%%\r\nx = 4;\r\ny_correct = 24;\r\nassert(isequal(F(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":430136,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":103,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-02T14:04:25.000Z","updated_at":"2026-03-31T15:11:19.000Z","published_at":"2020-10-02T14:04: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\u003eFind the Factorial of a given number, x, that is the multiplication of all integer numbers from 1 to x.\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":45317,"title":"Positive Definiteness of a Matrix","description":"Determine if input matrix is positive definite or not.","description_html":"\u003cp\u003eDetermine if input matrix is positive definite or not.\u003c/p\u003e","function_template":"function y = pos_def(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 0;0 1];\r\ny_correct = 1;\r\nassert(isequal(pos_def(x),y_correct))\r\n%%\r\nx = 0;\r\ny_correct = 0;\r\nassert(isequal(pos_def(x),y_correct))\r\n%%\r\nx = [2 -1 0;-1 2 -1;0 -1 2];\r\ny_correct = 1;\r\nassert(isequal(pos_def(x),y_correct))\r\n%%\r\nx = [-1 -2;2 1];\r\ny_correct = 0;\r\nassert(isequal(pos_def(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":285886,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":32,"test_suite_updated_at":"2020-02-13T17:24:29.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2020-02-07T21:06:21.000Z","updated_at":"2026-02-16T11:55:27.000Z","published_at":"2020-02-07T21:06:43.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\u003eDetermine if input matrix is positive definite or not.\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":627,"title":"Compute a dot product of two vectors x and y","description":"x and y are input vectors, d is a number and contains their dot product","description_html":"\u003cp\u003ex and y are input vectors, d is a number and contains their dot product\u003c/p\u003e","function_template":"function d =vector_dot(x,y)\r\n  d = 0;\r\nend","test_suite":"%%\r\nx = [1 2];\r\ny= [1 3];\r\nd_correct=7;\r\nassert(isequal(vector_dot(x,y),d_correct))\r\n\r\n%%\r\nx = [1 -1];\r\ny= [1 1];\r\nd_correct=0;\r\nassert(isequal(vector_dot(x,y),d_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":1,"created_by":3727,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1050,"test_suite_updated_at":"2012-04-26T15:48:54.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-04-26T15:47:56.000Z","updated_at":"2026-03-02T13:02:46.000Z","published_at":"2012-04-26T15:47:56.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\u003ex and y are input vectors, d is a number and contains their dot product\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":44268,"title":"Combination of Vectors","description":"Return a combination of vectors x1, x2 based on y1, y2 per:\r\n\r\n      x(j) = 0     if y1(j) \u003c y2(j) \r\n      x(j) = x1(j) if y1(j) = y2(j)\r\n      x(j) = x2(j) if y1(j) \u003e y2(j)\r\n  \r\nVectors can have any length, consistent orientation.","description_html":"\u003cp\u003eReturn a combination of vectors x1, x2 based on y1, y2 per:\u003c/p\u003e\u003cpre\u003e      x(j) = 0     if y1(j) \u0026lt; y2(j) \r\n      x(j) = x1(j) if y1(j) = y2(j)\r\n      x(j) = x2(j) if y1(j) \u0026gt; y2(j)\u003c/pre\u003e\u003cp\u003eVectors can have any length, consistent orientation.\u003c/p\u003e","function_template":"function y = piecewise(x11, y11, x21, y21)\r\n  y = x;\r\nend","test_suite":"%%\r\ny11 = [4 3 0 3];\r\ny21 = [2 0 1 3];\r\nx11 = [0 1 1 2];\r\nx21 = [-2 4 1 2];\r\na1 = [-2 4 0 2];\r\nassert(isequal(piecewise(x11, y11, x21, y21),a1))\r\n%%\r\ny12 = [2 2 2 2];\r\ny22 = [0 4 0 4];\r\nx12 = [1 1 1 1];\r\nx22 = [1 1 1 1];\r\na2 = [1 0 1 0];\r\nassert(isequal(piecewise(x12, y12, x22, y22),a2))\r\n%%\r\ny23 = [2 2 2 2];\r\ny13 = [0 4 0 4];\r\nx13 = [2 2 2 2];\r\nx23 = [2 2 2 2];\r\na3 = [0 2 0 2];\r\nassert(isequal(piecewise(x13, y13, x23, y23),a3))\r\n%%\r\ny14 = zeros(1, 100);\r\ny24 = ones(1, 100);\r\nx14 = ones(1,100);\r\nx24 = 2*ones(1,100);\r\na4 = zeros(1, 100);\r\nassert(isequal(piecewise(x14, y14, x24, y24),a4))\r\n%%\r\ny25 = 2;\r\ny15 = 0;\r\nx15 = 2;\r\nx25 = 2;\r\na5 = 0;\r\nassert(isequal(piecewise(x15, y15, x25, y25),a5))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":31205,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":50,"test_suite_updated_at":"2017-07-25T12:35:28.000Z","rescore_all_solutions":false,"group_id":674,"created_at":"2017-07-24T12:12:10.000Z","updated_at":"2026-02-06T11:50:42.000Z","published_at":"2017-07-24T12:12:29.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\u003eReturn a combination of vectors x1, x2 based on y1, y2 per:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[      x(j) = 0     if y1(j) \u003c y2(j) \\n      x(j) = x1(j) if y1(j) = y2(j)\\n      x(j) = x2(j) if y1(j) \u003e y2(j)]]\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\u003eVectors can have any length, consistent orientation.\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":44093,"title":"Determinants","description":"Given a square matrix(A), find the determinant(d).\r\n\r\nFor example:\r\n\r\nA = [1,3;4,5]\r\n\r\nd = 1*5-4*3 = -7","description_html":"\u003cp\u003eGiven a square matrix(A), find the determinant(d).\u003c/p\u003e\u003cp\u003eFor example:\u003c/p\u003e\u003cp\u003eA = [1,3;4,5]\u003c/p\u003e\u003cp\u003ed = 1*5-4*3 = -7\u003c/p\u003e","function_template":"function d = your_fcn_name(A)\r\n  d = A;\r\nend","test_suite":"%%\r\nA = [1,3;4,5];\r\nd_correct = -7;\r\nassert(isequal(your_fcn_name(A),d_correct))\r\n\r\n%%\r\nA = [6,0,0,5;1,7,2,-5;2,0,0,0;8,3,1,8];\r\nd_correct = 10;\r\nassert(isequal(your_fcn_name(A),d_correct))\r\n\r\n%%\r\nA = [1,0,4;2,3,2;0,5,-2];\r\nd_correct = 24;\r\nassert(isequal(your_fcn_name(A),d_correct))\r\n\r\n%%\r\nA = [4,0,-7,3,-5;0,0,2,0,0;7,3,-6,4,-8;5,0,5,2,-3;0,0,9,-1,2];\r\nd_correct = 6;\r\nassert(isequal(your_fcn_name(A),d_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":126209,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":72,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-04-13T19:49:36.000Z","updated_at":"2026-03-16T09:24:14.000Z","published_at":"2017-04-13T19:52:06.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a square matrix(A), find the determinant(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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example:\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 = [1,3;4,5]\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\u003ed = 1*5-4*3 = -7\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":42901,"title":"Free-time Equation","description":"Given a 7-day week, an *_nc_* -number of *_tc_* -hour classes, *_ta_* -hours awake in a day, and *_tw_* -hours that you work in a week....\r\n\r\nWrite an equation that will calculate the amount of free-time you have in a typical week.\r\n\r\nNOTE: Read the top sentence for a better understanding of what each variable  means, and assume that a *_tc_* -hour class will only take *_tc_* -hours from your week...","description_html":"\u003cp\u003eGiven a 7-day week, an \u003cb\u003e\u003ci\u003enc\u003c/i\u003e\u003c/b\u003e -number of \u003cb\u003e\u003ci\u003etc\u003c/i\u003e\u003c/b\u003e -hour classes, \u003cb\u003e\u003ci\u003eta\u003c/i\u003e\u003c/b\u003e -hours awake in a day, and \u003cb\u003e\u003ci\u003etw\u003c/i\u003e\u003c/b\u003e -hours that you work in a week....\u003c/p\u003e\u003cp\u003eWrite an equation that will calculate the amount of free-time you have in a typical week.\u003c/p\u003e\u003cp\u003eNOTE: Read the top sentence for a better understanding of what each variable  means, and assume that a \u003cb\u003e\u003ci\u003etc\u003c/i\u003e\u003c/b\u003e -hour class will only take \u003cb\u003e\u003ci\u003etc\u003c/i\u003e\u003c/b\u003e -hours from your week...\u003c/p\u003e","function_template":"function f = freeTime(nc,ta,tc,tw)\r\n  f = (7 *  ) - ((   ) + (  ));\r\nend","test_suite":"%%\r\nnc = 5;\r\nta = 12;\r\ntc = 3;\r\ntw = 35;\r\nf_correct = 34;\r\nassert(isequal(freeTime(nc,ta,tc,tw),f_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":79153,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":77,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-07-02T03:34:19.000Z","updated_at":"2026-02-16T16:37:51.000Z","published_at":"2016-07-02T03:36:59.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 a 7-day week, an\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\u003enc\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e -number 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: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\u003etc\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e -hour classes,\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\u003eta\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e -hours awake in a day, 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: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\u003etw\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e -hours that you work in a week....\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 an equation that will calculate the amount of free-time you have in a typical week.\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: Read the top sentence for a better understanding of what each variable means, and assume that a\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\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\u003etc\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e -hour class will only take\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\u003etc\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e -hours from your week...\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":45196,"title":"Determine whether a given point is inside or outside a polygon","description":"A closed polygon may be described by an N x 2 array of nodes, where the last node and the first node are the same. Each row of the array is a 2-element vector giving the x and y coordinates of a node. The polygon is described by straight-line segments that go from node to node.\r\nIn this problem, we provide you with a polygon p of this type, and with a number of points r, each having an x and y coordinate. You are to determine whether each point falls inside or outside the polygon. If the point is inside the polygon, return the value 1. If outside, return the value 0.\r\nHINT: One way to solve this is to find a point 'p_test' that is outside of the polygon, and then to count the number of times that a line from 'r' to 'p_test' crosses the sides of the polygon.","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: 186px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 93px; transform-origin: 407px 93px; vertical-align: baseline; \"\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: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA closed polygon may be described by an N x 2 array of nodes, where the last node and the first node are the same. Each row of the array is a 2-element vector giving the x and y coordinates of a node. The polygon is described by straight-line segments that go from node to node.\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: 361px 8px; transform-origin: 361px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn this problem, we provide you with a polygon p of this type, and with a number of points r, each having an x and y coordinate. You are to determine whether each point falls inside or outside the polygon. If the point is inside the polygon, return the value 1. If outside, return the value 0.\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: 380.5px 8px; transform-origin: 380.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eHINT: One way to solve this is to find a point 'p_test' that is outside of the polygon, and then to count the number of times that a line from 'r' to 'p_test' crosses the sides of the polygon.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function InOut = inOrOut(p,r)\r\n% inOrOut() Determines whether point r is inside (InOut = 1) or \r\n% outside (InOut = 0) polygon p\r\n    InOut = 0;\r\nend\r\n","test_suite":"p = [0,0; 0,100; 5,10; 10,100; 15,20; 20,100; 25,30; 30,100; ...\r\n    35,40; 40,100; 45,50; 50,100; 50,0; 0,0];\r\n%%\r\nr = [44.28, 60.99];\r\np = [0,0; 0,100; 5,10; 10,100; 15,20; 20,100; 25,30; 30,100; ...\r\n    35,40; 40,100; 45,50; 50,100; 50,0; 0,0];\r\ny_correct = 0;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [38.33, 57.67];\r\ny_correct = 1;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [0.98, 23.99];\r\ny_correct = 1;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [27.07, 95.94];\r\ny_correct = 0;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [ -7.45, 7.14];\r\ny_correct = 0;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [43.19, 2.87];\r\ny_correct = 1;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [19.39, 16.79];\r\ny_correct = 1;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [48.72, 71.27];\r\ny_correct = 1;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [-6.42, 68.20];\r\ny_correct = 0;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [20.03, 47.11];\r\ny_correct = 1;\r\nassert(inOrOut(p,r) == y_correct);\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":8580,"edited_by":223089,"edited_at":"2022-09-09T08:55:17.000Z","deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":"2022-09-09T08:55:17.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2019-11-06T23:11:51.000Z","updated_at":"2026-01-23T09:40:37.000Z","published_at":"2019-11-06T23:20:58.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 closed polygon may be described by an N x 2 array of nodes, where the last node and the first node are the same. Each row of the array is a 2-element vector giving the x and y coordinates of a node. The polygon is described by straight-line segments that go from node to node.\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\u003eIn this problem, we provide you with a polygon p of this type, and with a number of points r, each having an x and y coordinate. You are to determine whether each point falls inside or outside the polygon. If the point is inside the polygon, return the value 1. If outside, return the value 0.\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\u003eHINT: One way to solve this is to find a point 'p_test' that is outside of the polygon, and then to count the number of times that a line from 'r' to 'p_test' crosses the sides of the polygon.\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":61047,"title":"MATLAB Time Warp – Stabilize the Temporal Lattice by Finding the Dominant Eigenvector of a Time-Distorted Matrix","description":"The Chrono-MAT Engine is malfunctioning.\r\nA time-distorted matrix A governs the stability of spacetime.\r\nYour mission: determine the dominant eigenvector, the direction of least temporal resistance.\r\nGiven a square matrix A, compute the normalized eigenvector corresponding to the largest eigenvalue (by magnitude).\r\nNormalize it so that its Euclidean norm equals 1.\r\nIf multiple eigenvalues share the same magnitude, pick the eigenvector corresponding to the first one returned by MATLAB.","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; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 171px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 85.5px; transform-origin: 408px 85.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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe \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; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eChrono-MAT Engine\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is malfunctioning.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA time-distorted matrix \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; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eA\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e governs the stability of spacetime.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eYour mission: determine 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; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003edominant eigenvector\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, the direction of least temporal resistance.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven a square matrix \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; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eA\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, compute 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; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003enormalized eigenvector\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e corresponding to 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; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003elargest eigenvalue (by magnitude)\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNormalize it so that its Euclidean norm equals 1.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf multiple eigenvalues share the same magnitude, pick the eigenvector corresponding to 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; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003efirst\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e one returned by MATLAB.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function v = stabilizeLattice(A)\r\n  y = x;\r\nend","test_suite":"%\r\nA = [4 2; 2 1];\r\ny_correct = [-0.8944; -0.4472];\r\nv = stabilizeLattice(A);\r\nassert(isequal(round(abs(v),4), round(abs(y_correct),4)))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":4953963,"edited_by":4953963,"edited_at":"2025-10-23T13:07:36.000Z","deleted_by":null,"deleted_at":null,"solvers_count":10,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2025-10-23T13:07:00.000Z","updated_at":"2026-03-19T07:25:04.000Z","published_at":"2025-10-23T13:07:36.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\u003eThe \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eChrono-MAT Engine\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is malfunctioning.\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 time-distorted matrix \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e governs the stability of spacetime.\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\u003eYour mission: determine the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003edominant eigenvector\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, the direction of least temporal resistance.\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 a square matrix \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, compute the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003enormalized eigenvector\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e corresponding to the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003elargest eigenvalue (by magnitude)\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNormalize it so that its Euclidean norm equals 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\u003eIf multiple eigenvalues share the same magnitude, pick the eigenvector corresponding to the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003efirst\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e one returned by MATLAB.\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":169,"title":"Set a Soroban Abacus","description":"*Description*\r\n\r\nThis problem is the inverse of \u003chttp://www.mathworks.com/matlabcentral/cody/problems/136-read-a-soroban-abacus Problem 136: Read a Soroban Abacus\u003e. Provided an N-digit integer, return a logical matrix of size 7xN that symbolizes the input number.\r\n\r\n*Example*\r\n\r\n\r\n    x = 10586;\r\n    y = [ 1 1 0 0 0\r\n          0 0 1 1 1\r\n          1 0 0 1 1\r\n          0 1 1 1 0\r\n          1 1 1 1 1\r\n          1 1 1 0 1\r\n          1 1 1 1 1 ];","description_html":"\u003cp\u003e\u003cb\u003eDescription\u003c/b\u003e\u003c/p\u003e\u003cp\u003eThis problem is the inverse of \u003ca href=\"http://www.mathworks.com/matlabcentral/cody/problems/136-read-a-soroban-abacus\"\u003eProblem 136: Read a Soroban Abacus\u003c/a\u003e. Provided an N-digit integer, return a logical matrix of size 7xN that symbolizes the input number.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cpre\u003e    x = 10586;\r\n    y = [ 1 1 0 0 0\r\n          0 0 1 1 1\r\n          1 0 0 1 1\r\n          0 1 1 1 0\r\n          1 1 1 1 1\r\n          1 1 1 0 1\r\n          1 1 1 1 1 ];\u003c/pre\u003e","function_template":"function y = soroban_set(x)\r\n    y = zeros(7,N);\r\nend","test_suite":"%%\r\nx = 2;\r\ny = [1;0;1;1;0;1;1];\r\nassert(isequal(soroban_set(x),y))\r\n\r\n%%\r\nx = 10586;\r\ny = [ 1 1 0 0 0\r\n      0 0 1 1 1\r\n      1 0 0 1 1\r\n      0 1 1 1 0\r\n      1 1 1 1 1\r\n      1 1 1 0 1\r\n      1 1 1 1 1 ];\r\nassert(isequal(soroban_set(x),y))\r\n\r\n%%\r\nx = 0;\r\ny = [ 1\r\n      0\r\n      0\r\n      1\r\n      1\r\n      1\r\n      1 ];\r\nassert(isequal(soroban_set(x),y))\r\n\r\n%%\r\nx = 50000;\r\ny = [ 0 1 1 1 1\r\n      1 0 0 0 0\r\n      0 0 0 0 0\r\n      1 1 1 1 1\r\n      1 1 1 1 1\r\n      1 1 1 1 1\r\n      1 1 1 1 1 ];\r\nassert(isequal(soroban_set(x),y))\r\n\r\n%%\r\nx = 9876543210;\r\ny = [ 0 0 0 0 0 1 1 1 1 1\r\n      1 1 1 1 1 0 0 0 0 0\r\n      1 1 1 1 0 1 1 1 1 0\r\n      1 1 1 0 1 1 1 1 0 1\r\n      1 1 0 1 1 1 1 0 1 1\r\n      1 0 1 1 1 1 0 1 1 1\r\n      0 1 1 1 1 0 1 1 1 1 ];\r\nassert(isequal(soroban_set(x),y))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":38,"test_suite_updated_at":"2012-02-02T03:45:39.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-01-30T04:56:28.000Z","updated_at":"2026-03-31T13:07:34.000Z","published_at":"2012-02-02T03:52:17.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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eDescription\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\u003eThis problem is the inverse of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/136-read-a-soroban-abacus\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 136: Read a Soroban Abacus\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. Provided an N-digit integer, return a logical matrix of size 7xN that symbolizes the input number.\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[    x = 10586;\\n    y = [ 1 1 0 0 0\\n          0 0 1 1 1\\n          1 0 0 1 1\\n          0 1 1 1 0\\n          1 1 1 1 1\\n          1 1 1 0 1\\n          1 1 1 1 1 ];]]\u003e\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":975,"title":"Gauss Eliminate 2-by-2 example","description":"Use forward elimination to make the coefficient matrix, A, an upper triangular matrix, and then solve using back substitution, for a sample 2-by-2 system.","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: 348.5px 8px; transform-origin: 348.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUse forward elimination to make the coefficient matrix, A, an upper triangular matrix, and then solve using back substitution, for a sample 2-by-2 system.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [Ab,x] = GaussEliminate2eqs(A,b)\r\n% A is 2-by-2 system coefficient matrix of the linear system\r\n% b is the 2-by-1 right-hand-side column vector\r\n% Ab is the 2-by-3 Augmented matrix of [A,b] after forward elimination\r\n% x  is the 2-by-1 solution vector\r\n\r\nend","test_suite":"%%\r\nA = [3 2; -1, 2];\r\nb = [18; 2];\r\n[Ab,x]=GaussEliminate2eqs(A,b);\r\nAb_correct = [A,b];\r\nAb_correct(2,:) = [0 8/3 8];\r\nx_correct = [4; 3];\r\nassert(isequal(Ab,Ab_correct))\r\nassert(isequal(x, x_correct))\r\n\r\n%%\r\nA = [3 6; -2 -3];\r\nb = [9;12];\r\n[Ab,x]=GaussEliminate2eqs(A,b);\r\nAb_correct = [3 6 9;-1 -1 15];\r\nx_correct = [-33;18];\r\nassert(isequal(Ab,Ab_correct))\r\nassert(isequal(x, x_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":279,"edited_by":223089,"edited_at":"2022-12-04T08:25:24.000Z","deleted_by":null,"deleted_at":null,"solvers_count":126,"test_suite_updated_at":"2022-12-04T08:25:24.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-10-08T05:33:17.000Z","updated_at":"2026-03-11T11:45:42.000Z","published_at":"2012-10-08T05:33:17.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\u003eUse forward elimination to make the coefficient matrix, A, an upper triangular matrix, and then solve using back substitution, for a sample 2-by-2 system.\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":60966,"title":"Determine if LTI system with feedback control is stable","description":"Linear timeiinvariant systems can be represented by the differential equation , where  is an  matrix,  is an vector representing the system state,  is a  matrix, and  is a vector representing the control input. Feedback control seeks to stabilize this system with a control of the form , where  is an  matrix defined by a user. The closed-loop system can be represented by , and is asymptotically stable if and only if all the eigenvalues of  have negative real parts.\r\n\r\nWrite a function that takes an , , and  and returns a logical scalar that is true when the system is asymptotically stable and false when it is not stable.","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: 214.6px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 107.3px; transform-origin: 408px 107.3px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 133.6px; 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: 385px 66.8px; text-align: left; transform-origin: 385px 66.8px; 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: 238.333px 8px; transform-origin: 238.333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eLinear timeiinvariant systems can be represented by the differential equation \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-15px\"\u003e\u003cimg src=\"data:image/png;base64,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\" width=\"87.5\" height=\"35\" style=\"width: 87.5px; height: 35px;\"\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: 24.8917px 8px; transform-origin: 24.8917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, where \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eA\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: 18.6667px 8px; transform-origin: 18.6667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is an \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEUAAAAkCAYAAADfJffWAAADLElEQVRoQ+1XO49OURQ1vYpKQ4JCIR6ZeCSi80hEIxLMUIpXoyKoRISEH+ARhSi8WppR6CYZNDoKWipC6FlrctZkz737zLfPPclHcU6y8p37ndfe666z974Ty1rrMTDROOkz0EhxVNFIaaTEgkVTSlNKU0qMgaaUGE8tpjSl/H9KWQGTngDngM8x8+ZnbQOuA/sL1lRNHef1mYGl+4DfwJYgMSTkNbAceA4crfI2uHicpFAps8CGIDGWkDdYcwD4HvSrappHyjrsSOwBNgOrgRfAxXTSLfyeAFYBH4FdBcZGiakhhGpcC2w19m9MNuoqcg7bWeBul0GPFEp0Mi2gbNm2A4wDfNM/E7TxbUNYd3/veRQxNYRw70uJDNn3Cs+MR2cA2voYmAbkW4+Dpa7PHBbuAKiGg8BL4BFwE+CBjBFsV9J/EUI0J0dMDSH2fGsf1cB2PvnBlyvfvqIvFS2sX4qUP2kW2V0D/ABOp//I+p3UX4/fkmySI+YkBh4AfIO1MYRX/ALAoH4YeAjsNnZ+QZ/X3w3eOVIs01xIUmygu4fnU0BpTFl4G6ljFaOxWkK4j1U5n68Cz8yZ31I/HFM4X06z76VQMX0f41JP1+HoM2PYUzOZ8etddLEzj0TLaQ53bbQqX4nxXkbLKeUDJjN1snVjBjPTpzTGAMZANrTZGKI9SuoY71xLshczqJgjABW509sgl5LltCdlMU3jea2G1g7doHocezGYR+uY3IuQ0xw/BujaaL5Uns2aHilWXl5mUWWqVDdEJbksMypdR86S055KeO7btEn2mnqk2HLcU8IvbMoMIcIuo89gHM1Ao9JuDTHWaU8JtPUGIMLID+saFabzfHmkyGlPCfa+MhXvBQ4BU8FrNIoQKWEoMXKa+3hKUKzkS2TmYTHK+mVRXOySYpn20pXyPw/lxpsAFnYRlUQJqSFGKs+VCqq9OM6mYlRnukqxTntFGTPPe0BfrbxCEUJ4mGqHkjrEKiYSw+R07otapQavzzWg991DQ8f9lcwqmAosyVgkZsi6RW+/5GGcpJTY9U/nNlIc+hspjZTYrWxKaUppSokx0JQS4+kv7oDZJaNZ5TgAAAAASUVORK5CYII=\" width=\"34.5\" height=\"18\" style=\"width: 34.5px; height: 18px;\"\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: 24.8833px 8px; transform-origin: 24.8833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e matrix, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ex\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: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is an \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEUAAAAkCAYAAADfJffWAAACqUlEQVRoQ+2YsUscQRTGvd5C7NKYwhSmiYIkKWyNQrBJo4gpJSb2EUwtCegfoAlWIkS01EYLOyGaJl0skjbpgqK9fh+ZB4+92Zs3u+N56Cx87N7u7Nyb337z5u02uvLWRKCRmTQTyFA8rshQMhRbsshOyU7JTtEE+vHjI9QDjYfQ3PXpIzAmHYiD+w5lEQCGnDvGMpT/BOiS3w7GVadC6UVgX6F5FWxoevP6U2jJYvsWnXUslH0ETRtfOlvLU2wFhkAOoW5oG5qyUPS06VgodMoRNGAEo4Ec456X0L/bgsK5SI1Cg1AftAstuICWsX8NPYBOoZGIYK1gUgJh2LWdQosOQ++cbdnpM4h255M+d5KMvqKAWR5kCExqIEmgyMC+4eC5c8ME9nvQBvQJIhDmCG4f3DkLEGlTBuYmgCSFIpajEx5CZ9CcG9Vb7Ffd8SPnohgobFsEM4tz6xCTat0cUoyl9vRhh9oJzPqEohPdZ/x+A8XmlGKwGoxcSw0kmVNk0OzQt4T+wXkm2i/KPbFOkfbMYVvqZuav71U7K7kviVN+onMundyKOYMr0y93jS9XfJ+ouukcIn3E1DHW/60NRQ/aZ2XJJwye06pq7VBMqjPoi8ncWsdYgbBdbSg6ifpWFqlMTW+cJZGXrTKh5ToGhG5bG4oux31OuMC/cYUQYHwbZTK2lO0MNLTs3gSY2lBk0D4n6KTIpfgF9AqaNk6jEBB5uqnB1ILCoE9cZKxo1wp+ZYn/3p2jO55ALOwsLrECSQ1GlxcsIR6H5mDxy5setK8oYxL+4aYPoXAKWYAwDqmQY+oQ7ZjYHMbcSBfL64iw+IuDTWgH8i797fwcyQGyCqYDY1asqveFDFF6vZ1QKgfZ7hszFA/xDCVDsU3E7JTslOwUG4HsFBunazWTwiVMoNvxAAAAAElFTkSuQmCC\" width=\"34.5\" height=\"18\" style=\"width: 34.5px; height: 18px;\"\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: 116.675px 8px; transform-origin: 116.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003evector representing the system state, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eB\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: 14.775px 8px; transform-origin: 14.775px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is a \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAAAkCAYAAADB7MdlAAADiElEQVRoQ+1YOYgVQRDdzY3MTBTUQFE8EA8QMw8QDUy8AwPxSsRAQRExEAXNvTAy8YpEETQwEAR3TQwEDTR1s0XRXN+TLqntX/On6g9/TKrhMd2/a/p4/bqq5k9OZHEzMOm2TMOJJCsggiQryQowEDBNZSVZAQYCpqmsJCvAQMA0lZVkBRgImPaprPlY1wPgFPA1sMb1sL0C7Ai8MxbTPsl6iR1sB34Ba5yEkajXwDzgMbBvLCw4B+2TLCrrLbDMSZgmagrv7ARmnfsai5lF1hLMRGwFVgMLgWfAubKC63geBhYAn4HNgU14CetCFNW7GFhb1r9CKZn7ugnQhmU/8KjUubZbwN7S3oDne826RRalvg44CVD+LHyRfobK+FEgE95AW4jUYzfV2wjrQhTn5Lp40GfLAnigywGO+xTgwR8se9N9vO4vACqY+5a+f/sYdg3fwWpjeWkXns+B+8C1siD6IJYL5TcPUWLTRFhXomR8KuhLafAwnxSijuD5CpC9sX6x9J3BkyqTPl79TXpTw8j6rSZbhPp34Hj57QSelCzLUiAS3ZoIO4qOewBPtauP4u14WCbiDbkECFH8We9tN9qnC4l135wb00QWpSzKYRQiWdrB3kH7GBD1WfqgWNcKk76uRHEcWd8M6nQblwHxTVTvdJmMc70BhBS9b5fP0pOxboX6b/idDv4uIGqrifC2tQr4zsAivQMpu0+oS9SlH9Ipx3m0ryqytAgYvOjrSPJKYE70bVKWTMYxa5+k/QETRd77UYv2UTJGJA+z5tXr46a3ANpNSL5nHYz2ZQNJcFPqIM7RuhLir7gpXs9Rc5/amR/CWAwi3jys6YC0P7WCj/grHnJNiPSZQcsiq20yORlrMq/CmqJeW1rhGX/Yl4L2SfWt0H1m0LLI0pNZyvmJFTNiCfv0AQwC3ojYlh50JWyYcrTjr32S+CsJWpKYM1X6WyyyhAxLOdoZk/1twB7ggPM6thEl6xqVsDpluF1JUQKT9Z0p/op9TDc+1v6uJkuHVb5QTybscw0cdBXAhNWjKi9RXQgT5Vj+VDt+a28iEiqLRedeprI0Gda95YQfAPkXgFfRQxQn05mx96NYK8zjI0U5lq1OGay9SQbAoMYkdiDK9/2vA7N+nmokgsoHbvS96gZ2b/ZJVvfV/ucRkqzAASRZSVaAgYBpKivJCjAQME1lJVkBBgKmfwCTL/0lUbJyPgAAAABJRU5ErkJggg==\" width=\"37.5\" height=\"18\" style=\"width: 37.5px; height: 18px;\"\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: 38.5px 8px; transform-origin: 38.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e matrix, and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eu\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: 14.775px 8px; transform-origin: 14.775px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is a \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAAAkCAYAAADB7MdlAAADAElEQVRoQ+2Yvc8NQRSH79tLiE7jTVCQCI0XiUhEhESIQuLjL0ChQ1CJAqFQKHz8BeiUFAqVjwoFjZaKEHp+TzInORl7787Znch7Yzb5ZffunNk58+yZM2fvwqQdxQQWii2b4aTBCgRBg9VgBQgETFtkNVgBAgHTFlmTyX7xuio9ka7PYvc/wzJIOxKgyw3W36GyWrcuSovSFmljgzV9PQGL45tEdD2dN1in5fA66UIg32J6X3ouPQr2M/O5g7Ukz18n7x/ofKpw4gA6Jv2S9kpvCvt5s7mDhfNE1t0AMA/qvPrdGwCKLqNhrddD0D5pq7RWeicdTw5d0vmstEb6KG1yjmJzO7U90/lAYBKlwGqBqgZrm550RbKd4oSucRKxi/xIb4UBfdtu/X7f0VbKrA9YTVBVYNnEvGMAsmVyRtfAtF1ku67PpU7UKkSltRFZRFjkmAasNqiqsD6kyHql81tplQQottybErnii3RH2iOdzNpIvEDGPnrkwBjbkvmYHJX7MTpn8UBqka/pyUTGSumgmziRw0DkLI5D0qd0/VJnquJozson4oHRBvyaoHhmFVgk6ofJe6LniOS35p/6vSK1W86yyf5OF72fDzmdjt8W3TSNhd81XBVYlh8Y4Jbki0VfF+UT8IOTy4bUPjYp74Pdi9RhBe+iTmR91kiUBkTVZsnnHctXOJMD8bks71fifA7Klh73I3VY6VijI6uvoracROLfmXllbY913+qyUsengbKCs6+siI6D/WhYsyLHJ/6unGT5il2TSfLtRhFbuiP2lQe1gY2GZUmVnW5XNlHv7Aa12Q6YvyXa+MZjFx3yrTdr16sJbBQsHzl5YgeIvfkukETQtbQWSPzfJavL+pZIX0Tl/WsB86uod/PI/yn1TnTtZlYydOUkKzdIyiTjG4XLz95utI4yX+l3VIp8KQDpsGSfc/YyyMMvpvm+XP5WZuIc0X8Phvbri/TO9uUCa5Dz/7pTgxUg3mA1WAECAdMWWQ1WgEDAtEVWgxUgEDD9A07I1SWdIYEDAAAAAElFTkSuQmCC\" width=\"37.5\" height=\"18\" style=\"width: 37.5px; height: 18px;\"\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: 115.525px 8px; transform-origin: 115.525px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003evector representing the control input. Feedback control seeks to stabilize this system with a control of the form \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHAAAAAkCAYAAABR/76qAAAEIklEQVRoQ+2aS6hNURjH752T10iJAQNKmXiVKAolMlAeMbgjj5ERxcDAgMLEyGNo4FUGUoqBsddEKQYoJUZIzPn/sr/Td9dde9uPs8/Z51ir/t1z9157rW9//++5zpmcSGOkNTA50tIn4ScSgSNuBInAROCIa2DExU8emAgccQ2MuPjJA5sTeFRLbBZ2CLPccr/0+abwRLgjLBWOCIeEhW7eM32+L5yvI0oisI7W4s9c0+XD2S3I2yM8jkz1807rPv9/qytGIrCu5mY+54mBuO2RpfHWK0IRwZUkSgRWUlfh5M8uNB7T56vBbCOPkHlQeN+PrROB/dDi3/z2zi21LCCIHLhXuC6cahIyQ3ETgf0h0LyL1d4KGzKS1ujvDWGRcCLilY13b0LgfO2+OpPgZT+tqvFbDX6BR9pyW7btXf3dJ0DqReGTcFyIFTSNJY0RCDGUu/OETcJi4UF2zW/ok/aC/5zAn3p/ayHIf7QVhEzIpNIsk+8gfUum8+XZs1yzcUEfWJt9eiE6zwMh8ZZgVkVFFVqQJW2S8vqSpsR6WGvTgVJq9U1NN448T5h87q5/0Wf6PMhD4WVaBHLoVuGDcFZYl61nRJFDNwqzMwJ7RVJRCLWwQMm7JBAEy7idbUKYOFlSMeNIIEXJuZz3rxOZvG73a10i4ZTAQQGDtNVzpiICizzMqioWjHlnST7HYtpT5zEY8y6BEMig6iQdVRlEv6/ZA0S3OcJOIRqG8wj0ZXEYrvy9mHdWEXZQc72S6+65Vg++iDz8212z5t2nibClKLP/G2cEeCEOEx15BPqyOBTce1+V/FdG8LbmtEWgD3femP1+eacyRe9aukDMI9BIIiGvFCwRhw1rl4qJtsgvq2hvzKGeqqaZIgeaJk8egZb/rKexh3DtH4JVSXlhJe+lx62I8aEuNGYfqWjuV5S0MHLgR8HaksIiMUagtx5/pkcfQjU6V4CI0DvLyDdOBIZeFhpzSETsfDSmM8LvK4EenGKoME3FCPTuawkYxV8WOCIy67DYznz6l1ZOGspYxZDmeD3lGTNGzxEagxxJH1c0mL9KOCDQ59rXU8YTPHwXesVUjEBLoOb2NKp84bhbIBfaoS0WZY0nPUqZhnVIum5lWx8i8wqVf4VDvBjwPAbBkZu1DL5AIodCHOeq01qKGIG+giIHQo59OelDIK7NMRsnBGWOilrR4pAWDYkJawUvVlgB+7bCjuDwTob/Etj3g9xn7lRGdm/9vBBK4mQ8FC4J5rIs+lrgqAgCz4QLDkmhg9yWMBf+LIL9adrvOX1YzcCZaDhsrh2bEYJnkKNrFoLz7qcf9g6S+Tb2avJ1UhvypDUraiARWFFhXZueCOwaIxXlSQRWVFjXpicCu8ZIRXkSgRUV1rXpicCuMVJRnkRgRYV1bfofpXDdJZDOy+4AAAAASUVORK5CYII=\" width=\"56\" height=\"18\" style=\"width: 56px; height: 18px;\"\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: 24.8917px 8px; transform-origin: 24.8917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, where \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eK\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: 18.6667px 8px; transform-origin: 18.6667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is an \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAAAkCAYAAADB7MdlAAADe0lEQVRoQ+2YO6xNQRSG7+0lHp2GBAUJIfFMRCIiJEIU4tXdyqPQIaEQFUKhUHhUokKrolB7RIGCgpaKEHr+72aWrDt39mPtncgp5iR/9tl7Zs2s+faateac6an66U1gunfP2nGqwgoEQYVVYQUIBLrWyKqwAgQCXWtkVVgBAoGuNbIqrACBQNdJiaxT8nmFdD7gO13vSs+lR0G7Qd0nAdZmef4qeX9P15M9VwKgI9JvaZf0uqfd4G6TAAvniazbAWAe1DnZ3RlMIGBYgrVS9mi3tF5aJr2TjqZxL+h6RloqfZTWuPnoczO1PdN1b8CXvsCGgloiXzZJG6UN0vLk27Z0xffL0mqpGK1NsBjUDBnrmISTiEl+SnvSJL5th569L7T1ZdYFbCgo5me7H5YOJCA8uyhdTevC9yfSieTsS10N5Oyjtm3oHQOQbZPT+g7Mp2nQLbqeTd+ZnKi0NiKLCIt8moCNAeXnv64bti6fVdKV9J11fZf+pPt5O6MN1gcZEZIQfistkmxAm/Crnt2SdkrH02TWRigDGQeinxwYc1syH5ujXmisrWld93WdkfYlP3nRnxy8ObmwCRb7+5sjvNANyGMih21IzuKzX/qcvpsz0ZyVA/XAaAP+WFCM4yNnne7ZfuY7eethcoSos+ezj5pgeSOi56DkS/Mv3S9Ig1rOssWaM5YPcgiRe4tubMbCZwy/Lu5z322r54WrFZYZ0emG5A+L/lyUL4Bo87lszNnH+2CAI+ew0kvhEGsJvAT/i9qp8vmaW2GZEVG1VvJ5xydIkrsH4nNZbheJqDyZYxs5hzXNZetiS3N88NvM56tiYSptw64TtU+Qc0qrJre2xynkI4Csb1PV6zpWdM3lYZSiivMjlbEUII2R1RY5PvGXcpLlK6omlYSwx4m+FbHreDAGmMFg4aXIsaJlIEkpi6V/vztLkWVJlSS3PVuodzavFj5f0cZvPKrokN96bVVvKDCDUYocHwS86DfSA8lX+XnV0BuVkpyvFjlI/+Z4Oz8kO5d1bZGuiMrthwCzCl5KEf5F4ztHihlpzoE6jyzvRJ68cbhtQivLJE+S8bWe288cjZ6jzFfsDuULy+h6GJYi8hfgD+GXSuNN0r8OOB/99wBgQ+y6Ir3YPimwBjn/v40qrADxCqvCChAIdK2RVWEFCAS61siqsAIEAl3/AjF16yVFGsuNAAAAAElFTkSuQmCC\" width=\"37.5\" height=\"18\" style=\"width: 37.5px; height: 18px;\"\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: 57.175px 8px; transform-origin: 57.175px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e matrix defined by a user. The closed-loop system can be represented by \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-15px\"\u003e\u003cimg src=\"data:image/png;base64,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\" width=\"59.5\" height=\"35\" style=\"width: 59.5px; height: 35px;\"\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: 150.917px 8px; transform-origin: 150.917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and is asymptotically stable if and only if all the eigenvalues of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACcAAAAoCAYAAAB99ePgAAACM0lEQVRYR+1WPS9EURDd7VVUFCLRqCQKH4loRKhUCiIKhQSFUkIjW5HwA3xEoVBQq4joiI9Gp6GgoBPiB3BOckeuZ/fNfbPv7W7xXnJy7+57d+Zk7pyZKRYa+Ck2MLdCTs56O3nk8sh5ERjF/hToA+6skdHOWXPuGob7gSngWHNifW8htwBn287hHtZ5q3PtXFJyzTD4DDQ5wzdYBzQn1vdJye3C0bRH7g37Nqtz7VwScp0w9ujy7Mgz3IL9u+bI8j4JOYrgExgDXoFW55C/zyzOtTOh5CZhaB8YBlg6RK20vwjsaI4s70PJMVIngChzE/tl5zAzxYaQI5EZYAh4coT8cpKZYjVyFME9sA5seFcjHYJ/ZaZYjRyrfzcwCEQV+e2RzUSxceT86Gj5XI1i6WfCCe5Pn44j94ADLwAdl3uqVSy7zYpTOzvOvz5diZwkfNzUkZZiKw4R5chJ/7yKiRojueqEwn01ik1ETiKizWppKTaYnPRPtqNKuSb514vNraJY2mMZ+gA6gHagBPgzYBA5Xucl0AWEVP2omqNtjOQvgDmPjPRkP/lVcnR0AEgzZ0C2AI5I0hUkSPx2BGDX8L+PnqFTPv68R6HNAkuAlA2VnDhOa5X0CLmBmpOTK29IciKWkL5b88gxPb6AcpWfedcDyPhVF3J+kaa4zp2QxrH6g0RdyDF6nKBLAMsTr/gQkAogvVWGVnaZNeB35NdGprTUa7KTkzOFDYfyyOWRs0bAeu4HvRx9Kc8YqwgAAAAASUVORK5CYII=\" width=\"19.5\" height=\"20\" style=\"width: 19.5px; height: 20px;\"\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: 78.575px 8px; transform-origin: 78.575px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e have negative real parts.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; 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: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\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: 385px 21px; text-align: left; transform-origin: 385px 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: 92.4333px 8px; transform-origin: 92.4333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that takes an \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eA\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: 3.88333px 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eB\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: 17.5px 8px; transform-origin: 17.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eK\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: 250.1px 8px; transform-origin: 250.1px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and returns a logical scalar that is true when the system is asymptotically stable and false when it is not stable.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function tf = isStable(A, B, K)\r\n  tf = true;\r\nend","test_suite":"A = [-1.0360,0.9407;1.8779,0.7873];\r\nB = [-0.8759;0.3199];\r\nK = [-4.1353,-5.8468];\r\nassert(isStable(A, B, K))\r\n%%\r\nA = [-0.5583,-0.5700;-0.3114,-1.0257];\r\nB = [-0.9087;-0.2099];\r\nK = [1.4549,10.7761];\r\nassert(~isStable(A, B, K))\r\n%%\r\nA = [-1.6989,-0.1178;0.6076,0.6992];\r\nB = [0.2696;0.4943];\r\nK = [-2.7019,-0.5485];\r\nassert(~isStable(A, B, K))\r\n%%\r\nA = [-1.4831,-0.4470;-1.0203,0.1097];\r\nB = [1.1287;-0.2900];\r\nK = [-0.4390,-0.3865];\r\nassert(~isStable(A, B, K))\r\n%%\r\nA = [1.4702,0.8123;-0.3268,0.5455];\r\nB = [-1.0516;0.3975];\r\nK = [14.3992,56.0007];\r\nassert(isStable(A, B, K))","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":4910100,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":8,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2025-07-17T16:26:09.000Z","updated_at":"2026-04-03T11:32:22.000Z","published_at":"2025-07-17T16:26:09.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\u003eLinear timeiinvariant systems can be represented by the differential equation \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\frac{dx}{dt} = Ax+Bu\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, where \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is an \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\\\\times n\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e matrix, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is an \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\\\\times 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003evector representing the system state, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eB\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is a \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\\\\times m\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e matrix, and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eu\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is a \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003em\\\\times 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003evector representing the control input. Feedback control seeks to stabilize this system with a control of the form \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eu = -Kx\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, where \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eK\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is an \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003em\\\\times n\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e matrix defined by a user. The closed-loop system can be represented by \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\frac{dx}{dt} = A_\\\\mathrm{cl} x\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, and is asymptotically stable if and only if all the eigenvalues of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eA_\\\\mathrm{cl}\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e have negative real parts.\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\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\u003eWrite a function that takes an \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eB\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eK\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and returns a logical scalar that is true when the system is asymptotically stable and false when it is not stable.\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":59651,"title":"Orthogonalize a 2x2 matrix using the Gram-Schmidt process","description":"Use the Gram-Schmidt process to orthogonalize two linearly independent column vectors. Return two output column vectors that are orthogonal and unit length. One example of two linearly independent vectors is u1=[1;1;0] and u2=[2;3;4];","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: 42px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407.5px 21px; transform-origin: 407.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: 384.5px 21px; text-align: left; transform-origin: 384.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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eUse the Gram-Schmidt process to orthogonalize two linearly independent column vectors. Return two output column vectors that are orthogonal and unit length. One example of two linearly independent vectors is u1=[1;1;0] and u2=[2;3;4];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [q1,q2] = gram_schmidt2(u1,u2)\r\n    q1=u1;\r\n    q2=u2;\r\nend","test_suite":"%%\r\nu1=[1,1,0]';\r\nu2=[2,3,4]';\r\n[q1,q2] = gram_schmidt2(u1,u2);\r\nassert(-0.001 \u003c= dot(q1,q2) \u0026\u0026 dot(q1,q2) \u003c= 0.001)\r\nassert(0.99 \u003c norm(q1) \u003c 1.001)\r\nassert(0.99 \u003c norm(q2) \u003c 1.001)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":4078801,"edited_by":4078801,"edited_at":"2024-02-09T20:59:08.000Z","deleted_by":null,"deleted_at":null,"solvers_count":13,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2024-02-09T20:18:20.000Z","updated_at":"2026-02-20T13:59:09.000Z","published_at":"2024-02-09T20:26:08.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\u003eUse the Gram-Schmidt process to orthogonalize two linearly independent column vectors. Return two output column vectors that are orthogonal and unit length. One example of two linearly independent vectors is u1=[1;1;0] and u2=[2;3;4];\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":973,"title":"Partial pivoting for Gauss Elimination","description":"Write a function to implement partial pivoting for Gauss elimination, given the pivot element.","description_html":"\u003cp\u003eWrite a function to implement partial pivoting for Gauss elimination, given the pivot element.\u003c/p\u003e","function_template":"function Ab = PartialPivot(A,b,pivot)\r\n% A = m-by-n coefficient matrix\r\n% b = m-by-1 right-hand-side vector\r\n% pivot = pivot row and column\r\n% Ab = m-by-(n+1) Augmented matrix after pivot step\r\n  Ab = \r\nend","test_suite":"%%\r\nA = [0 2; 1 3];\r\nb = [4; 2];\r\nAb = [1 3 2; 0 2 4];\r\nassert(isequal(PartialPivot(A,b,1),Ab))\r\n%%\r\nA = [0 2 3; 4 6 7; 2, -3, 6];\r\nb = [8; -3; 5];\r\nAb = [A([2 1 3],:), b([2 1 3])];\r\nassert(isequal(PartialPivot(A,b,1),Ab))\r\n%%\r\nA = [4 6 7; 0 2 3; 0, -6, 5/2];\r\nb = [-3; 8; 13/2];\r\nAb = [A([1 3 2],:), b([1 3 2])];\r\nassert(isequal(PartialPivot(A,b,2),Ab))\r\n%%\r\nA = [0 2 5; 2 1 1; 3 1 0];\r\nb = [1; 1; 2];\r\nAb = [A([3 2 1],:), b([3 2 1])];\r\nassert(isequal(PartialPivot(A,b,1),Ab))\r\n%%\r\nA = eye(4);\r\nb = ones(4,1);\r\nassert(isequal(PartialPivot(A,b,3),[A,b]))","published":true,"deleted":false,"likes_count":2,"comments_count":4,"created_by":279,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":18,"test_suite_updated_at":"2012-10-10T03:30:19.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-10-08T00:42:34.000Z","updated_at":"2025-06-08T19:31:51.000Z","published_at":"2012-10-08T01:51:50.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\u003eWrite a function to implement partial pivoting for Gauss elimination, given the pivot element.\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":389,"title":"Column norms of a matrix","description":"Given a matrix M, return a vector y such that for each k\r\n\r\n    y(k)=norm(M(:,k))\r\n\r\n(y(k) is the Euclidean norm of the k-th column of M)\r\n\r\nEDIT: changed the test case so that proper handling of complex values is required.","description_html":"\u003cp\u003eGiven a matrix M, return a vector y such that for each k\u003c/p\u003e\u003cpre\u003e    y(k)=norm(M(:,k))\u003c/pre\u003e\u003cp\u003e(y(k) is the Euclidean norm of the k-th column of M)\u003c/p\u003e\u003cp\u003eEDIT: changed the test case so that proper handling of complex values is required.\u003c/p\u003e","function_template":"function y = your_fcn_name(M)\r\n  y = M;\r\nend","test_suite":"%%\r\nM = [1 2 3; 4 5 6; 7 8 9+2i];\r\nfor k=1:size(M,2)\r\n  y_correct(k)=norm(M(:,k));\r\nend\r\nassert(isequal(your_fcn_name(M),y_correct))\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":1,"created_by":1258,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":569,"test_suite_updated_at":"2012-02-24T14:50:55.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-23T09:33:39.000Z","updated_at":"2026-03-29T18:47:57.000Z","published_at":"2012-02-24T14:50:55.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 a matrix M, return a vector y such that for each k\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[    y(k)=norm(M(:,k))]]\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(y(k) is the Euclidean norm of the k-th column of M)\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\u003eEDIT: changed the test case so that proper handling of complex values is required.\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":44274,"title":"Calculate the sum of two polynomials","description":"Calculate the sum of two polynomials if they are written in notation with their coefficients.\r\nexample:\r\n()  +  ()  =  \r\na=[3 4 5];\r\nb=[1 4 7 6];\r\n\r\noutput =[1 7 11 11];","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: 172.733px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 86.3667px; transform-origin: 407px 86.3667px; 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: 276.5px 8px; transform-origin: 276.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCalculate the sum of two polynomials if they are written in notation with their coefficients.\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: 28px 8px; transform-origin: 28px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eexample:\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: 2.5px 8px; transform-origin: 2.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e(\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,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\" style=\"width: 79px; height: 19px;\" width=\"79\" height=\"19\"\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: 17px 8px; transform-origin: 17px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e)  +  (\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,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\" style=\"width: 108.5px; height: 19px;\" width=\"108.5\" height=\"19\"\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: 14.5px 8px; transform-origin: 14.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e)  =  \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,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\" style=\"width: 123.5px; height: 19px;\" width=\"123.5\" height=\"19\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 81.7333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-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: 404px 40.8667px; transform-origin: 404px 40.8667px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 40px 8.5px; tab-size: 4; transform-origin: 40px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003ea=[3 4 5];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 48px 8.5px; tab-size: 4; transform-origin: 48px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eb=[1 4 7 6];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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 8.5px; tab-size: 4; transform-origin: 0px 8.5px; unicode-bidi: normal; 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: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 80px 8.5px; tab-size: 4; transform-origin: 80px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eoutput =[1 7 11 11];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function p = rwpadd(a,b)\r\n  p= a+b;\r\nend","test_suite":"%%\r\na=[3 4 5];\r\nb=[1 4 7 6];\r\ny_correct = [1 7 11 11];\r\nassert(isequal(rwpadd(a,b),y_correct))\r\n\r\n%%\r\na=[1 1 1 3 -2];\r\nb=[1 3];\r\ny_correct = [1 1 1 4 1];\r\nassert(isequal(rwpadd(a,b),y_correct))\r\n\r\n%%\r\na=[1];\r\nb=[1 2 3];\r\ny_correct = [1 2 4];\r\nassert(isequal(rwpadd(a,b),y_correct))\r\n\r\n%%\r\na=randi(10,1,5);\r\nb=[];\r\nassert(isequal(rwpadd(a,b),a))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":38144,"edited_by":223089,"edited_at":"2022-12-12T05:56:48.000Z","deleted_by":null,"deleted_at":null,"solvers_count":88,"test_suite_updated_at":"2022-12-12T05:56:48.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-08-02T18:19:55.000Z","updated_at":"2026-04-07T18:12:52.000Z","published_at":"2017-08-02T18:19:55.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\u003eCalculate the sum of two polynomials if they are written in notation with their coefficients.\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=\\\"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=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e3x^2+4x+5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e)  +  (\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex^3+4x^2+7x+6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e)  =  \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex^3+7x^2+11x+11\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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[a=[3 4 5];\\nb=[1 4 7 6];\\n\\noutput =[1 7 11 11];]]\u003e\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":974,"title":"Forward Elimination for Gauss Elimination","description":"Perform forward elimination for a given pivot column in the augmented matrix, Ab=[A,b]","description_html":"\u003cp\u003ePerform forward elimination for a given pivot column in the augmented matrix, Ab=[A,b]\u003c/p\u003e","function_template":"function Ab = ForwardEliminate(Ab,pivot)\r\n% Ab = m-by-(n+1) Augmented matrix after pivot step\r\n% pivot = pivot row and column\r\n\r\nend","test_suite":"%%\r\nA = [4 6 7; 0 2 3; 2, -3, 6];\r\nb = [-3; 8; 5];\r\nAb = [A,b];\r\nAb(end,:)=[0, -6, 5/2, 13/2];\r\nassert(isequal(ForwardEliminate([A,b],1),Ab))\r\n%%\r\nA = [4 6 7; 0 2 3; 2, -3, 6];\r\nb = [-3; 8; 5];\r\nAb = [A,b];\r\nAb(end,:)=[0, -6, 5/2, 13/2];\r\nAb2 = Ab;\r\nAb2(3,:) = Ab(3,:) + 3*Ab(2,:);\r\nassert(isequal(ForwardEliminate(Ab,2),Ab2))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":279,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":29,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-10-08T03:02:44.000Z","updated_at":"2025-12-07T18:23:27.000Z","published_at":"2012-10-08T03:02:44.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\u003ePerform forward elimination for a given pivot column in the augmented matrix, Ab=[A,b]\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":44530,"title":"Are you more familiar with iteration methods or Linear Algebra? Let's see together.","description":"Given a sum result *_x_* value of a *_N_* number of addends, build an array of _*N*_ elements _*y*_ such that the following equality is satisfied: _sum(y) = x_ .\r\n\r\nFor example if: x = 10 and N = 2, possible solutions for y are: [7 3], or  [8 2].\r\n\r\nMore formally if x = a and N = n it results: \r\n\r\ny = [y_1 y_2 y_3 ... y_n]\r\nwhere:  y_1 + y_2 + y_3 +...+ y_n = a\r\n\r\nImportant notice: All the elements in y must be *different from zero* and *different from each other* . On the other hand I will not take into account if they are _integers or decimal numbers_ .\r\n\r\nHint: You can use several approaches and the solution is not unique. For example you can think to approach with a iterative method or, if you are more accustomed with Algebra, by solving a linear system. This choice it's up to you.\r\n\r\nGood luck and enjoy with the solution ;)\r\n","description_html":"\u003cp\u003eGiven a sum result \u003cb\u003e\u003ci\u003ex\u003c/i\u003e\u003c/b\u003e value of a \u003cb\u003e\u003ci\u003eN\u003c/i\u003e\u003c/b\u003e number of addends, build an array of \u003ci\u003e\u003cb\u003eN\u003c/b\u003e\u003c/i\u003e elements \u003ci\u003e\u003cb\u003ey\u003c/b\u003e\u003c/i\u003e such that the following equality is satisfied: \u003ci\u003esum(y) = x\u003c/i\u003e .\u003c/p\u003e\u003cp\u003eFor example if: x = 10 and N = 2, possible solutions for y are: [7 3], or  [8 2].\u003c/p\u003e\u003cp\u003eMore formally if x = a and N = n it results:\u003c/p\u003e\u003cp\u003ey = [y_1 y_2 y_3 ... y_n]\r\nwhere:  y_1 + y_2 + y_3 +...+ y_n = a\u003c/p\u003e\u003cp\u003eImportant notice: All the elements in y must be \u003cb\u003edifferent from zero\u003c/b\u003e and \u003cb\u003edifferent from each other\u003c/b\u003e . On the other hand I will not take into account if they are \u003ci\u003eintegers or decimal numbers\u003c/i\u003e .\u003c/p\u003e\u003cp\u003eHint: You can use several approaches and the solution is not unique. For example you can think to approach with a iterative method or, if you are more accustomed with Algebra, by solving a linear system. This choice it's up to you.\u003c/p\u003e\u003cp\u003eGood luck and enjoy with the solution ;)\u003c/p\u003e","function_template":"function y = buildSumArray(x,N)\r\n  y = sum(1:N);\r\nend","test_suite":"%% Test Case 1\r\nx = 6;\r\nN = 3;\r\ny = buildSumArray(x,N);\r\ny2 = unique(y);\r\n\r\nassert(isequal(round(sum(y)*100)/100,x))\r\nassert(isequal(length(y),N))\r\nassert(isequal(length(y2),N))\r\nassert(sum(y == 0) == 0)\r\n\r\n%% Test Case 2\r\nx = 13;\r\nN = 5;\r\ny = buildSumArray(x,N);\r\ny2 = unique(y);\r\n\r\nassert(isequal(round(sum(y)*100)/100,x))\r\nassert(isequal(length(y),N))\r\nassert(isequal(length(y2),N))\r\nassert(sum(y == 0) == 0)\r\n\r\n\r\n%% Test Case 3\r\nx = 78;\r\nN = 11;\r\ny = buildSumArray(x,N);\r\ny2 = unique(y);\r\n\r\nassert(isequal(round(sum(y)*100)/100,x))\r\nassert(isequal(length(y),N))\r\nassert(isequal(length(y2),N))\r\nassert(sum(y == 0) == 0)\r\n\r\n\r\n%% Test Case 4\r\nx = 2689;\r\nN = 245;\r\ny = buildSumArray(x,N);\r\ny2 = unique(y);\r\n\r\nassert(isequal(round(sum(y)*100)/100,x))\r\nassert(isequal(length(y),N))\r\nassert(isequal(length(y2),N))\r\nassert(sum(y == 0) == 0)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":181340,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":30,"test_suite_updated_at":"2018-02-24T12:07:13.000Z","rescore_all_solutions":false,"group_id":677,"created_at":"2018-02-24T11:21:15.000Z","updated_at":"2026-04-02T13:09:38.000Z","published_at":"2018-02-24T11:49:30.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 a sum result\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\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e value of a\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\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\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e number of addends, build an array 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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e elements\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\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\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e such that the following equality is satisfied:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esum(y) = x\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\u003eFor example if: x = 10 and N = 2, possible solutions for y are: [7 3], or [8 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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMore formally if x = a and N = n it results:\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\u003ey = [y_1 y_2 y_3 ... y_n] where: y_1 + y_2 + y_3 +...+ y_n = a\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\u003eImportant notice: All the elements in y must be\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003edifferent from zero\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003edifferent from each other\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e . On the other hand I will not take into account if they are\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eintegers or decimal numbers\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\u003eHint: You can use several approaches and the solution is not unique. For example you can think to approach with a iterative method or, if you are more accustomed with Algebra, by solving a linear system. This choice it's up to you.\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\u003eGood luck and enjoy with the solution ;)\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":43301,"title":"Calculate inverse matrix in m by n matrix ","description":"  x=(1:10)'\r\n  y=roundn(2*x+7*rand(size(x)),-1)\r\n\r\na*x=y\r\n\r\nEstimate a using inverse matrix calculation. This is principle of linear regression.","description_html":"\u003cpre class=\"language-matlab\"\u003ex=(1:10)'\r\ny=roundn(2*x+7*rand(size(x)),-1)\r\n\u003c/pre\u003e\u003cp\u003ea*x=y\u003c/p\u003e\u003cp\u003eEstimate a using inverse matrix calculation. This is principle of linear regression.\u003c/p\u003e","function_template":"function a = reginv(x,y)\r\n  a =\r\nend","test_suite":"%%\r\n  x=(1:10)'\r\n  y=3*x\r\n  a=3\r\n\r\nassert(abs(reginv(x,y)-a)\u003c0.001)\r\n\r\n%%\r\n  x=(1:10)'\r\n  y=3*x+2\r\n  a=3.2857\r\n\r\nassert(abs(reginv(x,y)-a)\u003c0.001)\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":2,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":89,"test_suite_updated_at":"2018-07-19T15:35:54.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-10T09:36:59.000Z","updated_at":"2026-01-02T15:53:13.000Z","published_at":"2016-10-10T09:36:59.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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[x=(1:10)'\\ny=roundn(2*x+7*rand(size(x)),-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\u003ea*x=y\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\u003eEstimate a using inverse matrix calculation. This is principle of linear regression.\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":59656,"title":"Orthogonalize 3 column vectors using the Gram-Schmidt process","description":"Use the Gram-Schmidt process to orthogonalize three linearly independent column vectors. Return three output column vectors that are orthogonal and unit length. One example of three linearly independent vectors is u1=[1;1;0],  u2=[2;3;4], and u3=[3;5;1].","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: 63px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407.5px 31.5px; transform-origin: 407.5px 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: 384.5px 31.5px; text-align: left; transform-origin: 384.5px 31.5px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eUse the Gram-Schmidt process to orthogonalize three linearly independent column vectors. Return three output column vectors that are orthogonal and unit length. One example of three linearly independent vectors is u1=[1;1;0],  u2=[2;3;4], and u3=[3;5;1].\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [q1,q2,q3] = gram_schmidt3(u1,u2,u3)\r\n    q1=u1;\r\n    q2=u2;\r\n    q3=u3;\r\nend","test_suite":"%%\r\nu1=[1;1;0];\r\nu2=[2;3;4];\r\nu3=[3;5;1];\r\n[q1,q2,q3]=gram_schmidt3(u1,u2,u3);\r\nassert(-0.0001\u003c=dot(q1,q2) \u0026\u0026 dot(q1,q2)\u003c=0.0001)\r\nassert(-0.0001\u003c=dot(q1,q3) \u0026\u0026 dot(q1,q3)\u003c=0.0001)\r\nassert(-0.0001\u003c=dot(q3,q2) \u0026\u0026  dot(q3,q2)\u003c=0.0001)\r\nassert(0.999 \u003c= norm(q1) \u0026\u0026 norm(q1)\u003c= 1.0001)\r\nassert(0.999 \u003c= norm(q2) \u0026\u0026 norm(q2)\u003c= 1.0001)\r\nassert(0.999 \u003c= norm(q3) \u0026\u0026 norm(q3)\u003c= 1.0001)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":4078801,"edited_by":4078801,"edited_at":"2024-02-09T21:11:26.000Z","deleted_by":null,"deleted_at":null,"solvers_count":13,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2024-02-09T21:00:56.000Z","updated_at":"2025-05-10T15:00:29.000Z","published_at":"2024-02-09T21:11:26.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\u003eUse the Gram-Schmidt process to orthogonalize three linearly independent column vectors. Return three output column vectors that are orthogonal and unit length. One example of three linearly independent vectors is u1=[1;1;0],  u2=[2;3;4], and u3=[3;5;1].\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":58922,"title":"Find out the smallest number 9 times greater","description":"What is the smallest natural number where the result of moving the digit on the far right to the front of the number is a number 9 times greater?\r\nThe x value (input) isn't necessary, you only have to find out the final number\r\nThis is a problem made by Globant in its 20th anniversary. \r\nGive the solution in string format","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: 132px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 66px; transform-origin: 407px 66px; vertical-align: baseline; \"\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eWhat is the smallest natural number where the result of moving the digit on the far right to the front of the number is a number 9 times greater?\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThe x value (input) isn't necessary, you only have to find out the final number\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThis is a problem made by Globant in its 20th anniversary. \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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGive the solution in string format\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = smallestNumber(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = '10112359550561797752808988764044943820224719';\r\nassert(isequal(smallestNumber(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":289312,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":8,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2023-08-28T14:35:21.000Z","updated_at":"2025-05-12T12:38:53.000Z","published_at":"2023-08-28T14:35:21.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\u003eWhat is the smallest natural number where the result of moving the digit on the far right to the front of the number is a number 9 times greater?\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 x value (input) isn't necessary, you only have to find out the final number\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\u003eThis is a problem made by Globant in its 20th anniversary. \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\u003eGive the solution in string format\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":1299,"title":"How long do each of the stages of the rocket take to burn?","description":"A space rocket has 3 stages:\r\n\r\n- stage 1, s1;\r\n\r\n- stage 2, s2;\r\n\r\n- stage 3, s3.\r\n\r\nIf s1 burns 3 x as long as s2 which burns 2 x as long as s3 then how long did s3 burn if the total burn time was tt minutes? How long did s2 burn? s1?","description_html":"\u003cp\u003eA space rocket has 3 stages:\u003c/p\u003e\u003cp\u003e- stage 1, s1;\u003c/p\u003e\u003cp\u003e- stage 2, s2;\u003c/p\u003e\u003cp\u003e- stage 3, s3.\u003c/p\u003e\u003cp\u003eIf s1 burns 3 x as long as s2 which burns 2 x as long as s3 then how long did s3 burn if the total burn time was tt minutes? How long did s2 burn? s1?\u003c/p\u003e","function_template":"function s = rocketburntime(totaltime,r1,r2)\r\n  s=(s1,s2,s3);\r\nend","test_suite":"%% test #1\r\ntt=18; rate1=3; rate2=2;\r\ny_correct =[12,4,2];\r\nassert(isequal(rocketburntime(tt,rate1,rate2),y_correct))\r\n%% test #2\r\ntt=32; rate1=4; rate2=3;\r\ny_correct =[24,6,2];\r\nassert(isequal(rocketburntime(tt,rate1,rate2),y_correct))\r\n%% test #3\r\ntt=58; rate1=6; rate2=4;\r\ny_correct =[48,8,2];\r\nassert(isequal(rocketburntime(tt,rate1,rate2),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":4,"created_by":1103,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":462,"test_suite_updated_at":"2013-02-24T01:38:26.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-02-24T01:16:02.000Z","updated_at":"2026-04-03T03:39:40.000Z","published_at":"2013-02-24T01:38:26.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\u003eA space rocket has 3 stages:\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- stage 1, s1;\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- stage 2, s2;\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- stage 3, s3.\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\u003eIf s1 burns 3 x as long as s2 which burns 2 x as long as s3 then how long did s3 burn if the total burn time was tt minutes? How long did s2 burn? s1?\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":46031,"title":"Construct dimensionless parameters","description":"*Summary* \r\n\r\nWrite a function to construct dimensionless parameters from a list of variables, a matrix indicating their dimensions, and a vector identifying the variables to use to make the other variables dimensionless. More details are given in \"Problem statement\" below.\r\n\r\n*Introduction* \r\n\r\n_Dimensional analysis and the Buckingham π theorem_\r\n\r\nThe \u003chttps://en.wikipedia.org/wiki/Buckingham_π_theorem Buckingham π theorem\u003e is a key result exploited in \u003chttps://en.wikipedia.org/wiki/Dimensional_analysis dimensional analysis\u003e in engineering, physics, and applied mathematics. It states that if a problem involves _m_ variables and _n_ physical dimensions (e.g., length, time, mass), then the problem can be described with _m-n_ dimensionless groups, called π groups. In \u003chttps://en.wikipedia.org/wiki/Buckingham_π_theorem other words\u003e, the \"physics does not depend on a specific unit system\".\r\n\r\nTo find the dimensionless groups, we follow these steps:\r\n\r\n# Choose _n_ variables that cannot form a dimensionless group by themselves\r\n# Form the product of one of the remaining _m-n_ variables with the variables in step 1, each raised to different exponents\r\n# Determine the exponents that would make the product (or group) dimensionless\r\n# Repeat steps 2 and 3 for the remaining variables\r\n\r\n_Example_\r\n\r\nSuppose we are interested in the drag _F_ (i.e., a force) on a cylinder of length _L_ and diameter _d_ immersed in a fluid of density _ρ_ and dynamic viscosity _μ_ flowing at velocity _V_. Because the problem involves 6 variables and 3 dimensions (length, time, and mass), it can be described with 3 dimensionless groups. For step 1 above, choose _V_, _d_, and _ρ_. We could choose other lists of 3, but notice that we could not choose _V_, _d_, and _L_ because _d_ and _L_ form a dimensionless group themselves (and we have no way of removing mass dimensions.)\r\n\r\nFor step 2, start with the drag _F_. Following the step, we get\r\n\r\n\r\n π_1 = F V^a1 d^a2 ρ^a3\r\n\r\nwhere _a1_, _a2_, and _a3_ are exponents. Because π_1 must be dimensionless and because the dimensionless of _F_, _V_, _d_, and _ρ_ are ML/T^2, L/T, L, and M/L^3, respectively, we can solve a system of three equations to find the exponents and write \r\n\r\n π_1 = F V^{-2} d^{-2} ρ^{-1}\r\n\r\nwhich is related to a quantity in fluid mechanics called the drag coefficient. We then repeat steps 2 and 3 with the two remaining variables and find\r\n\r\n  \r\n π_2 = L d^{-1}   and   π_3 = μ V^{-1} d^{-1} ρ^{-1}\r\n\r\nor a geometric ratio and the inverse of the \u003chttps://en.wikipedia.org/wiki/Reynolds_number Reynolds number\u003e.   \r\n\r\n*Problem statement*\r\n\r\nWrite a function that constructs dimensionless parameters from a cell array |vars| with the variable names, a matrix |dims| with the exponents for the dimensions in rows (length, time, mass) for each variable in the columns, and a vector |indx| indicating the variables chosen in step 1 above. The function should return a cell array |Pi| with the dimensionless groups in strings and a vector |a| of size |m x m-n| with the exponents of the normalizing variables. For the example above, the input could be specified as\r\n\r\n\r\n vars = {'F', 'V', 'd', 'L', 'rho', 'mu'};\r\n indx = [2 3 5];\r\n dims = [ 1  1  1  1  -3  -1;\r\n         -2 -1  0  0   0  -1;\r\n          1  0  0  0   1   1];\r\n  \r\nand the output would be\r\n  \r\n Pi = {'F V^{-2} d^{-2} rho^{-1}', 'L d^{-1}', 'mu V^{-1} d^{-1} rho^{-1}'} \r\n a  = [-2   0  -1;\r\n       -2  -1  -1;\r\n       -1   0  -1]\r\n\r\nFurther specifications:\r\n\r\n* If the variables chosen in |indx| will not work (i.e., the number is incorrect or some form a dimensionless group themselves), return |a = NaN| and |Pi = {'Error in choosing normalizing variables'}|.\r\n* If the exponent of a variable is zero, omit the variable from the string.\r\n* If the exponent of a variable is one, keep the variable but do not show the exponent.\r\n* If the exponent of a variable is a positive integer, indicate it with a caret (^) and no braces.\r\n* If the exponent is anything else, indicate it with a caret and braces. \r\n* If the exponent is not an integer, express it as a fraction. Hint: MATLAB has a function that will help. \r\n\r\n","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: 1429.07px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 714.533px; transform-origin: 407px 714.533px; 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: 31.9px 7.8px; transform-origin: 31.9px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eSummary\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: 376.783px 7.8px; transform-origin: 376.783px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to construct dimensionless parameters from a list of variables, a matrix indicating their dimensions, and a vector identifying the variables to use to make the other variables dimensionless. More details are given in \"Problem statement\" below.\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: 40.8167px 7.8px; transform-origin: 40.8167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eIntroduction\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: 133.45px 7.8px; transform-origin: 133.45px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eDimensional analysis and the Buckingham \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\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: 27.6167px 7.8px; transform-origin: 27.6167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e theorem\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 12.0667px 7.8px; transform-origin: 12.0667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Buckingham_%CF%80_theorem\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eBuckingham π theorem\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: 82.0833px 7.8px; transform-origin: 82.0833px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is a key result exploited in\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Dimensional_analysis\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003edimensional analysis\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: 115.167px 7.8px; transform-origin: 115.167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e in engineering, physics, and applied mathematics. It states that if a problem involves\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003em\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: 43.5833px 7.8px; transform-origin: 43.5833px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e variables and\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\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: 174.633px 7.8px; transform-origin: 174.633px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e physical dimensions (e.g., length, time, mass), then the problem can be described with\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE0AAAAkCAYAAADM8rciAAAB1UlEQVRoge2XUY3DMBBEh0MYlEAIFEERhEEYhEEpHIZCKIdQCIZQ6H3Yo0z2tj27vatcaZ9kqc3Iye56PXGAIAiCIAiCIAiCIAg+jh7ACcAg17r8f8qahdrx36N7jQ4pxjH/Jj1S/JO5/pAjgDOAm4xRbrgYrRdtluuraK3QAbhin8Mi2gX73ObaB2jhemwFO+VB7STa5GgtojGyo2aknPmbenG3AWlFuBIsCrfcIDc9/KK1iMbYI+U6is7cr7U3XvPEC1Ll1aPYhXO+sXreF/ZtXwJ98JVRs0Aa44SUo6JdWEwvE6/OZLbvkgNQ6BfniudxZV8ZNf7JGJc87IvgmXtilInWDDvRVvPAg2g1fvYXnVbqPVqUG36+5SfJrQpdeVtt9YPxgVZloG9EG8LuEmDL3dPuop3kGSH9wFsJatUG+ka0IawPau4DKtBu8SbSD7yVoEYPbO3tqUWx5g/sjyLcKUU5aCfZLaZ+YL3gYDQedlvaploUryHsThlQuE31qGFRk7TF0IB49mntU4pHJS9+YMv9jFSwomOTdpK3EjxqeJ7FgjKo1goGbPZxz3Pt51XRLjlie4V7UPMK0mXNfgC3xKP4ge1jveolEARBEARBEAQfyzelOuHRDH9yPgAAAABJRU5ErkJggg==\" alt=\"m-n\" style=\"width: 38.5px; height: 18px;\" width=\"38.5\" height=\"18\"\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: 93.7667px 7.8px; transform-origin: 93.7667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e dimensionless groups, called \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\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: 33.0667px 7.8px; transform-origin: 33.0667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e groups. In\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Buckingham_%CF%80_theorem\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eother words\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: 96.65px 7.8px; transform-origin: 96.65px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, the \"physics does not depend on a specific unit system\".\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: 174.267px 7.8px; transform-origin: 174.267px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eTo find the dimensionless groups, we follow these steps:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003col style=\"block-size: 102.167px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: decimal; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 391px 51.0833px; transform-origin: 391px 51.0833px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 24.1333px 7.8px; transform-origin: 24.1333px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eChoose\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 201.117px 7.8px; transform-origin: 201.117px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e variables that cannot form a dimensionless group by themselves\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 40.8667px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 20.4333px; text-align: left; transform-origin: 363px 20.4333px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 126.8px 7.8px; transform-origin: 126.8px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eForm the product of one of the remaining\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE0AAAAkCAYAAADM8rciAAAB1UlEQVRoge2XUY3DMBBEh0MYlEAIFEERhEEYhEEpHIZCKIdQCIZQ6H3Yo0z2tj27vatcaZ9kqc3Iye56PXGAIAiCIAiCIAiCIAg+jh7ACcAg17r8f8qahdrx36N7jQ4pxjH/Jj1S/JO5/pAjgDOAm4xRbrgYrRdtluuraK3QAbhin8Mi2gX73ObaB2jhemwFO+VB7STa5GgtojGyo2aknPmbenG3AWlFuBIsCrfcIDc9/KK1iMbYI+U6is7cr7U3XvPEC1Ll1aPYhXO+sXreF/ZtXwJ98JVRs0Aa44SUo6JdWEwvE6/OZLbvkgNQ6BfniudxZV8ZNf7JGJc87IvgmXtilInWDDvRVvPAg2g1fvYXnVbqPVqUG36+5SfJrQpdeVtt9YPxgVZloG9EG8LuEmDL3dPuop3kGSH9wFsJatUG+ka0IawPau4DKtBu8SbSD7yVoEYPbO3tqUWx5g/sjyLcKUU5aCfZLaZ+YL3gYDQedlvaploUryHsThlQuE31qGFRk7TF0IB49mntU4pHJS9+YMv9jFSwomOTdpK3EjxqeJ7FgjKo1goGbPZxz3Pt51XRLjlie4V7UPMK0mXNfgC3xKP4ge1jveolEARBEARBEAQfyzelOuHRDH9yPgAAAABJRU5ErkJggg==\" alt=\"m-n\" style=\"width: 38.5px; height: 18px;\" width=\"38.5\" height=\"18\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 191.25px 7.8px; transform-origin: 191.25px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e variables with the variables in step 1, each raised to different exponents\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 247.017px 7.8px; transform-origin: 247.017px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eDetermine the exponents that would make the product (or group) dimensionless\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 150.933px 7.8px; transform-origin: 150.933px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eRepeat steps 2 and 3 for the remaining variables\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ol\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: 27.2333px 7.8px; transform-origin: 27.2333px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eExample\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 105px; 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 52.5px; text-align: left; transform-origin: 384px 52.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: 118.267px 7.8px; transform-origin: 118.267px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSuppose we are interested in the drag\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eF\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: 111.633px 7.8px; transform-origin: 111.633px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (i.e., a force) on a cylinder of length\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eL\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: 42.8px 7.8px; transform-origin: 42.8px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and diameter\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ed\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: 70.4px 7.8px; transform-origin: 70.4px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e immersed in a fluid of density\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\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: 70.0167px 7.8px; transform-origin: 70.0167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and dynamic viscosity\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\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: 56.8px 7.8px; transform-origin: 56.8px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e flowing at velocity\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eV\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: 191.783px 7.8px; transform-origin: 191.783px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Because the problem involves 6 variables and 3 dimensions (length, time, and mass), it can be described with 3 dimensionless groups. For step 1 above, choose\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eV\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e,\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ed\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: 15.5667px 7.8px; transform-origin: 15.5667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\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: 16.2px 7.8px; transform-origin: 16.2px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. We could choose other lists of 3, but notice that we could not choose\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eV\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e,\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ed\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: 15.5667px 7.8px; transform-origin: 15.5667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eL\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: 28.4px 7.8px; transform-origin: 28.4px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e because\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ed\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: 13.6167px 7.8px; transform-origin: 13.6167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eL\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: 70.0167px 7.8px; transform-origin: 70.0167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e form a dimensionless group themselves (and we have no way of removing mass dimensions.)\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: 91px 7.8px; transform-origin: 91px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor step 2, start with the drag\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 4.28333px 7.8px; transform-origin: 4.28333px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eF\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: 84.8px 7.8px; transform-origin: 84.8px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Following the step, we get\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 26px; 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 13px; text-align: left; transform-origin: 384px 13px; 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: 13.6px 7.8px; transform-origin: 13.6px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e       \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,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\" alt=\"pi_1 = F V^{a1} d^{a2} rho^{a3}\" style=\"width: 102px; height: 26px;\" width=\"102\" height=\"26\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42.8167px; 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 21.4167px; text-align: left; transform-origin: 384px 21.4167px; 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: 19.0667px 7.8px; transform-origin: 19.0667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ewhere\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 7.78333px 7.8px; transform-origin: 7.78333px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea1\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e,\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 7.78333px 7.8px; transform-origin: 7.78333px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea2\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: 15.5667px 7.8px; transform-origin: 15.5667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 7.78333px 7.8px; transform-origin: 7.78333px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea3\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: 79.35px 7.8px; transform-origin: 79.35px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e are exponents. Because \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB8AAAAoCAYAAAAG0SEsAAABCUlEQVRYhe2WUQ2EMAyGPw84wAAGUHAKcDAHOMACGpBwHrCABixwD7ShtwMCt+Verl/SBDq2f/SnC+A4juM4P6YEGqC9EFUu0QLogeVGlLmER2ACnmbxp8Qo95PJ9TmEkcWCXFdGWAmSa3MJKgXv3mnpg8lNksvm8dFGYj+1EtOF+TXw+FZcy2tL3kmuO5lXAsOF507R8lpvZ8nVB3Nq1k0niddsJVdvH3I/s1pyRpsiri02mtywk+vY7++vxK1fC+vppqgN+rGFaCNJ4rbU8RsSjWkceX9bvDGLznz2sa1I3PvJ4rB+VIF9HwsZaw/Gk8Vz4eL/J66H1PBL0ZKtIzQaMv3lOI5zmxdP4XNErSZ5SAAAAABJRU5ErkJggg==\" alt=\"pi1\" style=\"width: 15.5px; height: 20px;\" width=\"15.5\" height=\"20\"\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: 180.9px 7.8px; transform-origin: 180.9px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e must be dimensionless and because the dimensionless of\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eF\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e,\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eV\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e,\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ed\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: 15.5667px 7.8px; transform-origin: 15.5667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\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: 14px 7.8px; transform-origin: 14px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e are \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF4AAAAnCAYAAACG//9nAAAC50lEQVRoge2aXZWDMBBGPw84wMAaQAEKcFAHOKiFakACHrCAhlroPoQ5HYaZkISyZHdzz8lLofm5JJMwLVAoFAqFQiGGLwANgPrqjvwXOgBPAC9W7igPAAAww83IT9OKulu8H8LjhPZ+FSSjOqHuCdsH2sKJ322zhotNsqQslcqoq1muW9eonDErH1jPPl8fQwv1szfapJDjFd8sFcxYx6kpYnDEXdRB8Y462MNJkPc8l2tdQps+qqXuln3WKO3HlnGn3Recz2DkJhEzA2mQUrpGf6CdGGjj45D4Ee+VqPVLfq9i1+U1zhf8Y1cZsRYyRHy3w3Zm3Ix7+azzDeIoA7YC+qVNLZT6xBMPzzVef9SeMmI7a0Nj/QwXnnIRX0FfTT3sUBEivvFc00JbECPcLOHyQ5YM7eQ35CP+Bj3OdrDFhIgH7EgwwB6zFxIvY/DeshnhBkmzLAfxk6d9i1Dx1neTz+4kXm6Uvllfi3tyEE99ij0Sp4rvoK+CGoGxnsQD62MfzWYN2mxokDmIv2P/yKeRIr6DHtKqmD5w8TRrfBIptPAlloP4GWnvBLHiaRwTnDtenogIdVw8sJ31Vkf5yeFq8VR3SoogRnwF50oK5yW4D1K8fMuTp4EZ2+V0tXiZIojhyOZ6CCmePqPO8DQCvTDJh3G1+KRz9EJW4q1ZP0HP51wpXksRxJCVeGCdQBvwFqeJvVK8liKIITvxMg/DX5gkZ4qvYZ9WrBRBDNmJB7ZpY2tmnSnet3FaKYIYshQvO2W9FZ4lntKt1sY5wf5hIpTLxFOGUYOnEXzHtRDxLdYD3DvvUkbQeuCpKQLJJeJ5o5Yw+oXJiqMyuTZhK4NepeWe0SvljnWq2ZoUvedaKDW24TQp0xhKB/vNSy7rGnps99XBw1e/c99esTbW1BQB4CbRXrtHQ9ifhGL/Gf8iKHh4IO4nysKHOJIiKCRCf1Yq/DADyl/lfpxPpAgKCTQ4fnYvFAqFv8Y3hk7O7aav8lkAAAAASUVORK5CYII=\" alt=\"ML/T^2\" style=\"width: 47px; height: 19.5px;\" width=\"47\" height=\"19.5\"\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: 38.5px 7.8px; transform-origin: 38.5px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, L/T, L, and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEwAAAAnCAYAAAClpK6yAAACoklEQVRoge2ZW3HDMBAAl4MZmEAJBEEQhEEZhEEoBEMhmEMoGEMopB/yjZWzHr6z3TaNd0bTaVPrsZLOOgV2dnZ2dv4Lh6G0v92Rv84JuAOPodyBz1/t0UJawiC24AD0w0/5XeS97Eq7AN1GdXdAk2jvARxrD7eM+zguHtNNpq5D6aEMPWHbCLl6pXw42og5E4RpkRMOwz/3jPv5AdwcjcosxeUy1G/hwLTzZ+CaqP8+fHZiGT2OGBYHwQe2WWsSz1+sHRi4Al+Zz2QlePqYohnaunnq6lRncp1OcWI6+963zp18LJHVJ6trCUfCGOP6TKGoY7pK5lbQE2ZpqbAjZRFrChNaxr6bdkVHMB5Lm1PBkVHQUmFfhC2ZYwthMIYUU+wWYTpO1N4cHWGFNSwTJs+XYslWwiCMwyVMB/DSKmvV/ywRdiKIL7G1MNeWhOdXuKyeFFeeg+USYTfqR5A1hLVMxyMTb3pTxsKkgtLgZQvFMccrTNqrvWTWEBbnjg1j0Def5WJhMF1lGol18ax4hZ2ZFz/WEHYijFXGK+LMaGFx51J5Vs803/MK06lQji1jmBktTP6WSpfkoKoleoR9MDOP4wWE5VbZjfQW8ggrpUKaPy8MnhPzL8ZOp4R4hJVSIc1LCNN5YnxQ1ViF1VIhjVdYy/IbjQk5YTC9/skd8KzCaqmQxivsamxnFiVhcbpUyuotwuQcZ7lg9AiTl8rcbT8buXFIEadLpZmyCJuTCmkk0RdhtTer3Nebr25qxCsoN1C5Uc2lDzppv1U6ac3dGqZ3dt3Qri4Xnq+bPDfISeJTry56CbekB1iqI7fN56ZCwrnSRq2sHvB/mk9WnPV3wPWlw7tiSYV2CHHQ8gXL23PnHwThn8KaCr09ckba2dnZ8fANorRmT/lyAUsAAAAASUVORK5CYII=\" alt=\"M/L^3\" style=\"width: 38px; height: 19.5px;\" width=\"38\" height=\"19.5\"\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: 269.8px 7.8px; transform-origin: 269.8px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, respectively, we can solve a system of three equations to find the exponents and write\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21.8167px; 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.9167px; text-align: left; transform-origin: 384px 10.9167px; 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: 13.6px 7.8px; transform-origin: 13.6px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e       \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANcAAAAqCAYAAAAgcc5yAAAFVklEQVR4nO2c/ZHaMBDFXw/ugAbcABVcBXRAB3RAC9RwJdADLVBDWkj+EC88dJIlWxISyf5mPJMBYhZpv7U+wDAMwzAMwzAMwzCMmkwA9o9rVCjf1FuQBSYAc28hjDGYAFwB/JbrDuCrp1AeZ7zK9wvAEeMZ2RFOtnNvQYwxuAE4wSnqDsAFTwUewQOfAXzDyTbBKTCN7NBRLmUPJ+cNTi4zLgNfcIrrQyU5vVecH0xwRu7DSHZ9rzhJTjDj2oTWJFsun6XPhiLG0vdv5QAXEXxqKMkMZ7w17uGzh5PvVnDvFphxbYTK7ef/3OSrd+n7IQ+7D3yOtU5I4afHe/p/rmiTulFJ1qZdTCt/oW3qRuO6NLh3CWZcFVCDOC58LrXYO+9eOU2EA541UauC/vvxHVvvz9/9G2FHUQrrrpGaLoAZVzEzXg0iFTlSSqBePkdZqPitFIt1Tkm9xeh+ryLRT5gdjIYZVyGMHLnKk/LemualFJqRLqRYM8pqQHJCeS0T6prtVsoXi5pMCWtH7bU1data9b+GkSM3519KG4HXFCp1PxpiSLH8+m3pihnPDOcwShRXU12Nrvo7c66QDNNDvhZ1Jo029wplDmZchaSK9R3W1RkaCZciBje/VXuc6WBpjaS/p3Z0uWKcs60Q1YwrN8y3KGh74ddbsQiyRgHUYy5FjTva1TATnGGHIkJOlNBUk5G9dk10QTgLWBPFNHVu0QwqNq4D3Cbnhs+aIbzknGnpDCkXnQ4IRRl67bWkDLZld4yGFXIIx8jrwOs0B6cotA1fM8JeEE6Z58jrPkc4nf3Gs9nCMaWaRlZkXFzM3Ku2p13z3bErNJGQi9Y1Fzhj/YJbVK7Nlvurs/KbDUzXWp3pXB/398/pbghPRwBPJ3LDq3KykRH6HVuhwvrycS9SzvIS+Jw6yZr1Eb9r9V7pjBeLVjUeLnjLYi60wGuvEo/qNwV4TzWOLTWBGq0fnbhhLdKYA5bXKpSGUZ5QCsvfETPKtcwJ+VJKTFn9PZnwuo+la7uDWyvK9Y349MsPODBJ6E1UUbmwIz+yUMIXXo3Lh+nGlo3STpo6J9Z4qY7ju9BmRUhxGLlKsoNaMDrFar9UKt4N5tUMtYxkOR7rU5930bGn0IYdI6/noGmKemOmZyOgLfZQ9Ndo0Lujx1R6ydkvOcpu0HtpSkjlSIXpT37eReuJUCQ5RV7PQTuGNCau8yiZQCrl08jeu0PMTCBW8+t6DzXpwUVWA2HNEfNYtZ536dUt9GcAY1PrW9ML9fo8a7pjHCekvz/mQNmCb3VcsAbqY0xWzRRGSblfFpkeVc9+UspVeg7Qq1uotUatYt1HD6fPaDuYuxatCUPHAaoXvR2C6mPs6ILG12ovN6FPqfqvaW0Qe2yi1Lh6dQv1CKJlS1ydQO+6RdGRr9ToVe9Jda2NQ7Kqo+wt619ioZSpHo1rRtwjfOrsVWmrPQdVilGaGESNx1dY1Qu+z4PpHvj6qHA2cZh0kPm/pkW6wLqw3ISYAn6icfkjT62KdVXS3g0BHzV83dsTnpMPVGgaVo+ooLWrr2OUaxjDAn56Jn/Rbt77SzXNJxqXpkQtFZ8drBHXxm/o8OCcxqSR7Y5+Ka2mfJq+7+Fkjc1PdmPCczoj5I3mx3s5A6ufZFx7uA2K1W21jWzCGIevMTjHpxMIhH+y4Iy+UVdr49NDnsvj30MZVQs+ybiMz4Ply1BnV+/CjMtohdbGw9RU78SMy2iF9gb++RQwhBmX0Qo2noY6GH4nm593MYwFRpoQeTtFz7sYRoI9XFbEv3lvGIZhGIZhGIZhGIZhGIZhGMb/yR8nA78mDUCKogAAAABJRU5ErkJggg==\" alt=\"pi1 = F V^{-2} d^{-2} rho^{-1}\" style=\"width: 107.5px; height: 21px;\" width=\"107.5\" height=\"21\"\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: 363.433px 7.8px; transform-origin: 363.433px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ewhich is related to a quantity in fluid mechanics called the drag coefficient. We then repeat steps 2 and 3 with the two remaining variables and find\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21.8167px; 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.9167px; text-align: left; transform-origin: 384px 10.9167px; 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: 13.6px 7.8px; transform-origin: 13.6px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e       \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAAAqCAYAAAB7uVNDAAADEklEQVR4nO2abZGDMBCGXw84wAAGTkEV1EEd1AEW0ICEesBCNWCh9yO8w5JLWkg2hfb2mcnMtZlbwmazXw1gGIZhGIZhfCMVgGbvRRj7cAEwAmj3XojxXn7gNn0A8IAZwL/lCjOAZCq4k/RsVIrPqyeZvaJMM4AMaAA9nBLlaKc5DVoAdyG7U5ILmAGo4W++Nj9C/llRrhmAAg2WBlAXeMapkHwzAAXOmDfnXugZ7SR/EN+tyUHkCBmOGYACMgfQjM8S5gByo2RYWDNOAblmAAqMeK7kXOqC8tUMgCVKihv6ZPz4r1X2NZjLyIuQr022AZyxLFFeDc2e85b4Fxu565Gbc8uUVcFtyAgXVtipuynJD5FlAB22xSDtBGnLs2Mjt6nCzXnAKTOVBm7jRyyNkslfrvwY3MPNuUsLp7wac4ySG8zMuGRycVMYuUqVxpTa+JFVhO+Rrk/mcqjhvBf10E/rWBWiGZf8RUpl8mRodcOOiKzNU+MzT36swUMPMCbKfwt8AVooPcKrRTPR+dTEULrn1FDC/CkW3/lrXanyMhu6L+n+mRjFFn3GsnRiqPg0Q+DmPLD0iGt55d4rMa/Z/lWFrl7Gelp1aNGnab4Rn2kMW618zypAbk5qfKaeYsmxrDAOeThkg4KxXtbFoZp4wF9lMZaOkf+JsWcVkNL+5SUM/i29XwgayBCZ3x2WEGPgO7noE2YLjmXdKY2UPasAWQKv9Vw3zKFCnu5nLdrSlVQy8gVk/GNcpAEwy31FiT5BSWTza018pr7kQYgZgN9d5HyPA1zerLF8ed9ty4UzP3ilIL7wIS09QGyDYnDzpYHLErLzvuclTekVOxxEP/Lkh15+8ObXxFi2PzWvT5XEvwHUI5xgXrDUhx9u5EEapsFOoPQQdxyoDKwwdwFDlt9Mczesc40V3EuX+BVNGyZxqfmGn8lXnrwL5kNQw+mxw3c309AjrYY2voArDuTajPdyRjg/qPE5uYCRCO8Q+FQo85u3cSDYAeNFBzlGWD7w1VSYK4TYMPdvGIZhGIZhGIZhGPvxCzKCpjeOtJtbAAAAAElFTkSuQmCC\" alt=\"pi2 = L/d\" style=\"width: 64px; height: 21px;\" width=\"64\" height=\"21\"\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: 11.6833px 7.8px; transform-origin: 11.6833px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eand\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21.8167px; 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.9167px; text-align: left; transform-origin: 384px 10.9167px; 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: 13.6px 7.8px; transform-origin: 13.6px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e       \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANMAAAAqCAYAAAApmm4IAAAFFklEQVR4nO2cYZXqMBCFr4c6qAEMoAAFOMBBHWABDUjAAxbQsBZ4P8o9vS1Jk5KUhNf5zskfynan6czkziS7gGEYhmEYhmEYhmEYALAD0JQ2Yoba7WvQ22hsmBbADcATdTpr7fYBwAnAH4BzaUOMcpxf44k6nbV2+/bo7bujt8+CyajWWUnt9nWwYPo6Dfps5hut42daz3dz6vOczroDcEBex7JgMt5o0DvaA4ODPNHXBHu4naUFcJz8zBnuwPuUVGdtAVzQ1w281zGPaQAsmIwZjhgHU4yTXDAEXm5yOSud6om6gn1tLJgKssPyYGLWX8OhcjkrmwWPZIvGWDAZs2gw7QPf5UrWOa7tMF+HTcecLanO6upq+Wo+33DZsGYwherYmLrWgqkw3DsJ1RcN+lXpHnGf0PDdI4eztnKfg3yu0i9mfDuY9gvtOzjuYcFUGNZAoZfAFxVavVLI4axaB+Z2+s3IvNhlPGdBWgNzLeo9+gnu4H9uzdhXz3eY7S9Jlob51FlVOl5Rb4MkJHNTSQ6mabs2NHLuiyzRuL6RYo9KmpPjuq46c88Qkl900LUz8hJnZRucznPFuC3uquu+aR9p0NvHYz6cywfc7yyFpGBSZ4kZa3V3UoZvNYhBJY0rKJlk5rK0BuQf3h2FwZZzvyZkR0g98LnvGNvLxsMacnSJfaR52fTA2E4GlK/2+RTGw2IFwShvMTyoBgsnfM1i7JZhpGRQTt6f45q2vUMZcK7wfsC/YuXigP5ZOCdn+IOBzzx1UGBogrjm41v2EQaSK/gOGOY7h3Ru0b9j2ndF7/9RQd9g7CBc3tQxObFrFsyl4crjWt1OiJe22onTTMl71HKkX1dil6PQeVNW+1xw9XElyxhpXQzqZL50rlShDMW9kVqcZQmheomBFpOlVXZQzrEVXkubVZ/X5aAN3p+hFBosoetrNEo+htlKJR4zqm8J3eG9aXFGvS1PF3P1kr6smCytHT0GD4v5WuYkJOFUOpXu2NJWn//pfK/RKPkYGq4ZlIHiylDMuLzWYpAHSzNayW7eXL2khXhMx0gd8Yah3spZHKegq5LPQbVLVhK11edPqgSqUUVqOGsjLbxdWbXDu5PQmZZKmpLdPF+9dMJ41Y3J0jpndwyFbC1oJncFuPpBaVmqtarv9H2OTm52XNmZn2lhd8C8U1EWLc3Epbp5vnqJ8vWTLD0N8tJSSdFM7nJQXwOlBFQFvsaCbufUIqFHGUAdavowO4SL8AsqyxIBtF6i87AVq5vYlEQXhJ1MpWHp7D5Fg2XqgOoHvM65+DbaBHHNoSqAKuRdi7GMmRbJOrF8CXO1UPe6R+mMtgTNblf0tt9fn081e4e4vYxaag4X+v8X9F12GK/E3MS9o8z71Npz+vuZ1KsJJOA9E02Nvk+u+1acHd7/KvNXAsp1fIrPqZ28B+KDg3VJjXOgCYJJkpvJDcYr1wPlWuOa5NSGI3o/u6IiaQcMZ52YkafsXtduiJvUBu46q1amBewN7x27M4Z6LPbl8VBsrTD56Q4/2WM4mVCy1mOSe7xsoSo4Fbbr69T+P9EI66XcR2aMNEKbypuCMqf2YOIq+ksNky2w5PjWf0+H35B5lBK5j+8babAJsinF0MCtX9f4+5LcqJTYfParDDayNqUY9PhRi6EBsfZfkeZgrf+6Y6Th2vfbBHsMXTB2vH6h09JgsHtTL+wH4H5e7crGMAzDMAzDMAzDMAzDMAzDMLbGPzdEr6mprduEAAAAAElFTkSuQmCC\" alt=\"pi3 = mu/(V d rho)\" style=\"width: 105.5px; height: 21px;\" width=\"105.5\" height=\"21\"\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: 129.517px 7.8px; transform-origin: 129.517px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eor a geometric ratio and the inverse of 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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Reynolds_number\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eReynolds number\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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: 63.0167px 7.8px; transform-origin: 63.0167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eProblem statement\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 106.8px; 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 53.4px; text-align: left; transform-origin: 384px 53.4px; 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: 231.7px 7.8px; transform-origin: 231.7px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that constructs dimensionless parameters from a cell array\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 15.4px 7.8px; transform-origin: 15.4px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 15.4px 8.25px; transform-origin: 15.4px 8.25px; \"\u003evars\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: 104.25px 7.8px; transform-origin: 104.25px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with the variable names, a matrix\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 15.4px 7.8px; transform-origin: 15.4px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 15.4px 8.25px; transform-origin: 15.4px 8.25px; \"\u003edims\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with the exponents for the dimensions in rows (length, time, mass) for each variable in the columns, and a vector\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 15.4px 7.8px; transform-origin: 15.4px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 15.4px 8.25px; transform-origin: 15.4px 8.25px; \"\u003eindx\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e indicating the variables chosen in step 1 above. The function should return a cell array\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 7.7px 7.8px; transform-origin: 7.7px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003ePi\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: 105.033px 7.8px; transform-origin: 105.033px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with the dimensionless groups in strings and a vector\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 3.85px 7.8px; transform-origin: 3.85px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 3.85px 8.25px; transform-origin: 3.85px 8.25px; \"\u003ea\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: 22.1667px 7.8px; transform-origin: 22.1667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e of size\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 26.95px 7.8px; transform-origin: 26.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 26.95px 8.25px; transform-origin: 26.95px 8.25px; \"\u003em x m-n\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: 255.567px 7.8px; transform-origin: 255.567px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with the exponents of the normalizing variables. For the example above, the input could be specified as\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 102.167px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-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: 404px 51.0833px; transform-origin: 404px 51.0833px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 161.7px 8.25px; transform-origin: 161.7px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 34.65px 8.25px; transform-origin: 34.65px 8.25px; \"\u003e vars = {\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 11.55px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 11.55px 8.25px; \"\u003e'F'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e, \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 11.55px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 11.55px 8.25px; \"\u003e'V'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e, \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 11.55px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 11.55px 8.25px; \"\u003e'd'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e, \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 11.55px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 11.55px 8.25px; \"\u003e'L'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e, \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 19.25px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 19.25px 8.25px; \"\u003e'rho'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e, \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 15.4px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 15.4px 8.25px; \"\u003e'mu'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e};\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 61.6px 8.25px; transform-origin: 61.6px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e indx = [2 3 5];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 111.65px 8.25px; transform-origin: 111.65px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e dims = [ 1  1  1  1  -3  -1;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 111.65px 8.25px; transform-origin: 111.65px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e         -2 -1  0  0   0  -1;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 115.5px 8.25px; transform-origin: 115.5px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e          1  0  0  0   1   1];\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.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: 74.7px 7.8px; transform-origin: 74.7px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eand the output would be\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 81.7333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-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: 404px 40.8667px; transform-origin: 404px 40.8667px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 292.6px 8.25px; transform-origin: 292.6px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 8.25px; transform-origin: 26.95px 8.25px; \"\u003e Pi = {\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 100.1px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 100.1px 8.25px; \"\u003e'F V^{-2} d^{-2} rho^{-1}'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e, \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 38.5px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 38.5px 8.25px; \"\u003e'L d^{-1}'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e, \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 103.95px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 103.95px 8.25px; \"\u003e'mu V^{-1} d^{-1} rho^{-1}'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e} \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 69.3px 8.25px; transform-origin: 69.3px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e a  = [-2   0  -1;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 69.3px 8.25px; transform-origin: 69.3px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       -2  -1  -1;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 69.3px 8.25px; transform-origin: 69.3px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       -1   0  -1]\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.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: 68.4667px 7.8px; transform-origin: 68.4667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFurther specifications:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 143.933px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 391px 71.9667px; transform-origin: 391px 71.9667px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 41.7667px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 20.8833px; text-align: left; transform-origin: 363px 20.8833px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 77.4167px 7.8px; transform-origin: 77.4167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf the variables chosen in\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 15.4px 7.8px; transform-origin: 15.4px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 15.4px 8.25px; transform-origin: 15.4px 8.25px; \"\u003eindx\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 245.833px 7.8px; transform-origin: 245.833px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e will not work (i.e., the number is incorrect or some form a dimensionless group themselves), return\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 26.95px 7.8px; transform-origin: 26.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 26.95px 8.25px; transform-origin: 26.95px 8.25px; \"\u003ea = NaN\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 13.6167px 7.8px; transform-origin: 13.6167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 184.8px 7.8px; transform-origin: 184.8px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 184.8px 8.25px; transform-origin: 184.8px 8.25px; \"\u003ePi = {'Error in choosing normalizing variables'}\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 212.75px 7.8px; transform-origin: 212.75px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf the exponent of a variable is zero, omit the variable from the string.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 259.833px 7.8px; transform-origin: 259.833px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf the exponent of a variable is one, keep the variable but do not show the exponent.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 277.117px 7.8px; transform-origin: 277.117px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf the exponent of a variable is a positive integer, indicate it with a caret (^) and no braces.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 206.15px 7.8px; transform-origin: 206.15px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf the exponent is anything else, indicate it with a caret and braces.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 307.133px 7.8px; transform-origin: 307.133px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf the exponent is not an integer, express it as a fraction. Hint: MATLAB has a function that will help.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [Pi, a] = dimAnalysis(vars,dims,indx)\r\n  a  = ...;\r\n  Pi = ...;\r\nend","test_suite":"%%  Drag coefficient for a cylinder\r\n%     F = drag force, V = velocity, d = diameter, L = length, rho = density, mu = dynamic viscosity\r\nvars = {'F', 'V', 'd', 'L', 'rho', 'mu'};\r\nindx = [2 3 5];\r\ndims = [ 1  1  1  1  -3  -1;\r\n        -2 -1  0  0   0  -1;\r\n         1  0  0  0   1   1];\r\nPi_correct = {'F V^{-2} d^{-2} rho^{-1}', 'L d^{-1}', 'mu V^{-1} d^{-1} rho^{-1}'};\r\na_correct  = [-2   0  -1;\r\n              -2  -1  -1;\r\n              -1   0  -1];\r\n[Pi,a] = dimAnalysis(vars,dims,indx);\r\nassert(isequal(Pi,Pi_correct))\r\nassert(isequal(a,a_correct))\r\n\r\n%%  Drag coefficient for a cylinder--normalizing variables form a dimensionless group\r\n%     F = drag force, V = velocity, d = diameter, L = length, rho = density, mu = dynamic viscosity\r\nvars = {'F', 'V', 'd', 'L', 'rho', 'mu'};\r\nindx = [2 3 4];\r\ndims = [ 1  1  1  1  -3  -1;\r\n        -2 -1  0  0   0  -1;\r\n         1  0  0  0   1   1];\r\nPi_correct = {'Error in choosing normalizing variables'};\r\n[Pi,a] = dimAnalysis(vars,dims,indx);\r\nassert(isequal(Pi,Pi_correct))\r\nassert(isnan(a))\r\n\r\n%%  Time for a ball to fall a distance h\r\n%     T = time, g = acceleration of gravity, h = distance, m = mass of ball\r\nvars = {'T', 'g', 'h', 'm'};\r\nindx = 2:4;\r\ndims = [ 0  1  1  0;\r\n         1 -2  0  0;\r\n         0  0  0  1];\r\nPi_correct = {'T g^{1/2} h^{-1/2}'};\r\na_correct  = [0.5 -0.5 0]';\r\n[Pi,a] = dimAnalysis(vars,dims,indx);\r\nassert(isequal(Pi,Pi_correct))\r\nassert(isequal(a,a_correct))\r\n\r\n%%  Period of a pendulum with small amplitude\r\n%     T = period, L = length of pendulum, g = acceleration of gravity\r\nvars = {'T', 'L', 'g'};\r\nindx = 2:3;\r\ndims = [ 0  1  1;\r\n         1  0 -2];\r\nPi_correct = {'T L^{-1/2} g^{1/2}'};\r\na_correct  = [-0.5 0.5]';\r\n[Pi,a] = dimAnalysis(vars,dims,indx);\r\nassert(isequal(Pi,Pi_correct))\r\nassert(isequal(a,a_correct))\r\n\r\n%%  Period of a pendulum with finite amplitude\r\n%     T = period, L = length of pendulum, g = acceleration of gravity, theta0 = initial amplitude\r\nvars = {'T', 'L', 'g', 'theta0'};\r\nindx = 2:3;\r\ndims = [ 0  1  1 0;\r\n         1  0 -2 0];\r\nPi_correct = {'T L^{-1/2} g^{1/2}', 'theta0'};\r\na_correct  = [-0.5 0;\r\n               0.5 0];\r\n[Pi,a] = dimAnalysis(vars,dims,indx);\r\nassert(isequal(Pi,Pi_correct))\r\nassert(isequal(a,a_correct))\r\n\r\n%%  Stokes first problem: flow induced by an impulsively started plate bounded a semi-infinite viscous fluid\r\n%     u = fluid velocity, U = plate velocity, y = distance from plate, t = time, nu = kinematic viscosity\r\nvars = {'u', 'U', 'y', 't', 'nu'};\r\nindx = 3:4;\r\ndims = [ 1  1  1  0  2;\r\n        -1 -1  0  1 -1];\r\nPi_correct = {'u y^{-1} t', 'U y^{-1} t', 'nu y^{-2} t'};\r\na_correct  = [-1  -1  -2\r\n               1   1   1];\r\n[Pi,a] = dimAnalysis(vars,dims,indx);\r\nassert(isequal(Pi,Pi_correct))\r\nassert(isequal(a,a_correct))\r\n\r\n%%  Kepler's 3rd law for a planet whose mass is much smaller than the Sun's mass\r\n%      T = orbital period, r = semi-major axis of the orbit, G = gravitational constant, M = mass of Sun\r\nvars = {'T' 'r' 'G' 'M'};\r\nindx = 2:4;\r\ndims = [ 0  1  3  0; \r\n         1  0 -2  0; \r\n         0  0 -1  1];\r\nPi_correct = {'T r^{-3/2} G^{1/2} M^{1/2}'};\r\na_correct  = [-1.5 0.5 0.5]';\r\n[Pi,a] = dimAnalysis(vars,dims,indx);\r\nassert(isequal(Pi,Pi_correct))\r\nassert(isequal(a,a_correct))\r\n\r\n%%  Kepler's 3rd law--too few normalizing variables\r\n%      T = orbital period, r = semi-major axis of the orbit, G = gravitational constant, M = mass of Sun\r\nvars = {'T' 'r' 'G' 'M'};\r\nindx = 2:3;\r\ndims = [ 0  1 -1  0; \r\n         1  0 -2  0; \r\n         0  0 -1  1];\r\nPi_correct = {'Error in choosing normalizing variables'};\r\n[Pi,a] = dimAnalysis(vars,dims,indx);\r\nassert(isequal(Pi,Pi_correct))\r\nassert(isnan(a))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":4,"test_suite_updated_at":"2020-07-07T17:45:44.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-07-05T14:44:00.000Z","updated_at":"2020-07-30T17:53:02.000Z","published_at":"2020-07-05T23:53:11.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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eSummary\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\u003eWrite a function to construct dimensionless parameters from a list of variables, a matrix indicating their dimensions, and a vector identifying the variables to use to make the other variables dimensionless. More details are given in \\\"Problem statement\\\" below.\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eIntroduction\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\u003eDimensional analysis and the Buckingham \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"pi\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e theorem\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\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/Buckingham_π_theorem\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eBuckingham π theorem\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is a key result exploited in\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Dimensional_analysis\\\"\u003e\u003cw:r\u003e\u003cw:t\u003edimensional analysis\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e in engineering, physics, and applied mathematics. It states that if a problem involves\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"m\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e variables and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e physical dimensions (e.g., length, time, mass), then the problem can be described with\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"m-n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003em-n\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e dimensionless groups, called \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"pi\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e groups. In\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Buckingham_π_theorem\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eother words\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, the \\\"physics does not depend on a specific unit system\\\".\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\u003eTo find the dimensionless groups, we follow these steps:\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChoose\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e variables that cannot form a dimensionless group by themselves\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eForm the product of one of the remaining\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"m-n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003em-n\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e variables with the variables in step 1, each raised to different exponents\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDetermine the exponents that would make the product (or group) dimensionless\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRepeat steps 2 and 3 for the remaining variables\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\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSuppose we are interested in the drag\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"F\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eF\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e (i.e., a force) on a cylinder of length\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"L\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eL\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and diameter\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"d\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ed\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e immersed in a fluid of density\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"rho\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\rho\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and dynamic viscosity\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"mu\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\mu\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e flowing at velocity\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"V\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eV\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. Because the problem involves 6 variables and 3 dimensions (length, time, and mass), it can be described with 3 dimensionless groups. For step 1 above, choose\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"V\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eV\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"d\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ed\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"rho\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\rho\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. We could choose other lists of 3, but notice that we could not choose\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"V\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eV\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"d\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ed\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"L\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eL\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e because\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"d\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ed\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"L\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eL\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e form a dimensionless group themselves (and we have no way of removing mass dimensions.)\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 step 2, start with the drag\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eF\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Following the step, we get\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\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=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"pi_1 = F V^{a1} d^{a2} rho^{a3}\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi_1 = F V^{a_1} d^{a_2} \\\\rho^{a3}\u003c/w:t\u003e\u003c/w:r\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\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea1\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea2\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea3\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e are exponents. Because \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"pi1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi_1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e must be dimensionless and because the dimensionless of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"F\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eF\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"V\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eV\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"d\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ed\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"rho\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\rho\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e are \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"ML/T^2\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\rm ML/T^2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, L/T, L, and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"M/L^3\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\rm M/L^3\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, respectively, we can solve a system of three equations to find the exponents and write\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=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"pi1 = F V^{-2} d^{-2} rho^{-1}\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi_1 = F V^{-2}d^{-2}\\\\rho^{-1}\u003c/w:t\u003e\u003c/w:r\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\u003ewhich is related to a quantity in fluid mechanics called the drag coefficient. We then repeat steps 2 and 3 with the two remaining variables and find\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=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"pi2 = L/d\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi_2 = L d^{-1}\u003c/w:t\u003e\u003c/w:r\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\u003eand\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=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"pi3 = mu/(V d rho)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi_3 = \\\\mu V^{-1} d^{-1} \\\\rho^{-1}\u003c/w:t\u003e\u003c/w:r\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\u003eor a geometric ratio and the inverse of 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/Reynolds_number\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eReynolds number\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eProblem statement\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\u003eWrite a function that constructs dimensionless parameters from a cell array\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\u003evars\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e with the variable names, a matrix\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\u003edims\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e with the exponents for the dimensions in rows (length, time, mass) for each variable in the columns, and a vector\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\u003eindx\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e indicating the variables chosen in step 1 above. The function should return a cell array\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\u003ePi\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e with the dimensionless groups in strings and a vector\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of size\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\u003em x m-n\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e with the exponents of the normalizing variables. For the example above, the input could be specified as\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ vars = {'F', 'V', 'd', 'L', 'rho', 'mu'};\\n indx = [2 3 5];\\n dims = [ 1  1  1  1  -3  -1;\\n         -2 -1  0  0   0  -1;\\n          1  0  0  0   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\u003eand the output would 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[ Pi = {'F V^{-2} d^{-2} rho^{-1}', 'L d^{-1}', 'mu V^{-1} d^{-1} rho^{-1}'} \\n a  = [-2   0  -1;\\n       -2  -1  -1;\\n       -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\u003eFurther specifications:\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf the variables chosen in\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\u003eindx\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e will not work (i.e., the number is incorrect or some form a dimensionless group themselves), return\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea = NaN\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\u003ePi = {'Error in choosing normalizing variables'}\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf the exponent of a variable is zero, omit the variable from the string.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf the exponent of a variable is one, keep the variable but do not show the exponent.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf the exponent of a variable is a positive integer, indicate it with a caret (^) and no braces.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf the exponent is anything else, indicate it with a caret and braces.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf the exponent is not an integer, express it as a fraction. Hint: MATLAB has a function that will help.\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":501,"title":"Let's do Markov Chains!","description":"Markov Chains are really useful in a lot of fields. This problem will ask a question about a simple system with 3 states: A,B and C. The probability that one state will go to another can be given in a matrix such as:\r\nmc = [0.5 0.2  0;\r\n      0.2  0  0.6;\r\n      0.3 0.8 0.4];\r\nSo, the first element is the probability that something in state A will remain in state A (0.5 here). The zero as the 5th element means nothing in state B will remain in state B. Now, if you are given the current state of the system, say state=[1 0 0], you can get the next state.\r\nIn this problem, I will given an incomplete matrix (A zero in place of one value), and then an initial state and the next state like:\r\nstates=[1 0.5;\r\n        0 0.2;\r\n        0 0.3]\r\nYou will have to provide the correct markov matrix as the output.\r\nRound the output to 2 digits after decimal.","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: 369.6px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 184.8px; transform-origin: 407px 184.8px; vertical-align: baseline; \"\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\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eMarkov Chains\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: 336px 8px; transform-origin: 336px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e are really useful in a lot of fields. This problem will ask a question about a simple system with 3 states: A,B and C. The probability that one state will go to another can be given in a matrix such as:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 61.3px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-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: 404px 30.65px; transform-origin: 404px 30.65px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 68px 8.5px; tab-size: 4; transform-origin: 68px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003emc = [0.5 0.2  0;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 72px 8.5px; tab-size: 4; transform-origin: 72px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e      0.2  0  0.6;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 76px 8.5px; tab-size: 4; transform-origin: 76px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e      0.3 0.8 0.4];\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.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: 363.5px 8px; transform-origin: 363.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSo, the first element is the probability that something in state A will remain in state A (0.5 here). The zero as the 5th element means nothing in state B will remain in state B. Now, if you are given the current state of the system, say state=[1 0 0], you can get the next state.\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: 380.5px 8px; transform-origin: 380.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn this problem, I will given an incomplete matrix (A zero in place of one value), and then an initial state and the next state like:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 61.3px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-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: 404px 30.65px; transform-origin: 404px 30.65px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 56px 8.5px; tab-size: 4; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003estates=[1 0.5;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 56px 8.5px; tab-size: 4; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        0 0.2;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 56px 8.5px; tab-size: 4; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        0 0.3]\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.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: 201px 8px; transform-origin: 201px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eYou will have to provide the correct markov matrix as the output.\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: 132px 8px; transform-origin: 132px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eRound the output to 2 digits after decimal.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function MC = markov(mc,states)\r\n  MC = mc;\r\nend","test_suite":"%%\r\nmc = [0.5 0.2  0;\r\n      0.2  0  0.6;\r\n      0.3  0 0.4];\r\nstates = [0.3 0.21;\r\n          0.3 0.3;\r\n          0.4 0.49];\r\nMC = [0.5 0.2  0;\r\n      0.2  0  0.6;\r\n      0.3 0.8 0.4];\r\nassert(isequal(markov(mc,states),MC))\r\n\r\n%%\r\nmc = [0.5 0.2  0;\r\n       0  0  0.6;\r\n      0.3 0.8 0.4];\r\nstates = [0.5 0.31;\r\n          0.3 0.22;\r\n          0.2 0.47];\r\nMC = [0.5 0.2  0;\r\n      0.2  0  0.6;\r\n      0.3 0.8 0.4];\r\nassert(isequal(markov(mc,states),MC))\r\n\r\n%%\r\nmc = [0.4 0;\r\n      0.6 0.23];\r\nstates = [0.1 0.733;\r\n          0.9 0.267];\r\nMC = [0.4 0.77;\r\n      0.6 0.23];\r\nassert(isequal(markov(mc,states),MC))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":8,"created_by":1675,"edited_by":223089,"edited_at":"2022-10-27T18:19:40.000Z","deleted_by":null,"deleted_at":null,"solvers_count":15,"test_suite_updated_at":"2012-03-15T14:27:16.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-03-15T14:27:16.000Z","updated_at":"2022-10-27T18:19:40.000Z","published_at":"2012-03-15T21:19:51.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:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMarkov Chains\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e are really useful in a lot of fields. This problem will ask a question about a simple system with 3 states: A,B and C. The probability that one state will go to another can be given in a matrix such as:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[mc = [0.5 0.2  0;\\n      0.2  0  0.6;\\n      0.3 0.8 0.4];]]\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\u003eSo, the first element is the probability that something in state A will remain in state A (0.5 here). The zero as the 5th element means nothing in state B will remain in state B. Now, if you are given the current state of the system, say state=[1 0 0], you can get the next state.\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\u003eIn this problem, I will given an incomplete matrix (A zero in place of one value), and then an initial state and the next state like:\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[states=[1 0.5;\\n        0 0.2;\\n        0 0.3]]]\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\u003eYou will have to provide the correct markov matrix as the output.\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\u003eRound the output to 2 digits after decimal.\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":1108,"title":"Raise Matrix to Power","description":"For a given square matrix x and scalar a, find x^a without using '^' or 'mpower'.","description_html":"\u003cp\u003eFor a given square matrix x and scalar a, find x^a without using '^' or 'mpower'.\u003c/p\u003e","function_template":"function y = matpow(x,a)\r\ny = x**a;\r\nend","test_suite":"%%\r\nfiletext = fileread('matpow.m');\r\nassert(isempty(strfind(filetext, '^')))\r\nassert(isempty(strfind(filetext, 'mpower')))\r\n\r\n%%\r\nx=[1 2; -1 2];\r\n\r\ny_correct=x^5;\r\ny=matpow(x,5);\r\nassert(max(abs(y(:)-y_correct(:)))\u003c1e-5)\r\n\r\n%%\r\nx=[1 2; -1 2];\r\ny_correct=x^-3.5;\r\ny=matpow(x,-3.5);\r\nassert(max(abs(y(:)-y_correct(:)))\u003c1e-5)\r\n\r\n\r\n%%\r\nx=[1 2 3; 4 2 -1; -2 4 -3];\r\n\r\ny_correct=x^6;\r\ny=matpow(x,6);\r\nassert(max(abs(y(:)-y_correct(:)))\u003c1e-5)\r\n\r\n%%\r\nx=[1 2 3; 4 2 -1; -2 4 -3];\r\n\r\ny_correct=x^-4;\r\ny=matpow(x,-4);\r\nassert(max(abs(y(:)-y_correct(:)))\u003c1e-5)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":3399,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":48,"test_suite_updated_at":"2012-12-08T17:13:33.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-12-08T14:12:53.000Z","updated_at":"2025-12-07T19:24:11.000Z","published_at":"2012-12-08T14:16:04.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\u003eFor a given square matrix x and scalar a, find x^a without using '^' or 'mpower'.\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":44849,"title":"Given a base n, find the y values less or equal than 100(without 1), such that they will never produce a periodic number if we divide any whole number between some of them","description":"A periodic number depends on the base b where we are working. So, for example the number \r\n2/3 in decimal base is periodic(0.666666666) but if we are working in base 3, the same number can be expressed as 2/10, and the result is not periodic (0.2). \r\nBy this way, it is possible to enunciate:\r\n\r\n* In base 2 or 3, all numbers will produce periodics numbers unless the number is the base or power of the base\r\n* In decimal base, numbers as 2,5,8,40,50 for example will never produce periodics numbers. \r\n\r\nBy this way, you have to find when a number in any base can produce periodics numbers or not, and then find the values less or equal than 100 that in this base will never produce a periodic number.","description_html":"\u003cp\u003eA periodic number depends on the base b where we are working. So, for example the number \r\n2/3 in decimal base is periodic(0.666666666) but if we are working in base 3, the same number can be expressed as 2/10, and the result is not periodic (0.2). \r\nBy this way, it is possible to enunciate:\u003c/p\u003e\u003cul\u003e\u003cli\u003eIn base 2 or 3, all numbers will produce periodics numbers unless the number is the base or power of the base\u003c/li\u003e\u003cli\u003eIn decimal base, numbers as 2,5,8,40,50 for example will never produce periodics numbers.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eBy this way, you have to find when a number in any base can produce periodics numbers or not, and then find the values less or equal than 100 that in this base will never produce a periodic number.\u003c/p\u003e","function_template":"function y = nperiodos(b)\r\ny=b;\r\nend","test_suite":"%%\r\nb = 2;\r\ny_correct = [2 4 8 16 32 64];\r\nassert(isequal(nperiodos(b),y_correct))\r\n%%\r\nb=3;\r\ny_correct = [3 9 27 81];\r\nassert(isequal(nperiodos(b),y_correct))\r\n%%\r\nb=60;\r\ny_correct = [2 3 4 5 6 8 9 10 12 15 16 18 20 24 25 27 30 32 36 40 45 48 50 54 60 64 72 75 80 81 90 96 100];\r\nassert(isequal(nperiodos(b),y_correct))\r\n%%\r\nb=50;\r\ny_correct = [2 4 5 8 10 16 20 25 32 40 50 64 80 100];\r\nassert(isequal(nperiodos(b),y_correct))\r\n%%\r\nb=10;\r\ny_correct = [2 4 5 8 10 16 20 25 32 40 50 64 80 100];\r\nassert(isequal(nperiodos(b),y_correct))\r\n%%\r\nb=29;\r\ny_correct = [29];\r\nassert(isequal(nperiodos(b),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":289312,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":11,"test_suite_updated_at":"2019-02-13T21:28:22.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2019-02-13T21:27:15.000Z","updated_at":"2019-02-16T21:35:00.000Z","published_at":"2019-02-13T21:28:22.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 periodic number depends on the base b where we are working. So, for example the number 2/3 in decimal base is periodic(0.666666666) but if we are working in base 3, the same number can be expressed as 2/10, and the result is not periodic (0.2). By this way, it is possible to enunciate:\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\u003eIn base 2 or 3, all numbers will produce periodics numbers unless the number is the base or power of the base\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\u003eIn decimal base, numbers as 2,5,8,40,50 for example will never produce periodics numbers.\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\u003eBy this way, you have to find when a number in any base can produce periodics numbers or not, and then find the values less or equal than 100 that in this base will never produce a periodic number.\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":44277,"title":"Given n, create n random numbers such that their standard deviation is also n.","description":"Given n, create n random numbers such that their standard deviation is also n.","description_html":"\u003cp\u003eGiven n, create n random numbers such that their standard deviation is also n.\u003c/p\u003e","function_template":"function y = randpro(n)\r\n  y = n+3;\r\nend","test_suite":"%%\r\nx = 10;\r\nassert(length(randpro(x))==10)\r\nassert(std(randpro(x))\u003e9)\r\nassert(std(randpro(x))\u003c11)\r\n\r\n%%\r\nx = 17;\r\nassert(length(randpro(x))==17)\r\nassert(std(randpro(x))\u003e16)\r\nassert(std(randpro(x))\u003c18)\r\n\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":204,"test_suite_updated_at":"2017-08-06T19:53:33.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-08-06T19:46:05.000Z","updated_at":"2026-02-11T03:12:53.000Z","published_at":"2017-08-06T19:53: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\",\"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\u003eGiven n, create n random numbers such that their standard deviation is also n.\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":136,"title":"Read a Soroban Abacus","description":"*Description*\r\n\r\nThe Soroban is the name of the modern Japanese abacus. Information on reading a Soroban can be found \u003chttp://webhome.idirect.com/~totton/abacus/pages.htm#Soroban1 here\u003e.\r\n\r\n\u003c\u003chttp://webhome.idirect.com/~totton/abacus/1.gif\u003e\u003e\r\n\r\nThe soroban essentially consists of 7xN slots that 5xN beads may occupy. The input to the function will be a graphical representation of the soroban where |true| signifies a slot filled with a bead whereas |false| signifies a vacant slot. You can assume that all inputs will be valid soroban configurations.\r\n\r\n*Example*\r\n\r\n   input = [ 1 1 0 0 0\r\n             0 0 1 1 1\r\n             1 0 0 1 1\r\n             0 1 1 1 0\r\n             1 1 1 1 1\r\n             1 1 1 0 1\r\n             1 1 1 1 1 ];\r\n   output = 10586","description_html":"\u003cp\u003e\u003cb\u003eDescription\u003c/b\u003e\u003c/p\u003e\u003cp\u003eThe Soroban is the name of the modern Japanese abacus. Information on reading a Soroban can be found \u003ca href=\"http://webhome.idirect.com/~totton/abacus/pages.htm#Soroban1\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\u003cimg src=\"http://webhome.idirect.com/~totton/abacus/1.gif\"\u003e\u003cp\u003eThe soroban essentially consists of 7xN slots that 5xN beads may occupy. The input to the function will be a graphical representation of the soroban where \u003ctt\u003etrue\u003c/tt\u003e signifies a slot filled with a bead whereas \u003ctt\u003efalse\u003c/tt\u003e signifies a vacant slot. You can assume that all inputs will be valid soroban configurations.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cpre\u003e   input = [ 1 1 0 0 0\r\n             0 0 1 1 1\r\n             1 0 0 1 1\r\n             0 1 1 1 0\r\n             1 1 1 1 1\r\n             1 1 1 0 1\r\n             1 1 1 1 1 ];\r\n   output = 10586\u003c/pre\u003e","function_template":"function y = soroban_evaluate(s)\r\n  y = sum(s(:));\r\nend","test_suite":"%%\r\nx = [ 1 0 1 1 0 1 1 ]';\r\ny_correct = 2;\r\nassert(isequal(soroban_evaluate(x),y_correct))\r\n\r\n%%\r\nx = [ 1 1 0 0 0\r\n      0 0 1 1 1\r\n      1 0 0 1 1\r\n      0 1 1 1 0\r\n      1 1 1 1 1\r\n      1 1 1 0 1\r\n      1 1 1 1 1 ];\r\ny_correct = 10586;\r\nassert(isequal(soroban_evaluate(x),y_correct))\r\n\r\n%%\r\nx = [ 1 1 1 1 1\r\n      0 0 0 0 0\r\n      0 0 0 0 0\r\n      1 1 1 1 1\r\n      1 1 1 1 1\r\n      1 1 1 1 1\r\n      1 1 1 1 1 ];\r\ny_correct = 0;\r\nassert(isequal(soroban_evaluate(x),y_correct))\r\n\r\n%%\r\nx = [ 0 1 1 1 1\r\n      1 0 0 0 0\r\n      0 0 0 0 0\r\n      1 1 1 1 1\r\n      1 1 1 1 1\r\n      1 1 1 1 1\r\n      1 1 1 1 1 ];\r\ny_correct = 50000;\r\nassert(isequal(soroban_evaluate(x),y_correct))\r\n\r\n%%\r\nx = [ 0 0 0 0 0 1 1 1 1 1\r\n      1 1 1 1 1 0 0 0 0 0\r\n      1 1 1 1 0 1 1 1 1 0\r\n      1 1 1 0 1 1 1 1 0 1\r\n      1 1 0 1 1 1 1 0 1 1\r\n      1 0 1 1 1 1 0 1 1 1\r\n      0 1 1 1 1 0 1 1 1 1 ];\r\ny_correct = 9876543210;\r\nassert(isequal(soroban_evaluate(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":17,"comments_count":7,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":230,"test_suite_updated_at":"2012-01-28T08:11:33.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-01-28T07:55:24.000Z","updated_at":"2026-02-09T02:06:49.000Z","published_at":"2012-01-28T08:11: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\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eDescription\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 Soroban is the name of the modern Japanese abacus. Information on reading a Soroban can be found\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://webhome.idirect.com/~totton/abacus/pages.htm#Soroban1\\\"\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: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 soroban essentially consists of 7xN slots that 5xN beads may occupy. The input to the function will be a graphical representation of the soroban 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\u003etrue\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e signifies a slot filled with a bead whereas\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\u003efalse\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e signifies a vacant slot. You can assume that all inputs will be valid soroban configurations.\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   input = [ 1 1 0 0 0\\n             0 0 1 1 1\\n             1 0 0 1 1\\n             0 1 1 1 0\\n             1 1 1 1 1\\n             1 1 1 0 1\\n             1 1 1 1 1 ];\\n   output = 10586]]\u003e\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,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\"}]}"},{"id":110,"title":"Make an N-dimensional Multiplication Table","description":"*INSTRUCTIONS*\r\n\r\nThis is a multi-dimensional variant of the normal multiplication table used to teach elementary students multiplication. In this variant, we are going to produce a table that multiplies the divisors 1 to _n_ (input) agains itself in _d_ dimensions.\r\n\r\n_Note_: Inputting _d_ = 0 should return the number 1 and _d_ = 1 should return a column vector with the elements 1 to _n_.\r\n\r\n\r\n*Example:*\r\n\r\nInput: \r\n\r\n  n = 3;\r\n  d = 3;\r\n\r\nOutput:\r\n\r\n  tt(:,:,1) = [ 1  2  3\r\n                2  4  6\r\n                3  6  9  ];\r\n  tt(:,:,2) = [ 2  4  6\r\n                4  8  12\r\n                6  12 18 ];\r\n  tt(:,:,3) = [ 3  6  9\r\n                6  12 18\r\n                9  18 27 ];","description_html":"\u003cp\u003e\u003cb\u003eINSTRUCTIONS\u003c/b\u003e\u003c/p\u003e\u003cp\u003eThis is a multi-dimensional variant of the normal multiplication table used to teach elementary students multiplication. In this variant, we are going to produce a table that multiplies the divisors 1 to \u003ci\u003en\u003c/i\u003e (input) agains itself in \u003ci\u003ed\u003c/i\u003e dimensions.\u003c/p\u003e\u003cp\u003e\u003ci\u003eNote\u003c/i\u003e: Inputting \u003ci\u003ed\u003c/i\u003e = 0 should return the number 1 and \u003ci\u003ed\u003c/i\u003e = 1 should return a column vector with the elements 1 to \u003ci\u003en\u003c/i\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eInput:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003en = 3;\r\nd = 3;\r\n\u003c/pre\u003e\u003cp\u003eOutput:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ett(:,:,1) = [ 1  2  3\r\n              2  4  6\r\n              3  6  9  ];\r\ntt(:,:,2) = [ 2  4  6\r\n              4  8  12\r\n              6  12 18 ];\r\ntt(:,:,3) = [ 3  6  9\r\n              6  12 18\r\n              9  18 27 ];\r\n\u003c/pre\u003e","function_template":"function tt = ndtimestable(n,d)\r\n  tt = zeros(n*ones(1,d));\r\nend","test_suite":"%%\r\nm = 5;\r\nn = 0;\r\ntt = 1;\r\nassert(isequal(ndtimestable(m,n),tt))\r\n\r\n%%\r\nm = 10;\r\nn = 1;\r\ntt = (1:10)';\r\nassert(isequal(ndtimestable(m,n),tt))\r\n\r\n%%\r\nm = 12;\r\nn = 2;\r\ntt= [    1     2     3     4     5     6     7     8     9    10    11    12\r\n         2     4     6     8    10    12    14    16    18    20    22    24\r\n         3     6     9    12    15    18    21    24    27    30    33    36\r\n         4     8    12    16    20    24    28    32    36    40    44    48\r\n         5    10    15    20    25    30    35    40    45    50    55    60\r\n         6    12    18    24    30    36    42    48    54    60    66    72\r\n         7    14    21    28    35    42    49    56    63    70    77    84\r\n         8    16    24    32    40    48    56    64    72    80    88    96\r\n         9    18    27    36    45    54    63    72    81    90    99   108\r\n        10    20    30    40    50    60    70    80    90   100   110   120\r\n        11    22    33    44    55    66    77    88    99   110   121   132\r\n        12    24    36    48    60    72    84    96   108   120   132   144  ];\r\nassert(isequal(ndtimestable(m,n),tt))\r\n\r\n%%\r\nm = 3;\r\nn = 3;\r\ntt = zeros(m,m,m);\r\ntt(:,:,1) = [ 1  2  3\r\n              2  4  6\r\n              3  6  9  ];\r\ntt(:,:,2) = [ 2  4  6\r\n              4  8  12\r\n              6  12 18 ];\r\ntt(:,:,3) = [ 3  6  9\r\n              6  12 18\r\n              9  18 27 ];\r\nassert(isequal(ndtimestable(m,n),tt))\r\n\r\n%%\r\nm = 2;\r\nn = 4;\r\ntt = zeros(m,m,m,m);\r\ntt(:,:,1,1) = ...\r\n  [  1     2\r\n     2     4  ];\r\ntt(:,:,2,1) = ...\r\n  [  2     4\r\n     4     8  ];\r\ntt(:,:,1,2) = ...\r\n  [  2     4\r\n     4     8  ];\r\ntt(:,:,2,2) = ...\r\n  [  4     8\r\n     8    16  ];\r\nassert(isequal(ndtimestable(m,n),tt))\r\n\r\n%%\r\nm = 2;\r\nn = 7;\r\nassert(numel(ndtimestable(m,n)) == m^n);","published":true,"deleted":false,"likes_count":6,"comments_count":0,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":141,"test_suite_updated_at":"2012-01-26T15:30:12.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-01-26T15:17:25.000Z","updated_at":"2026-04-03T03:18:48.000Z","published_at":"2012-01-26T15:30: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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eINSTRUCTIONS\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\u003eThis is a multi-dimensional variant of the normal multiplication table used to teach elementary students multiplication. In this variant, we are going to produce a table that multiplies the divisors 1 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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (input) agains itself in\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ed\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e dimensions.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eNote\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e: Inputting\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ed\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = 0 should return the number 1 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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ed\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = 1 should return a column vector with the elements 1 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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\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: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\u003eInput:\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[n = 3;\\nd = 3;]]\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\u003eOutput:\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[tt(:,:,1) = [ 1  2  3\\n              2  4  6\\n              3  6  9  ];\\ntt(:,:,2) = [ 2  4  6\\n              4  8  12\\n              6  12 18 ];\\ntt(:,:,3) = [ 3  6  9\\n              6  12 18\\n              9  18 27 ];]]\u003e\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":46120,"title":"Solve the Challenger puzzle","description":null,"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: 442.333px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 221.167px; transform-origin: 407px 221.167px; vertical-align: baseline; \"\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: 14px 7.8px; transform-origin: 14px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://kingfeatures.com/features/puzzlesandgames/challenger/\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eChallenger\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: 321.267px 7.8px; transform-origin: 321.267px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e puzzle by Linus Maurer requires the solver to fill a 4x4 matrix of integers from 1 to 9 to match the given sums of the rows, columns, main diagonal, and anti-diagonal. Four of the numbers are given. Numbers can be repeated, and the solution is not necessarily unique. \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: 376.017px 7.8px; transform-origin: 376.017px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to solve the Challenger. The input will be a matrix resembling the game board. For example, if the input is\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 122.6px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-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: 404px 61.3px; transform-origin: 404px 61.3px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 96.25px 8.25px; transform-origin: 96.25px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e   NaN  NaN  NaN  NaN  12\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 96.25px 8.25px; transform-origin: 96.25px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0    0    0    4  23\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 96.25px 8.25px; transform-origin: 96.25px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0    1    0    0  11\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 96.25px 8.25px; transform-origin: 96.25px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     6    0    0    0  21\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 96.25px 8.25px; transform-origin: 96.25px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0    0    2    0  13\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 96.25px 8.25px; transform-origin: 96.25px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     9   20   22   17  12\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 84px; 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: 384px 42px; text-align: left; transform-origin: 384px 42px; 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: 379.85px 7.8px; transform-origin: 379.85px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ethen the sums of the four columns are 9, 20, 22, and 17. The sums of the rows are 23, 11, 21, and 13, and the sums of the two diagonals are 12 and 12. The four starting numbers are 6, 1, 2, and 4, and zeros indicate the numbers to be determined. Ignore the NaNs. The output of the function should be the 4x4 matrix of numbers. In the example, a valid solution would be \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 81.7333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-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: 404px 40.8667px; transform-origin: 404px 40.8667px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 80.85px 8.25px; transform-origin: 80.85px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     1    9    9    4\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 80.85px 8.25px; transform-origin: 80.85px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     1    1    4    5\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 80.85px 8.25px; transform-origin: 80.85px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     6    3    7    5\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 84.7px 8.25px; transform-origin: 84.7px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     1    7    2    3 \u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.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 7.8px; transform-origin: 0px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = Challenger(x)\r\n  y = f(x);\r\nend","test_suite":"%%\r\nx = [NaN NaN NaN NaN 12; 0 0 0 4 23; 0 1 0 0 11; 6 0 0 0 21; 0 0 2 0 13; 9 20 22 17 12];\r\nsum_row = x(6,1:4); sum_col = x(2:5,5); sum_d1 = x(6,5); sum_d2 = x(1,5);\r\ny = Challenger(x);\r\nassert(isequal(sum(y),sum_row) \u0026\u0026 isequal(sum(y,2),sum_col) \u0026\u0026 trace(y) == sum_d1 \u0026\u0026 trace(fliplr(y)) == sum_d2)\r\n\r\n%%\r\nx = [NaN NaN NaN NaN 25; 0 0 0 7 18; 0 9 0 0 29; 0 0 6 0 27; 9 0 0 0 27; 30 21 19 31 28];\r\nsum_row = x(6,1:4); sum_col = x(2:5,5); sum_d1 = x(6,5); sum_d2 = x(1,5);\r\ny = Challenger(x);\r\nassert(isequal(sum(y),sum_row) \u0026\u0026 isequal(sum(y,2),sum_col) \u0026\u0026 trace(y) == sum_d1 \u0026\u0026 trace(fliplr(y)) == sum_d2)\r\n\r\n%%\r\nx = [NaN NaN NaN NaN 19; 0 0 0 2 16; 5 0 0 0 22; 0 0 4 0 27; 0 2 0 0 11; 19 16 19 22 15];\r\nsum_row = x(6,1:4); sum_col = x(2:5,5); sum_d1 = x(6,5); sum_d2 = x(1,5);\r\ny = Challenger(x);\r\nassert(isequal(sum(y),sum_row) \u0026\u0026 isequal(sum(y,2),sum_col) \u0026\u0026 trace(y) == sum_d1 \u0026\u0026 trace(fliplr(y)) == sum_d2)\r\n\r\n%%\r\nx = [NaN NaN NaN NaN 20; 0 0 4 0 25; 0 6 0 0 22; 4 0 0 0 21; 0 0 0 4 25; 26 20 22 25 26];\r\nsum_row = x(6,1:4); sum_col = x(2:5,5); sum_d1 = x(6,5); sum_d2 = x(1,5);\r\ny = Challenger(x);\r\nassert(isequal(sum(y),sum_row) \u0026\u0026 isequal(sum(y,2),sum_col) \u0026\u0026 trace(y) == sum_d1 \u0026\u0026 trace(fliplr(y)) == sum_d2)","published":true,"deleted":false,"likes_count":3,"comments_count":3,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":27,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-08-08T15:02:54.000Z","updated_at":"2026-02-11T17:03:32.000Z","published_at":"2020-08-08T15:35:49.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\u003eThe \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://kingfeatures.com/features/puzzlesandgames/challenger/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eChallenger\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e puzzle by Linus Maurer requires the solver to fill a 4x4 matrix of integers from 1 to 9 to match the given sums of the rows, columns, main diagonal, and anti-diagonal. Four of the numbers are given. Numbers can be repeated, and the solution is not necessarily unique. \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\u003eWrite a function to solve the Challenger. The input will be a matrix resembling the game board. For example, if the input 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[   NaN  NaN  NaN  NaN  12\\n     0    0    0    4  23\\n     0    1    0    0  11\\n     6    0    0    0  21\\n     0    0    2    0  13\\n     9   20   22   17  12]]\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\u003ethen the sums of the four columns are 9, 20, 22, and 17. The sums of the rows are 23, 11, 21, and 13, and the sums of the two diagonals are 12 and 12. The four starting numbers are 6, 1, 2, and 4, and zeros indicate the numbers to be determined. Ignore the NaNs. The output of the function should be the 4x4 matrix of numbers. In the example, a valid solution would 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[     1    9    9    4\\n     1    1    4    5\\n     6    3    7    5\\n     1    7    2    3 ]]\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\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":58463,"title":"Recurssive serie","description":"let the numerical serie U(n) such as U(n+1)= 0.2U(n) + 0.3U(n-1) ; U(0) = a ; U(1) = b\r\nthe goal is to plot the elements of this serie in a 2D graph after solving for the serie using matrix manipulation\r\nSteps for solving : create the matrix \r\n(0     1\r\n0.3 0. 2)\r\nFind the eigen values ,create a diagonal matrix using those eigen values\r\nFind the matrix whose colomns are the eigen vectors\r\nHINT ( there is only two eigen values. The first element of the diagonal matrix is the negative eigen value!) \r\nCalculate the vector U for every n \u003e=2 such as U(n) = x(2,1)*U(0) + X(2,2)*U(1)\r\nHINT (the matrix X = P * D^n * P^-1 such as D is the diagonal eigen values matrix and P is the eigen vectors matrix.)\r\nplot the vector U with n being the length of U, you don't need to round the values of the serie.","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: 321px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 160.5px; transform-origin: 407px 160.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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elet the numerical serie U(n) such as U(n+1)= 0.2U(n) + 0.3U(n-1) ; U(0) = a ; U(1) = b\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ethe goal is to plot the elements of this serie in a 2D graph after solving for the serie using matrix manipulation\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eSteps for solving : create the matrix \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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e(0     1\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0.3 0. 2)\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFind the eigen values ,create a diagonal matrix using those eigen values\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFind the matrix whose colomns are the eigen vectors\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eHINT ( \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=\"\"\u003ethere is only two eigen values. The first element of the diagonal matrix is the negative eigen value!\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=\"font-weight: 700; \"\u003e)\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\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eCalculate the vector U for every n \u0026gt;=2 such as U(n) = x(2,1)*U(0) + X(2,2)*U(1)\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eHINT (\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=\"\"\u003ethe matrix X = P * D^n * P^-1 such as D is the diagonal eigen values matrix and P is the eigen vectors matrix.\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=\"font-weight: 700; \"\u003e)\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eplot the vector U with n being the length of U, you don't need to round the values of the serie.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function U = recurrence(a,b,n)\r\n  U=[a,b];\r\n  \r\n  \r\n  plot([1:n],U,\"*\");\r\nend","test_suite":"%%\r\na = 0;\r\nb = 1;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(U(2),1))\r\n%%\r\na = 1;\r\nb = 0;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(U(2),0))\r\n%%\r\na = 3;\r\nb = 1;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(round(U(5),3),0.179))\r\n%%\r\na = 9;\r\nb = 7;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(round(U(6),3),0.530))\r\n%%\r\na = 5;\r\nb = 5;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(round(U(3),3),1.15))\r\n%%\r\na = 0.6;\r\nb = -4;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(round(U(4),3),-0.487))\r\n%%\r\na=0;\r\nb=0;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(U(4),0))\r\n%%\r\na=0;\r\nb=0;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(U(5),0))\r\n%%\r\na=0;\r\nb=0;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(U(7),0))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":3437689,"edited_by":3437689,"edited_at":"2023-06-24T21:36:27.000Z","deleted_by":null,"deleted_at":null,"solvers_count":3,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2023-06-24T20:47:31.000Z","updated_at":"2023-06-24T21:36:27.000Z","published_at":"2023-06-24T21:36: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\u003elet the numerical serie U(n) such as U(n+1)= 0.2U(n) + 0.3U(n-1) ; U(0) = a ; U(1) = b\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 goal is to plot the elements of this serie in a 2D graph after solving for the serie using matrix manipulation\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\u003eSteps for solving : create the matrix \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(0     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\u003e0.3 0. 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\u003eFind the eigen values ,create a diagonal matrix using those eigen values\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\u003eFind the matrix whose colomns are the eigen 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHINT ( \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr/\u003e\u003cw:t\u003ethere is only two eigen values. The first element of the diagonal matrix is the negative eigen value!\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: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\u003eCalculate the vector U for every n \u0026gt;=2 such as U(n) = x(2,1)*U(0) + X(2,2)*U(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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHINT (\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003ethe matrix X = P * D^n * P^-1 such as D is the diagonal eigen values matrix and P is the eigen vectors matrix.\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\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:t\u003eplot the vector U with n being the length of U, you don't need to round the values of the serie.\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":44258,"title":"Outer product of multiple vectors","description":"In tensor algebra, it is often useful to define a tensor as a product of lower order tensors. Similarly, a multidimensional array T might be defined as an outer product of vectors, where a given element is defined by\r\n\r\n  T(i,j,k) = A(i)*B(j)*C(k);\r\n\r\nCreate a function |outerProduct| that accepts any number of row or column vectors and calculates their outer product. For the above example,\r\n\r\n  T = outerProduct(A,B,C);\r\n","description_html":"\u003cp\u003eIn tensor algebra, it is often useful to define a tensor as a product of lower order tensors. Similarly, a multidimensional array T might be defined as an outer product of vectors, where a given element is defined by\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eT(i,j,k) = A(i)*B(j)*C(k);\r\n\u003c/pre\u003e\u003cp\u003eCreate a function \u003ctt\u003eouterProduct\u003c/tt\u003e that accepts any number of row or column vectors and calculates their outer product. For the above example,\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eT = outerProduct(A,B,C);\r\n\u003c/pre\u003e","function_template":"function y = outerProduct(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('outerProduct.m');\r\nassert(~contains(filetext,'regexp'))\r\n\r\n%%\r\ny = outerProduct([],[]);\r\nassert(isempty(y))\r\n\r\n%%\r\nx = randi(100);\r\ny = randi(100);\r\nassert(isequal(outerProduct(x,y),x*y))\r\n\r\n%%\r\nx = randi(100,[1 100]);\r\ny = randi(100,[1 90]);\r\nassert(isequal(outerProduct(x,y),x.'*y))\r\nassert(isequal(outerProduct(x.',y),x.'*y))\r\nassert(isequal(outerProduct(x,y.'),x.'*y))\r\n\r\n%%\r\nx = randi(100,[1 1000]);\r\nxc = num2cell(x);\r\nassert(isequal(outerProduct(xc{:}),prod(x)))","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":1011,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":117,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-07-10T05:32:47.000Z","updated_at":"2026-03-24T05:17:10.000Z","published_at":"2017-07-10T05:33:24.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\u003eIn tensor algebra, it is often useful to define a tensor as a product of lower order tensors. Similarly, a multidimensional array T might be defined as an outer product of vectors, where a given element is defined by\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[T(i,j,k) = A(i)*B(j)*C(k);]]\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\u003eCreate 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\u003eouterProduct\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e that accepts any number of row or column vectors and calculates their outer product. For the above example,\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[T = outerProduct(A,B,C);]]\u003e\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":59132,"title":"Snakes and Ladders: Average Number of Turns","description":"In this problem, you will play a single-player variant of the classic game Snakes and Ladders. The rules are as follows:\r\nThe player begins on the \"zero\" square. (There is no zero square, so practically off the board, entering it on the first turn.)\r\nEach turn is played by throwing a standard 6-sided die and moving along the squares, in order.\r\nIf the square at which the player arrives after traveling the number of squares indicated by the die is the foot of a ladder or the mouth of a snake, the player immediately moves the square at the top of the ladder or at the tail of the snake, respectively.\r\nIf the die shows a number greater then the number of steps required for the player to reach the final square (overshoot), the player stays in the current square and the turn is wasted.\r\nThe game ends when the player arrives at the final square.\r\nYou are given a board, represented by an integer vector. Some vector elements will consist of their own index in the vector, while others will hold the index of a different element in the vector. The latter represent either a snake or a ladder, where snakes will consist of numbers lower than their indeces and ladders higher. You may assume the following:\r\nSnakes and ladders will not connect in series, i.e. the mouth of a snake or the foor of a ladder will not coincide with the tail of a snake or the top of a ladder.\r\nThere will not be a ladder leading to the final position.\r\nReturn n, the expected number of turns for a player to reach the final square.\r\nAfter having solved this problem, try Problem 59137 Snakes and Ladders: Variable Die.","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: 440.327px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.989px 220.156px; transform-origin: 406.996px 220.163px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21.0085px; 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.991px 10.4972px; text-align: left; transform-origin: 383.999px 10.5043px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIn this problem, you will play a single-player variant of the classic game \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Snakes_and_ladders\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eSnakes and Ladders\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. The rules are as follows:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 183.963px; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 390.994px 91.9744px; transform-origin: 390.994px 91.9815px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 40.8807px; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 362.997px 20.4403px; text-align: left; transform-origin: 362.997px 20.4403px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThe player begins on the \"zero\" square. (There is no zero square, so practically off the board, entering it on the first turn.)\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4403px; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 362.997px 10.2131px; text-align: left; transform-origin: 362.997px 10.2202px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eEach turn is played by throwing a standard 6-sided die and moving along the squares, in order.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 61.321px; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 362.997px 30.6534px; text-align: left; transform-origin: 362.997px 30.6605px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIf the square at which the player arrives after traveling the number of squares indicated by the die is the foot of a ladder or the mouth of a snake, the player immediately moves the square at the top of the ladder or at the tail of the snake, respectively.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 40.8807px; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 362.997px 20.4403px; text-align: left; transform-origin: 362.997px 20.4403px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIf the die shows a number greater then the number of steps required for the player to reach the final square (overshoot), the player stays in the current square and the turn is wasted.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4403px; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 362.997px 10.2131px; text-align: left; transform-origin: 362.997px 10.2202px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThe game ends when the player arrives at the final square.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 63.0256px; 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.991px 31.5057px; text-align: left; transform-origin: 383.999px 31.5128px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eYou are given a board, represented by an integer vector. Some vector elements will consist of their own index in the vector, while others will hold the index of a different element in the vector. The latter represent either a snake or a ladder, where snakes will consist of numbers lower than their indeces and ladders higher. You may assume the following:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 61.321px; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 390.994px 30.6534px; transform-origin: 390.994px 30.6605px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 40.8807px; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 362.997px 20.4403px; text-align: left; transform-origin: 362.997px 20.4403px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eSnakes and ladders will not connect in series, i.e. the mouth of a snake or the foor of a ladder will not coincide with the tail of a snake or the top of a ladder.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4403px; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 362.997px 10.2131px; text-align: left; transform-origin: 362.997px 10.2202px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThere will not be a ladder leading to the final position.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21.0085px; 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.991px 10.4972px; text-align: left; transform-origin: 383.999px 10.5043px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eReturn n, the expected number of turns for a player to reach the final square.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21.0085px; 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.991px 10.4972px; text-align: left; transform-origin: 383.999px 10.5043px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eAfter having solved this problem, try \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/59137-snakes-and-ladders-variable-die\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProblem 59137\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\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; \"\u003eSnakes and Ladders: Variable Die\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\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function n = snakesNladders(board)\r\n  n = numel(board);\r\nend","test_suite":"%%\r\nfiletext = fileread('snakesNladders.m');\r\nassert(isempty(strfind(filetext,'regexp')))\r\nassert(isempty(strfind(filetext,'assign')))\r\nassert(isempty(strfind(filetext,'eval')))\r\nassert(isempty(strfind(filetext,'echo')))\r\nassert(isempty(strfind(filetext,'!')))\r\n\r\n%%\r\nboard = [1 2 3 7 5 6 7 2 9];\r\nassert(abs(snakesNladders(board)-8.6)\u003c1e-3)\r\n\r\n%%\r\nboard = [1 2 3 4 5 6 7 8 9 23 11 8 13 14 15 4 69 18 19 32 21 60 23 7 25 26 41 59 6 30 31 32 33 34 35 36 66 38 39 40 41 42 43 9 67 62 47 48 49 50 51 35 53 68 2 56 57 58 59 60 13 62 3 64 65 66 67 68 69 70 71 51 73];\r\nassert(abs(snakesNladders(board)-28.8383)\u003c1e-3)\r\n\r\n%%\r\nboard = [35 2 3 4 14 6 7 8 3 10 7 12 19 14 10 16 17 18 19 17 21 22 31 24 25 26 32 8 29 34 31 32 24 34 35 36];\r\nassert(abs(snakesNladders(board)-14.3318)\u003c1e-3)","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":15521,"edited_by":15521,"edited_at":"2023-11-21T09:39:41.000Z","deleted_by":null,"deleted_at":null,"solvers_count":4,"test_suite_updated_at":"2023-11-21T09:39:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2023-11-03T19:49:40.000Z","updated_at":"2025-12-10T21:42:55.000Z","published_at":"2023-11-03T19:49:40.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\u003eIn this problem, you will play a single-player variant of the classic game \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Snakes_and_ladders\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eSnakes and Ladders\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The rules are as follows:\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe player begins on the \\\"zero\\\" square. (There is no zero square, so practically off the board, entering it on the first turn.)\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEach turn is played by throwing a standard 6-sided die and moving along the squares, in order.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf the square at which the player arrives after traveling the number of squares indicated by the die is the foot of a ladder or the mouth of a snake, the player immediately moves the square at the top of the ladder or at the tail of the snake, respectively.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf the die shows a number greater then the number of steps required for the player to reach the final square (overshoot), the player stays in the current square and the turn is wasted.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe game ends when the player arrives at the final 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\u003eYou are given a board, represented by an integer vector. Some vector elements will consist of their own index in the vector, while others will hold the index of a different element in the vector. The latter represent either a snake or a ladder, where snakes will consist of numbers lower than their indeces and ladders higher. You may assume the following:\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSnakes and ladders will not connect in series, i.e. the mouth of a snake or the foor of a ladder will not coincide with the tail of a snake or the top of a ladder.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThere will not be a ladder leading to the final position.\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\u003eReturn n, the expected number of turns for a player to reach the final 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\u003eAfter having solved this problem, try \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/59137-snakes-and-ladders-variable-die\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 59137\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eSnakes and Ladders: Variable Die\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\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":59137,"title":"Snakes and Ladders: Variable Die","description":"This problem is a sequal to Problem 59132 Snakes and Ladders: Average Number of Turns.\r\nInstead of a 6-sided die, your function should now receive an integer d (assume 2 or greater), representing the number of faces of the die. Otherwise, the problem is the same.","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: 72.017px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.989px 36.0085px; transform-origin: 406.996px 36.0085px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21.0085px; 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.991px 10.4972px; text-align: left; transform-origin: 383.999px 10.5043px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThis problem is a sequal to \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/59132-snakes-and-ladders-average-number-of-moves\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProblem 59132\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\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; \"\u003eSnakes and Ladders: Average Number of Turns\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\u003c/div\u003e\u003cdiv style=\"block-size: 42.017px; 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.991px 21.0085px; text-align: left; transform-origin: 383.999px 21.0085px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eInstead of a 6-sided die, your function should now receive an integer d (assume 2 or greater), representing the number of faces of the die. Otherwise, the problem is the same.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function n = snakesNladders(board,d)\r\n  n = numel(board) + d;\r\nend","test_suite":"%%\r\nfiletext = fileread('snakesNladders.m');\r\nassert(isempty(strfind(filetext,'regexp')))\r\nassert(isempty(strfind(filetext,'assign')))\r\nassert(isempty(strfind(filetext,'eval')))\r\nassert(isempty(strfind(filetext,'echo')))\r\nassert(isempty(strfind(filetext,'!')))\r\n\r\n%%\r\nboard = [1 2 3 7 5 6 7 2 9];\r\nassert(abs(snakesNladders(board,8)-9)\u003c1e-3)\r\n\r\n%%\r\nboard = [1 2 3 4 5 6 7 8 9 23 11 8 13 14 15 4 69 18 19 32 21 60 23 7 25 26 41 59 6 30 31 32 33 34 35 36 66 38 39 40 41 42 43 9 67 62 47 48 49 50 51 35 53 68 2 56 57 58 59 60 13 62 3 64 65 66 67 68 69 70 71 51 73];\r\nassert(abs(snakesNladders(board,3)-47.0345)\u003c1e-3)\r\n\r\n%%\r\nboard = [35 2 3 4 14 6 7 8 3 10 7 12 19 14 10 16 17 18 19 17 21 22 31 24 25 26 32 8 29 34 31 32 24 34 35 36];\r\nassert(abs(snakesNladders(board,4)-17.0807)\u003c1e-3)","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":15521,"edited_by":15521,"edited_at":"2023-11-03T19:55:30.000Z","deleted_by":null,"deleted_at":null,"solvers_count":4,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2023-11-03T19:49:44.000Z","updated_at":"2023-11-03T19:55:30.000Z","published_at":"2023-11-03T19:49:44.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\u003eThis problem is a sequal to \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/59132-snakes-and-ladders-average-number-of-moves\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 59132\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eSnakes and Ladders: Average Number of Turns\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInstead of a 6-sided die, your function should now receive an integer d (assume 2 or greater), representing the number of faces of the die. Otherwise, the problem is the same.\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":3074,"title":"Compute the cokurtosis of a given portfolio.","description":"As input data, you are given a nObs-by-nAssets matrix _portRet_ of return series for assets in a portfolio along with an nAssets-by-1 vector _portWeights_ of portfolio weights. Example: \r\n\r\n \u003e\u003e nObs = 504; % Number of observations\r\n\r\n \u003e\u003e nAssets = 5; % Number of assets in the portfolio\r\n\r\n \u003e\u003e portRet = randn(nObs, nAssets); % Sample portfolio return series\r\n\r\n \u003e\u003e portWeights = rand(nAssets, 1); \r\n\r\n \u003e\u003e portWeights = portWeights/sum(portWeights); % Portfolio weights are \u003e=0 and sum to 1.\r\n\r\nThe task is to compute the *portfolio cokurtosis* , which is a scalar statistic associated with the portfolio. A full description of this statistic, along with sample MATLAB code for computing it, can be found here:\r\n\r\nhttp://www.quantatrisk.com/2013/01/20/coskewness-and-cokurtosis/\r\n\r\nWrite a function that accepts _portRet_ and _portWeights_ as input arguments and returns the scalar statistic _portCokurt_ as its output. You can use the code at the website above as a starting point, but try to simplify and shorten it in the spirit of Cody.\r\n\r\n\r\n\r\n","description_html":"\u003cp\u003eAs input data, you are given a nObs-by-nAssets matrix \u003ci\u003eportRet\u003c/i\u003e of return series for assets in a portfolio along with an nAssets-by-1 vector \u003ci\u003eportWeights\u003c/i\u003e of portfolio weights. Example:\u003c/p\u003e\u003cpre\u003e \u0026gt;\u0026gt; nObs = 504; % Number of observations\u003c/pre\u003e\u003cpre\u003e \u0026gt;\u0026gt; nAssets = 5; % Number of assets in the portfolio\u003c/pre\u003e\u003cpre\u003e \u0026gt;\u0026gt; portRet = randn(nObs, nAssets); % Sample portfolio return series\u003c/pre\u003e\u003cpre\u003e \u0026gt;\u0026gt; portWeights = rand(nAssets, 1); \u003c/pre\u003e\u003cpre\u003e \u0026gt;\u0026gt; portWeights = portWeights/sum(portWeights); % Portfolio weights are \u0026gt;=0 and sum to 1.\u003c/pre\u003e\u003cp\u003eThe task is to compute the \u003cb\u003eportfolio cokurtosis\u003c/b\u003e , which is a scalar statistic associated with the portfolio. A full description of this statistic, along with sample MATLAB code for computing it, can be found here:\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.quantatrisk.com/2013/01/20/coskewness-and-cokurtosis/\"\u003ehttp://www.quantatrisk.com/2013/01/20/coskewness-and-cokurtosis/\u003c/a\u003e\u003c/p\u003e\u003cp\u003eWrite a function that accepts \u003ci\u003eportRet\u003c/i\u003e and \u003ci\u003eportWeights\u003c/i\u003e as input arguments and returns the scalar statistic \u003ci\u003eportCokurt\u003c/i\u003e as its output. You can use the code at the website above as a starting point, but try to simplify and shorten it in the spirit of Cody.\u003c/p\u003e","function_template":"function portCokurt = computePortCokurt(portRet, portWeights)\r\n\r\n\r\nend","test_suite":"%%\r\nrng('default')\r\nR = randn(504, 5);\r\nw = ones(5, 1)/5;\r\nassert(abs(computePortCokurt(R, w)-0.119749008958925)\u003c1e-3)\r\n\r\n%%\r\nrng('default')\r\nR = randn(252, 15);\r\nw = ones(15, 1)/15;\r\nassert(abs(computePortCokurt(R, w)-0.013012357540290)\u003c1e-3)\r\n\r\n%% \r\nrng('default')\r\nR = randn(100, 1);\r\nw = 1;\r\nassert(abs(computePortCokurt(R, w)-6.280759230562035)\u003c1e-3)\r\n\r\n%%\r\nrng('default')\r\nR = randn(5, 10);\r\nw = [0.1*ones(5, 1); 0.5; zeros(4, 1)];\r\nassert(abs(computePortCokurt(R, w)-0.169198885214440)\u003c1e-3)","published":true,"deleted":false,"likes_count":0,"comments_count":2,"created_by":2328,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-03-10T11:04:22.000Z","updated_at":"2015-03-11T18:00:35.000Z","published_at":"2015-03-10T11:25: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\u003eAs input data, you are given a nObs-by-nAssets matrix\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eportRet\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of return series for assets in a portfolio along with an nAssets-by-1 vector\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eportWeights\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of portfolio weights. Example:\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[ \u003e\u003e nObs = 504; % Number of observations\\n\\n \u003e\u003e nAssets = 5; % Number of assets in the portfolio\\n\\n \u003e\u003e portRet = randn(nObs, nAssets); % Sample portfolio return series\\n\\n \u003e\u003e portWeights = rand(nAssets, 1); \\n\\n \u003e\u003e portWeights = portWeights/sum(portWeights); % Portfolio weights are \u003e=0 and sum to 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\u003eThe task is to compute 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\u003eportfolio cokurtosis\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e , which is a scalar statistic associated with the portfolio. A full description of this statistic, along with sample MATLAB code for computing it, can be found 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:hyperlink w:docLocation=\\\"http://www.quantatrisk.com/2013/01/20/coskewness-and-cokurtosis/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://www.quantatrisk.com/2013/01/20/coskewness-and-cokurtosis/\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function that accepts\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eportRet\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eportWeights\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e as input arguments and returns the scalar statistic\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eportCokurt\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e as its output. You can use the code at the website above as a starting point, but try to simplify and shorten it in the spirit of Cody.\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":787,"title":"Path Optimization thru N words : Time Optimization","description":"This is an extension of\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/196-love-is-an-n-letter-word Cody 196 love\u003e with a more stressing test set and scoring based upon time.\r\n\r\nGreater than 10 words induces time issues with brute force combinatorics.\r\n\r\nDescription is copy of Alfonso Nieto-Castanon's problem statement for Cody 196.\r\n\r\nGiven a list of N words, return the N-letter word (choosing one letter from each word) with the property of having the least distance between each pair of two consecutive letters (if there are multiple optimal solutions return any one of them). Letters may repeat inside words.\r\n\r\nExample: s1 = {'abcd','bcde','cdef','defg'}; should return s2 = 'dddd'; (with total letter-distance = 0)\r\n\r\nExample: s1={'aldfejk','czoa','vwy','abcde'}; should return s2='love'; (with total letter-distance = 27: 'l'-'o'=3 + 'o'-'v'=7 + 'v'-'e'=17 ; compare for example to the possible word 'aave' which has a total letter-distance of 38)\r\n\r\n*Passing:* All problems correct and time \u003c 2 seconds\r\n\r\n*Output chart:* Time in milliseconds with a max of 100 ms.\r\n\r\nNote: Did consider logarithmic scale but keeping it simple for now.","description_html":"\u003cp\u003eThis is an extension of \u003ca href=\"http://www.mathworks.com/matlabcentral/cody/problems/196-love-is-an-n-letter-word\"\u003eCody 196 love\u003c/a\u003e with a more stressing test set and scoring based upon time.\u003c/p\u003e\u003cp\u003eGreater than 10 words induces time issues with brute force combinatorics.\u003c/p\u003e\u003cp\u003eDescription is copy of Alfonso Nieto-Castanon's problem statement for Cody 196.\u003c/p\u003e\u003cp\u003eGiven a list of N words, return the N-letter word (choosing one letter from each word) with the property of having the least distance between each pair of two consecutive letters (if there are multiple optimal solutions return any one of them). Letters may repeat inside words.\u003c/p\u003e\u003cp\u003eExample: s1 = {'abcd','bcde','cdef','defg'}; should return s2 = 'dddd'; (with total letter-distance = 0)\u003c/p\u003e\u003cp\u003eExample: s1={'aldfejk','czoa','vwy','abcde'}; should return s2='love'; (with total letter-distance = 27: 'l'-'o'=3 + 'o'-'v'=7 + 'v'-'e'=17 ; compare for example to the possible word 'aave' which has a total letter-distance of 38)\u003c/p\u003e\u003cp\u003e\u003cb\u003ePassing:\u003c/b\u003e All problems correct and time \u0026lt; 2 seconds\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput chart:\u003c/b\u003e Time in milliseconds with a max of 100 ms.\u003c/p\u003e\u003cp\u003eNote: Did consider logarithmic scale but keeping it simple for now.\u003c/p\u003e","function_template":"function y = min_path_cost(s1)\r\n  s2 = '';\r\nend","test_suite":"%%\r\nfeval(@assignin,'caller','score',100);\r\n%%\r\nformat short\r\nformat compact\r\nglobal net_time\r\ns1 = {'abcd','bcde','cdef','defg'};\r\n\r\ns2=min_path_cost(s1); % to get good time\r\nt0=clock;\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3;\r\n\r\nassert(isequal(s2,'dddd'))\r\n\r\nnet_time=dt\r\n%%\r\nglobal net_time\r\ntemp=net_time; % anti-cheat\r\ns1 = {'aldfejk','czoa','vwy','abcde'};\r\n\r\ns2=min_path_cost(s1);\r\nt0=clock;\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3\r\n\r\nassert(isequal(s2,'love'))\r\n\r\nnet_time=temp+dt\r\n%%\r\nglobal net_time\r\n% anti-cheat \r\ntemp=net_time;\r\n\r\ns1 = {'aldfejk','czoa','vwy','abcde'};\r\n\r\ns2=min_path_cost(s1);\r\nt0=clock;\r\npause(0.2);\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3\r\n\r\nassert(isequal(s2,'love'))\r\n\r\nif dt\u003c200\r\n net_time=2001 % cheat trap fail condition\r\nend\r\n%%\r\n% not part of the time trial\r\n% avoids look-up table hack - Castano\r\ns1 = cellfun(@(x)char('a'-1+randi(26,1,5)),cell(1,7),'uniformoutput',false);\r\nassert(all(any(bsxfun(@eq,min_path_cost(s1),cell2mat(cellfun(@(x)x',s1,'uniformoutput',false)))))\u0026all(sum(abs(diff(double(min_path_cost(s1)))))\u003c=sum(abs(diff(double(cell2mat(cellfun(@(x)x(randi(numel(x),1,1000))',s1,'uniformoutput',false))),1,2)),2)));\r\n%%\r\nglobal net_time\r\ntemp=net_time;\r\ns1 = {'lqjfac','deamv','fkazbw','idlw','ajmf','abcwz','wxyz'}; %lmklmww\r\n\r\ns2=min_path_cost(s1);\r\nt0=clock;\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3\r\n\r\nassert(isequal(s2,'lmklmww'))\r\nnet_time=temp+dt\r\n\r\n%%\r\nglobal net_time\r\ntemp=net_time;\r\ns1 = {'lwjac','demv','fkabw','idlw','pqmf','abcnq','fwxyz','mnop'};\r\n\r\ns2=min_path_cost(s1);\r\nt0=clock;\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3\r\n\r\nassert(isequal(s2,'cdfdfcfm')|isequal(s2,'cdbdfcfm'))\r\nnet_time=temp+dt\r\n%%\r\nglobal net_time\r\ntemp=net_time;\r\ns1 = {'ldjac','demv','fkabw','idlw','pqmf','abcnq','fwxyz','mnop','flap'};\r\n\r\ns2=min_path_cost(s1);\r\nt0=clock;\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3\r\n\r\nassert(isequal(s2,'ddfdfcfml')|isequal(s2,'ddbdfcfml'))\r\nnet_time=temp+dt\r\n%%\r\nglobal net_time\r\ntemp=net_time;\r\ns1 = {'the','goal','of','life','is','living','in','agreement','with','nature'};\r\n\r\ns2=min_path_cost(s1);\r\nt0=clock;\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3\r\n\r\nassert(isequal(s2,'hgfiiiighe')|isequal(s2,'hgffiiighe'))\r\nnet_time=temp+dt\r\n%%\r\nglobal net_time\r\ntemp=net_time;\r\ns1 = {'he' 'has','all','the','virtues','idislike','andnone','ofthe','vicesi','admire'};\r\n\r\ns2=min_path_cost(s1);\r\nt0=clock;\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3\r\n\r\nassert(isequal(s2,'eaaeeeeeee'))\r\nnet_time=temp+dt\r\n%%\r\nglobal net_time\r\ntemp=net_time;\r\n\r\ns1 = {'history' 'will','be','kind','to','me','for','i','intend','to','write','it'};\r\n\r\ns2=min_path_cost(s1);\r\nt0=clock;\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3\r\n\r\nassert(isequal(s2,'iiekomoiiort')|isequal(s2,'iieiomoiiort'))\r\nnet_time=temp+dt\r\n\r\n%%\r\nglobal net_time\r\n% Time performance rqmt\r\nassert(net_time\u003c2000,sprintf('Net time = %s',num2str(net_time))); \r\n%%\r\nglobal net_time\r\n% net_time in ms\r\n% Create graph data\r\nnet_time=min(100,net_time) % Limit graph y-axis\r\n\r\nfeval(@assignin,'caller','score',floor(net_time));\r\n\r\n%fh=fopen('min_path_cost.m','wt');\r\n%fprintf(fh,'%s\\n',repmat('1;',[1,round(net_time/2)]));\r\n%fclose(fh);","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":8,"test_suite_updated_at":"2012-11-22T12:11:45.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-06-24T20:34:17.000Z","updated_at":"2012-11-22T12:11:45.000Z","published_at":"2012-06-25T00:03:56.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is an extension of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/196-love-is-an-n-letter-word\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody 196 love\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e with a more stressing test set and scoring based upon time.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGreater than 10 words induces time issues with brute force combinatorics.\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\u003eDescription is copy of Alfonso Nieto-Castanon's problem statement for Cody 196.\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 list of N words, return the N-letter word (choosing one letter from each word) with the property of having the least distance between each pair of two consecutive letters (if there are multiple optimal solutions return any one of them). Letters may repeat inside words.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample: s1 = {'abcd','bcde','cdef','defg'}; should return s2 = 'dddd'; (with total letter-distance = 0)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample: s1={'aldfejk','czoa','vwy','abcde'}; should return s2='love'; (with total letter-distance = 27: 'l'-'o'=3 + 'o'-'v'=7 + 'v'-'e'=17 ; compare for example to the possible word 'aave' which has a total letter-distance of 38)\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\u003ePassing:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e All problems correct and time \u0026lt; 2 seconds\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\u003eOutput chart:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Time in milliseconds with a max of 100 ms.\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: Did consider logarithmic scale but keeping it simple for now.\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":1983,"title":"Big data","description":"Optimize this line of code:\r\n\r\n B = sum(gradient(corrcoef(A)).^2);\r\n \r\nfor a matrix A with size(A,2)\u003e\u003esize(A,1)\r\n\r\n*Description:*\r\n\r\nAnalyses of large datasets often require some level of optimization for speed and/or memory usage. This is an example problem where both the initial data A and final measure of interest B fit perfectly well in memory, but the intermediate variables (in this case an impossibly large correlation matrix) required to compute the final measure of interest do not. \r\n\r\nWe have a large 2-dimensional matrix A (with dimensions 100 x 100,000).\r\n\r\nWe need to compute the following row vector B (with dimensions 1 x 100,000):\r\n\r\n B = sum(gradient(corrcoef(A)).^2);\r\n \r\nThis computes first the matrix of correlation coefficients for each pair of columns in A:\r\n\r\n a = corrcoef(A)\r\n\r\n(a 100,000 by 100,000 matrix), then computes the spatial derivative of the resulting correlation matrix along the second dimension:\r\n\r\n b = gradient(a)\r\n\r\n(another 100,000 by 100,000 matrix), and finally computes the squared norm of each column in the resulting matrix:\r\n\r\n B = sum(b.^2,1) \r\n\r\n(a 100,000 element vector)\r\n\r\nThis straight-forward \"vectorized\" approach, nevertheless, fails because it requires too much memory (enough to store a 100,000 x 100,000 correlation matrix, around 80Gb). \r\n\r\nWe clearly need some form of simplification/optimization. Can you compute the measure B within the time-limit of a Cody solution? (typically about 30 seconds)\r\n\r\nSolutions will be scored based on computation time (score equal to total time in seconds). \r\n\r\n*Context:* (not relevant to solving this problem)\r\n\r\nThis problem arises in the analyses of fMRI datasets. A typical result from a fMRI scanner session is a 4-dimensional matrix A(x,y,z,t), where the first three dimensions are spatial dimensions (a scanner of the subject's head/brain) and the fourth dimension is temporal (sequential scans obtained during a typical fMRI session). Think of these as time-varying three-dimensional pictures of your brain activation. A lot of research in the past few years has focused on functional connectivity, a measure of the temporal correlation between the \"activation\" of any pair of brain areas. Several recent papers have investigated the possibility to obtain entirely data-driven parcellations of the brain (partitioning the brain into functionally-homogeneous areas) based on these spatial patterns of functional connectivity. The measure _B_ above represents one of the measures that have been suggested as a way to drive these data-driven parcellations (borders between two adjacent but functionally distinct brain areas are expected to show higher spatial gradients in functional connectivity profiles). For simplicity I have collapsed the three spatial dimensions into one for this problem, but the computational complexity of the original computation is approximately the same (a typical scanner session results in something of the order of several hundred thousands \"voxels\" -three dimensional \"pixels\"- within the brain, and a few hundred time-points; this makes computing the entire \"voxel-to-voxel\" correlation matrix, or measures derived from it, rather challenging).\r\n\r\n","description_html":"\u003cp\u003eOptimize this line of code:\u003c/p\u003e\u003cpre\u003e B = sum(gradient(corrcoef(A)).^2);\u003c/pre\u003e\u003cp\u003efor a matrix A with size(A,2)\u0026gt;\u0026gt;size(A,1)\u003c/p\u003e\u003cp\u003e\u003cb\u003eDescription:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eAnalyses of large datasets often require some level of optimization for speed and/or memory usage. This is an example problem where both the initial data A and final measure of interest B fit perfectly well in memory, but the intermediate variables (in this case an impossibly large correlation matrix) required to compute the final measure of interest do not.\u003c/p\u003e\u003cp\u003eWe have a large 2-dimensional matrix A (with dimensions 100 x 100,000).\u003c/p\u003e\u003cp\u003eWe need to compute the following row vector B (with dimensions 1 x 100,000):\u003c/p\u003e\u003cpre\u003e B = sum(gradient(corrcoef(A)).^2);\u003c/pre\u003e\u003cp\u003eThis computes first the matrix of correlation coefficients for each pair of columns in A:\u003c/p\u003e\u003cpre\u003e a = corrcoef(A)\u003c/pre\u003e\u003cp\u003e(a 100,000 by 100,000 matrix), then computes the spatial derivative of the resulting correlation matrix along the second dimension:\u003c/p\u003e\u003cpre\u003e b = gradient(a)\u003c/pre\u003e\u003cp\u003e(another 100,000 by 100,000 matrix), and finally computes the squared norm of each column in the resulting matrix:\u003c/p\u003e\u003cpre\u003e B = sum(b.^2,1) \u003c/pre\u003e\u003cp\u003e(a 100,000 element vector)\u003c/p\u003e\u003cp\u003eThis straight-forward \"vectorized\" approach, nevertheless, fails because it requires too much memory (enough to store a 100,000 x 100,000 correlation matrix, around 80Gb).\u003c/p\u003e\u003cp\u003eWe clearly need some form of simplification/optimization. Can you compute the measure B within the time-limit of a Cody solution? (typically about 30 seconds)\u003c/p\u003e\u003cp\u003eSolutions will be scored based on computation time (score equal to total time in seconds).\u003c/p\u003e\u003cp\u003e\u003cb\u003eContext:\u003c/b\u003e (not relevant to solving this problem)\u003c/p\u003e\u003cp\u003eThis problem arises in the analyses of fMRI datasets. A typical result from a fMRI scanner session is a 4-dimensional matrix A(x,y,z,t), where the first three dimensions are spatial dimensions (a scanner of the subject's head/brain) and the fourth dimension is temporal (sequential scans obtained during a typical fMRI session). Think of these as time-varying three-dimensional pictures of your brain activation. A lot of research in the past few years has focused on functional connectivity, a measure of the temporal correlation between the \"activation\" of any pair of brain areas. Several recent papers have investigated the possibility to obtain entirely data-driven parcellations of the brain (partitioning the brain into functionally-homogeneous areas) based on these spatial patterns of functional connectivity. The measure \u003ci\u003eB\u003c/i\u003e above represents one of the measures that have been suggested as a way to drive these data-driven parcellations (borders between two adjacent but functionally distinct brain areas are expected to show higher spatial gradients in functional connectivity profiles). For simplicity I have collapsed the three spatial dimensions into one for this problem, but the computational complexity of the original computation is approximately the same (a typical scanner session results in something of the order of several hundred thousands \"voxels\" -three dimensional \"pixels\"- within the brain, and a few hundred time-points; this makes computing the entire \"voxel-to-voxel\" correlation matrix, or measures derived from it, rather challenging).\u003c/p\u003e","function_template":"function B = bigdata(A)\r\nB=zeros(1,size(A,2));\r\nend","test_suite":"%%\r\nglobal score time_count;\r\nscore=60; time_count=[];\r\nassessFunctionAbsence({'global'},'FileName','bigdata.m');\r\n\r\n%%\r\n% test small matrices first\r\nA=randn(100,100);\r\nB=bigdata(A);\r\nB0=sum(gradient(corrcoef(A)).^2);\r\nassert(all(abs(B-B0)\u003c1e-4));\r\n\r\n%%\r\n% test small matrices first\r\nA=randn(100,1000);\r\nt0=clock;\r\nB=bigdata(A);\r\nt1=etime(clock,t0);\r\nB0=sum(gradient(corrcoef(A)).^2);\r\nassert(all(abs(B-B0)\u003c1e-4));\r\nfprintf('Test 1 (1000 columns). Ellapsed time %f\\n',t1);\r\n\r\n%%\r\n% test small matrices first\r\nglobal time_count;\r\nA=randn(100,2000);\r\nt0=clock;\r\nB=bigdata(A);\r\nt1=etime(clock,t0);\r\nB0=sum(gradient(corrcoef(A)).^2);\r\nassert(all(abs(B-B0)\u003c1e-4));\r\nfprintf('Test 2 (2000 columns). Ellapsed time %f\\n',t1);\r\ntime_count=t1;\r\n\r\n%%\r\n% test small matrices first\r\nglobal time_count;\r\nA=randn(100,3000);\r\nt0=clock;\r\nB=bigdata(A);\r\nt1=etime(clock,t0);\r\nB0=sum(gradient(corrcoef(A)).^2);\r\nassert(all(abs(B-B0)\u003c1e-4));\r\nfprintf('Test 3 (3000 columns). Ellapsed time %f\\n',t1);\r\ntime_count=[time_count t1];\r\n\r\n%%\r\n% test small matrices first\r\nglobal time_count;\r\nA=randn(100,4000);\r\nt0=clock;\r\nB=bigdata(A);\r\nt1=etime(clock,t0);\r\nB0=sum(gradient(corrcoef(A)).^2);\r\nassert(all(abs(B-B0)\u003c1e-4));\r\nfprintf('Test 4 (4000 columns). Ellapsed time %f\\n',t1);\r\ntime_count=[time_count t1];\r\n\r\n%%\r\n% test big matrix\r\nglobal score time_count;\r\nassert(sum(time_count)\u003c2,'small matrices take too long; skipping big matrix computation to avoid time-out');\r\n\r\nrandn('seed',0);\r\nA=randn(100,100000);\r\nt0=clock;\r\nB=bigdata(A);\r\nt1=etime(clock,t0);\r\n\r\nassert(all(abs(B([81473 90580 12699 91338 63236 9755 27850 54689 95751 96489 15762 97060 95717 48538 80029 14189 42177 91574 79221 95950 65575 3572 84913 93400 67874])-[446.969229611013 529.483918542325 492.884459351883 506.453343056463 557.687700571202 570.008636747334 546.678181864512 445.139644002495 459.617263841976 565.276303202775 481.70081228927 505.718997924023 515.061623552965 363.542792068668 482.02142593325 578.480557740742 553.42526785998 470.314702013725 604.606838616675 539.148055906616 450.528222494512 491.803528433601 547.232718164205 561.773622227699 520.453638191039])\u003c1e-4));\r\nfprintf('Test 5 (100000 columns). Ellapsed time %f\\n',t1);\r\ntime_count=[time_count t1];\r\nscore=min(60,round(sum(time_count)));\r\n\r\n%%\r\nglobal score;\r\nurlwrite('https://sites.google.com/a/alfnie.com/alfnie/software/SetSolutionScore.p?attredirects=0\u0026amp;d=1','SetSolutionScore.p');\r\nrehash path;\r\nSetSolutionScore(score);\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":43,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":4,"test_suite_updated_at":"2017-10-27T00:44:32.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2013-11-12T05:45:56.000Z","updated_at":"2017-10-27T00:44:32.000Z","published_at":"2013-11-13T03:31: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\u003eOptimize this line of code:\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[ B = sum(gradient(corrcoef(A)).^2);]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003efor a matrix A with size(A,2)\u0026gt;\u0026gt;size(A,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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eDescription:\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\u003eAnalyses of large datasets often require some level of optimization for speed and/or memory usage. This is an example problem where both the initial data A and final measure of interest B fit perfectly well in memory, but the intermediate variables (in this case an impossibly large correlation matrix) required to compute the final measure of interest do 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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe have a large 2-dimensional matrix A (with dimensions 100 x 100,000).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe need to compute the following row vector B (with dimensions 1 x 100,000):\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[ B = sum(gradient(corrcoef(A)).^2);]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis computes first the matrix of correlation coefficients for each pair of columns in A:\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[ a = corrcoef(A)]]\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(a 100,000 by 100,000 matrix), then computes the spatial derivative of the resulting correlation matrix along the second dimension:\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[ b = gradient(a)]]\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(another 100,000 by 100,000 matrix), and finally computes the squared norm of each column in the resulting matrix:\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[ B = sum(b.^2,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\u003e(a 100,000 element vector)\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\u003eThis straight-forward \\\"vectorized\\\" approach, nevertheless, fails because it requires too much memory (enough to store a 100,000 x 100,000 correlation matrix, around 80Gb).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe clearly need some form of simplification/optimization. Can you compute the measure B within the time-limit of a Cody solution? (typically about 30 seconds)\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\u003eSolutions will be scored based on computation time (score equal to total time in seconds).\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\u003eContext:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (not relevant to solving this problem)\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\u003eThis problem arises in the analyses of fMRI datasets. A typical result from a fMRI scanner session is a 4-dimensional matrix A(x,y,z,t), where the first three dimensions are spatial dimensions (a scanner of the subject's head/brain) and the fourth dimension is temporal (sequential scans obtained during a typical fMRI session). Think of these as time-varying three-dimensional pictures of your brain activation. A lot of research in the past few years has focused on functional connectivity, a measure of the temporal correlation between the \\\"activation\\\" of any pair of brain areas. Several recent papers have investigated the possibility to obtain entirely data-driven parcellations of the brain (partitioning the brain into functionally-homogeneous areas) based on these spatial patterns of functional connectivity. The measure\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eB\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e above represents one of the measures that have been suggested as a way to drive these data-driven parcellations (borders between two adjacent but functionally distinct brain areas are expected to show higher spatial gradients in functional connectivity profiles). For simplicity I have collapsed the three spatial dimensions into one for this problem, but the computational complexity of the original computation is approximately the same (a typical scanner session results in something of the order of several hundred thousands \\\"voxels\\\" -three dimensional \\\"pixels\\\"- within the brain, and a few hundred time-points; this makes computing the entire \\\"voxel-to-voxel\\\" correlation matrix, or measures derived from it, rather challenging).\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":1110,"title":"USC Fall 2012 ACM: Martian Pranks","description":"This Challenge is to solve Question C, Martian Pranks, of the \u003chttp://contest.usc.edu/index.php/Fall12/Home USC ACM Fall 2012 Contest\u003e.\r\n\r\nRocks are moving between Rover pictures. This proves Life on Mars, but how Fast is that Life? \r\n\r\nAll Rocks are bounded by a square with opposite corners (0,0) and (1,1). The camera only sees this 1x1 area. One Martian per Rock. Martians travel the minimum distance from the 1x1 edge to the initial rock position and from the final rock position to the edge to hide at velocity V. While moving a rock Marty's velocity reduces to V/2. An unmoved rock allows Marty to stay on the sideline. Note, the camera software does not track specific rocks, so an unmoved rock in Pict1 may be item 1 and this same rock may be item 4 in the second picture. Multiple rocks may occupy the same location in a picture.  \r\n\r\nReturn the Minimum Martian Speed to transition from the initial Rock set to the Final rock set. \r\n\r\n\r\n*Input: [Rock_locations_Pict1_Pict2,Time between pictures ]*\r\n\r\n*Output: [Minimum Martian Speed]*; to 2 decimal places;\r\n\r\n*Scoring: Cumulative Time ( msec )*\r\n\r\n\r\nThe full \u003chttp://contest.usc.edu/index.php/Fall12/Home?action=download\u0026upname=pranks.in.txt USC data file\u003e\r\n\r\n*Example:*\r\n\r\n*Input: [0.3 0.6;0.4 0.5;0.5 0.5;0.95 0.2;0.6 0.5;0.9 0.4;0.5 0.5; 0.3 0.6], 3.0*\r\n\r\nEssentially, 4 rocks in two pictures with a time between pictures of 3 seconds\r\n\r\n*Output: 0.37* is quite obvious, not in the least \r\n \r\nThis answer comes by moving [I1 F4; I2 F3; I3 F1; I4 F2] with rows two and three  being of equal maximum effective distance of 1.1. My \"effective distance\" for I2 F3 is .4 + (.1)*2 + .5, where .1 is hypot(I2,F3) and multiply by 2 for speed reduction. This 1.1/3 rounds to 0.37.\r\n\r\n\r\n\u003chttp://contest.usc.edu/index.php/Fall12/Home?action=download\u0026upname=pranks.zhencao.cpp.txt The Winner's Pranks solution\u003e.  This solution is much tighter than my first method thus I am scoring by time.  Hopefully someone can champion Matlab and produce a succinct and worthy solution. The winner solved this in 22 minutes and second place took a leisurely 65 minutes. Time Started when the page was opened.\r\n\r\n","description_html":"\u003cp\u003eThis Challenge is to solve Question C, Martian Pranks, of the \u003ca href=\"http://contest.usc.edu/index.php/Fall12/Home\"\u003eUSC ACM Fall 2012 Contest\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eRocks are moving between Rover pictures. This proves Life on Mars, but how Fast is that Life?\u003c/p\u003e\u003cp\u003eAll Rocks are bounded by a square with opposite corners (0,0) and (1,1). The camera only sees this 1x1 area. One Martian per Rock. Martians travel the minimum distance from the 1x1 edge to the initial rock position and from the final rock position to the edge to hide at velocity V. While moving a rock Marty's velocity reduces to V/2. An unmoved rock allows Marty to stay on the sideline. Note, the camera software does not track specific rocks, so an unmoved rock in Pict1 may be item 1 and this same rock may be item 4 in the second picture. Multiple rocks may occupy the same location in a picture.\u003c/p\u003e\u003cp\u003eReturn the Minimum Martian Speed to transition from the initial Rock set to the Final rock set.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput: [Rock_locations_Pict1_Pict2,Time between pictures ]\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput: [Minimum Martian Speed]\u003c/b\u003e; to 2 decimal places;\u003c/p\u003e\u003cp\u003e\u003cb\u003eScoring: Cumulative Time ( msec )\u003c/b\u003e\u003c/p\u003e\u003cp\u003eThe full \u003ca href=\"http://contest.usc.edu/index.php/Fall12/Home?action=download\u0026amp;upname=pranks.in.txt\"\u003eUSC data file\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput: [0.3 0.6;0.4 0.5;0.5 0.5;0.95 0.2;0.6 0.5;0.9 0.4;0.5 0.5; 0.3 0.6], 3.0\u003c/b\u003e\u003c/p\u003e\u003cp\u003eEssentially, 4 rocks in two pictures with a time between pictures of 3 seconds\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput: 0.37\u003c/b\u003e is quite obvious, not in the least\u003c/p\u003e\u003cp\u003eThis answer comes by moving [I1 F4; I2 F3; I3 F1; I4 F2] with rows two and three  being of equal maximum effective distance of 1.1. My \"effective distance\" for I2 F3 is .4 + (.1)*2 + .5, where .1 is hypot(I2,F3) and multiply by 2 for speed reduction. This 1.1/3 rounds to 0.37.\u003c/p\u003e\u003cp\u003e\u003ca href=\"http://contest.usc.edu/index.php/Fall12/Home?action=download\u0026amp;upname=pranks.zhencao.cpp.txt\"\u003eThe Winner's Pranks solution\u003c/a\u003e.  This solution is much tighter than my first method thus I am scoring by time.  Hopefully someone can champion Matlab and produce a succinct and worthy solution. The winner solved this in 22 minutes and second place took a leisurely 65 minutes. Time Started when the page was opened.\u003c/p\u003e","function_template":"function [v]=Pranks(R,t)\r\n  v=0;\r\nend","test_suite":"feval(@assignin,'caller','score',4000);\r\n%%\r\ntic\r\nurlwrite('http://contest.usc.edu/index.php/Fall12/Home?action=download\u0026upname=pranks.in.txt','pranks.in.txt')\r\ntoc\r\n%%\r\n fid=fopen('pranks.in.txt','r');\r\n v_expect=[.37 .26 1.11 .02 .89 .79 .01 .17 .37 1.05 .28 .04 .02 .09 .14 .49 .71 .06 .01];\r\n \r\n qty=fscanf(fid,'%i',1);\r\n\r\n t1=0;\r\n for q=1:qty %qty\r\n  n = fscanf(fid,'%f %f \\n',2)'; % num_rocks, time\r\n  t=n(2);\r\n  \r\n  A=zeros(2*n(1),2); % Format is rows, columns\r\n  for i=1:2*n(1)\r\n   r = fscanf(fid,'%f %f \\n',2)';\r\n   A(i,:) = r;\r\n  end\r\n \r\n \r\n  tic\r\n  ta=clock;\r\n   [v]=Pranks(A,t) ;\r\n  t1=t1+etime(clock,ta)*1000; % Time in msec\r\n   \r\nfprintf('%2i  vel %.2f  Sum Time %.0f \\n',q,v,t1)\r\n  \r\n  assert(isequal(v,v_expect(q)));\r\n   \r\n end\r\n \r\n fprintf('Processing Complete\\n')\r\n fclose(fid);\r\n\r\n\r\nt2=min(4000,t1);\r\nfprintf('Actual Time = %.0f msec\\n',t1)\r\n\r\nfeval(@assignin,'caller','score',floor(t2));","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-12-10T00:08:26.000Z","updated_at":"2012-12-10T01:48:14.000Z","published_at":"2012-12-10T01:48: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:r\u003e\u003cw:t\u003eThis Challenge is to solve Question C, Martian Pranks, of 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://contest.usc.edu/index.php/Fall12/Home\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUSC ACM Fall 2012 Contest\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\u003eRocks are moving between Rover pictures. This proves Life on Mars, but how Fast is that Life?\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\u003eAll Rocks are bounded by a square with opposite corners (0,0) and (1,1). The camera only sees this 1x1 area. One Martian per Rock. Martians travel the minimum distance from the 1x1 edge to the initial rock position and from the final rock position to the edge to hide at velocity V. While moving a rock Marty's velocity reduces to V/2. An unmoved rock allows Marty to stay on the sideline. Note, the camera software does not track specific rocks, so an unmoved rock in Pict1 may be item 1 and this same rock may be item 4 in the second picture. Multiple rocks may occupy the same location in a picture.\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\u003eReturn the Minimum Martian Speed to transition from the initial Rock set to the Final rock set.\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\u003eInput: [Rock_locations_Pict1_Pict2,Time between pictures ]\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\u003eOutput: [Minimum Martian Speed]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e; to 2 decimal places;\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\u003eScoring: Cumulative Time ( msec )\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 full\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://contest.usc.edu/index.php/Fall12/Home?action=download\u0026amp;upname=pranks.in.txt\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUSC data file\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw: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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput: [0.3 0.6;0.4 0.5;0.5 0.5;0.95 0.2;0.6 0.5;0.9 0.4;0.5 0.5; 0.3 0.6], 3.0\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\u003eEssentially, 4 rocks in two pictures with a time between pictures of 3 seconds\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\u003eOutput: 0.37\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is quite obvious, not in the least\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\u003eThis answer comes by moving [I1 F4; I2 F3; I3 F1; I4 F2] with rows two and three being of equal maximum effective distance of 1.1. My \\\"effective distance\\\" for I2 F3 is .4 + (.1)*2 + .5, where .1 is hypot(I2,F3) and multiply by 2 for speed reduction. This 1.1/3 rounds to 0.37.\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:hyperlink w:docLocation=\\\"http://contest.usc.edu/index.php/Fall12/Home?action=download\u0026amp;upname=pranks.zhencao.cpp.txt\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eThe Winner's Pranks solution\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. This solution is much tighter than my first method thus I am scoring by time. Hopefully someone can champion Matlab and produce a succinct and worthy solution. The winner solved this in 22 minutes and second place took a leisurely 65 minutes. Time Started when the page was opened.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":56583,"title":"Slope intercept application","description":"Find y given slope (m), x, and y intercept (b).","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.440000534057617px; 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; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; 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; text-align: left; 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; \"\u003e\u003cspan style=\"\"\u003eFind y given slope (m), x, and y intercept (b).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(m, x, b)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isequal(your_fcn_name(1, 2, 0),2));\r\n%%\r\nassert(isequal(your_fcn_name(5, 0, 0),0));\r\n%%\r\nassert(isequal(your_fcn_name(3, 5, 5),20));\r\n%%\r\nassert(isequal(your_fcn_name(2, 1, 1),3));\r\n%%\r\nassert(isequal(your_fcn_name(0, 5, 1),1));\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":2797253,"edited_by":26769,"edited_at":"2022-11-22T22:10:31.000Z","deleted_by":null,"deleted_at":null,"solvers_count":110,"test_suite_updated_at":"2022-11-22T22:10:31.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2022-11-10T21:15:08.000Z","updated_at":"2026-02-06T11:51:28.000Z","published_at":"2022-11-10T21:15:08.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 y given slope (m), x, and y intercept (b).\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":2376,"title":"Find the Nth Root of a Given Number","description":"Find the Nth root of a given number x.\r\n\r\nExamples\r\n\r\n x = 4096\r\n n = 4\r\n y = 8\r\n\r\n x = 625\r\n n = 5\r\n y = 3.6239","description_html":"\u003cp\u003eFind the Nth root of a given number x.\u003c/p\u003e\u003cp\u003eExamples\u003c/p\u003e\u003cpre\u003e x = 4096\r\n n = 4\r\n y = 8\u003c/pre\u003e\u003cpre\u003e x = 625\r\n n = 5\r\n y = 3.6239\u003c/pre\u003e","function_template":"function y = nth_root(x,n)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 4096;n=4;\r\ny_correct = 8;\r\n\r\nassert(isequal(nth_root(x,n),y_correct))\r\n\r\n%%\r\nx = 256;n=4;\r\ny_correct = 4;\r\n\r\nassert(isequal(nth_root(x,n),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":22553,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":364,"test_suite_updated_at":"2014-08-26T16:11:50.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-06-18T15:50:59.000Z","updated_at":"2026-03-23T11:17:06.000Z","published_at":"2014-06-18T15:52:17.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\u003eFind the Nth root of a given number 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\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[ x = 4096\\n n = 4\\n y = 8\\n\\n x = 625\\n n = 5\\n y = 3.6239]]\u003e\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":43158,"title":"Solve system of equation!","description":"Given provided system of equation, and find x and y.\r\n\r\nSystem of equation can be expressed as each term's coefficient. For example,\r\n\r\n2*x+1*y=3\r\n1*x+1*y=2\r\n\r\ncan be\r\n\r\n[2 1 3; 1 1 2]\r\n\r\nMake function that use above matrix as a input to find solution x and y.","description_html":"\u003cp\u003eGiven provided system of equation, and find x and y.\u003c/p\u003e\u003cp\u003eSystem of equation can be expressed as each term's coefficient. For example,\u003c/p\u003e\u003cp\u003e2*x+1*y=3\r\n1*x+1*y=2\u003c/p\u003e\u003cp\u003ecan be\u003c/p\u003e\u003cp\u003e[2 1 3; 1 1 2]\u003c/p\u003e\u003cp\u003eMake function that use above matrix as a input to find solution x and y.\u003c/p\u003e","function_template":"function y = solvesystem(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [2 1 3; 1 1 2];\r\ny_correct = x(:,1:end-1)\\x(:,end);\r\nassert(isequal(solvesystem(x),y_correct))\r\n\r\n%%\r\nx = [1 1 0; 1 -1 0];\r\ny_correct = x(:,1:end-1)\\x(:,end);\r\nassert(isequal(solvesystem(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":66,"test_suite_updated_at":"2016-10-21T06:42:33.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T13:53:09.000Z","updated_at":"2026-02-26T22:49:23.000Z","published_at":"2016-10-07T13:54:04.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\u003eGiven provided system of equation, and find x and y.\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\u003eSystem of equation can be expressed as each term's coefficient. For example,\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\u003e2*x+1*y=3 1*x+1*y=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\u003ecan be\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[2 1 3; 1 1 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\u003eMake function that use above matrix as a input to find solution x and y.\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":46648,"title":"Factorial","description":null,"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: 20.8px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.4px; transform-origin: 407px 10.4px; 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 10.4px; text-align: left; transform-origin: 384px 10.4px; 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=\"\"\u003eFind the Factorial of a given number, x, that is the multiplication of all integer numbers from 1 to x.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = F(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 0;\r\ny_correct = 1;\r\nassert(isequal(F(x),y_correct))\r\n\r\n%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(F(x),y_correct))\r\n\r\n%%\r\nx = 4;\r\ny_correct = 24;\r\nassert(isequal(F(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":430136,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":103,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-02T14:04:25.000Z","updated_at":"2026-03-31T15:11:19.000Z","published_at":"2020-10-02T14:04: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\u003eFind the Factorial of a given number, x, that is the multiplication of all integer numbers from 1 to x.\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":45317,"title":"Positive Definiteness of a Matrix","description":"Determine if input matrix is positive definite or not.","description_html":"\u003cp\u003eDetermine if input matrix is positive definite or not.\u003c/p\u003e","function_template":"function y = pos_def(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 0;0 1];\r\ny_correct = 1;\r\nassert(isequal(pos_def(x),y_correct))\r\n%%\r\nx = 0;\r\ny_correct = 0;\r\nassert(isequal(pos_def(x),y_correct))\r\n%%\r\nx = [2 -1 0;-1 2 -1;0 -1 2];\r\ny_correct = 1;\r\nassert(isequal(pos_def(x),y_correct))\r\n%%\r\nx = [-1 -2;2 1];\r\ny_correct = 0;\r\nassert(isequal(pos_def(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":285886,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":32,"test_suite_updated_at":"2020-02-13T17:24:29.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2020-02-07T21:06:21.000Z","updated_at":"2026-02-16T11:55:27.000Z","published_at":"2020-02-07T21:06:43.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\u003eDetermine if input matrix is positive definite or not.\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":627,"title":"Compute a dot product of two vectors x and y","description":"x and y are input vectors, d is a number and contains their dot product","description_html":"\u003cp\u003ex and y are input vectors, d is a number and contains their dot product\u003c/p\u003e","function_template":"function d =vector_dot(x,y)\r\n  d = 0;\r\nend","test_suite":"%%\r\nx = [1 2];\r\ny= [1 3];\r\nd_correct=7;\r\nassert(isequal(vector_dot(x,y),d_correct))\r\n\r\n%%\r\nx = [1 -1];\r\ny= [1 1];\r\nd_correct=0;\r\nassert(isequal(vector_dot(x,y),d_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":1,"created_by":3727,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1050,"test_suite_updated_at":"2012-04-26T15:48:54.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-04-26T15:47:56.000Z","updated_at":"2026-03-02T13:02:46.000Z","published_at":"2012-04-26T15:47:56.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\u003ex and y are input vectors, d is a number and contains their dot product\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":44268,"title":"Combination of Vectors","description":"Return a combination of vectors x1, x2 based on y1, y2 per:\r\n\r\n      x(j) = 0     if y1(j) \u003c y2(j) \r\n      x(j) = x1(j) if y1(j) = y2(j)\r\n      x(j) = x2(j) if y1(j) \u003e y2(j)\r\n  \r\nVectors can have any length, consistent orientation.","description_html":"\u003cp\u003eReturn a combination of vectors x1, x2 based on y1, y2 per:\u003c/p\u003e\u003cpre\u003e      x(j) = 0     if y1(j) \u0026lt; y2(j) \r\n      x(j) = x1(j) if y1(j) = y2(j)\r\n      x(j) = x2(j) if y1(j) \u0026gt; y2(j)\u003c/pre\u003e\u003cp\u003eVectors can have any length, consistent orientation.\u003c/p\u003e","function_template":"function y = piecewise(x11, y11, x21, y21)\r\n  y = x;\r\nend","test_suite":"%%\r\ny11 = [4 3 0 3];\r\ny21 = [2 0 1 3];\r\nx11 = [0 1 1 2];\r\nx21 = [-2 4 1 2];\r\na1 = [-2 4 0 2];\r\nassert(isequal(piecewise(x11, y11, x21, y21),a1))\r\n%%\r\ny12 = [2 2 2 2];\r\ny22 = [0 4 0 4];\r\nx12 = [1 1 1 1];\r\nx22 = [1 1 1 1];\r\na2 = [1 0 1 0];\r\nassert(isequal(piecewise(x12, y12, x22, y22),a2))\r\n%%\r\ny23 = [2 2 2 2];\r\ny13 = [0 4 0 4];\r\nx13 = [2 2 2 2];\r\nx23 = [2 2 2 2];\r\na3 = [0 2 0 2];\r\nassert(isequal(piecewise(x13, y13, x23, y23),a3))\r\n%%\r\ny14 = zeros(1, 100);\r\ny24 = ones(1, 100);\r\nx14 = ones(1,100);\r\nx24 = 2*ones(1,100);\r\na4 = zeros(1, 100);\r\nassert(isequal(piecewise(x14, y14, x24, y24),a4))\r\n%%\r\ny25 = 2;\r\ny15 = 0;\r\nx15 = 2;\r\nx25 = 2;\r\na5 = 0;\r\nassert(isequal(piecewise(x15, y15, x25, y25),a5))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":31205,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":50,"test_suite_updated_at":"2017-07-25T12:35:28.000Z","rescore_all_solutions":false,"group_id":674,"created_at":"2017-07-24T12:12:10.000Z","updated_at":"2026-02-06T11:50:42.000Z","published_at":"2017-07-24T12:12:29.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\u003eReturn a combination of vectors x1, x2 based on y1, y2 per:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[      x(j) = 0     if y1(j) \u003c y2(j) \\n      x(j) = x1(j) if y1(j) = y2(j)\\n      x(j) = x2(j) if y1(j) \u003e y2(j)]]\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\u003eVectors can have any length, consistent orientation.\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":44093,"title":"Determinants","description":"Given a square matrix(A), find the determinant(d).\r\n\r\nFor example:\r\n\r\nA = [1,3;4,5]\r\n\r\nd = 1*5-4*3 = -7","description_html":"\u003cp\u003eGiven a square matrix(A), find the determinant(d).\u003c/p\u003e\u003cp\u003eFor example:\u003c/p\u003e\u003cp\u003eA = [1,3;4,5]\u003c/p\u003e\u003cp\u003ed = 1*5-4*3 = -7\u003c/p\u003e","function_template":"function d = your_fcn_name(A)\r\n  d = A;\r\nend","test_suite":"%%\r\nA = [1,3;4,5];\r\nd_correct = -7;\r\nassert(isequal(your_fcn_name(A),d_correct))\r\n\r\n%%\r\nA = [6,0,0,5;1,7,2,-5;2,0,0,0;8,3,1,8];\r\nd_correct = 10;\r\nassert(isequal(your_fcn_name(A),d_correct))\r\n\r\n%%\r\nA = [1,0,4;2,3,2;0,5,-2];\r\nd_correct = 24;\r\nassert(isequal(your_fcn_name(A),d_correct))\r\n\r\n%%\r\nA = [4,0,-7,3,-5;0,0,2,0,0;7,3,-6,4,-8;5,0,5,2,-3;0,0,9,-1,2];\r\nd_correct = 6;\r\nassert(isequal(your_fcn_name(A),d_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":126209,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":72,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-04-13T19:49:36.000Z","updated_at":"2026-03-16T09:24:14.000Z","published_at":"2017-04-13T19:52:06.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a square matrix(A), find the determinant(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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example:\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 = [1,3;4,5]\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\u003ed = 1*5-4*3 = -7\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":42901,"title":"Free-time Equation","description":"Given a 7-day week, an *_nc_* -number of *_tc_* -hour classes, *_ta_* -hours awake in a day, and *_tw_* -hours that you work in a week....\r\n\r\nWrite an equation that will calculate the amount of free-time you have in a typical week.\r\n\r\nNOTE: Read the top sentence for a better understanding of what each variable  means, and assume that a *_tc_* -hour class will only take *_tc_* -hours from your week...","description_html":"\u003cp\u003eGiven a 7-day week, an \u003cb\u003e\u003ci\u003enc\u003c/i\u003e\u003c/b\u003e -number of \u003cb\u003e\u003ci\u003etc\u003c/i\u003e\u003c/b\u003e -hour classes, \u003cb\u003e\u003ci\u003eta\u003c/i\u003e\u003c/b\u003e -hours awake in a day, and \u003cb\u003e\u003ci\u003etw\u003c/i\u003e\u003c/b\u003e -hours that you work in a week....\u003c/p\u003e\u003cp\u003eWrite an equation that will calculate the amount of free-time you have in a typical week.\u003c/p\u003e\u003cp\u003eNOTE: Read the top sentence for a better understanding of what each variable  means, and assume that a \u003cb\u003e\u003ci\u003etc\u003c/i\u003e\u003c/b\u003e -hour class will only take \u003cb\u003e\u003ci\u003etc\u003c/i\u003e\u003c/b\u003e -hours from your week...\u003c/p\u003e","function_template":"function f = freeTime(nc,ta,tc,tw)\r\n  f = (7 *  ) - ((   ) + (  ));\r\nend","test_suite":"%%\r\nnc = 5;\r\nta = 12;\r\ntc = 3;\r\ntw = 35;\r\nf_correct = 34;\r\nassert(isequal(freeTime(nc,ta,tc,tw),f_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":79153,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":77,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-07-02T03:34:19.000Z","updated_at":"2026-02-16T16:37:51.000Z","published_at":"2016-07-02T03:36:59.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 a 7-day week, an\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\u003enc\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e -number 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: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\u003etc\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e -hour classes,\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\u003eta\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e -hours awake in a day, 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: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\u003etw\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e -hours that you work in a week....\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 an equation that will calculate the amount of free-time you have in a typical week.\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: Read the top sentence for a better understanding of what each variable means, and assume that a\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\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\u003etc\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e -hour class will only take\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\u003etc\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e -hours from your week...\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":45196,"title":"Determine whether a given point is inside or outside a polygon","description":"A closed polygon may be described by an N x 2 array of nodes, where the last node and the first node are the same. Each row of the array is a 2-element vector giving the x and y coordinates of a node. The polygon is described by straight-line segments that go from node to node.\r\nIn this problem, we provide you with a polygon p of this type, and with a number of points r, each having an x and y coordinate. You are to determine whether each point falls inside or outside the polygon. If the point is inside the polygon, return the value 1. If outside, return the value 0.\r\nHINT: One way to solve this is to find a point 'p_test' that is outside of the polygon, and then to count the number of times that a line from 'r' to 'p_test' crosses the sides of the polygon.","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: 186px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 93px; transform-origin: 407px 93px; vertical-align: baseline; \"\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: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA closed polygon may be described by an N x 2 array of nodes, where the last node and the first node are the same. Each row of the array is a 2-element vector giving the x and y coordinates of a node. The polygon is described by straight-line segments that go from node to node.\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: 361px 8px; transform-origin: 361px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn this problem, we provide you with a polygon p of this type, and with a number of points r, each having an x and y coordinate. You are to determine whether each point falls inside or outside the polygon. If the point is inside the polygon, return the value 1. If outside, return the value 0.\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: 380.5px 8px; transform-origin: 380.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eHINT: One way to solve this is to find a point 'p_test' that is outside of the polygon, and then to count the number of times that a line from 'r' to 'p_test' crosses the sides of the polygon.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function InOut = inOrOut(p,r)\r\n% inOrOut() Determines whether point r is inside (InOut = 1) or \r\n% outside (InOut = 0) polygon p\r\n    InOut = 0;\r\nend\r\n","test_suite":"p = [0,0; 0,100; 5,10; 10,100; 15,20; 20,100; 25,30; 30,100; ...\r\n    35,40; 40,100; 45,50; 50,100; 50,0; 0,0];\r\n%%\r\nr = [44.28, 60.99];\r\np = [0,0; 0,100; 5,10; 10,100; 15,20; 20,100; 25,30; 30,100; ...\r\n    35,40; 40,100; 45,50; 50,100; 50,0; 0,0];\r\ny_correct = 0;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [38.33, 57.67];\r\ny_correct = 1;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [0.98, 23.99];\r\ny_correct = 1;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [27.07, 95.94];\r\ny_correct = 0;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [ -7.45, 7.14];\r\ny_correct = 0;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [43.19, 2.87];\r\ny_correct = 1;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [19.39, 16.79];\r\ny_correct = 1;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [48.72, 71.27];\r\ny_correct = 1;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [-6.42, 68.20];\r\ny_correct = 0;\r\nassert(inOrOut(p,r) == y_correct);\r\n%%\r\nr = [20.03, 47.11];\r\ny_correct = 1;\r\nassert(inOrOut(p,r) == y_correct);\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":8580,"edited_by":223089,"edited_at":"2022-09-09T08:55:17.000Z","deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":"2022-09-09T08:55:17.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2019-11-06T23:11:51.000Z","updated_at":"2026-01-23T09:40:37.000Z","published_at":"2019-11-06T23:20:58.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 closed polygon may be described by an N x 2 array of nodes, where the last node and the first node are the same. Each row of the array is a 2-element vector giving the x and y coordinates of a node. The polygon is described by straight-line segments that go from node to node.\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\u003eIn this problem, we provide you with a polygon p of this type, and with a number of points r, each having an x and y coordinate. You are to determine whether each point falls inside or outside the polygon. If the point is inside the polygon, return the value 1. If outside, return the value 0.\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\u003eHINT: One way to solve this is to find a point 'p_test' that is outside of the polygon, and then to count the number of times that a line from 'r' to 'p_test' crosses the sides of the polygon.\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":61047,"title":"MATLAB Time Warp – Stabilize the Temporal Lattice by Finding the Dominant Eigenvector of a Time-Distorted Matrix","description":"The Chrono-MAT Engine is malfunctioning.\r\nA time-distorted matrix A governs the stability of spacetime.\r\nYour mission: determine the dominant eigenvector, the direction of least temporal resistance.\r\nGiven a square matrix A, compute the normalized eigenvector corresponding to the largest eigenvalue (by magnitude).\r\nNormalize it so that its Euclidean norm equals 1.\r\nIf multiple eigenvalues share the same magnitude, pick the eigenvector corresponding to the first one returned by MATLAB.","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; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 171px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 85.5px; transform-origin: 408px 85.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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe \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; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eChrono-MAT Engine\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is malfunctioning.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA time-distorted matrix \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; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eA\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e governs the stability of spacetime.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eYour mission: determine 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; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003edominant eigenvector\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, the direction of least temporal resistance.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven a square matrix \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; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eA\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, compute 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; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003enormalized eigenvector\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e corresponding to 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; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003elargest eigenvalue (by magnitude)\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNormalize it so that its Euclidean norm equals 1.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; 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: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf multiple eigenvalues share the same magnitude, pick the eigenvector corresponding to 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; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003efirst\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e one returned by MATLAB.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function v = stabilizeLattice(A)\r\n  y = x;\r\nend","test_suite":"%\r\nA = [4 2; 2 1];\r\ny_correct = [-0.8944; -0.4472];\r\nv = stabilizeLattice(A);\r\nassert(isequal(round(abs(v),4), round(abs(y_correct),4)))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":4953963,"edited_by":4953963,"edited_at":"2025-10-23T13:07:36.000Z","deleted_by":null,"deleted_at":null,"solvers_count":10,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2025-10-23T13:07:00.000Z","updated_at":"2026-03-19T07:25:04.000Z","published_at":"2025-10-23T13:07:36.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\u003eThe \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eChrono-MAT Engine\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is malfunctioning.\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 time-distorted matrix \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e governs the stability of spacetime.\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\u003eYour mission: determine the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003edominant eigenvector\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, the direction of least temporal resistance.\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 a square matrix \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, compute the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003enormalized eigenvector\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e corresponding to the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003elargest eigenvalue (by magnitude)\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNormalize it so that its Euclidean norm equals 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\u003eIf multiple eigenvalues share the same magnitude, pick the eigenvector corresponding to the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003efirst\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e one returned by MATLAB.\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":169,"title":"Set a Soroban Abacus","description":"*Description*\r\n\r\nThis problem is the inverse of \u003chttp://www.mathworks.com/matlabcentral/cody/problems/136-read-a-soroban-abacus Problem 136: Read a Soroban Abacus\u003e. Provided an N-digit integer, return a logical matrix of size 7xN that symbolizes the input number.\r\n\r\n*Example*\r\n\r\n\r\n    x = 10586;\r\n    y = [ 1 1 0 0 0\r\n          0 0 1 1 1\r\n          1 0 0 1 1\r\n          0 1 1 1 0\r\n          1 1 1 1 1\r\n          1 1 1 0 1\r\n          1 1 1 1 1 ];","description_html":"\u003cp\u003e\u003cb\u003eDescription\u003c/b\u003e\u003c/p\u003e\u003cp\u003eThis problem is the inverse of \u003ca href=\"http://www.mathworks.com/matlabcentral/cody/problems/136-read-a-soroban-abacus\"\u003eProblem 136: Read a Soroban Abacus\u003c/a\u003e. Provided an N-digit integer, return a logical matrix of size 7xN that symbolizes the input number.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cpre\u003e    x = 10586;\r\n    y = [ 1 1 0 0 0\r\n          0 0 1 1 1\r\n          1 0 0 1 1\r\n          0 1 1 1 0\r\n          1 1 1 1 1\r\n          1 1 1 0 1\r\n          1 1 1 1 1 ];\u003c/pre\u003e","function_template":"function y = soroban_set(x)\r\n    y = zeros(7,N);\r\nend","test_suite":"%%\r\nx = 2;\r\ny = [1;0;1;1;0;1;1];\r\nassert(isequal(soroban_set(x),y))\r\n\r\n%%\r\nx = 10586;\r\ny = [ 1 1 0 0 0\r\n      0 0 1 1 1\r\n      1 0 0 1 1\r\n      0 1 1 1 0\r\n      1 1 1 1 1\r\n      1 1 1 0 1\r\n      1 1 1 1 1 ];\r\nassert(isequal(soroban_set(x),y))\r\n\r\n%%\r\nx = 0;\r\ny = [ 1\r\n      0\r\n      0\r\n      1\r\n      1\r\n      1\r\n      1 ];\r\nassert(isequal(soroban_set(x),y))\r\n\r\n%%\r\nx = 50000;\r\ny = [ 0 1 1 1 1\r\n      1 0 0 0 0\r\n      0 0 0 0 0\r\n      1 1 1 1 1\r\n      1 1 1 1 1\r\n      1 1 1 1 1\r\n      1 1 1 1 1 ];\r\nassert(isequal(soroban_set(x),y))\r\n\r\n%%\r\nx = 9876543210;\r\ny = [ 0 0 0 0 0 1 1 1 1 1\r\n      1 1 1 1 1 0 0 0 0 0\r\n      1 1 1 1 0 1 1 1 1 0\r\n      1 1 1 0 1 1 1 1 0 1\r\n      1 1 0 1 1 1 1 0 1 1\r\n      1 0 1 1 1 1 0 1 1 1\r\n      0 1 1 1 1 0 1 1 1 1 ];\r\nassert(isequal(soroban_set(x),y))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":38,"test_suite_updated_at":"2012-02-02T03:45:39.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-01-30T04:56:28.000Z","updated_at":"2026-03-31T13:07:34.000Z","published_at":"2012-02-02T03:52:17.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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eDescription\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\u003eThis problem is the inverse of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/136-read-a-soroban-abacus\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 136: Read a Soroban Abacus\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. Provided an N-digit integer, return a logical matrix of size 7xN that symbolizes the input number.\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[    x = 10586;\\n    y = [ 1 1 0 0 0\\n          0 0 1 1 1\\n          1 0 0 1 1\\n          0 1 1 1 0\\n          1 1 1 1 1\\n          1 1 1 0 1\\n          1 1 1 1 1 ];]]\u003e\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":975,"title":"Gauss Eliminate 2-by-2 example","description":"Use forward elimination to make the coefficient matrix, A, an upper triangular matrix, and then solve using back substitution, for a sample 2-by-2 system.","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: 348.5px 8px; transform-origin: 348.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUse forward elimination to make the coefficient matrix, A, an upper triangular matrix, and then solve using back substitution, for a sample 2-by-2 system.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [Ab,x] = GaussEliminate2eqs(A,b)\r\n% A is 2-by-2 system coefficient matrix of the linear system\r\n% b is the 2-by-1 right-hand-side column vector\r\n% Ab is the 2-by-3 Augmented matrix of [A,b] after forward elimination\r\n% x  is the 2-by-1 solution vector\r\n\r\nend","test_suite":"%%\r\nA = [3 2; -1, 2];\r\nb = [18; 2];\r\n[Ab,x]=GaussEliminate2eqs(A,b);\r\nAb_correct = [A,b];\r\nAb_correct(2,:) = [0 8/3 8];\r\nx_correct = [4; 3];\r\nassert(isequal(Ab,Ab_correct))\r\nassert(isequal(x, x_correct))\r\n\r\n%%\r\nA = [3 6; -2 -3];\r\nb = [9;12];\r\n[Ab,x]=GaussEliminate2eqs(A,b);\r\nAb_correct = [3 6 9;-1 -1 15];\r\nx_correct = [-33;18];\r\nassert(isequal(Ab,Ab_correct))\r\nassert(isequal(x, x_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":279,"edited_by":223089,"edited_at":"2022-12-04T08:25:24.000Z","deleted_by":null,"deleted_at":null,"solvers_count":126,"test_suite_updated_at":"2022-12-04T08:25:24.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-10-08T05:33:17.000Z","updated_at":"2026-03-11T11:45:42.000Z","published_at":"2012-10-08T05:33:17.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\u003eUse forward elimination to make the coefficient matrix, A, an upper triangular matrix, and then solve using back substitution, for a sample 2-by-2 system.\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":60966,"title":"Determine if LTI system with feedback control is stable","description":"Linear timeiinvariant systems can be represented by the differential equation , where  is an  matrix,  is an vector representing the system state,  is a  matrix, and  is a vector representing the control input. Feedback control seeks to stabilize this system with a control of the form , where  is an  matrix defined by a user. The closed-loop system can be represented by , and is asymptotically stable if and only if all the eigenvalues of  have negative real parts.\r\n\r\nWrite a function that takes an , , and  and returns a logical scalar that is true when the system is asymptotically stable and false when it is not stable.","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: 214.6px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 107.3px; transform-origin: 408px 107.3px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 133.6px; 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: 385px 66.8px; text-align: left; transform-origin: 385px 66.8px; 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: 238.333px 8px; transform-origin: 238.333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eLinear timeiinvariant systems can be represented by the differential equation \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-15px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK8AAABGCAYAAAC62cQ/AAAIsUlEQVR4Xu2dOagtRRCG38sVXCINFNRAQVDcQTRTQRRRcY0MxC0xEAUNDAz04YKI4IbCCxSfioEogiIYiOIKrmigggYaKYrmWt+j6766fbtn+pzpmXt6pgaKc+6Znp7qv/+pqa7q7rt3jx+OQKMI7G1Ub1fbEdjj5HUSNIuAk7fZrnPFnbzOgWYRcPI223WueE3y3itwPuSQOgJTITCEvM+KkqeJHCdyjMi7IpdMpbjfxxEYQl7Qu07kQIDxPre8TqgpERhK3otF2XeCwufI52dTKu/3WjYCQ8n7sMB3t8gPIueL/LlsOL31UyIwlLzfi7Ini7waXIgpdfd7LRyBIeQ9SrD7I+B3u3w+s3AsvfkTIzCEvLeJrk8HfU+Sz58m1t1vt3AESsnLwOwuEcJiHF+Hz2uDv3uKwfFs+X6NyIUi54r8LnKsOU+E4nERwmtusRdOwCHN7yMvrsHbgYSEwojtMigjwgChOZ4TudUoQbLiC5GrRW4JvytJsdaPiPwTyOu+8pDeW/i1XeTFgr6RsZAaZQA+EhMkKOLD+sQQ/PlQ3wXyiYsB+T8X8QjFwkm4bvNz5IV43wbixpaVeyl5/5Xvx3cQUKMRuA5/i9yZIfq6+vt1C0YgR96PBRP81Vz8Vs/3pYRxM9R1SD0Ec4IeTHhAl5IiP1Haeo/I5cHI5foSw/VmMHhVB/Up8tqU7/Vy01cSWv0XfutLCZfUNQcCa6aRh90OXufQtr42WPeQsnYcA8FfCoaQc3186bvXtvMp8tpX/alSOvZJbYisLyWM8j8WEn0lxTes8G/G+hydwGzD1K2qju1jKo7HQJD7F5HDwl37OFOsXExeBmmfhqtzkYA+l8LeXMvy2yci5xVr1k5BO3hNdd5utkRn/hGaTL1Ba+hm3665MZDlQTX3MSavtaqpGKxVtC/MRacS6+WpIx7M0ReaqwHmlHVgdb4MN1TLskmxayVN1dd1BLAd1+TGQJa8fbwp7r+YTNaKxP5ubP61k4jropB1xvEB94sQFjtLRKdN6iuFTuf3saxBMQADC6I/0ZavRDZxYDoFea3LlHtI1BUF7kksL8kERpMckO0tkV9FNDlBSvgikStFIDJ/E7elLPHhm0R4Eq1DT537RD4UaT1spoM0fLgzRTRVvknu0djkjf3dlD9rXVG4tKrPC38wdBzb8gKx5Y2tK08Jx40iD4ocKcIUSA6ISbr4MpGnRJTU+D2UtUuC7JNH6OTJ6HyosqkP2kSaHFfKzmuO0+Fxo6ZMn49NXutmpsKqavSYechhLTNcIzMLp3Av4RIhNZut5RrrlmwbDKd8UDriCRG9ISR9LJCVc6+LkN59UQQrSjTCJi1i4qIAHUyGjSN1Pu7g+G/rM/WVzZ3noTp83Yuj6zTNfbr8ru6Shg8p2hVxmDJ9PjZ57TQBXEfICWEh5FUijHXAnSkGL4jEmVgI/LKIGr5Utlbdkh1vtFYGUJtEXn074SaoWwVhre+XS5nbZ2CK9PnY5MWI6UAVkup3bSe/3SzSNbbRByAVqbABAuvGHqy/FfJWMphVquE1RlYpjoHbB6w04jB2+nxM8lpfNiYe53ANydJydGVis5Y1kF4jVTsMgpN3NT7rACVFThupKR1RD02fxzHm1VpzqPSqgyiutPdODVLt/BjKpzDpSmLZc8n4sZN3te4udV9KIw5D0+e7SV6LxY5XeoDVPpypN31XthZXQ61uEk8nbzl5lWg5K7VKxEHvOnb6fCy3IZ7PkPPxLSa0OS6nBCVCY92wOASXjB+3Qt5Si9dFxaHRBnyzb0IH5O5TGnHQ68dOn49F3pKUMG20ljVFXvV346wbYwFm6KnPnDQYMXnPKDdEVUr+LLX8VVDTbpNXX899vqEdffdFHKZIn49F3pKUMN1qy8V+q7WudgwBLmQtjxDBcsdWeYsuMXmt5Sjg1OAi+DSvDa5l3Ao0NPZRj9VFi9KIw1Tp87HIW5ISjhNesXW1VlkX8GqOgT1AdCaaRiooj7HbihXH5NX8/Lh0OFT7e0Ghqe63zn3UL+uzutSdW9unKc6p0+djkDf2R3Nzvu2Ai+wbmVg7/0Wtss6B1mVnV0g5El86lRarDGkfELk0nDvYj634vOuQrsY11jqUzNO1ltemiS2pp0yfj0HeOMJhQ2A8pLxN7xdhdTgHlvKOiLj8brHCKkNMFu1S3g70iDSQOta1j1v96uTNU9xaDkoB4n6R1OYq6qdpaEdr1WtOkB+YE5IiLmWHps9zrahJXgjF9geays3dkzZ+J8JMO6YSpBbncq2m2PlO+vhREd3rzsaIwZCHYUc9Tt48eedwRiej5x66pts4Bnl9k+mmKdGO8jXI65tMt9Pfs9K0BnnVZzsQkBlzycmswPfGDEOgFnnt6LAkpDRMa7/aERAEapG3ZJNp4nhMUs6NPr1DHIGVEKhF3r5NpjX0weoLO4F7JWW9sCNgEahB3r5NpjnPgkuWFblL4fyrhkAN8qZy1KqgBt9ZHpKdYFGtNV7RohBYlbyaZenbZJr89wcimiKMQfWd1BdFs3EaW0redTaZRmO7zql0Xdc4LfVaZ4dACXmHbDJNto2l7hxubWdHn91tUB95h24yrbOp/P+07W4/z/LufeTVWUnrbjKtk9tLV9POEmRv1DgIdJG3ZGVr1ybTNuuWm7A8Tqu81kUg0EXeoZtMl/7fikUA7Y2sj0COvDU2mVbyl+5hUL91XuOsEciR1yYe1tlkOt7W1FPCs6bR7jQuR96hm0xbf1mXgLOsht/9cASqIFBieVfZZPoG0YqVn7oyVFPC7Kj4voj/c+0q3eaVgECOvOtuMq1LmzXExmI89jtgYxG3us65qgh0RRvW2WRalVPLq6tl9X8WV1XeK1s2An1JimWj463faAScvBvdPa5cFwJOXudHswg4eZvtOlfcyescaBYBJ2+zXeeKO3mdA80i4ORttutccSevc6BZBJy8zXadK/4/oehFZVmYKEUAAAAASUVORK5CYII=\" width=\"87.5\" height=\"35\" style=\"width: 87.5px; height: 35px;\"\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: 24.8917px 8px; transform-origin: 24.8917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, where \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eA\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: 18.6667px 8px; transform-origin: 18.6667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is an \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEUAAAAkCAYAAADfJffWAAADLElEQVRoQ+1XO49OURQ1vYpKQ4JCIR6ZeCSi80hEIxLMUIpXoyKoRISEH+ARhSi8WppR6CYZNDoKWipC6FlrctZkz737zLfPPclHcU6y8p37ndfe666z974Ty1rrMTDROOkz0EhxVNFIaaTEgkVTSlNKU0qMgaaUGE8tpjSl/H9KWQGTngDngM8x8+ZnbQOuA/sL1lRNHef1mYGl+4DfwJYgMSTkNbAceA4crfI2uHicpFAps8CGIDGWkDdYcwD4HvSrappHyjrsSOwBNgOrgRfAxXTSLfyeAFYBH4FdBcZGiakhhGpcC2w19m9MNuoqcg7bWeBul0GPFEp0Mi2gbNm2A4wDfNM/E7TxbUNYd3/veRQxNYRw70uJDNn3Cs+MR2cA2voYmAbkW4+Dpa7PHBbuAKiGg8BL4BFwE+CBjBFsV9J/EUI0J0dMDSH2fGsf1cB2PvnBlyvfvqIvFS2sX4qUP2kW2V0D/ABOp//I+p3UX4/fkmySI+YkBh4AfIO1MYRX/ALAoH4YeAjsNnZ+QZ/X3w3eOVIs01xIUmygu4fnU0BpTFl4G6ljFaOxWkK4j1U5n68Cz8yZ31I/HFM4X06z76VQMX0f41JP1+HoM2PYUzOZ8etddLEzj0TLaQ53bbQqX4nxXkbLKeUDJjN1snVjBjPTpzTGAMZANrTZGKI9SuoY71xLshczqJgjABW509sgl5LltCdlMU3jea2G1g7doHocezGYR+uY3IuQ0xw/BujaaL5Uns2aHilWXl5mUWWqVDdEJbksMypdR86S055KeO7btEn2mnqk2HLcU8IvbMoMIcIuo89gHM1Ao9JuDTHWaU8JtPUGIMLID+saFabzfHmkyGlPCfa+MhXvBQ4BU8FrNIoQKWEoMXKa+3hKUKzkS2TmYTHK+mVRXOySYpn20pXyPw/lxpsAFnYRlUQJqSFGKs+VCqq9OM6mYlRnukqxTntFGTPPe0BfrbxCEUJ4mGqHkjrEKiYSw+R07otapQavzzWg991DQ8f9lcwqmAosyVgkZsi6RW+/5GGcpJTY9U/nNlIc+hspjZTYrWxKaUppSokx0JQS4+kv7oDZJaNZ5TgAAAAASUVORK5CYII=\" width=\"34.5\" height=\"18\" style=\"width: 34.5px; height: 18px;\"\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: 24.8833px 8px; transform-origin: 24.8833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e matrix, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ex\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: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is an \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEUAAAAkCAYAAADfJffWAAACqUlEQVRoQ+2YsUscQRTGvd5C7NKYwhSmiYIkKWyNQrBJo4gpJSb2EUwtCegfoAlWIkS01EYLOyGaJl0skjbpgqK9fh+ZB4+92Zs3u+N56Cx87N7u7Nyb337z5u02uvLWRKCRmTQTyFA8rshQMhRbsshOyU7JTtEE+vHjI9QDjYfQ3PXpIzAmHYiD+w5lEQCGnDvGMpT/BOiS3w7GVadC6UVgX6F5FWxoevP6U2jJYvsWnXUslH0ETRtfOlvLU2wFhkAOoW5oG5qyUPS06VgodMoRNGAEo4Ec456X0L/bgsK5SI1Cg1AftAstuICWsX8NPYBOoZGIYK1gUgJh2LWdQosOQ++cbdnpM4h255M+d5KMvqKAWR5kCExqIEmgyMC+4eC5c8ME9nvQBvQJIhDmCG4f3DkLEGlTBuYmgCSFIpajEx5CZ9CcG9Vb7Ffd8SPnohgobFsEM4tz6xCTat0cUoyl9vRhh9oJzPqEohPdZ/x+A8XmlGKwGoxcSw0kmVNk0OzQt4T+wXkm2i/KPbFOkfbMYVvqZuav71U7K7kviVN+onMundyKOYMr0y93jS9XfJ+ouukcIn3E1DHW/60NRQ/aZ2XJJwye06pq7VBMqjPoi8ncWsdYgbBdbSg6ifpWFqlMTW+cJZGXrTKh5ToGhG5bG4oux31OuMC/cYUQYHwbZTK2lO0MNLTs3gSY2lBk0D4n6KTIpfgF9AqaNk6jEBB5uqnB1ILCoE9cZKxo1wp+ZYn/3p2jO55ALOwsLrECSQ1GlxcsIR6H5mDxy5setK8oYxL+4aYPoXAKWYAwDqmQY+oQ7ZjYHMbcSBfL64iw+IuDTWgH8i797fwcyQGyCqYDY1asqveFDFF6vZ1QKgfZ7hszFA/xDCVDsU3E7JTslOwUG4HsFBunazWTwiVMoNvxAAAAAElFTkSuQmCC\" width=\"34.5\" height=\"18\" style=\"width: 34.5px; height: 18px;\"\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: 116.675px 8px; transform-origin: 116.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003evector representing the system state, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eB\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: 14.775px 8px; transform-origin: 14.775px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is a \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAAAkCAYAAADB7MdlAAADiElEQVRoQ+1YOYgVQRDdzY3MTBTUQFE8EA8QMw8QDUy8AwPxSsRAQRExEAXNvTAy8YpEETQwEAR3TQwEDTR1s0XRXN+TLqntX/On6g9/TKrhMd2/a/p4/bqq5k9OZHEzMOm2TMOJJCsggiQryQowEDBNZSVZAQYCpqmsJCvAQMA0lZVkBRgImPaprPlY1wPgFPA1sMb1sL0C7Ai8MxbTPsl6iR1sB34Ba5yEkajXwDzgMbBvLCw4B+2TLCrrLbDMSZgmagrv7ARmnfsai5lF1hLMRGwFVgMLgWfAubKC63geBhYAn4HNgU14CetCFNW7GFhb1r9CKZn7ugnQhmU/8KjUubZbwN7S3oDne826RRalvg44CVD+LHyRfobK+FEgE95AW4jUYzfV2wjrQhTn5Lp40GfLAnigywGO+xTgwR8se9N9vO4vACqY+5a+f/sYdg3fwWpjeWkXns+B+8C1siD6IJYL5TcPUWLTRFhXomR8KuhLafAwnxSijuD5CpC9sX6x9J3BkyqTPl79TXpTw8j6rSZbhPp34Hj57QSelCzLUiAS3ZoIO4qOewBPtauP4u14WCbiDbkECFH8We9tN9qnC4l135wb00QWpSzKYRQiWdrB3kH7GBD1WfqgWNcKk76uRHEcWd8M6nQblwHxTVTvdJmMc70BhBS9b5fP0pOxboX6b/idDv4uIGqrifC2tQr4zsAivQMpu0+oS9SlH9Ipx3m0ryqytAgYvOjrSPJKYE70bVKWTMYxa5+k/QETRd77UYv2UTJGJA+z5tXr46a3ANpNSL5nHYz2ZQNJcFPqIM7RuhLir7gpXs9Rc5/amR/CWAwi3jys6YC0P7WCj/grHnJNiPSZQcsiq20yORlrMq/CmqJeW1rhGX/Yl4L2SfWt0H1m0LLI0pNZyvmJFTNiCfv0AQwC3ojYlh50JWyYcrTjr32S+CsJWpKYM1X6WyyyhAxLOdoZk/1twB7ggPM6thEl6xqVsDpluF1JUQKT9Z0p/op9TDc+1v6uJkuHVb5QTybscw0cdBXAhNWjKi9RXQgT5Vj+VDt+a28iEiqLRedeprI0Gda95YQfAPkXgFfRQxQn05mx96NYK8zjI0U5lq1OGay9SQbAoMYkdiDK9/2vA7N+nmokgsoHbvS96gZ2b/ZJVvfV/ucRkqzAASRZSVaAgYBpKivJCjAQME1lJVkBBgKmfwCTL/0lUbJyPgAAAABJRU5ErkJggg==\" width=\"37.5\" height=\"18\" style=\"width: 37.5px; height: 18px;\"\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: 38.5px 8px; transform-origin: 38.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e matrix, and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eu\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: 14.775px 8px; transform-origin: 14.775px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is a \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAAAkCAYAAADB7MdlAAADAElEQVRoQ+2Yvc8NQRSH79tLiE7jTVCQCI0XiUhEhESIQuLjL0ChQ1CJAqFQKHz8BeiUFAqVjwoFjZaKEHp+TzInORl7787Znch7Yzb5ZffunNk58+yZM2fvwqQdxQQWii2b4aTBCgRBg9VgBQgETFtkNVgBAgHTFlmTyX7xuio9ka7PYvc/wzJIOxKgyw3W36GyWrcuSovSFmljgzV9PQGL45tEdD2dN1in5fA66UIg32J6X3ouPQr2M/O5g7Ukz18n7x/ofKpw4gA6Jv2S9kpvCvt5s7mDhfNE1t0AMA/qvPrdGwCKLqNhrddD0D5pq7RWeicdTw5d0vmstEb6KG1yjmJzO7U90/lAYBKlwGqBqgZrm550RbKd4oSucRKxi/xIb4UBfdtu/X7f0VbKrA9YTVBVYNnEvGMAsmVyRtfAtF1ku67PpU7UKkSltRFZRFjkmAasNqiqsD6kyHql81tplQQottybErnii3RH2iOdzNpIvEDGPnrkwBjbkvmYHJX7MTpn8UBqka/pyUTGSumgmziRw0DkLI5D0qd0/VJnquJozson4oHRBvyaoHhmFVgk6ofJe6LniOS35p/6vSK1W86yyf5OF72fDzmdjt8W3TSNhd81XBVYlh8Y4Jbki0VfF+UT8IOTy4bUPjYp74Pdi9RhBe+iTmR91kiUBkTVZsnnHctXOJMD8bks71fifA7Klh73I3VY6VijI6uvoracROLfmXllbY913+qyUsengbKCs6+siI6D/WhYsyLHJ/6unGT5il2TSfLtRhFbuiP2lQe1gY2GZUmVnW5XNlHv7Aa12Q6YvyXa+MZjFx3yrTdr16sJbBQsHzl5YgeIvfkukETQtbQWSPzfJavL+pZIX0Tl/WsB86uod/PI/yn1TnTtZlYydOUkKzdIyiTjG4XLz95utI4yX+l3VIp8KQDpsGSfc/YyyMMvpvm+XP5WZuIc0X8Phvbri/TO9uUCa5Dz/7pTgxUg3mA1WAECAdMWWQ1WgEDAtEVWgxUgEDD9A07I1SWdIYEDAAAAAElFTkSuQmCC\" width=\"37.5\" height=\"18\" style=\"width: 37.5px; height: 18px;\"\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: 115.525px 8px; transform-origin: 115.525px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003evector representing the control input. Feedback control seeks to stabilize this system with a control of the form \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHAAAAAkCAYAAABR/76qAAAEIklEQVRoQ+2aS6hNURjH752T10iJAQNKmXiVKAolMlAeMbgjj5ERxcDAgMLEyGNo4FUGUoqBsddEKQYoJUZIzPn/sr/Td9dde9uPs8/Z51ir/t1z9157rW9//++5zpmcSGOkNTA50tIn4ScSgSNuBInAROCIa2DExU8emAgccQ2MuPjJA5sTeFRLbBZ2CLPccr/0+abwRLgjLBWOCIeEhW7eM32+L5yvI0oisI7W4s9c0+XD2S3I2yM8jkz1807rPv9/qytGIrCu5mY+54mBuO2RpfHWK0IRwZUkSgRWUlfh5M8uNB7T56vBbCOPkHlQeN+PrROB/dDi3/z2zi21LCCIHLhXuC6cahIyQ3ETgf0h0LyL1d4KGzKS1ujvDWGRcCLilY13b0LgfO2+OpPgZT+tqvFbDX6BR9pyW7btXf3dJ0DqReGTcFyIFTSNJY0RCDGUu/OETcJi4UF2zW/ok/aC/5zAn3p/ayHIf7QVhEzIpNIsk+8gfUum8+XZs1yzcUEfWJt9eiE6zwMh8ZZgVkVFFVqQJW2S8vqSpsR6WGvTgVJq9U1NN448T5h87q5/0Wf6PMhD4WVaBHLoVuGDcFZYl61nRJFDNwqzMwJ7RVJRCLWwQMm7JBAEy7idbUKYOFlSMeNIIEXJuZz3rxOZvG73a10i4ZTAQQGDtNVzpiICizzMqioWjHlnST7HYtpT5zEY8y6BEMig6iQdVRlEv6/ZA0S3OcJOIRqG8wj0ZXEYrvy9mHdWEXZQc72S6+65Vg++iDz8212z5t2nibClKLP/G2cEeCEOEx15BPqyOBTce1+V/FdG8LbmtEWgD3femP1+eacyRe9aukDMI9BIIiGvFCwRhw1rl4qJtsgvq2hvzKGeqqaZIgeaJk8egZb/rKexh3DtH4JVSXlhJe+lx62I8aEuNGYfqWjuV5S0MHLgR8HaksIiMUagtx5/pkcfQjU6V4CI0DvLyDdOBIZeFhpzSETsfDSmM8LvK4EenGKoME3FCPTuawkYxV8WOCIy67DYznz6l1ZOGspYxZDmeD3lGTNGzxEagxxJH1c0mL9KOCDQ59rXU8YTPHwXesVUjEBLoOb2NKp84bhbIBfaoS0WZY0nPUqZhnVIum5lWx8i8wqVf4VDvBjwPAbBkZu1DL5AIodCHOeq01qKGIG+giIHQo59OelDIK7NMRsnBGWOilrR4pAWDYkJawUvVlgB+7bCjuDwTob/Etj3g9xn7lRGdm/9vBBK4mQ8FC4J5rIs+lrgqAgCz4QLDkmhg9yWMBf+LIL9adrvOX1YzcCZaDhsrh2bEYJnkKNrFoLz7qcf9g6S+Tb2avJ1UhvypDUraiARWFFhXZueCOwaIxXlSQRWVFjXpicCu8ZIRXkSgRUV1rXpicCuMVJRnkRgRYV1bfofpXDdJZDOy+4AAAAASUVORK5CYII=\" width=\"56\" height=\"18\" style=\"width: 56px; height: 18px;\"\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: 24.8917px 8px; transform-origin: 24.8917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, where \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eK\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: 18.6667px 8px; transform-origin: 18.6667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is an \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAAAkCAYAAADB7MdlAAADe0lEQVRoQ+2YO6xNQRSG7+0lHp2GBAUJIfFMRCIiJEIU4tXdyqPQIaEQFUKhUHhUokKrolB7RIGCgpaKEHr+72aWrDt39mPtncgp5iR/9tl7Zs2s+faateac6an66U1gunfP2nGqwgoEQYVVYQUIBLrWyKqwAgQCXWtkVVgBAoGuNbIqrACBQNdJiaxT8nmFdD7gO13vSs+lR0G7Qd0nAdZmef4qeX9P15M9VwKgI9JvaZf0uqfd4G6TAAvniazbAWAe1DnZ3RlMIGBYgrVS9mi3tF5aJr2TjqZxL+h6RloqfZTWuPnoczO1PdN1b8CXvsCGgloiXzZJG6UN0vLk27Z0xffL0mqpGK1NsBjUDBnrmISTiEl+SnvSJL5th569L7T1ZdYFbCgo5me7H5YOJCA8uyhdTevC9yfSieTsS10N5Oyjtm3oHQOQbZPT+g7Mp2nQLbqeTd+ZnKi0NiKLCIt8moCNAeXnv64bti6fVdKV9J11fZf+pPt5O6MN1gcZEZIQfistkmxAm/Crnt2SdkrH02TWRigDGQeinxwYc1syH5ujXmisrWld93WdkfYlP3nRnxy8ObmwCRb7+5sjvNANyGMih21IzuKzX/qcvpsz0ZyVA/XAaAP+WFCM4yNnne7ZfuY7eethcoSos+ezj5pgeSOi56DkS/Mv3S9Ig1rOssWaM5YPcgiRe4tubMbCZwy/Lu5z322r54WrFZYZ0emG5A+L/lyUL4Bo87lszNnH+2CAI+ew0kvhEGsJvAT/i9qp8vmaW2GZEVG1VvJ5xydIkrsH4nNZbheJqDyZYxs5hzXNZetiS3N88NvM56tiYSptw64TtU+Qc0qrJre2xynkI4Csb1PV6zpWdM3lYZSiivMjlbEUII2R1RY5PvGXcpLlK6omlYSwx4m+FbHreDAGmMFg4aXIsaJlIEkpi6V/vztLkWVJlSS3PVuodzavFj5f0cZvPKrokN96bVVvKDCDUYocHwS86DfSA8lX+XnV0BuVkpyvFjlI/+Z4Oz8kO5d1bZGuiMrthwCzCl5KEf5F4ztHihlpzoE6jyzvRJ68cbhtQivLJE+S8bWe288cjZ6jzFfsDuULy+h6GJYi8hfgD+GXSuNN0r8OOB/99wBgQ+y6Ir3YPimwBjn/v40qrADxCqvCChAIdK2RVWEFCAS61siqsAIEAl3/AjF16yVFGsuNAAAAAElFTkSuQmCC\" width=\"37.5\" height=\"18\" style=\"width: 37.5px; height: 18px;\"\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: 57.175px 8px; transform-origin: 57.175px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e matrix defined by a user. The closed-loop system can be represented by \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-15px\"\u003e\u003cimg src=\"data:image/png;base64,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\" width=\"59.5\" height=\"35\" style=\"width: 59.5px; height: 35px;\"\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: 150.917px 8px; transform-origin: 150.917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and is asymptotically stable if and only if all the eigenvalues of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACcAAAAoCAYAAAB99ePgAAACM0lEQVRYR+1WPS9EURDd7VVUFCLRqCQKH4loRKhUCiIKhQSFUkIjW5HwA3xEoVBQq4joiI9Gp6GgoBPiB3BOckeuZ/fNfbPv7W7xXnJy7+57d+Zk7pyZKRYa+Ck2MLdCTs56O3nk8sh5ERjF/hToA+6skdHOWXPuGob7gSngWHNifW8htwBn287hHtZ5q3PtXFJyzTD4DDQ5wzdYBzQn1vdJye3C0bRH7g37Nqtz7VwScp0w9ujy7Mgz3IL9u+bI8j4JOYrgExgDXoFW55C/zyzOtTOh5CZhaB8YBlg6RK20vwjsaI4s70PJMVIngChzE/tl5zAzxYaQI5EZYAh4coT8cpKZYjVyFME9sA5seFcjHYJ/ZaZYjRyrfzcwCEQV+e2RzUSxceT86Gj5XI1i6WfCCe5Pn44j94ADLwAdl3uqVSy7zYpTOzvOvz5diZwkfNzUkZZiKw4R5chJ/7yKiRojueqEwn01ik1ETiKizWppKTaYnPRPtqNKuSb514vNraJY2mMZ+gA6gHagBPgzYBA5Xucl0AWEVP2omqNtjOQvgDmPjPRkP/lVcnR0AEgzZ0C2AI5I0hUkSPx2BGDX8L+PnqFTPv68R6HNAkuAlA2VnDhOa5X0CLmBmpOTK29IciKWkL5b88gxPb6AcpWfedcDyPhVF3J+kaa4zp2QxrH6g0RdyDF6nKBLAMsTr/gQkAogvVWGVnaZNeB35NdGprTUa7KTkzOFDYfyyOWRs0bAeu4HvRx9Kc8YqwgAAAAASUVORK5CYII=\" width=\"19.5\" height=\"20\" style=\"width: 19.5px; height: 20px;\"\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: 78.575px 8px; transform-origin: 78.575px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e have negative real parts.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; 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: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\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: 385px 21px; text-align: left; transform-origin: 385px 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: 92.4333px 8px; transform-origin: 92.4333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that takes an \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eA\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: 3.88333px 8px; transform-origin: 3.88333px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eB\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: 17.5px 8px; transform-origin: 17.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eK\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: 250.1px 8px; transform-origin: 250.1px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and returns a logical scalar that is true when the system is asymptotically stable and false when it is not stable.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function tf = isStable(A, B, K)\r\n  tf = true;\r\nend","test_suite":"A = [-1.0360,0.9407;1.8779,0.7873];\r\nB = [-0.8759;0.3199];\r\nK = [-4.1353,-5.8468];\r\nassert(isStable(A, B, K))\r\n%%\r\nA = [-0.5583,-0.5700;-0.3114,-1.0257];\r\nB = [-0.9087;-0.2099];\r\nK = [1.4549,10.7761];\r\nassert(~isStable(A, B, K))\r\n%%\r\nA = [-1.6989,-0.1178;0.6076,0.6992];\r\nB = [0.2696;0.4943];\r\nK = [-2.7019,-0.5485];\r\nassert(~isStable(A, B, K))\r\n%%\r\nA = [-1.4831,-0.4470;-1.0203,0.1097];\r\nB = [1.1287;-0.2900];\r\nK = [-0.4390,-0.3865];\r\nassert(~isStable(A, B, K))\r\n%%\r\nA = [1.4702,0.8123;-0.3268,0.5455];\r\nB = [-1.0516;0.3975];\r\nK = [14.3992,56.0007];\r\nassert(isStable(A, B, K))","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":4910100,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":8,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2025-07-17T16:26:09.000Z","updated_at":"2026-04-03T11:32:22.000Z","published_at":"2025-07-17T16:26:09.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\u003eLinear timeiinvariant systems can be represented by the differential equation \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\frac{dx}{dt} = Ax+Bu\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, where \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is an \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\\\\times n\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e matrix, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is an \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\\\\times 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003evector representing the system state, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eB\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is a \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\\\\times m\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e matrix, and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eu\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is a \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003em\\\\times 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003evector representing the control input. Feedback control seeks to stabilize this system with a control of the form \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eu = -Kx\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, where \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eK\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is an \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003em\\\\times n\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e matrix defined by a user. The closed-loop system can be represented by \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\frac{dx}{dt} = A_\\\\mathrm{cl} x\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, and is asymptotically stable if and only if all the eigenvalues of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eA_\\\\mathrm{cl}\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e have negative real parts.\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\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\u003eWrite a function that takes an \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eB\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eK\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and returns a logical scalar that is true when the system is asymptotically stable and false when it is not stable.\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":59651,"title":"Orthogonalize a 2x2 matrix using the Gram-Schmidt process","description":"Use the Gram-Schmidt process to orthogonalize two linearly independent column vectors. Return two output column vectors that are orthogonal and unit length. One example of two linearly independent vectors is u1=[1;1;0] and u2=[2;3;4];","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: 42px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407.5px 21px; transform-origin: 407.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: 384.5px 21px; text-align: left; transform-origin: 384.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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eUse the Gram-Schmidt process to orthogonalize two linearly independent column vectors. Return two output column vectors that are orthogonal and unit length. One example of two linearly independent vectors is u1=[1;1;0] and u2=[2;3;4];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [q1,q2] = gram_schmidt2(u1,u2)\r\n    q1=u1;\r\n    q2=u2;\r\nend","test_suite":"%%\r\nu1=[1,1,0]';\r\nu2=[2,3,4]';\r\n[q1,q2] = gram_schmidt2(u1,u2);\r\nassert(-0.001 \u003c= dot(q1,q2) \u0026\u0026 dot(q1,q2) \u003c= 0.001)\r\nassert(0.99 \u003c norm(q1) \u003c 1.001)\r\nassert(0.99 \u003c norm(q2) \u003c 1.001)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":4078801,"edited_by":4078801,"edited_at":"2024-02-09T20:59:08.000Z","deleted_by":null,"deleted_at":null,"solvers_count":13,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2024-02-09T20:18:20.000Z","updated_at":"2026-02-20T13:59:09.000Z","published_at":"2024-02-09T20:26:08.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\u003eUse the Gram-Schmidt process to orthogonalize two linearly independent column vectors. Return two output column vectors that are orthogonal and unit length. One example of two linearly independent vectors is u1=[1;1;0] and u2=[2;3;4];\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":973,"title":"Partial pivoting for Gauss Elimination","description":"Write a function to implement partial pivoting for Gauss elimination, given the pivot element.","description_html":"\u003cp\u003eWrite a function to implement partial pivoting for Gauss elimination, given the pivot element.\u003c/p\u003e","function_template":"function Ab = PartialPivot(A,b,pivot)\r\n% A = m-by-n coefficient matrix\r\n% b = m-by-1 right-hand-side vector\r\n% pivot = pivot row and column\r\n% Ab = m-by-(n+1) Augmented matrix after pivot step\r\n  Ab = \r\nend","test_suite":"%%\r\nA = [0 2; 1 3];\r\nb = [4; 2];\r\nAb = [1 3 2; 0 2 4];\r\nassert(isequal(PartialPivot(A,b,1),Ab))\r\n%%\r\nA = [0 2 3; 4 6 7; 2, -3, 6];\r\nb = [8; -3; 5];\r\nAb = [A([2 1 3],:), b([2 1 3])];\r\nassert(isequal(PartialPivot(A,b,1),Ab))\r\n%%\r\nA = [4 6 7; 0 2 3; 0, -6, 5/2];\r\nb = [-3; 8; 13/2];\r\nAb = [A([1 3 2],:), b([1 3 2])];\r\nassert(isequal(PartialPivot(A,b,2),Ab))\r\n%%\r\nA = [0 2 5; 2 1 1; 3 1 0];\r\nb = [1; 1; 2];\r\nAb = [A([3 2 1],:), b([3 2 1])];\r\nassert(isequal(PartialPivot(A,b,1),Ab))\r\n%%\r\nA = eye(4);\r\nb = ones(4,1);\r\nassert(isequal(PartialPivot(A,b,3),[A,b]))","published":true,"deleted":false,"likes_count":2,"comments_count":4,"created_by":279,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":18,"test_suite_updated_at":"2012-10-10T03:30:19.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-10-08T00:42:34.000Z","updated_at":"2025-06-08T19:31:51.000Z","published_at":"2012-10-08T01:51:50.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\u003eWrite a function to implement partial pivoting for Gauss elimination, given the pivot element.\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":389,"title":"Column norms of a matrix","description":"Given a matrix M, return a vector y such that for each k\r\n\r\n    y(k)=norm(M(:,k))\r\n\r\n(y(k) is the Euclidean norm of the k-th column of M)\r\n\r\nEDIT: changed the test case so that proper handling of complex values is required.","description_html":"\u003cp\u003eGiven a matrix M, return a vector y such that for each k\u003c/p\u003e\u003cpre\u003e    y(k)=norm(M(:,k))\u003c/pre\u003e\u003cp\u003e(y(k) is the Euclidean norm of the k-th column of M)\u003c/p\u003e\u003cp\u003eEDIT: changed the test case so that proper handling of complex values is required.\u003c/p\u003e","function_template":"function y = your_fcn_name(M)\r\n  y = M;\r\nend","test_suite":"%%\r\nM = [1 2 3; 4 5 6; 7 8 9+2i];\r\nfor k=1:size(M,2)\r\n  y_correct(k)=norm(M(:,k));\r\nend\r\nassert(isequal(your_fcn_name(M),y_correct))\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":1,"created_by":1258,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":569,"test_suite_updated_at":"2012-02-24T14:50:55.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-23T09:33:39.000Z","updated_at":"2026-03-29T18:47:57.000Z","published_at":"2012-02-24T14:50:55.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 a matrix M, return a vector y such that for each k\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[    y(k)=norm(M(:,k))]]\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(y(k) is the Euclidean norm of the k-th column of M)\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\u003eEDIT: changed the test case so that proper handling of complex values is required.\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":44274,"title":"Calculate the sum of two polynomials","description":"Calculate the sum of two polynomials if they are written in notation with their coefficients.\r\nexample:\r\n()  +  ()  =  \r\na=[3 4 5];\r\nb=[1 4 7 6];\r\n\r\noutput =[1 7 11 11];","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: 172.733px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 86.3667px; transform-origin: 407px 86.3667px; 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: 276.5px 8px; transform-origin: 276.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCalculate the sum of two polynomials if they are written in notation with their coefficients.\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: 28px 8px; transform-origin: 28px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eexample:\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: 2.5px 8px; transform-origin: 2.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e(\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,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\" style=\"width: 79px; height: 19px;\" width=\"79\" height=\"19\"\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: 17px 8px; transform-origin: 17px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e)  +  (\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,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\" style=\"width: 108.5px; height: 19px;\" width=\"108.5\" height=\"19\"\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: 14.5px 8px; transform-origin: 14.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e)  =  \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,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\" style=\"width: 123.5px; height: 19px;\" width=\"123.5\" height=\"19\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 81.7333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-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: 404px 40.8667px; transform-origin: 404px 40.8667px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 40px 8.5px; tab-size: 4; transform-origin: 40px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003ea=[3 4 5];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 48px 8.5px; tab-size: 4; transform-origin: 48px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eb=[1 4 7 6];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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 8.5px; tab-size: 4; transform-origin: 0px 8.5px; unicode-bidi: normal; 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: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 80px 8.5px; tab-size: 4; transform-origin: 80px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eoutput =[1 7 11 11];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function p = rwpadd(a,b)\r\n  p= a+b;\r\nend","test_suite":"%%\r\na=[3 4 5];\r\nb=[1 4 7 6];\r\ny_correct = [1 7 11 11];\r\nassert(isequal(rwpadd(a,b),y_correct))\r\n\r\n%%\r\na=[1 1 1 3 -2];\r\nb=[1 3];\r\ny_correct = [1 1 1 4 1];\r\nassert(isequal(rwpadd(a,b),y_correct))\r\n\r\n%%\r\na=[1];\r\nb=[1 2 3];\r\ny_correct = [1 2 4];\r\nassert(isequal(rwpadd(a,b),y_correct))\r\n\r\n%%\r\na=randi(10,1,5);\r\nb=[];\r\nassert(isequal(rwpadd(a,b),a))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":38144,"edited_by":223089,"edited_at":"2022-12-12T05:56:48.000Z","deleted_by":null,"deleted_at":null,"solvers_count":88,"test_suite_updated_at":"2022-12-12T05:56:48.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-08-02T18:19:55.000Z","updated_at":"2026-04-07T18:12:52.000Z","published_at":"2017-08-02T18:19:55.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\u003eCalculate the sum of two polynomials if they are written in notation with their coefficients.\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=\\\"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=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e3x^2+4x+5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e)  +  (\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex^3+4x^2+7x+6\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e)  =  \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex^3+7x^2+11x+11\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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[a=[3 4 5];\\nb=[1 4 7 6];\\n\\noutput =[1 7 11 11];]]\u003e\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":974,"title":"Forward Elimination for Gauss Elimination","description":"Perform forward elimination for a given pivot column in the augmented matrix, Ab=[A,b]","description_html":"\u003cp\u003ePerform forward elimination for a given pivot column in the augmented matrix, Ab=[A,b]\u003c/p\u003e","function_template":"function Ab = ForwardEliminate(Ab,pivot)\r\n% Ab = m-by-(n+1) Augmented matrix after pivot step\r\n% pivot = pivot row and column\r\n\r\nend","test_suite":"%%\r\nA = [4 6 7; 0 2 3; 2, -3, 6];\r\nb = [-3; 8; 5];\r\nAb = [A,b];\r\nAb(end,:)=[0, -6, 5/2, 13/2];\r\nassert(isequal(ForwardEliminate([A,b],1),Ab))\r\n%%\r\nA = [4 6 7; 0 2 3; 2, -3, 6];\r\nb = [-3; 8; 5];\r\nAb = [A,b];\r\nAb(end,:)=[0, -6, 5/2, 13/2];\r\nAb2 = Ab;\r\nAb2(3,:) = Ab(3,:) + 3*Ab(2,:);\r\nassert(isequal(ForwardEliminate(Ab,2),Ab2))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":279,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":29,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-10-08T03:02:44.000Z","updated_at":"2025-12-07T18:23:27.000Z","published_at":"2012-10-08T03:02:44.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\u003ePerform forward elimination for a given pivot column in the augmented matrix, Ab=[A,b]\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":44530,"title":"Are you more familiar with iteration methods or Linear Algebra? Let's see together.","description":"Given a sum result *_x_* value of a *_N_* number of addends, build an array of _*N*_ elements _*y*_ such that the following equality is satisfied: _sum(y) = x_ .\r\n\r\nFor example if: x = 10 and N = 2, possible solutions for y are: [7 3], or  [8 2].\r\n\r\nMore formally if x = a and N = n it results: \r\n\r\ny = [y_1 y_2 y_3 ... y_n]\r\nwhere:  y_1 + y_2 + y_3 +...+ y_n = a\r\n\r\nImportant notice: All the elements in y must be *different from zero* and *different from each other* . On the other hand I will not take into account if they are _integers or decimal numbers_ .\r\n\r\nHint: You can use several approaches and the solution is not unique. For example you can think to approach with a iterative method or, if you are more accustomed with Algebra, by solving a linear system. This choice it's up to you.\r\n\r\nGood luck and enjoy with the solution ;)\r\n","description_html":"\u003cp\u003eGiven a sum result \u003cb\u003e\u003ci\u003ex\u003c/i\u003e\u003c/b\u003e value of a \u003cb\u003e\u003ci\u003eN\u003c/i\u003e\u003c/b\u003e number of addends, build an array of \u003ci\u003e\u003cb\u003eN\u003c/b\u003e\u003c/i\u003e elements \u003ci\u003e\u003cb\u003ey\u003c/b\u003e\u003c/i\u003e such that the following equality is satisfied: \u003ci\u003esum(y) = x\u003c/i\u003e .\u003c/p\u003e\u003cp\u003eFor example if: x = 10 and N = 2, possible solutions for y are: [7 3], or  [8 2].\u003c/p\u003e\u003cp\u003eMore formally if x = a and N = n it results:\u003c/p\u003e\u003cp\u003ey = [y_1 y_2 y_3 ... y_n]\r\nwhere:  y_1 + y_2 + y_3 +...+ y_n = a\u003c/p\u003e\u003cp\u003eImportant notice: All the elements in y must be \u003cb\u003edifferent from zero\u003c/b\u003e and \u003cb\u003edifferent from each other\u003c/b\u003e . On the other hand I will not take into account if they are \u003ci\u003eintegers or decimal numbers\u003c/i\u003e .\u003c/p\u003e\u003cp\u003eHint: You can use several approaches and the solution is not unique. For example you can think to approach with a iterative method or, if you are more accustomed with Algebra, by solving a linear system. This choice it's up to you.\u003c/p\u003e\u003cp\u003eGood luck and enjoy with the solution ;)\u003c/p\u003e","function_template":"function y = buildSumArray(x,N)\r\n  y = sum(1:N);\r\nend","test_suite":"%% Test Case 1\r\nx = 6;\r\nN = 3;\r\ny = buildSumArray(x,N);\r\ny2 = unique(y);\r\n\r\nassert(isequal(round(sum(y)*100)/100,x))\r\nassert(isequal(length(y),N))\r\nassert(isequal(length(y2),N))\r\nassert(sum(y == 0) == 0)\r\n\r\n%% Test Case 2\r\nx = 13;\r\nN = 5;\r\ny = buildSumArray(x,N);\r\ny2 = unique(y);\r\n\r\nassert(isequal(round(sum(y)*100)/100,x))\r\nassert(isequal(length(y),N))\r\nassert(isequal(length(y2),N))\r\nassert(sum(y == 0) == 0)\r\n\r\n\r\n%% Test Case 3\r\nx = 78;\r\nN = 11;\r\ny = buildSumArray(x,N);\r\ny2 = unique(y);\r\n\r\nassert(isequal(round(sum(y)*100)/100,x))\r\nassert(isequal(length(y),N))\r\nassert(isequal(length(y2),N))\r\nassert(sum(y == 0) == 0)\r\n\r\n\r\n%% Test Case 4\r\nx = 2689;\r\nN = 245;\r\ny = buildSumArray(x,N);\r\ny2 = unique(y);\r\n\r\nassert(isequal(round(sum(y)*100)/100,x))\r\nassert(isequal(length(y),N))\r\nassert(isequal(length(y2),N))\r\nassert(sum(y == 0) == 0)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":181340,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":30,"test_suite_updated_at":"2018-02-24T12:07:13.000Z","rescore_all_solutions":false,"group_id":677,"created_at":"2018-02-24T11:21:15.000Z","updated_at":"2026-04-02T13:09:38.000Z","published_at":"2018-02-24T11:49:30.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 a sum result\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\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e value of a\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\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\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e number of addends, build an array 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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e elements\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\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\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e such that the following equality is satisfied:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esum(y) = x\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\u003eFor example if: x = 10 and N = 2, possible solutions for y are: [7 3], or [8 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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMore formally if x = a and N = n it results:\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\u003ey = [y_1 y_2 y_3 ... y_n] where: y_1 + y_2 + y_3 +...+ y_n = a\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\u003eImportant notice: All the elements in y must be\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003edifferent from zero\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003edifferent from each other\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e . On the other hand I will not take into account if they are\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eintegers or decimal numbers\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\u003eHint: You can use several approaches and the solution is not unique. For example you can think to approach with a iterative method or, if you are more accustomed with Algebra, by solving a linear system. This choice it's up to you.\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\u003eGood luck and enjoy with the solution ;)\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":43301,"title":"Calculate inverse matrix in m by n matrix ","description":"  x=(1:10)'\r\n  y=roundn(2*x+7*rand(size(x)),-1)\r\n\r\na*x=y\r\n\r\nEstimate a using inverse matrix calculation. This is principle of linear regression.","description_html":"\u003cpre class=\"language-matlab\"\u003ex=(1:10)'\r\ny=roundn(2*x+7*rand(size(x)),-1)\r\n\u003c/pre\u003e\u003cp\u003ea*x=y\u003c/p\u003e\u003cp\u003eEstimate a using inverse matrix calculation. This is principle of linear regression.\u003c/p\u003e","function_template":"function a = reginv(x,y)\r\n  a =\r\nend","test_suite":"%%\r\n  x=(1:10)'\r\n  y=3*x\r\n  a=3\r\n\r\nassert(abs(reginv(x,y)-a)\u003c0.001)\r\n\r\n%%\r\n  x=(1:10)'\r\n  y=3*x+2\r\n  a=3.2857\r\n\r\nassert(abs(reginv(x,y)-a)\u003c0.001)\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":2,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":89,"test_suite_updated_at":"2018-07-19T15:35:54.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-10T09:36:59.000Z","updated_at":"2026-01-02T15:53:13.000Z","published_at":"2016-10-10T09:36:59.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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[x=(1:10)'\\ny=roundn(2*x+7*rand(size(x)),-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\u003ea*x=y\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\u003eEstimate a using inverse matrix calculation. This is principle of linear regression.\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":59656,"title":"Orthogonalize 3 column vectors using the Gram-Schmidt process","description":"Use the Gram-Schmidt process to orthogonalize three linearly independent column vectors. Return three output column vectors that are orthogonal and unit length. One example of three linearly independent vectors is u1=[1;1;0],  u2=[2;3;4], and u3=[3;5;1].","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: 63px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407.5px 31.5px; transform-origin: 407.5px 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: 384.5px 31.5px; text-align: left; transform-origin: 384.5px 31.5px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eUse the Gram-Schmidt process to orthogonalize three linearly independent column vectors. Return three output column vectors that are orthogonal and unit length. One example of three linearly independent vectors is u1=[1;1;0],  u2=[2;3;4], and u3=[3;5;1].\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [q1,q2,q3] = gram_schmidt3(u1,u2,u3)\r\n    q1=u1;\r\n    q2=u2;\r\n    q3=u3;\r\nend","test_suite":"%%\r\nu1=[1;1;0];\r\nu2=[2;3;4];\r\nu3=[3;5;1];\r\n[q1,q2,q3]=gram_schmidt3(u1,u2,u3);\r\nassert(-0.0001\u003c=dot(q1,q2) \u0026\u0026 dot(q1,q2)\u003c=0.0001)\r\nassert(-0.0001\u003c=dot(q1,q3) \u0026\u0026 dot(q1,q3)\u003c=0.0001)\r\nassert(-0.0001\u003c=dot(q3,q2) \u0026\u0026  dot(q3,q2)\u003c=0.0001)\r\nassert(0.999 \u003c= norm(q1) \u0026\u0026 norm(q1)\u003c= 1.0001)\r\nassert(0.999 \u003c= norm(q2) \u0026\u0026 norm(q2)\u003c= 1.0001)\r\nassert(0.999 \u003c= norm(q3) \u0026\u0026 norm(q3)\u003c= 1.0001)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":4078801,"edited_by":4078801,"edited_at":"2024-02-09T21:11:26.000Z","deleted_by":null,"deleted_at":null,"solvers_count":13,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2024-02-09T21:00:56.000Z","updated_at":"2025-05-10T15:00:29.000Z","published_at":"2024-02-09T21:11:26.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\u003eUse the Gram-Schmidt process to orthogonalize three linearly independent column vectors. Return three output column vectors that are orthogonal and unit length. One example of three linearly independent vectors is u1=[1;1;0],  u2=[2;3;4], and u3=[3;5;1].\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":58922,"title":"Find out the smallest number 9 times greater","description":"What is the smallest natural number where the result of moving the digit on the far right to the front of the number is a number 9 times greater?\r\nThe x value (input) isn't necessary, you only have to find out the final number\r\nThis is a problem made by Globant in its 20th anniversary. \r\nGive the solution in string format","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: 132px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 66px; transform-origin: 407px 66px; vertical-align: baseline; \"\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eWhat is the smallest natural number where the result of moving the digit on the far right to the front of the number is a number 9 times greater?\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThe x value (input) isn't necessary, you only have to find out the final number\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThis is a problem made by Globant in its 20th anniversary. \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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGive the solution in string format\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = smallestNumber(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = '10112359550561797752808988764044943820224719';\r\nassert(isequal(smallestNumber(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":289312,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":8,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2023-08-28T14:35:21.000Z","updated_at":"2025-05-12T12:38:53.000Z","published_at":"2023-08-28T14:35:21.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\u003eWhat is the smallest natural number where the result of moving the digit on the far right to the front of the number is a number 9 times greater?\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 x value (input) isn't necessary, you only have to find out the final number\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\u003eThis is a problem made by Globant in its 20th anniversary. \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\u003eGive the solution in string format\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":1299,"title":"How long do each of the stages of the rocket take to burn?","description":"A space rocket has 3 stages:\r\n\r\n- stage 1, s1;\r\n\r\n- stage 2, s2;\r\n\r\n- stage 3, s3.\r\n\r\nIf s1 burns 3 x as long as s2 which burns 2 x as long as s3 then how long did s3 burn if the total burn time was tt minutes? How long did s2 burn? s1?","description_html":"\u003cp\u003eA space rocket has 3 stages:\u003c/p\u003e\u003cp\u003e- stage 1, s1;\u003c/p\u003e\u003cp\u003e- stage 2, s2;\u003c/p\u003e\u003cp\u003e- stage 3, s3.\u003c/p\u003e\u003cp\u003eIf s1 burns 3 x as long as s2 which burns 2 x as long as s3 then how long did s3 burn if the total burn time was tt minutes? How long did s2 burn? s1?\u003c/p\u003e","function_template":"function s = rocketburntime(totaltime,r1,r2)\r\n  s=(s1,s2,s3);\r\nend","test_suite":"%% test #1\r\ntt=18; rate1=3; rate2=2;\r\ny_correct =[12,4,2];\r\nassert(isequal(rocketburntime(tt,rate1,rate2),y_correct))\r\n%% test #2\r\ntt=32; rate1=4; rate2=3;\r\ny_correct =[24,6,2];\r\nassert(isequal(rocketburntime(tt,rate1,rate2),y_correct))\r\n%% test #3\r\ntt=58; rate1=6; rate2=4;\r\ny_correct =[48,8,2];\r\nassert(isequal(rocketburntime(tt,rate1,rate2),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":4,"created_by":1103,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":462,"test_suite_updated_at":"2013-02-24T01:38:26.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-02-24T01:16:02.000Z","updated_at":"2026-04-03T03:39:40.000Z","published_at":"2013-02-24T01:38:26.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\u003eA space rocket has 3 stages:\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- stage 1, s1;\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- stage 2, s2;\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- stage 3, s3.\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\u003eIf s1 burns 3 x as long as s2 which burns 2 x as long as s3 then how long did s3 burn if the total burn time was tt minutes? How long did s2 burn? s1?\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":46031,"title":"Construct dimensionless parameters","description":"*Summary* \r\n\r\nWrite a function to construct dimensionless parameters from a list of variables, a matrix indicating their dimensions, and a vector identifying the variables to use to make the other variables dimensionless. More details are given in \"Problem statement\" below.\r\n\r\n*Introduction* \r\n\r\n_Dimensional analysis and the Buckingham π theorem_\r\n\r\nThe \u003chttps://en.wikipedia.org/wiki/Buckingham_π_theorem Buckingham π theorem\u003e is a key result exploited in \u003chttps://en.wikipedia.org/wiki/Dimensional_analysis dimensional analysis\u003e in engineering, physics, and applied mathematics. It states that if a problem involves _m_ variables and _n_ physical dimensions (e.g., length, time, mass), then the problem can be described with _m-n_ dimensionless groups, called π groups. In \u003chttps://en.wikipedia.org/wiki/Buckingham_π_theorem other words\u003e, the \"physics does not depend on a specific unit system\".\r\n\r\nTo find the dimensionless groups, we follow these steps:\r\n\r\n# Choose _n_ variables that cannot form a dimensionless group by themselves\r\n# Form the product of one of the remaining _m-n_ variables with the variables in step 1, each raised to different exponents\r\n# Determine the exponents that would make the product (or group) dimensionless\r\n# Repeat steps 2 and 3 for the remaining variables\r\n\r\n_Example_\r\n\r\nSuppose we are interested in the drag _F_ (i.e., a force) on a cylinder of length _L_ and diameter _d_ immersed in a fluid of density _ρ_ and dynamic viscosity _μ_ flowing at velocity _V_. Because the problem involves 6 variables and 3 dimensions (length, time, and mass), it can be described with 3 dimensionless groups. For step 1 above, choose _V_, _d_, and _ρ_. We could choose other lists of 3, but notice that we could not choose _V_, _d_, and _L_ because _d_ and _L_ form a dimensionless group themselves (and we have no way of removing mass dimensions.)\r\n\r\nFor step 2, start with the drag _F_. Following the step, we get\r\n\r\n\r\n π_1 = F V^a1 d^a2 ρ^a3\r\n\r\nwhere _a1_, _a2_, and _a3_ are exponents. Because π_1 must be dimensionless and because the dimensionless of _F_, _V_, _d_, and _ρ_ are ML/T^2, L/T, L, and M/L^3, respectively, we can solve a system of three equations to find the exponents and write \r\n\r\n π_1 = F V^{-2} d^{-2} ρ^{-1}\r\n\r\nwhich is related to a quantity in fluid mechanics called the drag coefficient. We then repeat steps 2 and 3 with the two remaining variables and find\r\n\r\n  \r\n π_2 = L d^{-1}   and   π_3 = μ V^{-1} d^{-1} ρ^{-1}\r\n\r\nor a geometric ratio and the inverse of the \u003chttps://en.wikipedia.org/wiki/Reynolds_number Reynolds number\u003e.   \r\n\r\n*Problem statement*\r\n\r\nWrite a function that constructs dimensionless parameters from a cell array |vars| with the variable names, a matrix |dims| with the exponents for the dimensions in rows (length, time, mass) for each variable in the columns, and a vector |indx| indicating the variables chosen in step 1 above. The function should return a cell array |Pi| with the dimensionless groups in strings and a vector |a| of size |m x m-n| with the exponents of the normalizing variables. For the example above, the input could be specified as\r\n\r\n\r\n vars = {'F', 'V', 'd', 'L', 'rho', 'mu'};\r\n indx = [2 3 5];\r\n dims = [ 1  1  1  1  -3  -1;\r\n         -2 -1  0  0   0  -1;\r\n          1  0  0  0   1   1];\r\n  \r\nand the output would be\r\n  \r\n Pi = {'F V^{-2} d^{-2} rho^{-1}', 'L d^{-1}', 'mu V^{-1} d^{-1} rho^{-1}'} \r\n a  = [-2   0  -1;\r\n       -2  -1  -1;\r\n       -1   0  -1]\r\n\r\nFurther specifications:\r\n\r\n* If the variables chosen in |indx| will not work (i.e., the number is incorrect or some form a dimensionless group themselves), return |a = NaN| and |Pi = {'Error in choosing normalizing variables'}|.\r\n* If the exponent of a variable is zero, omit the variable from the string.\r\n* If the exponent of a variable is one, keep the variable but do not show the exponent.\r\n* If the exponent of a variable is a positive integer, indicate it with a caret (^) and no braces.\r\n* If the exponent is anything else, indicate it with a caret and braces. \r\n* If the exponent is not an integer, express it as a fraction. Hint: MATLAB has a function that will help. \r\n\r\n","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: 1429.07px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 714.533px; transform-origin: 407px 714.533px; 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: 31.9px 7.8px; transform-origin: 31.9px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eSummary\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: 376.783px 7.8px; transform-origin: 376.783px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to construct dimensionless parameters from a list of variables, a matrix indicating their dimensions, and a vector identifying the variables to use to make the other variables dimensionless. More details are given in \"Problem statement\" below.\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: 40.8167px 7.8px; transform-origin: 40.8167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eIntroduction\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: 133.45px 7.8px; transform-origin: 133.45px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eDimensional analysis and the Buckingham \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\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: 27.6167px 7.8px; transform-origin: 27.6167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e theorem\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 12.0667px 7.8px; transform-origin: 12.0667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Buckingham_%CF%80_theorem\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eBuckingham π theorem\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: 82.0833px 7.8px; transform-origin: 82.0833px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is a key result exploited in\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Dimensional_analysis\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003edimensional analysis\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: 115.167px 7.8px; transform-origin: 115.167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e in engineering, physics, and applied mathematics. It states that if a problem involves\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003em\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: 43.5833px 7.8px; transform-origin: 43.5833px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e variables and\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\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: 174.633px 7.8px; transform-origin: 174.633px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e physical dimensions (e.g., length, time, mass), then the problem can be described with\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE0AAAAkCAYAAADM8rciAAAB1UlEQVRoge2XUY3DMBBEh0MYlEAIFEERhEEYhEEpHIZCKIdQCIZQ6H3Yo0z2tj27vatcaZ9kqc3Iye56PXGAIAiCIAiCIAiCIAg+jh7ACcAg17r8f8qahdrx36N7jQ4pxjH/Jj1S/JO5/pAjgDOAm4xRbrgYrRdtluuraK3QAbhin8Mi2gX73ObaB2jhemwFO+VB7STa5GgtojGyo2aknPmbenG3AWlFuBIsCrfcIDc9/KK1iMbYI+U6is7cr7U3XvPEC1Ll1aPYhXO+sXreF/ZtXwJ98JVRs0Aa44SUo6JdWEwvE6/OZLbvkgNQ6BfniudxZV8ZNf7JGJc87IvgmXtilInWDDvRVvPAg2g1fvYXnVbqPVqUG36+5SfJrQpdeVtt9YPxgVZloG9EG8LuEmDL3dPuop3kGSH9wFsJatUG+ka0IawPau4DKtBu8SbSD7yVoEYPbO3tqUWx5g/sjyLcKUU5aCfZLaZ+YL3gYDQedlvaploUryHsThlQuE31qGFRk7TF0IB49mntU4pHJS9+YMv9jFSwomOTdpK3EjxqeJ7FgjKo1goGbPZxz3Pt51XRLjlie4V7UPMK0mXNfgC3xKP4ge1jveolEARBEARBEAQfyzelOuHRDH9yPgAAAABJRU5ErkJggg==\" alt=\"m-n\" style=\"width: 38.5px; height: 18px;\" width=\"38.5\" height=\"18\"\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: 93.7667px 7.8px; transform-origin: 93.7667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e dimensionless groups, called \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\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: 33.0667px 7.8px; transform-origin: 33.0667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e groups. In\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Buckingham_%CF%80_theorem\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eother words\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: 96.65px 7.8px; transform-origin: 96.65px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, the \"physics does not depend on a specific unit system\".\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: 174.267px 7.8px; transform-origin: 174.267px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eTo find the dimensionless groups, we follow these steps:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003col style=\"block-size: 102.167px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: decimal; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 391px 51.0833px; transform-origin: 391px 51.0833px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 24.1333px 7.8px; transform-origin: 24.1333px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eChoose\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 201.117px 7.8px; transform-origin: 201.117px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e variables that cannot form a dimensionless group by themselves\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 40.8667px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 20.4333px; text-align: left; transform-origin: 363px 20.4333px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 126.8px 7.8px; transform-origin: 126.8px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eForm the product of one of the remaining\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE0AAAAkCAYAAADM8rciAAAB1UlEQVRoge2XUY3DMBBEh0MYlEAIFEERhEEYhEEpHIZCKIdQCIZQ6H3Yo0z2tj27vatcaZ9kqc3Iye56PXGAIAiCIAiCIAiCIAg+jh7ACcAg17r8f8qahdrx36N7jQ4pxjH/Jj1S/JO5/pAjgDOAm4xRbrgYrRdtluuraK3QAbhin8Mi2gX73ObaB2jhemwFO+VB7STa5GgtojGyo2aknPmbenG3AWlFuBIsCrfcIDc9/KK1iMbYI+U6is7cr7U3XvPEC1Ll1aPYhXO+sXreF/ZtXwJ98JVRs0Aa44SUo6JdWEwvE6/OZLbvkgNQ6BfniudxZV8ZNf7JGJc87IvgmXtilInWDDvRVvPAg2g1fvYXnVbqPVqUG36+5SfJrQpdeVtt9YPxgVZloG9EG8LuEmDL3dPuop3kGSH9wFsJatUG+ka0IawPau4DKtBu8SbSD7yVoEYPbO3tqUWx5g/sjyLcKUU5aCfZLaZ+YL3gYDQedlvaploUryHsThlQuE31qGFRk7TF0IB49mntU4pHJS9+YMv9jFSwomOTdpK3EjxqeJ7FgjKo1goGbPZxz3Pt51XRLjlie4V7UPMK0mXNfgC3xKP4ge1jveolEARBEARBEAQfyzelOuHRDH9yPgAAAABJRU5ErkJggg==\" alt=\"m-n\" style=\"width: 38.5px; height: 18px;\" width=\"38.5\" height=\"18\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 191.25px 7.8px; transform-origin: 191.25px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e variables with the variables in step 1, each raised to different exponents\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 247.017px 7.8px; transform-origin: 247.017px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eDetermine the exponents that would make the product (or group) dimensionless\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 150.933px 7.8px; transform-origin: 150.933px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eRepeat steps 2 and 3 for the remaining variables\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ol\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: 27.2333px 7.8px; transform-origin: 27.2333px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eExample\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 105px; 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 52.5px; text-align: left; transform-origin: 384px 52.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: 118.267px 7.8px; transform-origin: 118.267px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSuppose we are interested in the drag\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eF\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: 111.633px 7.8px; transform-origin: 111.633px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (i.e., a force) on a cylinder of length\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eL\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: 42.8px 7.8px; transform-origin: 42.8px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and diameter\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ed\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: 70.4px 7.8px; transform-origin: 70.4px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e immersed in a fluid of density\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\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: 70.0167px 7.8px; transform-origin: 70.0167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and dynamic viscosity\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\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: 56.8px 7.8px; transform-origin: 56.8px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e flowing at velocity\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eV\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: 191.783px 7.8px; transform-origin: 191.783px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Because the problem involves 6 variables and 3 dimensions (length, time, and mass), it can be described with 3 dimensionless groups. For step 1 above, choose\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eV\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e,\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ed\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: 15.5667px 7.8px; transform-origin: 15.5667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\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: 16.2px 7.8px; transform-origin: 16.2px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. We could choose other lists of 3, but notice that we could not choose\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eV\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e,\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ed\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: 15.5667px 7.8px; transform-origin: 15.5667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eL\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: 28.4px 7.8px; transform-origin: 28.4px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e because\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ed\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: 13.6167px 7.8px; transform-origin: 13.6167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eL\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: 70.0167px 7.8px; transform-origin: 70.0167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e form a dimensionless group themselves (and we have no way of removing mass dimensions.)\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: 91px 7.8px; transform-origin: 91px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor step 2, start with the drag\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 4.28333px 7.8px; transform-origin: 4.28333px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eF\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: 84.8px 7.8px; transform-origin: 84.8px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Following the step, we get\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 26px; 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 13px; text-align: left; transform-origin: 384px 13px; 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: 13.6px 7.8px; transform-origin: 13.6px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e       \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,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\" alt=\"pi_1 = F V^{a1} d^{a2} rho^{a3}\" style=\"width: 102px; height: 26px;\" width=\"102\" height=\"26\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42.8167px; 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 21.4167px; text-align: left; transform-origin: 384px 21.4167px; 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: 19.0667px 7.8px; transform-origin: 19.0667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ewhere\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 7.78333px 7.8px; transform-origin: 7.78333px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea1\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e,\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 7.78333px 7.8px; transform-origin: 7.78333px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea2\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: 15.5667px 7.8px; transform-origin: 15.5667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 7.78333px 7.8px; transform-origin: 7.78333px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea3\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: 79.35px 7.8px; transform-origin: 79.35px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e are exponents. Because \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB8AAAAoCAYAAAAG0SEsAAABCUlEQVRYhe2WUQ2EMAyGPw84wAAGUHAKcDAHOMACGpBwHrCABixwD7ShtwMCt+Verl/SBDq2f/SnC+A4juM4P6YEGqC9EFUu0QLogeVGlLmER2ACnmbxp8Qo95PJ9TmEkcWCXFdGWAmSa3MJKgXv3mnpg8lNksvm8dFGYj+1EtOF+TXw+FZcy2tL3kmuO5lXAsOF507R8lpvZ8nVB3Nq1k0niddsJVdvH3I/s1pyRpsiri02mtywk+vY7++vxK1fC+vppqgN+rGFaCNJ4rbU8RsSjWkceX9bvDGLznz2sa1I3PvJ4rB+VIF9HwsZaw/Gk8Vz4eL/J66H1PBL0ZKtIzQaMv3lOI5zmxdP4XNErSZ5SAAAAABJRU5ErkJggg==\" alt=\"pi1\" style=\"width: 15.5px; height: 20px;\" width=\"15.5\" height=\"20\"\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: 180.9px 7.8px; transform-origin: 180.9px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e must be dimensionless and because the dimensionless of\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eF\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e,\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eV\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e,\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ed\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: 15.5667px 7.8px; transform-origin: 15.5667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, and\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\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: 14px 7.8px; transform-origin: 14px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e are \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF4AAAAnCAYAAACG//9nAAAC50lEQVRoge2aXZWDMBBGPw84wMAaQAEKcFAHOKiFakACHrCAhlroPoQ5HYaZkISyZHdzz8lLofm5JJMwLVAoFAqFQiGGLwANgPrqjvwXOgBPAC9W7igPAAAww83IT9OKulu8H8LjhPZ+FSSjOqHuCdsH2sKJ322zhotNsqQslcqoq1muW9eonDErH1jPPl8fQwv1szfapJDjFd8sFcxYx6kpYnDEXdRB8Y462MNJkPc8l2tdQps+qqXuln3WKO3HlnGn3Recz2DkJhEzA2mQUrpGf6CdGGjj45D4Ee+VqPVLfq9i1+U1zhf8Y1cZsRYyRHy3w3Zm3Ix7+azzDeIoA7YC+qVNLZT6xBMPzzVef9SeMmI7a0Nj/QwXnnIRX0FfTT3sUBEivvFc00JbECPcLOHyQ5YM7eQ35CP+Bj3OdrDFhIgH7EgwwB6zFxIvY/DeshnhBkmzLAfxk6d9i1Dx1neTz+4kXm6Uvllfi3tyEE99ij0Sp4rvoK+CGoGxnsQD62MfzWYN2mxokDmIv2P/yKeRIr6DHtKqmD5w8TRrfBIptPAlloP4GWnvBLHiaRwTnDtenogIdVw8sJ31Vkf5yeFq8VR3SoogRnwF50oK5yW4D1K8fMuTp4EZ2+V0tXiZIojhyOZ6CCmePqPO8DQCvTDJh3G1+KRz9EJW4q1ZP0HP51wpXksRxJCVeGCdQBvwFqeJvVK8liKIITvxMg/DX5gkZ4qvYZ9WrBRBDNmJB7ZpY2tmnSnet3FaKYIYshQvO2W9FZ4lntKt1sY5wf5hIpTLxFOGUYOnEXzHtRDxLdYD3DvvUkbQeuCpKQLJJeJ5o5Yw+oXJiqMyuTZhK4NepeWe0SvljnWq2ZoUvedaKDW24TQp0xhKB/vNSy7rGnps99XBw1e/c99esTbW1BQB4CbRXrtHQ9ifhGL/Gf8iKHh4IO4nysKHOJIiKCRCf1Yq/DADyl/lfpxPpAgKCTQ4fnYvFAqFv8Y3hk7O7aav8lkAAAAASUVORK5CYII=\" alt=\"ML/T^2\" style=\"width: 47px; height: 19.5px;\" width=\"47\" height=\"19.5\"\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: 38.5px 7.8px; transform-origin: 38.5px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, L/T, L, and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEwAAAAnCAYAAAClpK6yAAACoklEQVRoge2ZW3HDMBAAl4MZmEAJBEEQhEEZhEEoBEMhmEMoGEMopB/yjZWzHr6z3TaNd0bTaVPrsZLOOgV2dnZ2dv4Lh6G0v92Rv84JuAOPodyBz1/t0UJawiC24AD0w0/5XeS97Eq7AN1GdXdAk2jvARxrD7eM+zguHtNNpq5D6aEMPWHbCLl6pXw42og5E4RpkRMOwz/3jPv5AdwcjcosxeUy1G/hwLTzZ+CaqP8+fHZiGT2OGBYHwQe2WWsSz1+sHRi4Al+Zz2QlePqYohnaunnq6lRncp1OcWI6+963zp18LJHVJ6trCUfCGOP6TKGoY7pK5lbQE2ZpqbAjZRFrChNaxr6bdkVHMB5Lm1PBkVHQUmFfhC2ZYwthMIYUU+wWYTpO1N4cHWGFNSwTJs+XYslWwiCMwyVMB/DSKmvV/ywRdiKIL7G1MNeWhOdXuKyeFFeeg+USYTfqR5A1hLVMxyMTb3pTxsKkgtLgZQvFMccrTNqrvWTWEBbnjg1j0Def5WJhMF1lGol18ax4hZ2ZFz/WEHYijFXGK+LMaGFx51J5Vs803/MK06lQji1jmBktTP6WSpfkoKoleoR9MDOP4wWE5VbZjfQW8ggrpUKaPy8MnhPzL8ZOp4R4hJVSIc1LCNN5YnxQ1ViF1VIhjVdYy/IbjQk5YTC9/skd8KzCaqmQxivsamxnFiVhcbpUyuotwuQcZ7lg9AiTl8rcbT8buXFIEadLpZmyCJuTCmkk0RdhtTer3Nebr25qxCsoN1C5Uc2lDzppv1U6ac3dGqZ3dt3Qri4Xnq+bPDfISeJTry56CbekB1iqI7fN56ZCwrnSRq2sHvB/mk9WnPV3wPWlw7tiSYV2CHHQ8gXL23PnHwThn8KaCr09ckba2dnZ8fANorRmT/lyAUsAAAAASUVORK5CYII=\" alt=\"M/L^3\" style=\"width: 38px; height: 19.5px;\" width=\"38\" height=\"19.5\"\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: 269.8px 7.8px; transform-origin: 269.8px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, respectively, we can solve a system of three equations to find the exponents and write\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21.8167px; 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.9167px; text-align: left; transform-origin: 384px 10.9167px; 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: 13.6px 7.8px; transform-origin: 13.6px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e       \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANcAAAAqCAYAAAAgcc5yAAAFVklEQVR4nO2c/ZHaMBDFXw/ugAbcABVcBXRAB3RAC9RwJdADLVBDWkj+EC88dJIlWxISyf5mPJMBYhZpv7U+wDAMwzAMwzAMwzCMmkwA9o9rVCjf1FuQBSYAc28hjDGYAFwB/JbrDuCrp1AeZ7zK9wvAEeMZ2RFOtnNvQYwxuAE4wSnqDsAFTwUewQOfAXzDyTbBKTCN7NBRLmUPJ+cNTi4zLgNfcIrrQyU5vVecH0xwRu7DSHZ9rzhJTjDj2oTWJFsun6XPhiLG0vdv5QAXEXxqKMkMZ7w17uGzh5PvVnDvFphxbYTK7ef/3OSrd+n7IQ+7D3yOtU5I4afHe/p/rmiTulFJ1qZdTCt/oW3qRuO6NLh3CWZcFVCDOC58LrXYO+9eOU2EA541UauC/vvxHVvvz9/9G2FHUQrrrpGaLoAZVzEzXg0iFTlSSqBePkdZqPitFIt1Tkm9xeh+ryLRT5gdjIYZVyGMHLnKk/LemualFJqRLqRYM8pqQHJCeS0T6prtVsoXi5pMCWtH7bU1data9b+GkSM3519KG4HXFCp1PxpiSLH8+m3pihnPDOcwShRXU12Nrvo7c66QDNNDvhZ1Jo029wplDmZchaSK9R3W1RkaCZciBje/VXuc6WBpjaS/p3Z0uWKcs60Q1YwrN8y3KGh74ddbsQiyRgHUYy5FjTva1TATnGGHIkJOlNBUk5G9dk10QTgLWBPFNHVu0QwqNq4D3Cbnhs+aIbzknGnpDCkXnQ4IRRl67bWkDLZld4yGFXIIx8jrwOs0B6cotA1fM8JeEE6Z58jrPkc4nf3Gs9nCMaWaRlZkXFzM3Ku2p13z3bErNJGQi9Y1Fzhj/YJbVK7Nlvurs/KbDUzXWp3pXB/398/pbghPRwBPJ3LDq3KykRH6HVuhwvrycS9SzvIS+Jw6yZr1Eb9r9V7pjBeLVjUeLnjLYi60wGuvEo/qNwV4TzWOLTWBGq0fnbhhLdKYA5bXKpSGUZ5QCsvfETPKtcwJ+VJKTFn9PZnwuo+la7uDWyvK9Y349MsPODBJ6E1UUbmwIz+yUMIXXo3Lh+nGlo3STpo6J9Z4qY7ju9BmRUhxGLlKsoNaMDrFar9UKt4N5tUMtYxkOR7rU5930bGn0IYdI6/noGmKemOmZyOgLfZQ9Ndo0Lujx1R6ydkvOcpu0HtpSkjlSIXpT37eReuJUCQ5RV7PQTuGNCau8yiZQCrl08jeu0PMTCBW8+t6DzXpwUVWA2HNEfNYtZ536dUt9GcAY1PrW9ML9fo8a7pjHCekvz/mQNmCb3VcsAbqY0xWzRRGSblfFpkeVc9+UspVeg7Qq1uotUatYt1HD6fPaDuYuxatCUPHAaoXvR2C6mPs6ILG12ovN6FPqfqvaW0Qe2yi1Lh6dQv1CKJlS1ydQO+6RdGRr9ToVe9Jda2NQ7Kqo+wt619ioZSpHo1rRtwjfOrsVWmrPQdVilGaGESNx1dY1Qu+z4PpHvj6qHA2cZh0kPm/pkW6wLqw3ISYAn6icfkjT62KdVXS3g0BHzV83dsTnpMPVGgaVo+ooLWrr2OUaxjDAn56Jn/Rbt77SzXNJxqXpkQtFZ8drBHXxm/o8OCcxqSR7Y5+Ka2mfJq+7+Fkjc1PdmPCczoj5I3mx3s5A6ufZFx7uA2K1W21jWzCGIevMTjHpxMIhH+y4Iy+UVdr49NDnsvj30MZVQs+ybiMz4Ply1BnV+/CjMtohdbGw9RU78SMy2iF9gb++RQwhBmX0Qo2noY6GH4nm593MYwFRpoQeTtFz7sYRoI9XFbEv3lvGIZhGIZhGIZhGIZhGIZhGMb/yR8nA78mDUCKogAAAABJRU5ErkJggg==\" alt=\"pi1 = F V^{-2} d^{-2} rho^{-1}\" style=\"width: 107.5px; height: 21px;\" width=\"107.5\" height=\"21\"\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: 363.433px 7.8px; transform-origin: 363.433px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ewhich is related to a quantity in fluid mechanics called the drag coefficient. We then repeat steps 2 and 3 with the two remaining variables and find\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21.8167px; 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.9167px; text-align: left; transform-origin: 384px 10.9167px; 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: 13.6px 7.8px; transform-origin: 13.6px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e       \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAAAqCAYAAAB7uVNDAAADEklEQVR4nO2abZGDMBCGXw84wAAGTkEV1EEd1AEW0ICEesBCNWCh9yO8w5JLWkg2hfb2mcnMtZlbwmazXw1gGIZhGIZhfCMVgGbvRRj7cAEwAmj3XojxXn7gNn0A8IAZwL/lCjOAZCq4k/RsVIrPqyeZvaJMM4AMaAA9nBLlaKc5DVoAdyG7U5ILmAGo4W++Nj9C/llRrhmAAg2WBlAXeMapkHwzAAXOmDfnXugZ7SR/EN+tyUHkCBmOGYACMgfQjM8S5gByo2RYWDNOAblmAAqMeK7kXOqC8tUMgCVKihv6ZPz4r1X2NZjLyIuQr022AZyxLFFeDc2e85b4Fxu565Gbc8uUVcFtyAgXVtipuynJD5FlAB22xSDtBGnLs2Mjt6nCzXnAKTOVBm7jRyyNkslfrvwY3MPNuUsLp7wac4ySG8zMuGRycVMYuUqVxpTa+JFVhO+Rrk/mcqjhvBf10E/rWBWiGZf8RUpl8mRodcOOiKzNU+MzT36swUMPMCbKfwt8AVooPcKrRTPR+dTEULrn1FDC/CkW3/lrXanyMhu6L+n+mRjFFn3GsnRiqPg0Q+DmPLD0iGt55d4rMa/Z/lWFrl7Gelp1aNGnab4Rn2kMW618zypAbk5qfKaeYsmxrDAOeThkg4KxXtbFoZp4wF9lMZaOkf+JsWcVkNL+5SUM/i29XwgayBCZ3x2WEGPgO7noE2YLjmXdKY2UPasAWQKv9Vw3zKFCnu5nLdrSlVQy8gVk/GNcpAEwy31FiT5BSWTza018pr7kQYgZgN9d5HyPA1zerLF8ed9ty4UzP3ilIL7wIS09QGyDYnDzpYHLErLzvuclTekVOxxEP/Lkh15+8ObXxFi2PzWvT5XEvwHUI5xgXrDUhx9u5EEapsFOoPQQdxyoDKwwdwFDlt9Mczesc40V3EuX+BVNGyZxqfmGn8lXnrwL5kNQw+mxw3c309AjrYY2voArDuTajPdyRjg/qPE5uYCRCO8Q+FQo85u3cSDYAeNFBzlGWD7w1VSYK4TYMPdvGIZhGIZhGIZhGPvxCzKCpjeOtJtbAAAAAElFTkSuQmCC\" alt=\"pi2 = L/d\" style=\"width: 64px; height: 21px;\" width=\"64\" height=\"21\"\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: 11.6833px 7.8px; transform-origin: 11.6833px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eand\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21.8167px; 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.9167px; text-align: left; transform-origin: 384px 10.9167px; 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: 13.6px 7.8px; transform-origin: 13.6px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e       \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANMAAAAqCAYAAAApmm4IAAAFFklEQVR4nO2cYZXqMBCFr4c6qAEMoAAFOMBBHWABDUjAAxbQsBZ4P8o9vS1Jk5KUhNf5zskfynan6czkziS7gGEYhmEYhmEYhmEYALAD0JQ2Yoba7WvQ22hsmBbADcATdTpr7fYBwAnAH4BzaUOMcpxf44k6nbV2+/bo7bujt8+CyajWWUnt9nWwYPo6Dfps5hut42daz3dz6vOczroDcEBex7JgMt5o0DvaA4ODPNHXBHu4naUFcJz8zBnuwPuUVGdtAVzQ1w281zGPaQAsmIwZjhgHU4yTXDAEXm5yOSud6om6gn1tLJgKssPyYGLWX8OhcjkrmwWPZIvGWDAZs2gw7QPf5UrWOa7tMF+HTcecLanO6upq+Wo+33DZsGYwherYmLrWgqkw3DsJ1RcN+lXpHnGf0PDdI4eztnKfg3yu0i9mfDuY9gvtOzjuYcFUGNZAoZfAFxVavVLI4axaB+Z2+s3IvNhlPGdBWgNzLeo9+gnu4H9uzdhXz3eY7S9Jlob51FlVOl5Rb4MkJHNTSQ6mabs2NHLuiyzRuL6RYo9KmpPjuq46c88Qkl900LUz8hJnZRucznPFuC3uquu+aR9p0NvHYz6cywfc7yyFpGBSZ4kZa3V3UoZvNYhBJY0rKJlk5rK0BuQf3h2FwZZzvyZkR0g98LnvGNvLxsMacnSJfaR52fTA2E4GlK/2+RTGw2IFwShvMTyoBgsnfM1i7JZhpGRQTt6f45q2vUMZcK7wfsC/YuXigP5ZOCdn+IOBzzx1UGBogrjm41v2EQaSK/gOGOY7h3Ru0b9j2ndF7/9RQd9g7CBc3tQxObFrFsyl4crjWt1OiJe22onTTMl71HKkX1dil6PQeVNW+1xw9XElyxhpXQzqZL50rlShDMW9kVqcZQmheomBFpOlVXZQzrEVXkubVZ/X5aAN3p+hFBosoetrNEo+htlKJR4zqm8J3eG9aXFGvS1PF3P1kr6smCytHT0GD4v5WuYkJOFUOpXu2NJWn//pfK/RKPkYGq4ZlIHiylDMuLzWYpAHSzNayW7eXL2khXhMx0gd8Yah3spZHKegq5LPQbVLVhK11edPqgSqUUVqOGsjLbxdWbXDu5PQmZZKmpLdPF+9dMJ41Y3J0jpndwyFbC1oJncFuPpBaVmqtarv9H2OTm52XNmZn2lhd8C8U1EWLc3Epbp5vnqJ8vWTLD0N8tJSSdFM7nJQXwOlBFQFvsaCbufUIqFHGUAdavowO4SL8AsqyxIBtF6i87AVq5vYlEQXhJ1MpWHp7D5Fg2XqgOoHvM65+DbaBHHNoSqAKuRdi7GMmRbJOrF8CXO1UPe6R+mMtgTNblf0tt9fn081e4e4vYxaag4X+v8X9F12GK/E3MS9o8z71Npz+vuZ1KsJJOA9E02Nvk+u+1acHd7/KvNXAsp1fIrPqZ28B+KDg3VJjXOgCYJJkpvJDcYr1wPlWuOa5NSGI3o/u6IiaQcMZ52YkafsXtduiJvUBu46q1amBewN7x27M4Z6LPbl8VBsrTD56Q4/2WM4mVCy1mOSe7xsoSo4Fbbr69T+P9EI66XcR2aMNEKbypuCMqf2YOIq+ksNky2w5PjWf0+H35B5lBK5j+8babAJsinF0MCtX9f4+5LcqJTYfParDDayNqUY9PhRi6EBsfZfkeZgrf+6Y6Th2vfbBHsMXTB2vH6h09JgsHtTL+wH4H5e7crGMAzDMAzDMAzDMAzDMAzDMLbGPzdEr6mprduEAAAAAElFTkSuQmCC\" alt=\"pi3 = mu/(V d rho)\" style=\"width: 105.5px; height: 21px;\" width=\"105.5\" height=\"21\"\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: 129.517px 7.8px; transform-origin: 129.517px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eor a geometric ratio and the inverse of 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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Reynolds_number\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eReynolds number\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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: 63.0167px 7.8px; transform-origin: 63.0167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eProblem statement\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 106.8px; 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 53.4px; text-align: left; transform-origin: 384px 53.4px; 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: 231.7px 7.8px; transform-origin: 231.7px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that constructs dimensionless parameters from a cell array\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 15.4px 7.8px; transform-origin: 15.4px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 15.4px 8.25px; transform-origin: 15.4px 8.25px; \"\u003evars\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: 104.25px 7.8px; transform-origin: 104.25px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with the variable names, a matrix\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 15.4px 7.8px; transform-origin: 15.4px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 15.4px 8.25px; transform-origin: 15.4px 8.25px; \"\u003edims\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with the exponents for the dimensions in rows (length, time, mass) for each variable in the columns, and a vector\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 15.4px 7.8px; transform-origin: 15.4px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 15.4px 8.25px; transform-origin: 15.4px 8.25px; \"\u003eindx\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e indicating the variables chosen in step 1 above. The function should return a cell array\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 7.7px 7.8px; transform-origin: 7.7px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003ePi\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: 105.033px 7.8px; transform-origin: 105.033px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with the dimensionless groups in strings and a vector\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 3.85px 7.8px; transform-origin: 3.85px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 3.85px 8.25px; transform-origin: 3.85px 8.25px; \"\u003ea\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: 22.1667px 7.8px; transform-origin: 22.1667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e of size\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: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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: 26.95px 7.8px; transform-origin: 26.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 26.95px 8.25px; transform-origin: 26.95px 8.25px; \"\u003em x m-n\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: 255.567px 7.8px; transform-origin: 255.567px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e with the exponents of the normalizing variables. For the example above, the input could be specified as\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 102.167px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-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: 404px 51.0833px; transform-origin: 404px 51.0833px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 161.7px 8.25px; transform-origin: 161.7px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 34.65px 8.25px; transform-origin: 34.65px 8.25px; \"\u003e vars = {\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 11.55px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 11.55px 8.25px; \"\u003e'F'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e, \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 11.55px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 11.55px 8.25px; \"\u003e'V'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e, \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 11.55px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 11.55px 8.25px; \"\u003e'd'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e, \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 11.55px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 11.55px 8.25px; \"\u003e'L'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e, \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 19.25px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 19.25px 8.25px; \"\u003e'rho'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e, \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 15.4px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 15.4px 8.25px; \"\u003e'mu'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e};\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 61.6px 8.25px; transform-origin: 61.6px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e indx = [2 3 5];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 111.65px 8.25px; transform-origin: 111.65px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e dims = [ 1  1  1  1  -3  -1;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 111.65px 8.25px; transform-origin: 111.65px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e         -2 -1  0  0   0  -1;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 115.5px 8.25px; transform-origin: 115.5px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e          1  0  0  0   1   1];\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.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: 74.7px 7.8px; transform-origin: 74.7px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eand the output would be\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 81.7333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-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: 404px 40.8667px; transform-origin: 404px 40.8667px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 292.6px 8.25px; transform-origin: 292.6px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 26.95px 8.25px; transform-origin: 26.95px 8.25px; \"\u003e Pi = {\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 100.1px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 100.1px 8.25px; \"\u003e'F V^{-2} d^{-2} rho^{-1}'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e, \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 38.5px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 38.5px 8.25px; \"\u003e'L d^{-1}'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e, \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 103.95px 8.25px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 103.95px 8.25px; \"\u003e'mu V^{-1} d^{-1} rho^{-1}'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003e} \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 69.3px 8.25px; transform-origin: 69.3px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e a  = [-2   0  -1;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 69.3px 8.25px; transform-origin: 69.3px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       -2  -1  -1;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 69.3px 8.25px; transform-origin: 69.3px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       -1   0  -1]\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.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: 68.4667px 7.8px; transform-origin: 68.4667px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFurther specifications:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 143.933px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 391px 71.9667px; transform-origin: 391px 71.9667px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 41.7667px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 20.8833px; text-align: left; transform-origin: 363px 20.8833px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 77.4167px 7.8px; transform-origin: 77.4167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf the variables chosen in\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 15.4px 7.8px; transform-origin: 15.4px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 15.4px 8.25px; transform-origin: 15.4px 8.25px; \"\u003eindx\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 245.833px 7.8px; transform-origin: 245.833px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e will not work (i.e., the number is incorrect or some form a dimensionless group themselves), return\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 26.95px 7.8px; transform-origin: 26.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 26.95px 8.25px; transform-origin: 26.95px 8.25px; \"\u003ea = NaN\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 13.6167px 7.8px; transform-origin: 13.6167px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 184.8px 7.8px; transform-origin: 184.8px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 184.8px 8.25px; transform-origin: 184.8px 8.25px; \"\u003ePi = {'Error in choosing normalizing variables'}\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 1.95px 7.8px; transform-origin: 1.95px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 212.75px 7.8px; transform-origin: 212.75px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf the exponent of a variable is zero, omit the variable from the string.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 259.833px 7.8px; transform-origin: 259.833px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf the exponent of a variable is one, keep the variable but do not show the exponent.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 277.117px 7.8px; transform-origin: 277.117px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf the exponent of a variable is a positive integer, indicate it with a caret (^) and no braces.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 206.15px 7.8px; transform-origin: 206.15px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf the exponent is anything else, indicate it with a caret and braces.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 307.133px 7.8px; transform-origin: 307.133px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf the exponent is not an integer, express it as a fraction. Hint: MATLAB has a function that will help.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [Pi, a] = dimAnalysis(vars,dims,indx)\r\n  a  = ...;\r\n  Pi = ...;\r\nend","test_suite":"%%  Drag coefficient for a cylinder\r\n%     F = drag force, V = velocity, d = diameter, L = length, rho = density, mu = dynamic viscosity\r\nvars = {'F', 'V', 'd', 'L', 'rho', 'mu'};\r\nindx = [2 3 5];\r\ndims = [ 1  1  1  1  -3  -1;\r\n        -2 -1  0  0   0  -1;\r\n         1  0  0  0   1   1];\r\nPi_correct = {'F V^{-2} d^{-2} rho^{-1}', 'L d^{-1}', 'mu V^{-1} d^{-1} rho^{-1}'};\r\na_correct  = [-2   0  -1;\r\n              -2  -1  -1;\r\n              -1   0  -1];\r\n[Pi,a] = dimAnalysis(vars,dims,indx);\r\nassert(isequal(Pi,Pi_correct))\r\nassert(isequal(a,a_correct))\r\n\r\n%%  Drag coefficient for a cylinder--normalizing variables form a dimensionless group\r\n%     F = drag force, V = velocity, d = diameter, L = length, rho = density, mu = dynamic viscosity\r\nvars = {'F', 'V', 'd', 'L', 'rho', 'mu'};\r\nindx = [2 3 4];\r\ndims = [ 1  1  1  1  -3  -1;\r\n        -2 -1  0  0   0  -1;\r\n         1  0  0  0   1   1];\r\nPi_correct = {'Error in choosing normalizing variables'};\r\n[Pi,a] = dimAnalysis(vars,dims,indx);\r\nassert(isequal(Pi,Pi_correct))\r\nassert(isnan(a))\r\n\r\n%%  Time for a ball to fall a distance h\r\n%     T = time, g = acceleration of gravity, h = distance, m = mass of ball\r\nvars = {'T', 'g', 'h', 'm'};\r\nindx = 2:4;\r\ndims = [ 0  1  1  0;\r\n         1 -2  0  0;\r\n         0  0  0  1];\r\nPi_correct = {'T g^{1/2} h^{-1/2}'};\r\na_correct  = [0.5 -0.5 0]';\r\n[Pi,a] = dimAnalysis(vars,dims,indx);\r\nassert(isequal(Pi,Pi_correct))\r\nassert(isequal(a,a_correct))\r\n\r\n%%  Period of a pendulum with small amplitude\r\n%     T = period, L = length of pendulum, g = acceleration of gravity\r\nvars = {'T', 'L', 'g'};\r\nindx = 2:3;\r\ndims = [ 0  1  1;\r\n         1  0 -2];\r\nPi_correct = {'T L^{-1/2} g^{1/2}'};\r\na_correct  = [-0.5 0.5]';\r\n[Pi,a] = dimAnalysis(vars,dims,indx);\r\nassert(isequal(Pi,Pi_correct))\r\nassert(isequal(a,a_correct))\r\n\r\n%%  Period of a pendulum with finite amplitude\r\n%     T = period, L = length of pendulum, g = acceleration of gravity, theta0 = initial amplitude\r\nvars = {'T', 'L', 'g', 'theta0'};\r\nindx = 2:3;\r\ndims = [ 0  1  1 0;\r\n         1  0 -2 0];\r\nPi_correct = {'T L^{-1/2} g^{1/2}', 'theta0'};\r\na_correct  = [-0.5 0;\r\n               0.5 0];\r\n[Pi,a] = dimAnalysis(vars,dims,indx);\r\nassert(isequal(Pi,Pi_correct))\r\nassert(isequal(a,a_correct))\r\n\r\n%%  Stokes first problem: flow induced by an impulsively started plate bounded a semi-infinite viscous fluid\r\n%     u = fluid velocity, U = plate velocity, y = distance from plate, t = time, nu = kinematic viscosity\r\nvars = {'u', 'U', 'y', 't', 'nu'};\r\nindx = 3:4;\r\ndims = [ 1  1  1  0  2;\r\n        -1 -1  0  1 -1];\r\nPi_correct = {'u y^{-1} t', 'U y^{-1} t', 'nu y^{-2} t'};\r\na_correct  = [-1  -1  -2\r\n               1   1   1];\r\n[Pi,a] = dimAnalysis(vars,dims,indx);\r\nassert(isequal(Pi,Pi_correct))\r\nassert(isequal(a,a_correct))\r\n\r\n%%  Kepler's 3rd law for a planet whose mass is much smaller than the Sun's mass\r\n%      T = orbital period, r = semi-major axis of the orbit, G = gravitational constant, M = mass of Sun\r\nvars = {'T' 'r' 'G' 'M'};\r\nindx = 2:4;\r\ndims = [ 0  1  3  0; \r\n         1  0 -2  0; \r\n         0  0 -1  1];\r\nPi_correct = {'T r^{-3/2} G^{1/2} M^{1/2}'};\r\na_correct  = [-1.5 0.5 0.5]';\r\n[Pi,a] = dimAnalysis(vars,dims,indx);\r\nassert(isequal(Pi,Pi_correct))\r\nassert(isequal(a,a_correct))\r\n\r\n%%  Kepler's 3rd law--too few normalizing variables\r\n%      T = orbital period, r = semi-major axis of the orbit, G = gravitational constant, M = mass of Sun\r\nvars = {'T' 'r' 'G' 'M'};\r\nindx = 2:3;\r\ndims = [ 0  1 -1  0; \r\n         1  0 -2  0; \r\n         0  0 -1  1];\r\nPi_correct = {'Error in choosing normalizing variables'};\r\n[Pi,a] = dimAnalysis(vars,dims,indx);\r\nassert(isequal(Pi,Pi_correct))\r\nassert(isnan(a))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":4,"test_suite_updated_at":"2020-07-07T17:45:44.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-07-05T14:44:00.000Z","updated_at":"2020-07-30T17:53:02.000Z","published_at":"2020-07-05T23:53:11.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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eSummary\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\u003eWrite a function to construct dimensionless parameters from a list of variables, a matrix indicating their dimensions, and a vector identifying the variables to use to make the other variables dimensionless. More details are given in \\\"Problem statement\\\" below.\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eIntroduction\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\u003eDimensional analysis and the Buckingham \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"pi\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e theorem\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\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/Buckingham_π_theorem\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eBuckingham π theorem\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is a key result exploited in\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Dimensional_analysis\\\"\u003e\u003cw:r\u003e\u003cw:t\u003edimensional analysis\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e in engineering, physics, and applied mathematics. It states that if a problem involves\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"m\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e variables and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e physical dimensions (e.g., length, time, mass), then the problem can be described with\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"m-n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003em-n\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e dimensionless groups, called \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"pi\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e groups. In\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Buckingham_π_theorem\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eother words\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, the \\\"physics does not depend on a specific unit system\\\".\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\u003eTo find the dimensionless groups, we follow these steps:\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChoose\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e variables that cannot form a dimensionless group by themselves\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eForm the product of one of the remaining\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"m-n\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003em-n\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e variables with the variables in step 1, each raised to different exponents\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDetermine the exponents that would make the product (or group) dimensionless\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRepeat steps 2 and 3 for the remaining variables\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\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSuppose we are interested in the drag\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"F\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eF\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e (i.e., a force) on a cylinder of length\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"L\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eL\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and diameter\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"d\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ed\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e immersed in a fluid of density\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"rho\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\rho\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and dynamic viscosity\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"mu\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\mu\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e flowing at velocity\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"V\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eV\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. Because the problem involves 6 variables and 3 dimensions (length, time, and mass), it can be described with 3 dimensionless groups. For step 1 above, choose\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"V\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eV\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"d\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ed\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"rho\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\rho\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. We could choose other lists of 3, but notice that we could not choose\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"V\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eV\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"d\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ed\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"L\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eL\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e because\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"d\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ed\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"L\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eL\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e form a dimensionless group themselves (and we have no way of removing mass dimensions.)\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 step 2, start with the drag\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eF\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Following the step, we get\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\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=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"pi_1 = F V^{a1} d^{a2} rho^{a3}\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi_1 = F V^{a_1} d^{a_2} \\\\rho^{a3}\u003c/w:t\u003e\u003c/w:r\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\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea1\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea2\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea3\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e are exponents. Because \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"pi1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi_1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e must be dimensionless and because the dimensionless of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"F\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eF\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"V\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eV\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"d\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ed\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\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:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"rho\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\rho\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e are \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"ML/T^2\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\rm ML/T^2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, L/T, L, and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"M/L^3\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\rm M/L^3\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, respectively, we can solve a system of three equations to find the exponents and write\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=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"pi1 = F V^{-2} d^{-2} rho^{-1}\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi_1 = F V^{-2}d^{-2}\\\\rho^{-1}\u003c/w:t\u003e\u003c/w:r\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\u003ewhich is related to a quantity in fluid mechanics called the drag coefficient. We then repeat steps 2 and 3 with the two remaining variables and find\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=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"pi2 = L/d\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi_2 = L d^{-1}\u003c/w:t\u003e\u003c/w:r\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\u003eand\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=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"pi3 = mu/(V d rho)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\pi_3 = \\\\mu V^{-1} d^{-1} \\\\rho^{-1}\u003c/w:t\u003e\u003c/w:r\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\u003eor a geometric ratio and the inverse of 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/Reynolds_number\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eReynolds number\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eProblem statement\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\u003eWrite a function that constructs dimensionless parameters from a cell array\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\u003evars\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e with the variable names, a matrix\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\u003edims\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e with the exponents for the dimensions in rows (length, time, mass) for each variable in the columns, and a vector\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\u003eindx\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e indicating the variables chosen in step 1 above. The function should return a cell array\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\u003ePi\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e with the dimensionless groups in strings and a vector\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of size\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\u003em x m-n\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e with the exponents of the normalizing variables. For the example above, the input could be specified as\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ vars = {'F', 'V', 'd', 'L', 'rho', 'mu'};\\n indx = [2 3 5];\\n dims = [ 1  1  1  1  -3  -1;\\n         -2 -1  0  0   0  -1;\\n          1  0  0  0   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\u003eand the output would 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[ Pi = {'F V^{-2} d^{-2} rho^{-1}', 'L d^{-1}', 'mu V^{-1} d^{-1} rho^{-1}'} \\n a  = [-2   0  -1;\\n       -2  -1  -1;\\n       -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\u003eFurther specifications:\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf the variables chosen in\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\u003eindx\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e will not work (i.e., the number is incorrect or some form a dimensionless group themselves), return\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea = NaN\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\u003ePi = {'Error in choosing normalizing variables'}\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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf the exponent of a variable is zero, omit the variable from the string.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf the exponent of a variable is one, keep the variable but do not show the exponent.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf the exponent of a variable is a positive integer, indicate it with a caret (^) and no braces.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf the exponent is anything else, indicate it with a caret and braces.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf the exponent is not an integer, express it as a fraction. Hint: MATLAB has a function that will help.\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":501,"title":"Let's do Markov Chains!","description":"Markov Chains are really useful in a lot of fields. This problem will ask a question about a simple system with 3 states: A,B and C. The probability that one state will go to another can be given in a matrix such as:\r\nmc = [0.5 0.2  0;\r\n      0.2  0  0.6;\r\n      0.3 0.8 0.4];\r\nSo, the first element is the probability that something in state A will remain in state A (0.5 here). The zero as the 5th element means nothing in state B will remain in state B. Now, if you are given the current state of the system, say state=[1 0 0], you can get the next state.\r\nIn this problem, I will given an incomplete matrix (A zero in place of one value), and then an initial state and the next state like:\r\nstates=[1 0.5;\r\n        0 0.2;\r\n        0 0.3]\r\nYou will have to provide the correct markov matrix as the output.\r\nRound the output to 2 digits after decimal.","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: 369.6px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 184.8px; transform-origin: 407px 184.8px; vertical-align: baseline; \"\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\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eMarkov Chains\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: 336px 8px; transform-origin: 336px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e are really useful in a lot of fields. This problem will ask a question about a simple system with 3 states: A,B and C. The probability that one state will go to another can be given in a matrix such as:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 61.3px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-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: 404px 30.65px; transform-origin: 404px 30.65px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 68px 8.5px; tab-size: 4; transform-origin: 68px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003emc = [0.5 0.2  0;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 72px 8.5px; tab-size: 4; transform-origin: 72px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e      0.2  0  0.6;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 76px 8.5px; tab-size: 4; transform-origin: 76px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e      0.3 0.8 0.4];\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.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: 363.5px 8px; transform-origin: 363.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSo, the first element is the probability that something in state A will remain in state A (0.5 here). The zero as the 5th element means nothing in state B will remain in state B. Now, if you are given the current state of the system, say state=[1 0 0], you can get the next state.\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: 380.5px 8px; transform-origin: 380.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn this problem, I will given an incomplete matrix (A zero in place of one value), and then an initial state and the next state like:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 61.3px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-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: 404px 30.65px; transform-origin: 404px 30.65px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 56px 8.5px; tab-size: 4; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003estates=[1 0.5;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 56px 8.5px; tab-size: 4; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        0 0.2;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-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-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 56px 8.5px; tab-size: 4; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        0 0.3]\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.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: 201px 8px; transform-origin: 201px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eYou will have to provide the correct markov matrix as the output.\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: 132px 8px; transform-origin: 132px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eRound the output to 2 digits after decimal.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function MC = markov(mc,states)\r\n  MC = mc;\r\nend","test_suite":"%%\r\nmc = [0.5 0.2  0;\r\n      0.2  0  0.6;\r\n      0.3  0 0.4];\r\nstates = [0.3 0.21;\r\n          0.3 0.3;\r\n          0.4 0.49];\r\nMC = [0.5 0.2  0;\r\n      0.2  0  0.6;\r\n      0.3 0.8 0.4];\r\nassert(isequal(markov(mc,states),MC))\r\n\r\n%%\r\nmc = [0.5 0.2  0;\r\n       0  0  0.6;\r\n      0.3 0.8 0.4];\r\nstates = [0.5 0.31;\r\n          0.3 0.22;\r\n          0.2 0.47];\r\nMC = [0.5 0.2  0;\r\n      0.2  0  0.6;\r\n      0.3 0.8 0.4];\r\nassert(isequal(markov(mc,states),MC))\r\n\r\n%%\r\nmc = [0.4 0;\r\n      0.6 0.23];\r\nstates = [0.1 0.733;\r\n          0.9 0.267];\r\nMC = [0.4 0.77;\r\n      0.6 0.23];\r\nassert(isequal(markov(mc,states),MC))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":8,"created_by":1675,"edited_by":223089,"edited_at":"2022-10-27T18:19:40.000Z","deleted_by":null,"deleted_at":null,"solvers_count":15,"test_suite_updated_at":"2012-03-15T14:27:16.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-03-15T14:27:16.000Z","updated_at":"2022-10-27T18:19:40.000Z","published_at":"2012-03-15T21:19:51.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:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMarkov Chains\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e are really useful in a lot of fields. This problem will ask a question about a simple system with 3 states: A,B and C. The probability that one state will go to another can be given in a matrix such as:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[mc = [0.5 0.2  0;\\n      0.2  0  0.6;\\n      0.3 0.8 0.4];]]\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\u003eSo, the first element is the probability that something in state A will remain in state A (0.5 here). The zero as the 5th element means nothing in state B will remain in state B. Now, if you are given the current state of the system, say state=[1 0 0], you can get the next state.\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\u003eIn this problem, I will given an incomplete matrix (A zero in place of one value), and then an initial state and the next state like:\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[states=[1 0.5;\\n        0 0.2;\\n        0 0.3]]]\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\u003eYou will have to provide the correct markov matrix as the output.\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\u003eRound the output to 2 digits after decimal.\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":1108,"title":"Raise Matrix to Power","description":"For a given square matrix x and scalar a, find x^a without using '^' or 'mpower'.","description_html":"\u003cp\u003eFor a given square matrix x and scalar a, find x^a without using '^' or 'mpower'.\u003c/p\u003e","function_template":"function y = matpow(x,a)\r\ny = x**a;\r\nend","test_suite":"%%\r\nfiletext = fileread('matpow.m');\r\nassert(isempty(strfind(filetext, '^')))\r\nassert(isempty(strfind(filetext, 'mpower')))\r\n\r\n%%\r\nx=[1 2; -1 2];\r\n\r\ny_correct=x^5;\r\ny=matpow(x,5);\r\nassert(max(abs(y(:)-y_correct(:)))\u003c1e-5)\r\n\r\n%%\r\nx=[1 2; -1 2];\r\ny_correct=x^-3.5;\r\ny=matpow(x,-3.5);\r\nassert(max(abs(y(:)-y_correct(:)))\u003c1e-5)\r\n\r\n\r\n%%\r\nx=[1 2 3; 4 2 -1; -2 4 -3];\r\n\r\ny_correct=x^6;\r\ny=matpow(x,6);\r\nassert(max(abs(y(:)-y_correct(:)))\u003c1e-5)\r\n\r\n%%\r\nx=[1 2 3; 4 2 -1; -2 4 -3];\r\n\r\ny_correct=x^-4;\r\ny=matpow(x,-4);\r\nassert(max(abs(y(:)-y_correct(:)))\u003c1e-5)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":3399,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":48,"test_suite_updated_at":"2012-12-08T17:13:33.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-12-08T14:12:53.000Z","updated_at":"2025-12-07T19:24:11.000Z","published_at":"2012-12-08T14:16:04.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\u003eFor a given square matrix x and scalar a, find x^a without using '^' or 'mpower'.\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":44849,"title":"Given a base n, find the y values less or equal than 100(without 1), such that they will never produce a periodic number if we divide any whole number between some of them","description":"A periodic number depends on the base b where we are working. So, for example the number \r\n2/3 in decimal base is periodic(0.666666666) but if we are working in base 3, the same number can be expressed as 2/10, and the result is not periodic (0.2). \r\nBy this way, it is possible to enunciate:\r\n\r\n* In base 2 or 3, all numbers will produce periodics numbers unless the number is the base or power of the base\r\n* In decimal base, numbers as 2,5,8,40,50 for example will never produce periodics numbers. \r\n\r\nBy this way, you have to find when a number in any base can produce periodics numbers or not, and then find the values less or equal than 100 that in this base will never produce a periodic number.","description_html":"\u003cp\u003eA periodic number depends on the base b where we are working. So, for example the number \r\n2/3 in decimal base is periodic(0.666666666) but if we are working in base 3, the same number can be expressed as 2/10, and the result is not periodic (0.2). \r\nBy this way, it is possible to enunciate:\u003c/p\u003e\u003cul\u003e\u003cli\u003eIn base 2 or 3, all numbers will produce periodics numbers unless the number is the base or power of the base\u003c/li\u003e\u003cli\u003eIn decimal base, numbers as 2,5,8,40,50 for example will never produce periodics numbers.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eBy this way, you have to find when a number in any base can produce periodics numbers or not, and then find the values less or equal than 100 that in this base will never produce a periodic number.\u003c/p\u003e","function_template":"function y = nperiodos(b)\r\ny=b;\r\nend","test_suite":"%%\r\nb = 2;\r\ny_correct = [2 4 8 16 32 64];\r\nassert(isequal(nperiodos(b),y_correct))\r\n%%\r\nb=3;\r\ny_correct = [3 9 27 81];\r\nassert(isequal(nperiodos(b),y_correct))\r\n%%\r\nb=60;\r\ny_correct = [2 3 4 5 6 8 9 10 12 15 16 18 20 24 25 27 30 32 36 40 45 48 50 54 60 64 72 75 80 81 90 96 100];\r\nassert(isequal(nperiodos(b),y_correct))\r\n%%\r\nb=50;\r\ny_correct = [2 4 5 8 10 16 20 25 32 40 50 64 80 100];\r\nassert(isequal(nperiodos(b),y_correct))\r\n%%\r\nb=10;\r\ny_correct = [2 4 5 8 10 16 20 25 32 40 50 64 80 100];\r\nassert(isequal(nperiodos(b),y_correct))\r\n%%\r\nb=29;\r\ny_correct = [29];\r\nassert(isequal(nperiodos(b),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":289312,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":11,"test_suite_updated_at":"2019-02-13T21:28:22.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2019-02-13T21:27:15.000Z","updated_at":"2019-02-16T21:35:00.000Z","published_at":"2019-02-13T21:28:22.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 periodic number depends on the base b where we are working. So, for example the number 2/3 in decimal base is periodic(0.666666666) but if we are working in base 3, the same number can be expressed as 2/10, and the result is not periodic (0.2). By this way, it is possible to enunciate:\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\u003eIn base 2 or 3, all numbers will produce periodics numbers unless the number is the base or power of the base\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\u003eIn decimal base, numbers as 2,5,8,40,50 for example will never produce periodics numbers.\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\u003eBy this way, you have to find when a number in any base can produce periodics numbers or not, and then find the values less or equal than 100 that in this base will never produce a periodic number.\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":44277,"title":"Given n, create n random numbers such that their standard deviation is also n.","description":"Given n, create n random numbers such that their standard deviation is also n.","description_html":"\u003cp\u003eGiven n, create n random numbers such that their standard deviation is also n.\u003c/p\u003e","function_template":"function y = randpro(n)\r\n  y = n+3;\r\nend","test_suite":"%%\r\nx = 10;\r\nassert(length(randpro(x))==10)\r\nassert(std(randpro(x))\u003e9)\r\nassert(std(randpro(x))\u003c11)\r\n\r\n%%\r\nx = 17;\r\nassert(length(randpro(x))==17)\r\nassert(std(randpro(x))\u003e16)\r\nassert(std(randpro(x))\u003c18)\r\n\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":204,"test_suite_updated_at":"2017-08-06T19:53:33.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-08-06T19:46:05.000Z","updated_at":"2026-02-11T03:12:53.000Z","published_at":"2017-08-06T19:53: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\",\"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\u003eGiven n, create n random numbers such that their standard deviation is also n.\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":136,"title":"Read a Soroban Abacus","description":"*Description*\r\n\r\nThe Soroban is the name of the modern Japanese abacus. Information on reading a Soroban can be found \u003chttp://webhome.idirect.com/~totton/abacus/pages.htm#Soroban1 here\u003e.\r\n\r\n\u003c\u003chttp://webhome.idirect.com/~totton/abacus/1.gif\u003e\u003e\r\n\r\nThe soroban essentially consists of 7xN slots that 5xN beads may occupy. The input to the function will be a graphical representation of the soroban where |true| signifies a slot filled with a bead whereas |false| signifies a vacant slot. You can assume that all inputs will be valid soroban configurations.\r\n\r\n*Example*\r\n\r\n   input = [ 1 1 0 0 0\r\n             0 0 1 1 1\r\n             1 0 0 1 1\r\n             0 1 1 1 0\r\n             1 1 1 1 1\r\n             1 1 1 0 1\r\n             1 1 1 1 1 ];\r\n   output = 10586","description_html":"\u003cp\u003e\u003cb\u003eDescription\u003c/b\u003e\u003c/p\u003e\u003cp\u003eThe Soroban is the name of the modern Japanese abacus. Information on reading a Soroban can be found \u003ca href=\"http://webhome.idirect.com/~totton/abacus/pages.htm#Soroban1\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\u003cimg src=\"http://webhome.idirect.com/~totton/abacus/1.gif\"\u003e\u003cp\u003eThe soroban essentially consists of 7xN slots that 5xN beads may occupy. The input to the function will be a graphical representation of the soroban where \u003ctt\u003etrue\u003c/tt\u003e signifies a slot filled with a bead whereas \u003ctt\u003efalse\u003c/tt\u003e signifies a vacant slot. You can assume that all inputs will be valid soroban configurations.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cpre\u003e   input = [ 1 1 0 0 0\r\n             0 0 1 1 1\r\n             1 0 0 1 1\r\n             0 1 1 1 0\r\n             1 1 1 1 1\r\n             1 1 1 0 1\r\n             1 1 1 1 1 ];\r\n   output = 10586\u003c/pre\u003e","function_template":"function y = soroban_evaluate(s)\r\n  y = sum(s(:));\r\nend","test_suite":"%%\r\nx = [ 1 0 1 1 0 1 1 ]';\r\ny_correct = 2;\r\nassert(isequal(soroban_evaluate(x),y_correct))\r\n\r\n%%\r\nx = [ 1 1 0 0 0\r\n      0 0 1 1 1\r\n      1 0 0 1 1\r\n      0 1 1 1 0\r\n      1 1 1 1 1\r\n      1 1 1 0 1\r\n      1 1 1 1 1 ];\r\ny_correct = 10586;\r\nassert(isequal(soroban_evaluate(x),y_correct))\r\n\r\n%%\r\nx = [ 1 1 1 1 1\r\n      0 0 0 0 0\r\n      0 0 0 0 0\r\n      1 1 1 1 1\r\n      1 1 1 1 1\r\n      1 1 1 1 1\r\n      1 1 1 1 1 ];\r\ny_correct = 0;\r\nassert(isequal(soroban_evaluate(x),y_correct))\r\n\r\n%%\r\nx = [ 0 1 1 1 1\r\n      1 0 0 0 0\r\n      0 0 0 0 0\r\n      1 1 1 1 1\r\n      1 1 1 1 1\r\n      1 1 1 1 1\r\n      1 1 1 1 1 ];\r\ny_correct = 50000;\r\nassert(isequal(soroban_evaluate(x),y_correct))\r\n\r\n%%\r\nx = [ 0 0 0 0 0 1 1 1 1 1\r\n      1 1 1 1 1 0 0 0 0 0\r\n      1 1 1 1 0 1 1 1 1 0\r\n      1 1 1 0 1 1 1 1 0 1\r\n      1 1 0 1 1 1 1 0 1 1\r\n      1 0 1 1 1 1 0 1 1 1\r\n      0 1 1 1 1 0 1 1 1 1 ];\r\ny_correct = 9876543210;\r\nassert(isequal(soroban_evaluate(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":17,"comments_count":7,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":230,"test_suite_updated_at":"2012-01-28T08:11:33.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-01-28T07:55:24.000Z","updated_at":"2026-02-09T02:06:49.000Z","published_at":"2012-01-28T08:11: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\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eDescription\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 Soroban is the name of the modern Japanese abacus. Information on reading a Soroban can be found\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://webhome.idirect.com/~totton/abacus/pages.htm#Soroban1\\\"\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: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 soroban essentially consists of 7xN slots that 5xN beads may occupy. The input to the function will be a graphical representation of the soroban 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\u003etrue\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e signifies a slot filled with a bead whereas\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\u003efalse\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e signifies a vacant slot. You can assume that all inputs will be valid soroban configurations.\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   input = [ 1 1 0 0 0\\n             0 0 1 1 1\\n             1 0 0 1 1\\n             0 1 1 1 0\\n             1 1 1 1 1\\n             1 1 1 0 1\\n             1 1 1 1 1 ];\\n   output = 10586]]\u003e\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,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\"}]}"},{"id":110,"title":"Make an N-dimensional Multiplication Table","description":"*INSTRUCTIONS*\r\n\r\nThis is a multi-dimensional variant of the normal multiplication table used to teach elementary students multiplication. In this variant, we are going to produce a table that multiplies the divisors 1 to _n_ (input) agains itself in _d_ dimensions.\r\n\r\n_Note_: Inputting _d_ = 0 should return the number 1 and _d_ = 1 should return a column vector with the elements 1 to _n_.\r\n\r\n\r\n*Example:*\r\n\r\nInput: \r\n\r\n  n = 3;\r\n  d = 3;\r\n\r\nOutput:\r\n\r\n  tt(:,:,1) = [ 1  2  3\r\n                2  4  6\r\n                3  6  9  ];\r\n  tt(:,:,2) = [ 2  4  6\r\n                4  8  12\r\n                6  12 18 ];\r\n  tt(:,:,3) = [ 3  6  9\r\n                6  12 18\r\n                9  18 27 ];","description_html":"\u003cp\u003e\u003cb\u003eINSTRUCTIONS\u003c/b\u003e\u003c/p\u003e\u003cp\u003eThis is a multi-dimensional variant of the normal multiplication table used to teach elementary students multiplication. In this variant, we are going to produce a table that multiplies the divisors 1 to \u003ci\u003en\u003c/i\u003e (input) agains itself in \u003ci\u003ed\u003c/i\u003e dimensions.\u003c/p\u003e\u003cp\u003e\u003ci\u003eNote\u003c/i\u003e: Inputting \u003ci\u003ed\u003c/i\u003e = 0 should return the number 1 and \u003ci\u003ed\u003c/i\u003e = 1 should return a column vector with the elements 1 to \u003ci\u003en\u003c/i\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eInput:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003en = 3;\r\nd = 3;\r\n\u003c/pre\u003e\u003cp\u003eOutput:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ett(:,:,1) = [ 1  2  3\r\n              2  4  6\r\n              3  6  9  ];\r\ntt(:,:,2) = [ 2  4  6\r\n              4  8  12\r\n              6  12 18 ];\r\ntt(:,:,3) = [ 3  6  9\r\n              6  12 18\r\n              9  18 27 ];\r\n\u003c/pre\u003e","function_template":"function tt = ndtimestable(n,d)\r\n  tt = zeros(n*ones(1,d));\r\nend","test_suite":"%%\r\nm = 5;\r\nn = 0;\r\ntt = 1;\r\nassert(isequal(ndtimestable(m,n),tt))\r\n\r\n%%\r\nm = 10;\r\nn = 1;\r\ntt = (1:10)';\r\nassert(isequal(ndtimestable(m,n),tt))\r\n\r\n%%\r\nm = 12;\r\nn = 2;\r\ntt= [    1     2     3     4     5     6     7     8     9    10    11    12\r\n         2     4     6     8    10    12    14    16    18    20    22    24\r\n         3     6     9    12    15    18    21    24    27    30    33    36\r\n         4     8    12    16    20    24    28    32    36    40    44    48\r\n         5    10    15    20    25    30    35    40    45    50    55    60\r\n         6    12    18    24    30    36    42    48    54    60    66    72\r\n         7    14    21    28    35    42    49    56    63    70    77    84\r\n         8    16    24    32    40    48    56    64    72    80    88    96\r\n         9    18    27    36    45    54    63    72    81    90    99   108\r\n        10    20    30    40    50    60    70    80    90   100   110   120\r\n        11    22    33    44    55    66    77    88    99   110   121   132\r\n        12    24    36    48    60    72    84    96   108   120   132   144  ];\r\nassert(isequal(ndtimestable(m,n),tt))\r\n\r\n%%\r\nm = 3;\r\nn = 3;\r\ntt = zeros(m,m,m);\r\ntt(:,:,1) = [ 1  2  3\r\n              2  4  6\r\n              3  6  9  ];\r\ntt(:,:,2) = [ 2  4  6\r\n              4  8  12\r\n              6  12 18 ];\r\ntt(:,:,3) = [ 3  6  9\r\n              6  12 18\r\n              9  18 27 ];\r\nassert(isequal(ndtimestable(m,n),tt))\r\n\r\n%%\r\nm = 2;\r\nn = 4;\r\ntt = zeros(m,m,m,m);\r\ntt(:,:,1,1) = ...\r\n  [  1     2\r\n     2     4  ];\r\ntt(:,:,2,1) = ...\r\n  [  2     4\r\n     4     8  ];\r\ntt(:,:,1,2) = ...\r\n  [  2     4\r\n     4     8  ];\r\ntt(:,:,2,2) = ...\r\n  [  4     8\r\n     8    16  ];\r\nassert(isequal(ndtimestable(m,n),tt))\r\n\r\n%%\r\nm = 2;\r\nn = 7;\r\nassert(numel(ndtimestable(m,n)) == m^n);","published":true,"deleted":false,"likes_count":6,"comments_count":0,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":141,"test_suite_updated_at":"2012-01-26T15:30:12.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-01-26T15:17:25.000Z","updated_at":"2026-04-03T03:18:48.000Z","published_at":"2012-01-26T15:30: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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eINSTRUCTIONS\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\u003eThis is a multi-dimensional variant of the normal multiplication table used to teach elementary students multiplication. In this variant, we are going to produce a table that multiplies the divisors 1 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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (input) agains itself in\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ed\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e dimensions.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eNote\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e: Inputting\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ed\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = 0 should return the number 1 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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ed\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = 1 should return a column vector with the elements 1 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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\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: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\u003eInput:\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[n = 3;\\nd = 3;]]\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\u003eOutput:\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[tt(:,:,1) = [ 1  2  3\\n              2  4  6\\n              3  6  9  ];\\ntt(:,:,2) = [ 2  4  6\\n              4  8  12\\n              6  12 18 ];\\ntt(:,:,3) = [ 3  6  9\\n              6  12 18\\n              9  18 27 ];]]\u003e\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":46120,"title":"Solve the Challenger puzzle","description":null,"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: 442.333px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 221.167px; transform-origin: 407px 221.167px; vertical-align: baseline; \"\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: 14px 7.8px; transform-origin: 14px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://kingfeatures.com/features/puzzlesandgames/challenger/\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eChallenger\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: 321.267px 7.8px; transform-origin: 321.267px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e puzzle by Linus Maurer requires the solver to fill a 4x4 matrix of integers from 1 to 9 to match the given sums of the rows, columns, main diagonal, and anti-diagonal. Four of the numbers are given. Numbers can be repeated, and the solution is not necessarily unique. \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: 376.017px 7.8px; transform-origin: 376.017px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to solve the Challenger. The input will be a matrix resembling the game board. For example, if the input is\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 122.6px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-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: 404px 61.3px; transform-origin: 404px 61.3px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 96.25px 8.25px; transform-origin: 96.25px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e   NaN  NaN  NaN  NaN  12\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 96.25px 8.25px; transform-origin: 96.25px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0    0    0    4  23\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 96.25px 8.25px; transform-origin: 96.25px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0    1    0    0  11\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 96.25px 8.25px; transform-origin: 96.25px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     6    0    0    0  21\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 96.25px 8.25px; transform-origin: 96.25px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0    0    2    0  13\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 96.25px 8.25px; transform-origin: 96.25px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     9   20   22   17  12\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 84px; 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: 384px 42px; text-align: left; transform-origin: 384px 42px; 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: 379.85px 7.8px; transform-origin: 379.85px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ethen the sums of the four columns are 9, 20, 22, and 17. The sums of the rows are 23, 11, 21, and 13, and the sums of the two diagonals are 12 and 12. The four starting numbers are 6, 1, 2, and 4, and zeros indicate the numbers to be determined. Ignore the NaNs. The output of the function should be the 4x4 matrix of numbers. In the example, a valid solution would be \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 81.7333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-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: 404px 40.8667px; transform-origin: 404px 40.8667px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 80.85px 8.25px; transform-origin: 80.85px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     1    9    9    4\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 80.85px 8.25px; transform-origin: 80.85px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     1    1    4    5\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 80.85px 8.25px; transform-origin: 80.85px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     6    3    7    5\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.916667px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.916667px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.916667px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.916667px; border-start-end-radius: 0px; border-start-start-radius: 0px; 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: 404px 10.2167px; transform-origin: 404px 10.2167px; 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: 84.7px 8.25px; transform-origin: 84.7px 8.25px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     1    7    2    3 \u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.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 7.8px; transform-origin: 0px 7.8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = Challenger(x)\r\n  y = f(x);\r\nend","test_suite":"%%\r\nx = [NaN NaN NaN NaN 12; 0 0 0 4 23; 0 1 0 0 11; 6 0 0 0 21; 0 0 2 0 13; 9 20 22 17 12];\r\nsum_row = x(6,1:4); sum_col = x(2:5,5); sum_d1 = x(6,5); sum_d2 = x(1,5);\r\ny = Challenger(x);\r\nassert(isequal(sum(y),sum_row) \u0026\u0026 isequal(sum(y,2),sum_col) \u0026\u0026 trace(y) == sum_d1 \u0026\u0026 trace(fliplr(y)) == sum_d2)\r\n\r\n%%\r\nx = [NaN NaN NaN NaN 25; 0 0 0 7 18; 0 9 0 0 29; 0 0 6 0 27; 9 0 0 0 27; 30 21 19 31 28];\r\nsum_row = x(6,1:4); sum_col = x(2:5,5); sum_d1 = x(6,5); sum_d2 = x(1,5);\r\ny = Challenger(x);\r\nassert(isequal(sum(y),sum_row) \u0026\u0026 isequal(sum(y,2),sum_col) \u0026\u0026 trace(y) == sum_d1 \u0026\u0026 trace(fliplr(y)) == sum_d2)\r\n\r\n%%\r\nx = [NaN NaN NaN NaN 19; 0 0 0 2 16; 5 0 0 0 22; 0 0 4 0 27; 0 2 0 0 11; 19 16 19 22 15];\r\nsum_row = x(6,1:4); sum_col = x(2:5,5); sum_d1 = x(6,5); sum_d2 = x(1,5);\r\ny = Challenger(x);\r\nassert(isequal(sum(y),sum_row) \u0026\u0026 isequal(sum(y,2),sum_col) \u0026\u0026 trace(y) == sum_d1 \u0026\u0026 trace(fliplr(y)) == sum_d2)\r\n\r\n%%\r\nx = [NaN NaN NaN NaN 20; 0 0 4 0 25; 0 6 0 0 22; 4 0 0 0 21; 0 0 0 4 25; 26 20 22 25 26];\r\nsum_row = x(6,1:4); sum_col = x(2:5,5); sum_d1 = x(6,5); sum_d2 = x(1,5);\r\ny = Challenger(x);\r\nassert(isequal(sum(y),sum_row) \u0026\u0026 isequal(sum(y,2),sum_col) \u0026\u0026 trace(y) == sum_d1 \u0026\u0026 trace(fliplr(y)) == sum_d2)","published":true,"deleted":false,"likes_count":3,"comments_count":3,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":27,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-08-08T15:02:54.000Z","updated_at":"2026-02-11T17:03:32.000Z","published_at":"2020-08-08T15:35:49.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\u003eThe \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://kingfeatures.com/features/puzzlesandgames/challenger/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eChallenger\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e puzzle by Linus Maurer requires the solver to fill a 4x4 matrix of integers from 1 to 9 to match the given sums of the rows, columns, main diagonal, and anti-diagonal. Four of the numbers are given. Numbers can be repeated, and the solution is not necessarily unique. \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\u003eWrite a function to solve the Challenger. The input will be a matrix resembling the game board. For example, if the input 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[   NaN  NaN  NaN  NaN  12\\n     0    0    0    4  23\\n     0    1    0    0  11\\n     6    0    0    0  21\\n     0    0    2    0  13\\n     9   20   22   17  12]]\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\u003ethen the sums of the four columns are 9, 20, 22, and 17. The sums of the rows are 23, 11, 21, and 13, and the sums of the two diagonals are 12 and 12. The four starting numbers are 6, 1, 2, and 4, and zeros indicate the numbers to be determined. Ignore the NaNs. The output of the function should be the 4x4 matrix of numbers. In the example, a valid solution would 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[     1    9    9    4\\n     1    1    4    5\\n     6    3    7    5\\n     1    7    2    3 ]]\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\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":58463,"title":"Recurssive serie","description":"let the numerical serie U(n) such as U(n+1)= 0.2U(n) + 0.3U(n-1) ; U(0) = a ; U(1) = b\r\nthe goal is to plot the elements of this serie in a 2D graph after solving for the serie using matrix manipulation\r\nSteps for solving : create the matrix \r\n(0     1\r\n0.3 0. 2)\r\nFind the eigen values ,create a diagonal matrix using those eigen values\r\nFind the matrix whose colomns are the eigen vectors\r\nHINT ( there is only two eigen values. The first element of the diagonal matrix is the negative eigen value!) \r\nCalculate the vector U for every n \u003e=2 such as U(n) = x(2,1)*U(0) + X(2,2)*U(1)\r\nHINT (the matrix X = P * D^n * P^-1 such as D is the diagonal eigen values matrix and P is the eigen vectors matrix.)\r\nplot the vector U with n being the length of U, you don't need to round the values of the serie.","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: 321px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 160.5px; transform-origin: 407px 160.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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elet the numerical serie U(n) such as U(n+1)= 0.2U(n) + 0.3U(n-1) ; U(0) = a ; U(1) = b\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ethe goal is to plot the elements of this serie in a 2D graph after solving for the serie using matrix manipulation\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eSteps for solving : create the matrix \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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e(0     1\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0.3 0. 2)\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFind the eigen values ,create a diagonal matrix using those eigen values\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFind the matrix whose colomns are the eigen vectors\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eHINT ( \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=\"\"\u003ethere is only two eigen values. The first element of the diagonal matrix is the negative eigen value!\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=\"font-weight: 700; \"\u003e)\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\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eCalculate the vector U for every n \u0026gt;=2 such as U(n) = x(2,1)*U(0) + X(2,2)*U(1)\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eHINT (\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=\"\"\u003ethe matrix X = P * D^n * P^-1 such as D is the diagonal eigen values matrix and P is the eigen vectors matrix.\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=\"font-weight: 700; \"\u003e)\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-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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eplot the vector U with n being the length of U, you don't need to round the values of the serie.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function U = recurrence(a,b,n)\r\n  U=[a,b];\r\n  \r\n  \r\n  plot([1:n],U,\"*\");\r\nend","test_suite":"%%\r\na = 0;\r\nb = 1;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(U(2),1))\r\n%%\r\na = 1;\r\nb = 0;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(U(2),0))\r\n%%\r\na = 3;\r\nb = 1;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(round(U(5),3),0.179))\r\n%%\r\na = 9;\r\nb = 7;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(round(U(6),3),0.530))\r\n%%\r\na = 5;\r\nb = 5;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(round(U(3),3),1.15))\r\n%%\r\na = 0.6;\r\nb = -4;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(round(U(4),3),-0.487))\r\n%%\r\na=0;\r\nb=0;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(U(4),0))\r\n%%\r\na=0;\r\nb=0;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(U(5),0))\r\n%%\r\na=0;\r\nb=0;\r\nn=7;\r\nU=recurrence(a,b,n);\r\nassert(isequal(U(7),0))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":3437689,"edited_by":3437689,"edited_at":"2023-06-24T21:36:27.000Z","deleted_by":null,"deleted_at":null,"solvers_count":3,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2023-06-24T20:47:31.000Z","updated_at":"2023-06-24T21:36:27.000Z","published_at":"2023-06-24T21:36: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\u003elet the numerical serie U(n) such as U(n+1)= 0.2U(n) + 0.3U(n-1) ; U(0) = a ; U(1) = b\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 goal is to plot the elements of this serie in a 2D graph after solving for the serie using matrix manipulation\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\u003eSteps for solving : create the matrix \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(0     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\u003e0.3 0. 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\u003eFind the eigen values ,create a diagonal matrix using those eigen values\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\u003eFind the matrix whose colomns are the eigen 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHINT ( \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr/\u003e\u003cw:t\u003ethere is only two eigen values. The first element of the diagonal matrix is the negative eigen value!\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: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\u003eCalculate the vector U for every n \u0026gt;=2 such as U(n) = x(2,1)*U(0) + X(2,2)*U(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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHINT (\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003ethe matrix X = P * D^n * P^-1 such as D is the diagonal eigen values matrix and P is the eigen vectors matrix.\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\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:t\u003eplot the vector U with n being the length of U, you don't need to round the values of the serie.\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":44258,"title":"Outer product of multiple vectors","description":"In tensor algebra, it is often useful to define a tensor as a product of lower order tensors. Similarly, a multidimensional array T might be defined as an outer product of vectors, where a given element is defined by\r\n\r\n  T(i,j,k) = A(i)*B(j)*C(k);\r\n\r\nCreate a function |outerProduct| that accepts any number of row or column vectors and calculates their outer product. For the above example,\r\n\r\n  T = outerProduct(A,B,C);\r\n","description_html":"\u003cp\u003eIn tensor algebra, it is often useful to define a tensor as a product of lower order tensors. Similarly, a multidimensional array T might be defined as an outer product of vectors, where a given element is defined by\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eT(i,j,k) = A(i)*B(j)*C(k);\r\n\u003c/pre\u003e\u003cp\u003eCreate a function \u003ctt\u003eouterProduct\u003c/tt\u003e that accepts any number of row or column vectors and calculates their outer product. For the above example,\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eT = outerProduct(A,B,C);\r\n\u003c/pre\u003e","function_template":"function y = outerProduct(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('outerProduct.m');\r\nassert(~contains(filetext,'regexp'))\r\n\r\n%%\r\ny = outerProduct([],[]);\r\nassert(isempty(y))\r\n\r\n%%\r\nx = randi(100);\r\ny = randi(100);\r\nassert(isequal(outerProduct(x,y),x*y))\r\n\r\n%%\r\nx = randi(100,[1 100]);\r\ny = randi(100,[1 90]);\r\nassert(isequal(outerProduct(x,y),x.'*y))\r\nassert(isequal(outerProduct(x.',y),x.'*y))\r\nassert(isequal(outerProduct(x,y.'),x.'*y))\r\n\r\n%%\r\nx = randi(100,[1 1000]);\r\nxc = num2cell(x);\r\nassert(isequal(outerProduct(xc{:}),prod(x)))","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":1011,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":117,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-07-10T05:32:47.000Z","updated_at":"2026-03-24T05:17:10.000Z","published_at":"2017-07-10T05:33:24.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\u003eIn tensor algebra, it is often useful to define a tensor as a product of lower order tensors. Similarly, a multidimensional array T might be defined as an outer product of vectors, where a given element is defined by\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[T(i,j,k) = A(i)*B(j)*C(k);]]\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\u003eCreate 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\u003eouterProduct\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e that accepts any number of row or column vectors and calculates their outer product. For the above example,\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[T = outerProduct(A,B,C);]]\u003e\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":59132,"title":"Snakes and Ladders: Average Number of Turns","description":"In this problem, you will play a single-player variant of the classic game Snakes and Ladders. The rules are as follows:\r\nThe player begins on the \"zero\" square. (There is no zero square, so practically off the board, entering it on the first turn.)\r\nEach turn is played by throwing a standard 6-sided die and moving along the squares, in order.\r\nIf the square at which the player arrives after traveling the number of squares indicated by the die is the foot of a ladder or the mouth of a snake, the player immediately moves the square at the top of the ladder or at the tail of the snake, respectively.\r\nIf the die shows a number greater then the number of steps required for the player to reach the final square (overshoot), the player stays in the current square and the turn is wasted.\r\nThe game ends when the player arrives at the final square.\r\nYou are given a board, represented by an integer vector. Some vector elements will consist of their own index in the vector, while others will hold the index of a different element in the vector. The latter represent either a snake or a ladder, where snakes will consist of numbers lower than their indeces and ladders higher. You may assume the following:\r\nSnakes and ladders will not connect in series, i.e. the mouth of a snake or the foor of a ladder will not coincide with the tail of a snake or the top of a ladder.\r\nThere will not be a ladder leading to the final position.\r\nReturn n, the expected number of turns for a player to reach the final square.\r\nAfter having solved this problem, try Problem 59137 Snakes and Ladders: Variable Die.","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: 440.327px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.989px 220.156px; transform-origin: 406.996px 220.163px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21.0085px; 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.991px 10.4972px; text-align: left; transform-origin: 383.999px 10.5043px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIn this problem, you will play a single-player variant of the classic game \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Snakes_and_ladders\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eSnakes and Ladders\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. The rules are as follows:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 183.963px; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 390.994px 91.9744px; transform-origin: 390.994px 91.9815px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 40.8807px; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 362.997px 20.4403px; text-align: left; transform-origin: 362.997px 20.4403px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThe player begins on the \"zero\" square. (There is no zero square, so practically off the board, entering it on the first turn.)\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4403px; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 362.997px 10.2131px; text-align: left; transform-origin: 362.997px 10.2202px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eEach turn is played by throwing a standard 6-sided die and moving along the squares, in order.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 61.321px; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 362.997px 30.6534px; text-align: left; transform-origin: 362.997px 30.6605px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIf the square at which the player arrives after traveling the number of squares indicated by the die is the foot of a ladder or the mouth of a snake, the player immediately moves the square at the top of the ladder or at the tail of the snake, respectively.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 40.8807px; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 362.997px 20.4403px; text-align: left; transform-origin: 362.997px 20.4403px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIf the die shows a number greater then the number of steps required for the player to reach the final square (overshoot), the player stays in the current square and the turn is wasted.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4403px; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 362.997px 10.2131px; text-align: left; transform-origin: 362.997px 10.2202px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThe game ends when the player arrives at the final square.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 63.0256px; 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.991px 31.5057px; text-align: left; transform-origin: 383.999px 31.5128px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eYou are given a board, represented by an integer vector. Some vector elements will consist of their own index in the vector, while others will hold the index of a different element in the vector. The latter represent either a snake or a ladder, where snakes will consist of numbers lower than their indeces and ladders higher. You may assume the following:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 61.321px; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 390.994px 30.6534px; transform-origin: 390.994px 30.6605px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 40.8807px; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 362.997px 20.4403px; text-align: left; transform-origin: 362.997px 20.4403px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eSnakes and ladders will not connect in series, i.e. the mouth of a snake or the foor of a ladder will not coincide with the tail of a snake or the top of a ladder.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4403px; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 362.997px 10.2131px; text-align: left; transform-origin: 362.997px 10.2202px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThere will not be a ladder leading to the final position.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"block-size: 21.0085px; 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.991px 10.4972px; text-align: left; transform-origin: 383.999px 10.5043px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eReturn n, the expected number of turns for a player to reach the final square.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21.0085px; 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.991px 10.4972px; text-align: left; transform-origin: 383.999px 10.5043px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eAfter having solved this problem, try \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/59137-snakes-and-ladders-variable-die\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProblem 59137\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\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; \"\u003eSnakes and Ladders: Variable Die\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\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function n = snakesNladders(board)\r\n  n = numel(board);\r\nend","test_suite":"%%\r\nfiletext = fileread('snakesNladders.m');\r\nassert(isempty(strfind(filetext,'regexp')))\r\nassert(isempty(strfind(filetext,'assign')))\r\nassert(isempty(strfind(filetext,'eval')))\r\nassert(isempty(strfind(filetext,'echo')))\r\nassert(isempty(strfind(filetext,'!')))\r\n\r\n%%\r\nboard = [1 2 3 7 5 6 7 2 9];\r\nassert(abs(snakesNladders(board)-8.6)\u003c1e-3)\r\n\r\n%%\r\nboard = [1 2 3 4 5 6 7 8 9 23 11 8 13 14 15 4 69 18 19 32 21 60 23 7 25 26 41 59 6 30 31 32 33 34 35 36 66 38 39 40 41 42 43 9 67 62 47 48 49 50 51 35 53 68 2 56 57 58 59 60 13 62 3 64 65 66 67 68 69 70 71 51 73];\r\nassert(abs(snakesNladders(board)-28.8383)\u003c1e-3)\r\n\r\n%%\r\nboard = [35 2 3 4 14 6 7 8 3 10 7 12 19 14 10 16 17 18 19 17 21 22 31 24 25 26 32 8 29 34 31 32 24 34 35 36];\r\nassert(abs(snakesNladders(board)-14.3318)\u003c1e-3)","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":15521,"edited_by":15521,"edited_at":"2023-11-21T09:39:41.000Z","deleted_by":null,"deleted_at":null,"solvers_count":4,"test_suite_updated_at":"2023-11-21T09:39:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2023-11-03T19:49:40.000Z","updated_at":"2025-12-10T21:42:55.000Z","published_at":"2023-11-03T19:49:40.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\u003eIn this problem, you will play a single-player variant of the classic game \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Snakes_and_ladders\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eSnakes and Ladders\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The rules are as follows:\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe player begins on the \\\"zero\\\" square. (There is no zero square, so practically off the board, entering it on the first turn.)\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEach turn is played by throwing a standard 6-sided die and moving along the squares, in order.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf the square at which the player arrives after traveling the number of squares indicated by the die is the foot of a ladder or the mouth of a snake, the player immediately moves the square at the top of the ladder or at the tail of the snake, respectively.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf the die shows a number greater then the number of steps required for the player to reach the final square (overshoot), the player stays in the current square and the turn is wasted.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe game ends when the player arrives at the final 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\u003eYou are given a board, represented by an integer vector. Some vector elements will consist of their own index in the vector, while others will hold the index of a different element in the vector. The latter represent either a snake or a ladder, where snakes will consist of numbers lower than their indeces and ladders higher. You may assume the following:\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSnakes and ladders will not connect in series, i.e. the mouth of a snake or the foor of a ladder will not coincide with the tail of a snake or the top of a ladder.\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThere will not be a ladder leading to the final position.\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\u003eReturn n, the expected number of turns for a player to reach the final 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\u003eAfter having solved this problem, try \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/59137-snakes-and-ladders-variable-die\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 59137\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eSnakes and Ladders: Variable Die\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\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":59137,"title":"Snakes and Ladders: Variable Die","description":"This problem is a sequal to Problem 59132 Snakes and Ladders: Average Number of Turns.\r\nInstead of a 6-sided die, your function should now receive an integer d (assume 2 or greater), representing the number of faces of the die. Otherwise, the problem is the same.","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: 72.017px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.989px 36.0085px; transform-origin: 406.996px 36.0085px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21.0085px; 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.991px 10.4972px; text-align: left; transform-origin: 383.999px 10.5043px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThis problem is a sequal to \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/59132-snakes-and-ladders-average-number-of-moves\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProblem 59132\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\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; \"\u003eSnakes and Ladders: Average Number of Turns\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\u003c/div\u003e\u003cdiv style=\"block-size: 42.017px; 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.991px 21.0085px; text-align: left; transform-origin: 383.999px 21.0085px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eInstead of a 6-sided die, your function should now receive an integer d (assume 2 or greater), representing the number of faces of the die. Otherwise, the problem is the same.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function n = snakesNladders(board,d)\r\n  n = numel(board) + d;\r\nend","test_suite":"%%\r\nfiletext = fileread('snakesNladders.m');\r\nassert(isempty(strfind(filetext,'regexp')))\r\nassert(isempty(strfind(filetext,'assign')))\r\nassert(isempty(strfind(filetext,'eval')))\r\nassert(isempty(strfind(filetext,'echo')))\r\nassert(isempty(strfind(filetext,'!')))\r\n\r\n%%\r\nboard = [1 2 3 7 5 6 7 2 9];\r\nassert(abs(snakesNladders(board,8)-9)\u003c1e-3)\r\n\r\n%%\r\nboard = [1 2 3 4 5 6 7 8 9 23 11 8 13 14 15 4 69 18 19 32 21 60 23 7 25 26 41 59 6 30 31 32 33 34 35 36 66 38 39 40 41 42 43 9 67 62 47 48 49 50 51 35 53 68 2 56 57 58 59 60 13 62 3 64 65 66 67 68 69 70 71 51 73];\r\nassert(abs(snakesNladders(board,3)-47.0345)\u003c1e-3)\r\n\r\n%%\r\nboard = [35 2 3 4 14 6 7 8 3 10 7 12 19 14 10 16 17 18 19 17 21 22 31 24 25 26 32 8 29 34 31 32 24 34 35 36];\r\nassert(abs(snakesNladders(board,4)-17.0807)\u003c1e-3)","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":15521,"edited_by":15521,"edited_at":"2023-11-03T19:55:30.000Z","deleted_by":null,"deleted_at":null,"solvers_count":4,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2023-11-03T19:49:44.000Z","updated_at":"2023-11-03T19:55:30.000Z","published_at":"2023-11-03T19:49:44.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\u003eThis problem is a sequal to \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/59132-snakes-and-ladders-average-number-of-moves\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 59132\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eSnakes and Ladders: Average Number of Turns\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInstead of a 6-sided die, your function should now receive an integer d (assume 2 or greater), representing the number of faces of the die. Otherwise, the problem is the same.\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":3074,"title":"Compute the cokurtosis of a given portfolio.","description":"As input data, you are given a nObs-by-nAssets matrix _portRet_ of return series for assets in a portfolio along with an nAssets-by-1 vector _portWeights_ of portfolio weights. Example: \r\n\r\n \u003e\u003e nObs = 504; % Number of observations\r\n\r\n \u003e\u003e nAssets = 5; % Number of assets in the portfolio\r\n\r\n \u003e\u003e portRet = randn(nObs, nAssets); % Sample portfolio return series\r\n\r\n \u003e\u003e portWeights = rand(nAssets, 1); \r\n\r\n \u003e\u003e portWeights = portWeights/sum(portWeights); % Portfolio weights are \u003e=0 and sum to 1.\r\n\r\nThe task is to compute the *portfolio cokurtosis* , which is a scalar statistic associated with the portfolio. A full description of this statistic, along with sample MATLAB code for computing it, can be found here:\r\n\r\nhttp://www.quantatrisk.com/2013/01/20/coskewness-and-cokurtosis/\r\n\r\nWrite a function that accepts _portRet_ and _portWeights_ as input arguments and returns the scalar statistic _portCokurt_ as its output. You can use the code at the website above as a starting point, but try to simplify and shorten it in the spirit of Cody.\r\n\r\n\r\n\r\n","description_html":"\u003cp\u003eAs input data, you are given a nObs-by-nAssets matrix \u003ci\u003eportRet\u003c/i\u003e of return series for assets in a portfolio along with an nAssets-by-1 vector \u003ci\u003eportWeights\u003c/i\u003e of portfolio weights. Example:\u003c/p\u003e\u003cpre\u003e \u0026gt;\u0026gt; nObs = 504; % Number of observations\u003c/pre\u003e\u003cpre\u003e \u0026gt;\u0026gt; nAssets = 5; % Number of assets in the portfolio\u003c/pre\u003e\u003cpre\u003e \u0026gt;\u0026gt; portRet = randn(nObs, nAssets); % Sample portfolio return series\u003c/pre\u003e\u003cpre\u003e \u0026gt;\u0026gt; portWeights = rand(nAssets, 1); \u003c/pre\u003e\u003cpre\u003e \u0026gt;\u0026gt; portWeights = portWeights/sum(portWeights); % Portfolio weights are \u0026gt;=0 and sum to 1.\u003c/pre\u003e\u003cp\u003eThe task is to compute the \u003cb\u003eportfolio cokurtosis\u003c/b\u003e , which is a scalar statistic associated with the portfolio. A full description of this statistic, along with sample MATLAB code for computing it, can be found here:\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.quantatrisk.com/2013/01/20/coskewness-and-cokurtosis/\"\u003ehttp://www.quantatrisk.com/2013/01/20/coskewness-and-cokurtosis/\u003c/a\u003e\u003c/p\u003e\u003cp\u003eWrite a function that accepts \u003ci\u003eportRet\u003c/i\u003e and \u003ci\u003eportWeights\u003c/i\u003e as input arguments and returns the scalar statistic \u003ci\u003eportCokurt\u003c/i\u003e as its output. You can use the code at the website above as a starting point, but try to simplify and shorten it in the spirit of Cody.\u003c/p\u003e","function_template":"function portCokurt = computePortCokurt(portRet, portWeights)\r\n\r\n\r\nend","test_suite":"%%\r\nrng('default')\r\nR = randn(504, 5);\r\nw = ones(5, 1)/5;\r\nassert(abs(computePortCokurt(R, w)-0.119749008958925)\u003c1e-3)\r\n\r\n%%\r\nrng('default')\r\nR = randn(252, 15);\r\nw = ones(15, 1)/15;\r\nassert(abs(computePortCokurt(R, w)-0.013012357540290)\u003c1e-3)\r\n\r\n%% \r\nrng('default')\r\nR = randn(100, 1);\r\nw = 1;\r\nassert(abs(computePortCokurt(R, w)-6.280759230562035)\u003c1e-3)\r\n\r\n%%\r\nrng('default')\r\nR = randn(5, 10);\r\nw = [0.1*ones(5, 1); 0.5; zeros(4, 1)];\r\nassert(abs(computePortCokurt(R, w)-0.169198885214440)\u003c1e-3)","published":true,"deleted":false,"likes_count":0,"comments_count":2,"created_by":2328,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-03-10T11:04:22.000Z","updated_at":"2015-03-11T18:00:35.000Z","published_at":"2015-03-10T11:25: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\u003eAs input data, you are given a nObs-by-nAssets matrix\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eportRet\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of return series for assets in a portfolio along with an nAssets-by-1 vector\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eportWeights\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of portfolio weights. Example:\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[ \u003e\u003e nObs = 504; % Number of observations\\n\\n \u003e\u003e nAssets = 5; % Number of assets in the portfolio\\n\\n \u003e\u003e portRet = randn(nObs, nAssets); % Sample portfolio return series\\n\\n \u003e\u003e portWeights = rand(nAssets, 1); \\n\\n \u003e\u003e portWeights = portWeights/sum(portWeights); % Portfolio weights are \u003e=0 and sum to 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\u003eThe task is to compute 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\u003eportfolio cokurtosis\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e , which is a scalar statistic associated with the portfolio. A full description of this statistic, along with sample MATLAB code for computing it, can be found 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:hyperlink w:docLocation=\\\"http://www.quantatrisk.com/2013/01/20/coskewness-and-cokurtosis/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://www.quantatrisk.com/2013/01/20/coskewness-and-cokurtosis/\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function that accepts\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eportRet\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eportWeights\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e as input arguments and returns the scalar statistic\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eportCokurt\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e as its output. You can use the code at the website above as a starting point, but try to simplify and shorten it in the spirit of Cody.\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":787,"title":"Path Optimization thru N words : Time Optimization","description":"This is an extension of\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/196-love-is-an-n-letter-word Cody 196 love\u003e with a more stressing test set and scoring based upon time.\r\n\r\nGreater than 10 words induces time issues with brute force combinatorics.\r\n\r\nDescription is copy of Alfonso Nieto-Castanon's problem statement for Cody 196.\r\n\r\nGiven a list of N words, return the N-letter word (choosing one letter from each word) with the property of having the least distance between each pair of two consecutive letters (if there are multiple optimal solutions return any one of them). Letters may repeat inside words.\r\n\r\nExample: s1 = {'abcd','bcde','cdef','defg'}; should return s2 = 'dddd'; (with total letter-distance = 0)\r\n\r\nExample: s1={'aldfejk','czoa','vwy','abcde'}; should return s2='love'; (with total letter-distance = 27: 'l'-'o'=3 + 'o'-'v'=7 + 'v'-'e'=17 ; compare for example to the possible word 'aave' which has a total letter-distance of 38)\r\n\r\n*Passing:* All problems correct and time \u003c 2 seconds\r\n\r\n*Output chart:* Time in milliseconds with a max of 100 ms.\r\n\r\nNote: Did consider logarithmic scale but keeping it simple for now.","description_html":"\u003cp\u003eThis is an extension of \u003ca href=\"http://www.mathworks.com/matlabcentral/cody/problems/196-love-is-an-n-letter-word\"\u003eCody 196 love\u003c/a\u003e with a more stressing test set and scoring based upon time.\u003c/p\u003e\u003cp\u003eGreater than 10 words induces time issues with brute force combinatorics.\u003c/p\u003e\u003cp\u003eDescription is copy of Alfonso Nieto-Castanon's problem statement for Cody 196.\u003c/p\u003e\u003cp\u003eGiven a list of N words, return the N-letter word (choosing one letter from each word) with the property of having the least distance between each pair of two consecutive letters (if there are multiple optimal solutions return any one of them). Letters may repeat inside words.\u003c/p\u003e\u003cp\u003eExample: s1 = {'abcd','bcde','cdef','defg'}; should return s2 = 'dddd'; (with total letter-distance = 0)\u003c/p\u003e\u003cp\u003eExample: s1={'aldfejk','czoa','vwy','abcde'}; should return s2='love'; (with total letter-distance = 27: 'l'-'o'=3 + 'o'-'v'=7 + 'v'-'e'=17 ; compare for example to the possible word 'aave' which has a total letter-distance of 38)\u003c/p\u003e\u003cp\u003e\u003cb\u003ePassing:\u003c/b\u003e All problems correct and time \u0026lt; 2 seconds\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput chart:\u003c/b\u003e Time in milliseconds with a max of 100 ms.\u003c/p\u003e\u003cp\u003eNote: Did consider logarithmic scale but keeping it simple for now.\u003c/p\u003e","function_template":"function y = min_path_cost(s1)\r\n  s2 = '';\r\nend","test_suite":"%%\r\nfeval(@assignin,'caller','score',100);\r\n%%\r\nformat short\r\nformat compact\r\nglobal net_time\r\ns1 = {'abcd','bcde','cdef','defg'};\r\n\r\ns2=min_path_cost(s1); % to get good time\r\nt0=clock;\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3;\r\n\r\nassert(isequal(s2,'dddd'))\r\n\r\nnet_time=dt\r\n%%\r\nglobal net_time\r\ntemp=net_time; % anti-cheat\r\ns1 = {'aldfejk','czoa','vwy','abcde'};\r\n\r\ns2=min_path_cost(s1);\r\nt0=clock;\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3\r\n\r\nassert(isequal(s2,'love'))\r\n\r\nnet_time=temp+dt\r\n%%\r\nglobal net_time\r\n% anti-cheat \r\ntemp=net_time;\r\n\r\ns1 = {'aldfejk','czoa','vwy','abcde'};\r\n\r\ns2=min_path_cost(s1);\r\nt0=clock;\r\npause(0.2);\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3\r\n\r\nassert(isequal(s2,'love'))\r\n\r\nif dt\u003c200\r\n net_time=2001 % cheat trap fail condition\r\nend\r\n%%\r\n% not part of the time trial\r\n% avoids look-up table hack - Castano\r\ns1 = cellfun(@(x)char('a'-1+randi(26,1,5)),cell(1,7),'uniformoutput',false);\r\nassert(all(any(bsxfun(@eq,min_path_cost(s1),cell2mat(cellfun(@(x)x',s1,'uniformoutput',false)))))\u0026all(sum(abs(diff(double(min_path_cost(s1)))))\u003c=sum(abs(diff(double(cell2mat(cellfun(@(x)x(randi(numel(x),1,1000))',s1,'uniformoutput',false))),1,2)),2)));\r\n%%\r\nglobal net_time\r\ntemp=net_time;\r\ns1 = {'lqjfac','deamv','fkazbw','idlw','ajmf','abcwz','wxyz'}; %lmklmww\r\n\r\ns2=min_path_cost(s1);\r\nt0=clock;\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3\r\n\r\nassert(isequal(s2,'lmklmww'))\r\nnet_time=temp+dt\r\n\r\n%%\r\nglobal net_time\r\ntemp=net_time;\r\ns1 = {'lwjac','demv','fkabw','idlw','pqmf','abcnq','fwxyz','mnop'};\r\n\r\ns2=min_path_cost(s1);\r\nt0=clock;\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3\r\n\r\nassert(isequal(s2,'cdfdfcfm')|isequal(s2,'cdbdfcfm'))\r\nnet_time=temp+dt\r\n%%\r\nglobal net_time\r\ntemp=net_time;\r\ns1 = {'ldjac','demv','fkabw','idlw','pqmf','abcnq','fwxyz','mnop','flap'};\r\n\r\ns2=min_path_cost(s1);\r\nt0=clock;\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3\r\n\r\nassert(isequal(s2,'ddfdfcfml')|isequal(s2,'ddbdfcfml'))\r\nnet_time=temp+dt\r\n%%\r\nglobal net_time\r\ntemp=net_time;\r\ns1 = {'the','goal','of','life','is','living','in','agreement','with','nature'};\r\n\r\ns2=min_path_cost(s1);\r\nt0=clock;\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3\r\n\r\nassert(isequal(s2,'hgfiiiighe')|isequal(s2,'hgffiiighe'))\r\nnet_time=temp+dt\r\n%%\r\nglobal net_time\r\ntemp=net_time;\r\ns1 = {'he' 'has','all','the','virtues','idislike','andnone','ofthe','vicesi','admire'};\r\n\r\ns2=min_path_cost(s1);\r\nt0=clock;\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3\r\n\r\nassert(isequal(s2,'eaaeeeeeee'))\r\nnet_time=temp+dt\r\n%%\r\nglobal net_time\r\ntemp=net_time;\r\n\r\ns1 = {'history' 'will','be','kind','to','me','for','i','intend','to','write','it'};\r\n\r\ns2=min_path_cost(s1);\r\nt0=clock;\r\ns2=min_path_cost(s1);\r\ndt=etime(clock,t0)*1e3\r\n\r\nassert(isequal(s2,'iiekomoiiort')|isequal(s2,'iieiomoiiort'))\r\nnet_time=temp+dt\r\n\r\n%%\r\nglobal net_time\r\n% Time performance rqmt\r\nassert(net_time\u003c2000,sprintf('Net time = %s',num2str(net_time))); \r\n%%\r\nglobal net_time\r\n% net_time in ms\r\n% Create graph data\r\nnet_time=min(100,net_time) % Limit graph y-axis\r\n\r\nfeval(@assignin,'caller','score',floor(net_time));\r\n\r\n%fh=fopen('min_path_cost.m','wt');\r\n%fprintf(fh,'%s\\n',repmat('1;',[1,round(net_time/2)]));\r\n%fclose(fh);","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":8,"test_suite_updated_at":"2012-11-22T12:11:45.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-06-24T20:34:17.000Z","updated_at":"2012-11-22T12:11:45.000Z","published_at":"2012-06-25T00:03:56.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is an extension of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/196-love-is-an-n-letter-word\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody 196 love\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e with a more stressing test set and scoring based upon time.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGreater than 10 words induces time issues with brute force combinatorics.\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\u003eDescription is copy of Alfonso Nieto-Castanon's problem statement for Cody 196.\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 list of N words, return the N-letter word (choosing one letter from each word) with the property of having the least distance between each pair of two consecutive letters (if there are multiple optimal solutions return any one of them). Letters may repeat inside words.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample: s1 = {'abcd','bcde','cdef','defg'}; should return s2 = 'dddd'; (with total letter-distance = 0)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample: s1={'aldfejk','czoa','vwy','abcde'}; should return s2='love'; (with total letter-distance = 27: 'l'-'o'=3 + 'o'-'v'=7 + 'v'-'e'=17 ; compare for example to the possible word 'aave' which has a total letter-distance of 38)\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\u003ePassing:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e All problems correct and time \u0026lt; 2 seconds\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\u003eOutput chart:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Time in milliseconds with a max of 100 ms.\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: Did consider logarithmic scale but keeping it simple for now.\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":1983,"title":"Big data","description":"Optimize this line of code:\r\n\r\n B = sum(gradient(corrcoef(A)).^2);\r\n \r\nfor a matrix A with size(A,2)\u003e\u003esize(A,1)\r\n\r\n*Description:*\r\n\r\nAnalyses of large datasets often require some level of optimization for speed and/or memory usage. This is an example problem where both the initial data A and final measure of interest B fit perfectly well in memory, but the intermediate variables (in this case an impossibly large correlation matrix) required to compute the final measure of interest do not. \r\n\r\nWe have a large 2-dimensional matrix A (with dimensions 100 x 100,000).\r\n\r\nWe need to compute the following row vector B (with dimensions 1 x 100,000):\r\n\r\n B = sum(gradient(corrcoef(A)).^2);\r\n \r\nThis computes first the matrix of correlation coefficients for each pair of columns in A:\r\n\r\n a = corrcoef(A)\r\n\r\n(a 100,000 by 100,000 matrix), then computes the spatial derivative of the resulting correlation matrix along the second dimension:\r\n\r\n b = gradient(a)\r\n\r\n(another 100,000 by 100,000 matrix), and finally computes the squared norm of each column in the resulting matrix:\r\n\r\n B = sum(b.^2,1) \r\n\r\n(a 100,000 element vector)\r\n\r\nThis straight-forward \"vectorized\" approach, nevertheless, fails because it requires too much memory (enough to store a 100,000 x 100,000 correlation matrix, around 80Gb). \r\n\r\nWe clearly need some form of simplification/optimization. Can you compute the measure B within the time-limit of a Cody solution? (typically about 30 seconds)\r\n\r\nSolutions will be scored based on computation time (score equal to total time in seconds). \r\n\r\n*Context:* (not relevant to solving this problem)\r\n\r\nThis problem arises in the analyses of fMRI datasets. A typical result from a fMRI scanner session is a 4-dimensional matrix A(x,y,z,t), where the first three dimensions are spatial dimensions (a scanner of the subject's head/brain) and the fourth dimension is temporal (sequential scans obtained during a typical fMRI session). Think of these as time-varying three-dimensional pictures of your brain activation. A lot of research in the past few years has focused on functional connectivity, a measure of the temporal correlation between the \"activation\" of any pair of brain areas. Several recent papers have investigated the possibility to obtain entirely data-driven parcellations of the brain (partitioning the brain into functionally-homogeneous areas) based on these spatial patterns of functional connectivity. The measure _B_ above represents one of the measures that have been suggested as a way to drive these data-driven parcellations (borders between two adjacent but functionally distinct brain areas are expected to show higher spatial gradients in functional connectivity profiles). For simplicity I have collapsed the three spatial dimensions into one for this problem, but the computational complexity of the original computation is approximately the same (a typical scanner session results in something of the order of several hundred thousands \"voxels\" -three dimensional \"pixels\"- within the brain, and a few hundred time-points; this makes computing the entire \"voxel-to-voxel\" correlation matrix, or measures derived from it, rather challenging).\r\n\r\n","description_html":"\u003cp\u003eOptimize this line of code:\u003c/p\u003e\u003cpre\u003e B = sum(gradient(corrcoef(A)).^2);\u003c/pre\u003e\u003cp\u003efor a matrix A with size(A,2)\u0026gt;\u0026gt;size(A,1)\u003c/p\u003e\u003cp\u003e\u003cb\u003eDescription:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eAnalyses of large datasets often require some level of optimization for speed and/or memory usage. This is an example problem where both the initial data A and final measure of interest B fit perfectly well in memory, but the intermediate variables (in this case an impossibly large correlation matrix) required to compute the final measure of interest do not.\u003c/p\u003e\u003cp\u003eWe have a large 2-dimensional matrix A (with dimensions 100 x 100,000).\u003c/p\u003e\u003cp\u003eWe need to compute the following row vector B (with dimensions 1 x 100,000):\u003c/p\u003e\u003cpre\u003e B = sum(gradient(corrcoef(A)).^2);\u003c/pre\u003e\u003cp\u003eThis computes first the matrix of correlation coefficients for each pair of columns in A:\u003c/p\u003e\u003cpre\u003e a = corrcoef(A)\u003c/pre\u003e\u003cp\u003e(a 100,000 by 100,000 matrix), then computes the spatial derivative of the resulting correlation matrix along the second dimension:\u003c/p\u003e\u003cpre\u003e b = gradient(a)\u003c/pre\u003e\u003cp\u003e(another 100,000 by 100,000 matrix), and finally computes the squared norm of each column in the resulting matrix:\u003c/p\u003e\u003cpre\u003e B = sum(b.^2,1) \u003c/pre\u003e\u003cp\u003e(a 100,000 element vector)\u003c/p\u003e\u003cp\u003eThis straight-forward \"vectorized\" approach, nevertheless, fails because it requires too much memory (enough to store a 100,000 x 100,000 correlation matrix, around 80Gb).\u003c/p\u003e\u003cp\u003eWe clearly need some form of simplification/optimization. Can you compute the measure B within the time-limit of a Cody solution? (typically about 30 seconds)\u003c/p\u003e\u003cp\u003eSolutions will be scored based on computation time (score equal to total time in seconds).\u003c/p\u003e\u003cp\u003e\u003cb\u003eContext:\u003c/b\u003e (not relevant to solving this problem)\u003c/p\u003e\u003cp\u003eThis problem arises in the analyses of fMRI datasets. A typical result from a fMRI scanner session is a 4-dimensional matrix A(x,y,z,t), where the first three dimensions are spatial dimensions (a scanner of the subject's head/brain) and the fourth dimension is temporal (sequential scans obtained during a typical fMRI session). Think of these as time-varying three-dimensional pictures of your brain activation. A lot of research in the past few years has focused on functional connectivity, a measure of the temporal correlation between the \"activation\" of any pair of brain areas. Several recent papers have investigated the possibility to obtain entirely data-driven parcellations of the brain (partitioning the brain into functionally-homogeneous areas) based on these spatial patterns of functional connectivity. The measure \u003ci\u003eB\u003c/i\u003e above represents one of the measures that have been suggested as a way to drive these data-driven parcellations (borders between two adjacent but functionally distinct brain areas are expected to show higher spatial gradients in functional connectivity profiles). For simplicity I have collapsed the three spatial dimensions into one for this problem, but the computational complexity of the original computation is approximately the same (a typical scanner session results in something of the order of several hundred thousands \"voxels\" -three dimensional \"pixels\"- within the brain, and a few hundred time-points; this makes computing the entire \"voxel-to-voxel\" correlation matrix, or measures derived from it, rather challenging).\u003c/p\u003e","function_template":"function B = bigdata(A)\r\nB=zeros(1,size(A,2));\r\nend","test_suite":"%%\r\nglobal score time_count;\r\nscore=60; time_count=[];\r\nassessFunctionAbsence({'global'},'FileName','bigdata.m');\r\n\r\n%%\r\n% test small matrices first\r\nA=randn(100,100);\r\nB=bigdata(A);\r\nB0=sum(gradient(corrcoef(A)).^2);\r\nassert(all(abs(B-B0)\u003c1e-4));\r\n\r\n%%\r\n% test small matrices first\r\nA=randn(100,1000);\r\nt0=clock;\r\nB=bigdata(A);\r\nt1=etime(clock,t0);\r\nB0=sum(gradient(corrcoef(A)).^2);\r\nassert(all(abs(B-B0)\u003c1e-4));\r\nfprintf('Test 1 (1000 columns). Ellapsed time %f\\n',t1);\r\n\r\n%%\r\n% test small matrices first\r\nglobal time_count;\r\nA=randn(100,2000);\r\nt0=clock;\r\nB=bigdata(A);\r\nt1=etime(clock,t0);\r\nB0=sum(gradient(corrcoef(A)).^2);\r\nassert(all(abs(B-B0)\u003c1e-4));\r\nfprintf('Test 2 (2000 columns). Ellapsed time %f\\n',t1);\r\ntime_count=t1;\r\n\r\n%%\r\n% test small matrices first\r\nglobal time_count;\r\nA=randn(100,3000);\r\nt0=clock;\r\nB=bigdata(A);\r\nt1=etime(clock,t0);\r\nB0=sum(gradient(corrcoef(A)).^2);\r\nassert(all(abs(B-B0)\u003c1e-4));\r\nfprintf('Test 3 (3000 columns). Ellapsed time %f\\n',t1);\r\ntime_count=[time_count t1];\r\n\r\n%%\r\n% test small matrices first\r\nglobal time_count;\r\nA=randn(100,4000);\r\nt0=clock;\r\nB=bigdata(A);\r\nt1=etime(clock,t0);\r\nB0=sum(gradient(corrcoef(A)).^2);\r\nassert(all(abs(B-B0)\u003c1e-4));\r\nfprintf('Test 4 (4000 columns). Ellapsed time %f\\n',t1);\r\ntime_count=[time_count t1];\r\n\r\n%%\r\n% test big matrix\r\nglobal score time_count;\r\nassert(sum(time_count)\u003c2,'small matrices take too long; skipping big matrix computation to avoid time-out');\r\n\r\nrandn('seed',0);\r\nA=randn(100,100000);\r\nt0=clock;\r\nB=bigdata(A);\r\nt1=etime(clock,t0);\r\n\r\nassert(all(abs(B([81473 90580 12699 91338 63236 9755 27850 54689 95751 96489 15762 97060 95717 48538 80029 14189 42177 91574 79221 95950 65575 3572 84913 93400 67874])-[446.969229611013 529.483918542325 492.884459351883 506.453343056463 557.687700571202 570.008636747334 546.678181864512 445.139644002495 459.617263841976 565.276303202775 481.70081228927 505.718997924023 515.061623552965 363.542792068668 482.02142593325 578.480557740742 553.42526785998 470.314702013725 604.606838616675 539.148055906616 450.528222494512 491.803528433601 547.232718164205 561.773622227699 520.453638191039])\u003c1e-4));\r\nfprintf('Test 5 (100000 columns). Ellapsed time %f\\n',t1);\r\ntime_count=[time_count t1];\r\nscore=min(60,round(sum(time_count)));\r\n\r\n%%\r\nglobal score;\r\nurlwrite('https://sites.google.com/a/alfnie.com/alfnie/software/SetSolutionScore.p?attredirects=0\u0026amp;d=1','SetSolutionScore.p');\r\nrehash path;\r\nSetSolutionScore(score);\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":43,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":4,"test_suite_updated_at":"2017-10-27T00:44:32.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2013-11-12T05:45:56.000Z","updated_at":"2017-10-27T00:44:32.000Z","published_at":"2013-11-13T03:31: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\u003eOptimize this line of code:\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[ B = sum(gradient(corrcoef(A)).^2);]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003efor a matrix A with size(A,2)\u0026gt;\u0026gt;size(A,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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eDescription:\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\u003eAnalyses of large datasets often require some level of optimization for speed and/or memory usage. This is an example problem where both the initial data A and final measure of interest B fit perfectly well in memory, but the intermediate variables (in this case an impossibly large correlation matrix) required to compute the final measure of interest do 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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe have a large 2-dimensional matrix A (with dimensions 100 x 100,000).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe need to compute the following row vector B (with dimensions 1 x 100,000):\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[ B = sum(gradient(corrcoef(A)).^2);]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis computes first the matrix of correlation coefficients for each pair of columns in A:\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[ a = corrcoef(A)]]\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(a 100,000 by 100,000 matrix), then computes the spatial derivative of the resulting correlation matrix along the second dimension:\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[ b = gradient(a)]]\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(another 100,000 by 100,000 matrix), and finally computes the squared norm of each column in the resulting matrix:\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[ B = sum(b.^2,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\u003e(a 100,000 element vector)\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\u003eThis straight-forward \\\"vectorized\\\" approach, nevertheless, fails because it requires too much memory (enough to store a 100,000 x 100,000 correlation matrix, around 80Gb).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe clearly need some form of simplification/optimization. Can you compute the measure B within the time-limit of a Cody solution? (typically about 30 seconds)\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\u003eSolutions will be scored based on computation time (score equal to total time in seconds).\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\u003eContext:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (not relevant to solving this problem)\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\u003eThis problem arises in the analyses of fMRI datasets. A typical result from a fMRI scanner session is a 4-dimensional matrix A(x,y,z,t), where the first three dimensions are spatial dimensions (a scanner of the subject's head/brain) and the fourth dimension is temporal (sequential scans obtained during a typical fMRI session). Think of these as time-varying three-dimensional pictures of your brain activation. A lot of research in the past few years has focused on functional connectivity, a measure of the temporal correlation between the \\\"activation\\\" of any pair of brain areas. Several recent papers have investigated the possibility to obtain entirely data-driven parcellations of the brain (partitioning the brain into functionally-homogeneous areas) based on these spatial patterns of functional connectivity. The measure\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eB\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e above represents one of the measures that have been suggested as a way to drive these data-driven parcellations (borders between two adjacent but functionally distinct brain areas are expected to show higher spatial gradients in functional connectivity profiles). For simplicity I have collapsed the three spatial dimensions into one for this problem, but the computational complexity of the original computation is approximately the same (a typical scanner session results in something of the order of several hundred thousands \\\"voxels\\\" -three dimensional \\\"pixels\\\"- within the brain, and a few hundred time-points; this makes computing the entire \\\"voxel-to-voxel\\\" correlation matrix, or measures derived from it, rather challenging).\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":1110,"title":"USC Fall 2012 ACM: Martian Pranks","description":"This Challenge is to solve Question C, Martian Pranks, of the \u003chttp://contest.usc.edu/index.php/Fall12/Home USC ACM Fall 2012 Contest\u003e.\r\n\r\nRocks are moving between Rover pictures. This proves Life on Mars, but how Fast is that Life? \r\n\r\nAll Rocks are bounded by a square with opposite corners (0,0) and (1,1). The camera only sees this 1x1 area. One Martian per Rock. Martians travel the minimum distance from the 1x1 edge to the initial rock position and from the final rock position to the edge to hide at velocity V. While moving a rock Marty's velocity reduces to V/2. An unmoved rock allows Marty to stay on the sideline. Note, the camera software does not track specific rocks, so an unmoved rock in Pict1 may be item 1 and this same rock may be item 4 in the second picture. Multiple rocks may occupy the same location in a picture.  \r\n\r\nReturn the Minimum Martian Speed to transition from the initial Rock set to the Final rock set. \r\n\r\n\r\n*Input: [Rock_locations_Pict1_Pict2,Time between pictures ]*\r\n\r\n*Output: [Minimum Martian Speed]*; to 2 decimal places;\r\n\r\n*Scoring: Cumulative Time ( msec )*\r\n\r\n\r\nThe full \u003chttp://contest.usc.edu/index.php/Fall12/Home?action=download\u0026upname=pranks.in.txt USC data file\u003e\r\n\r\n*Example:*\r\n\r\n*Input: [0.3 0.6;0.4 0.5;0.5 0.5;0.95 0.2;0.6 0.5;0.9 0.4;0.5 0.5; 0.3 0.6], 3.0*\r\n\r\nEssentially, 4 rocks in two pictures with a time between pictures of 3 seconds\r\n\r\n*Output: 0.37* is quite obvious, not in the least \r\n \r\nThis answer comes by moving [I1 F4; I2 F3; I3 F1; I4 F2] with rows two and three  being of equal maximum effective distance of 1.1. My \"effective distance\" for I2 F3 is .4 + (.1)*2 + .5, where .1 is hypot(I2,F3) and multiply by 2 for speed reduction. This 1.1/3 rounds to 0.37.\r\n\r\n\r\n\u003chttp://contest.usc.edu/index.php/Fall12/Home?action=download\u0026upname=pranks.zhencao.cpp.txt The Winner's Pranks solution\u003e.  This solution is much tighter than my first method thus I am scoring by time.  Hopefully someone can champion Matlab and produce a succinct and worthy solution. The winner solved this in 22 minutes and second place took a leisurely 65 minutes. Time Started when the page was opened.\r\n\r\n","description_html":"\u003cp\u003eThis Challenge is to solve Question C, Martian Pranks, of the \u003ca href=\"http://contest.usc.edu/index.php/Fall12/Home\"\u003eUSC ACM Fall 2012 Contest\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eRocks are moving between Rover pictures. This proves Life on Mars, but how Fast is that Life?\u003c/p\u003e\u003cp\u003eAll Rocks are bounded by a square with opposite corners (0,0) and (1,1). The camera only sees this 1x1 area. One Martian per Rock. Martians travel the minimum distance from the 1x1 edge to the initial rock position and from the final rock position to the edge to hide at velocity V. While moving a rock Marty's velocity reduces to V/2. An unmoved rock allows Marty to stay on the sideline. Note, the camera software does not track specific rocks, so an unmoved rock in Pict1 may be item 1 and this same rock may be item 4 in the second picture. Multiple rocks may occupy the same location in a picture.\u003c/p\u003e\u003cp\u003eReturn the Minimum Martian Speed to transition from the initial Rock set to the Final rock set.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput: [Rock_locations_Pict1_Pict2,Time between pictures ]\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput: [Minimum Martian Speed]\u003c/b\u003e; to 2 decimal places;\u003c/p\u003e\u003cp\u003e\u003cb\u003eScoring: Cumulative Time ( msec )\u003c/b\u003e\u003c/p\u003e\u003cp\u003eThe full \u003ca href=\"http://contest.usc.edu/index.php/Fall12/Home?action=download\u0026amp;upname=pranks.in.txt\"\u003eUSC data file\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput: [0.3 0.6;0.4 0.5;0.5 0.5;0.95 0.2;0.6 0.5;0.9 0.4;0.5 0.5; 0.3 0.6], 3.0\u003c/b\u003e\u003c/p\u003e\u003cp\u003eEssentially, 4 rocks in two pictures with a time between pictures of 3 seconds\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput: 0.37\u003c/b\u003e is quite obvious, not in the least\u003c/p\u003e\u003cp\u003eThis answer comes by moving [I1 F4; I2 F3; I3 F1; I4 F2] with rows two and three  being of equal maximum effective distance of 1.1. My \"effective distance\" for I2 F3 is .4 + (.1)*2 + .5, where .1 is hypot(I2,F3) and multiply by 2 for speed reduction. This 1.1/3 rounds to 0.37.\u003c/p\u003e\u003cp\u003e\u003ca href=\"http://contest.usc.edu/index.php/Fall12/Home?action=download\u0026amp;upname=pranks.zhencao.cpp.txt\"\u003eThe Winner's Pranks solution\u003c/a\u003e.  This solution is much tighter than my first method thus I am scoring by time.  Hopefully someone can champion Matlab and produce a succinct and worthy solution. The winner solved this in 22 minutes and second place took a leisurely 65 minutes. Time Started when the page was opened.\u003c/p\u003e","function_template":"function [v]=Pranks(R,t)\r\n  v=0;\r\nend","test_suite":"feval(@assignin,'caller','score',4000);\r\n%%\r\ntic\r\nurlwrite('http://contest.usc.edu/index.php/Fall12/Home?action=download\u0026upname=pranks.in.txt','pranks.in.txt')\r\ntoc\r\n%%\r\n fid=fopen('pranks.in.txt','r');\r\n v_expect=[.37 .26 1.11 .02 .89 .79 .01 .17 .37 1.05 .28 .04 .02 .09 .14 .49 .71 .06 .01];\r\n \r\n qty=fscanf(fid,'%i',1);\r\n\r\n t1=0;\r\n for q=1:qty %qty\r\n  n = fscanf(fid,'%f %f \\n',2)'; % num_rocks, time\r\n  t=n(2);\r\n  \r\n  A=zeros(2*n(1),2); % Format is rows, columns\r\n  for i=1:2*n(1)\r\n   r = fscanf(fid,'%f %f \\n',2)';\r\n   A(i,:) = r;\r\n  end\r\n \r\n \r\n  tic\r\n  ta=clock;\r\n   [v]=Pranks(A,t) ;\r\n  t1=t1+etime(clock,ta)*1000; % Time in msec\r\n   \r\nfprintf('%2i  vel %.2f  Sum Time %.0f \\n',q,v,t1)\r\n  \r\n  assert(isequal(v,v_expect(q)));\r\n   \r\n end\r\n \r\n fprintf('Processing Complete\\n')\r\n fclose(fid);\r\n\r\n\r\nt2=min(4000,t1);\r\nfprintf('Actual Time = %.0f msec\\n',t1)\r\n\r\nfeval(@assignin,'caller','score',floor(t2));","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-12-10T00:08:26.000Z","updated_at":"2012-12-10T01:48:14.000Z","published_at":"2012-12-10T01:48: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:r\u003e\u003cw:t\u003eThis Challenge is to solve Question C, Martian Pranks, of 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://contest.usc.edu/index.php/Fall12/Home\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUSC ACM Fall 2012 Contest\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\u003eRocks are moving between Rover pictures. This proves Life on Mars, but how Fast is that Life?\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\u003eAll Rocks are bounded by a square with opposite corners (0,0) and (1,1). The camera only sees this 1x1 area. One Martian per Rock. Martians travel the minimum distance from the 1x1 edge to the initial rock position and from the final rock position to the edge to hide at velocity V. While moving a rock Marty's velocity reduces to V/2. An unmoved rock allows Marty to stay on the sideline. Note, the camera software does not track specific rocks, so an unmoved rock in Pict1 may be item 1 and this same rock may be item 4 in the second picture. Multiple rocks may occupy the same location in a picture.\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\u003eReturn the Minimum Martian Speed to transition from the initial Rock set to the Final rock set.\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\u003eInput: [Rock_locations_Pict1_Pict2,Time between pictures ]\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\u003eOutput: [Minimum Martian Speed]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e; to 2 decimal places;\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\u003eScoring: Cumulative Time ( msec )\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 full\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://contest.usc.edu/index.php/Fall12/Home?action=download\u0026amp;upname=pranks.in.txt\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUSC data file\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw: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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput: [0.3 0.6;0.4 0.5;0.5 0.5;0.95 0.2;0.6 0.5;0.9 0.4;0.5 0.5; 0.3 0.6], 3.0\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\u003eEssentially, 4 rocks in two pictures with a time between pictures of 3 seconds\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\u003eOutput: 0.37\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is quite obvious, not in the least\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\u003eThis answer comes by moving [I1 F4; I2 F3; I3 F1; I4 F2] with rows two and three being of equal maximum effective distance of 1.1. My \\\"effective distance\\\" for I2 F3 is .4 + (.1)*2 + .5, where .1 is hypot(I2,F3) and multiply by 2 for speed reduction. This 1.1/3 rounds to 0.37.\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:hyperlink w:docLocation=\\\"http://contest.usc.edu/index.php/Fall12/Home?action=download\u0026amp;upname=pranks.zhencao.cpp.txt\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eThe Winner's Pranks solution\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. This solution is much tighter than my first method thus I am scoring by time. Hopefully someone can champion Matlab and produce a succinct and worthy solution. The winner solved this in 22 minutes and second place took a leisurely 65 minutes. Time Started when the page was opened.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"term":"tag:\"linear algebra\"","current_player_id":null,"fields":[{"name":"page","type":"integer","callback":null,"default":1,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"per_page","type":"integer","callback":null,"default":50,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"sort","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"body","type":"text","callback":null,"default":"*:*","directive":null,"facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":false},{"name":"group","type":"string","callback":null,"default":null,"directive":"group","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"difficulty_rating_bin","type":"string","callback":null,"default":null,"directive":"difficulty_rating_bin","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"id","type":"integer","callback":null,"default":null,"directive":"id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"tag","type":"string","callback":null,"default":null,"directive":"tag","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"product","type":"string","callback":null,"default":null,"directive":"product","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_at","type":"timeframe","callback":{},"default":null,"directive":"created_at","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"profile_id","type":"integer","callback":null,"default":null,"directive":"author_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_by","type":"string","callback":null,"default":null,"directive":"author","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player_id","type":"integer","callback":null,"default":null,"directive":"solver_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player","type":"string","callback":null,"default":null,"directive":"solver","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"solvers_count","type":"integer","callback":null,"default":null,"directive":"solvers_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"comments_count","type":"integer","callback":null,"default":null,"directive":"comments_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"likes_count","type":"integer","callback":null,"default":null,"directive":"likes_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leader_id","type":"integer","callback":null,"default":null,"directive":"leader_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leading_solution","type":"integer","callback":null,"default":null,"directive":"leading_solution","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true}],"filters":[{"name":"asset_type","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":"\"cody:problem\"","prepend":true},{"name":"profile_id","type":"integer","callback":{},"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":"author_id","static":null,"prepend":true}],"query":{"params":{"per_page":50,"term":"tag:\"linear algebra\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"linear algebra\"","","\"","linear algebra","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f636e2d74f8\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f636e2d7458\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f636e2d6878\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f636e2d7778\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f636e2d76d8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f636e2d7638\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f636e2d7598\u003e":"tag:\"linear algebra\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f636e2d7598\u003e":"tag:\"linear algebra\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"cody-search","password":"78X075ddcV44","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"linear algebra\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"linear algebra\"","","\"","linear algebra","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f636e2d74f8\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f636e2d7458\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f636e2d6878\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f636e2d7778\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f636e2d76d8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f636e2d7638\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f636e2d7598\u003e":"tag:\"linear algebra\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f636e2d7598\u003e":"tag:\"linear algebra\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":56583,"difficulty_rating":"easy"},{"id":2376,"difficulty_rating":"easy"},{"id":43158,"difficulty_rating":"easy"},{"id":46648,"difficulty_rating":"easy"},{"id":45317,"difficulty_rating":"easy"},{"id":627,"difficulty_rating":"easy"},{"id":44268,"difficulty_rating":"easy"},{"id":44093,"difficulty_rating":"easy"},{"id":42901,"difficulty_rating":"easy"},{"id":45196,"difficulty_rating":"easy"},{"id":61047,"difficulty_rating":"easy"},{"id":169,"difficulty_rating":"easy"},{"id":975,"difficulty_rating":"easy"},{"id":60966,"difficulty_rating":"easy"},{"id":59651,"difficulty_rating":"easy"},{"id":973,"difficulty_rating":"easy"},{"id":389,"difficulty_rating":"easy"},{"id":44274,"difficulty_rating":"easy-medium"},{"id":974,"difficulty_rating":"easy-medium"},{"id":44530,"difficulty_rating":"easy-medium"},{"id":43301,"difficulty_rating":"easy-medium"},{"id":59656,"difficulty_rating":"easy-medium"},{"id":58922,"difficulty_rating":"easy-medium"},{"id":1299,"difficulty_rating":"easy-medium"},{"id":46031,"difficulty_rating":"easy-medium"},{"id":501,"difficulty_rating":"easy-medium"},{"id":1108,"difficulty_rating":"easy-medium"},{"id":44849,"difficulty_rating":"easy-medium"},{"id":44277,"difficulty_rating":"medium"},{"id":136,"difficulty_rating":"medium"},{"id":110,"difficulty_rating":"medium"},{"id":46120,"difficulty_rating":"medium"},{"id":58463,"difficulty_rating":"medium"},{"id":44258,"difficulty_rating":"medium"},{"id":59132,"difficulty_rating":"hard"},{"id":59137,"difficulty_rating":"hard"},{"id":3074,"difficulty_rating":"unrated"},{"id":787,"difficulty_rating":"unrated"},{"id":1983,"difficulty_rating":"unrated"},{"id":1110,"difficulty_rating":"unrated"}]}}