{"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":1693,"title":"Calculate distance travelled when given radius and rotations","description":"When given radius of wheel and number of rotations calculate total distance travelled\r\nconsider pi=3.14","description_html":"\u003cp\u003eWhen given radius of wheel and number of rotations calculate total distance travelled\r\nconsider pi=3.14\u003c/p\u003e","function_template":"function y = calci_dist(r,n)\r\n  y = 1;\r\nend","test_suite":"%%\r\nr = 1;\r\nn = 1;\r\ny_correct = 6.28;\r\nassert(isequal(calci_dist(r,n),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":14448,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":242,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-07-02T09:00:14.000Z","updated_at":"2026-03-09T20:57:39.000Z","published_at":"2013-07-02T09:02:09.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\u003eWhen given radius of wheel and number of rotations calculate total distance travelled consider pi=3.14\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":956,"title":"Unique: Enhanced Performance - Large and Wide Array - Speed Improvement (66% savings)","description":"The Challenge is to perform very fast unique function for a long and wide array.\r\n\r\nThe data is small integer representing data permutations of items like DNA and Rubik's cube faces.\r\n\r\n*Input:* Array of uint8 of dimensions (m, 48) with values 0:3\r\n\r\n*Output:* Array Equivalent to unique(A,'rows')\r\n\r\n*Hints:*\r\n\r\n1) Columns can be merged to form a reduced number of columns\r\n2) Unique has the option to provide an Array and a sorting Index","description_html":"\u003cp\u003eThe Challenge is to perform very fast unique function for a long and wide array.\u003c/p\u003e\u003cp\u003eThe data is small integer representing data permutations of items like DNA and Rubik's cube faces.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e Array of uint8 of dimensions (m, 48) with values 0:3\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e Array Equivalent to unique(A,'rows')\u003c/p\u003e\u003cp\u003e\u003cb\u003eHints:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e1) Columns can be merged to form a reduced number of columns\r\n2) Unique has the option to provide an Array and a sorting Index\u003c/p\u003e","function_template":"function ans = unique_rows_fast(a)\r\n  unique(a,'rows');\r\nend","test_suite":"%%\r\nfeval(@assignin,'caller','score',20000);\r\n%%\r\n% Warm-Up Calls and functionality check\r\ntic\r\nc=randi(4,1024,48,'uint8')-1;\r\nout = unique_rows_fast(c);\r\nassert(isequal(unique(c,'rows'),out)) \r\n\r\nc=randi(4,2048,48,'uint8')-1;\r\nout = unique_rows_fast(c);\r\nassert(isequal(unique(c,'rows'),out)) \r\n\r\nc=randi(4,4096,48,'uint8')-1;\r\nout = unique_rows_fast(c);\r\nassert(isequal(unique(c,'rows'),out)) \r\ntoc\r\n%%\r\ntic\r\nc=randi(4,4000000,48,'uint8')-1;\r\ntoc\r\n\r\nta=clock;\r\nout = unique_rows_fast(c);\r\nt1=etime(clock,ta)*1000;\r\n\r\ntic\r\nassert(isequal(unique(c,'rows'),out)) %\r\ntoc\r\n\r\nt2=min(20000,t1); % unique scores 18.1 sec\r\nfprintf('Actual Time = %.0f msec\\n',t1)\r\nfeval(@assignin,'caller','score',floor(t2));","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":20,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-09-24T03:51:17.000Z","updated_at":"2026-01-21T12:09:19.000Z","published_at":"2012-09-24T05:40: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\",\"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\u003eThe Challenge is to perform very fast unique function for a long and wide array.\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 data is small integer representing data permutations of items like DNA and Rubik's cube faces.\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:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Array of uint8 of dimensions (m, 48) with values 0:3\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:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Array Equivalent to unique(A,'rows')\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\u003eHints:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1) Columns can be merged to form a reduced number of columns 2) Unique has the option to provide an Array and a sorting Index\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":955,"title":"ismember: Enhanced Time Performance for 'rows'  - Speed Scoring (90% savings)","description":"The Challenge is to perform very fast the 'ismember' function for a long and wide array.\r\n\r\nThe data is small integer representing data permutations of items like DNA and Rubik's cube faces and orientations.\r\n\r\n*Input:* Array of uint8 of dimensions (m, 16) with values 0:3\r\n\r\n*Output:* Array Equivalent to ismember(A,B,'rows')\r\n\r\n*Hints:*\r\n\r\n1) Columns can be merged to form a reduced number of columns\r\n2) Unique has the option to provide an Array and a sorting Index","description_html":"\u003cp\u003eThe Challenge is to perform very fast the 'ismember' function for a long and wide array.\u003c/p\u003e\u003cp\u003eThe data is small integer representing data permutations of items like DNA and Rubik's cube faces and orientations.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e Array of uint8 of dimensions (m, 16) with values 0:3\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e Array Equivalent to ismember(A,B,'rows')\u003c/p\u003e\u003cp\u003e\u003cb\u003eHints:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e1) Columns can be merged to form a reduced number of columns\r\n2) Unique has the option to provide an Array and a sorting Index\u003c/p\u003e","function_template":"function idx = ismember_fast_rows(a,b)\r\n idx=ismember(a,b,'rows');\r\nend","test_suite":"%%\r\nfeval(@assignin,'caller','score',40000);\r\n%%\r\n% Functionality Tests\r\nL=128;\r\na=randi(4,L,16,'uint8')-1;\r\nb=randi(4,L,16,'uint8')-1;\r\nassert(isequal(ismember(a,b,'rows'),ismember_fast_rows(a,b)))\r\n\r\nb=a;\r\nassert(isequal(ismember(a,b,'rows'),ismember_fast_rows(a,b)))\r\n\r\nL=256;\r\na=randi(4,L,16,'uint8')-1;\r\nb=randi(4,L,16,'uint8')-1;\r\na(16:32,:)=b(32:48,:);\r\nassert(isequal(ismember(a,b,'rows'),ismember_fast_rows(a,b)))\r\n\r\n%%\r\nL=4000000;  % ismember 40    fast 5.2\r\n% 34 sec 4M\r\ntic\r\na=randi(4,L,16,'uint8')-1;\r\nb=randi(4,L,16,'uint8')-1;\r\ntoc\r\n\r\n\r\nta=clock;\r\nidx = ismember_fast_rows(a,b);\r\nt1=etime(clock,ta)*1000;\r\n\r\nfprintf('Elapsed time = %.0f msec\\n',t1)\r\n\r\n%assert(isequal(ismember(a,b,'rows'),idx))\r\n\r\nt2=min(40000,t1); % ismember scores 40000 msec\r\nfeval(@assignin,'caller','score',floor(t2));\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":6,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":19,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-09-24T02:05:42.000Z","updated_at":"2025-06-08T09:02:05.000Z","published_at":"2012-09-24T05:39: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\",\"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\u003eThe Challenge is to perform very fast the 'ismember' function for a long and wide array.\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 data is small integer representing data permutations of items like DNA and Rubik's cube faces and orientations.\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:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Array of uint8 of dimensions (m, 16) with values 0:3\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:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Array Equivalent to ismember(A,B,'rows')\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\u003eHints:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1) Columns can be merged to form a reduced number of columns 2) Unique has the option to provide an Array and a sorting Index\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":952,"title":"Unique: Enhanced Performance - Avoiding Memory Crash","description":"The Challenge is to create the unique array for a long and wide array.\r\n\r\nDifficulties are that the normal unique(a,'rows') function call will suffer a Memory crash on Cody. c=randi(4,9000000,48,'uint8')-1;\r\n\r\nThe second part of the challenge is Execution Speed.\r\n\r\nThe data is small integer representing data permutations of items like DNA and Rubik's cube faces.\r\n\r\n*Input:* Array of uint8 of dimensions (m, 48) with values 0:3\r\n\r\n*Output:* Array Equivalent to unique(A,'rows')\r\n\r\nHints:\r\n\r\n1) Columns can be merged to form a reduced number of columns\r\n2) Unique has the option to provide an Array and a sorting Index","description_html":"\u003cp\u003eThe Challenge is to create the unique array for a long and wide array.\u003c/p\u003e\u003cp\u003eDifficulties are that the normal unique(a,'rows') function call will suffer a Memory crash on Cody. c=randi(4,9000000,48,'uint8')-1;\u003c/p\u003e\u003cp\u003eThe second part of the challenge is Execution Speed.\u003c/p\u003e\u003cp\u003eThe data is small integer representing data permutations of items like DNA and Rubik's cube faces.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e Array of uint8 of dimensions (m, 48) with values 0:3\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e Array Equivalent to unique(A,'rows')\u003c/p\u003e\u003cp\u003eHints:\u003c/p\u003e\u003cp\u003e1) Columns can be merged to form a reduced number of columns\r\n2) Unique has the option to provide an Array and a sorting Index\u003c/p\u003e","function_template":"function ans = unique_rows_fast(a)\r\n  unique(a,'rows');\r\nend","test_suite":"%%\r\nfeval(@assignin,'caller','score',40000);\r\n%%\r\n% Warm-Up Calls and functionality check\r\ntic\r\nc=randi(4,1024,48,'uint8')-1;\r\nout = unique_rows_fast(c);\r\nassert(isequal(unique(c,'rows'),out)) \r\n\r\nc=randi(4,2048,48,'uint8')-1;\r\nout = unique_rows_fast(c);\r\nassert(isequal(unique(c,'rows'),out)) \r\n\r\nc=randi(4,4096,48,'uint8')-1;\r\nout = unique_rows_fast(c);\r\nassert(isequal(unique(c,'rows'),out)) \r\ntoc\r\n%%\r\ntic\r\nc=randi(4,9000000,48,'uint8')-1;\r\ntoc\r\n\r\nta=clock;\r\nout = unique_rows_fast(c);\r\nt1=etime(clock,ta)*1000;\r\n\r\n%assert(isequal(unique(c,'rows'),out)) % avoid time-out vs mem \r\nt2=min(40000,t1); % unique scores memory crash\r\nfprintf('Actual Time = %.0f msec\\n',t1)\r\nfeval(@assignin,'caller','score',floor(t2));\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":15,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-09-19T13:54:20.000Z","updated_at":"2025-12-07T18:19:10.000Z","published_at":"2012-09-24T05:41: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\u003eThe Challenge is to create the unique array for a long and wide array.\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\u003eDifficulties are that the normal unique(a,'rows') function call will suffer a Memory crash on Cody. c=randi(4,9000000,48,'uint8')-1;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe second part of the challenge is Execution Speed.\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 data is small integer representing data permutations of items like DNA and Rubik's cube faces.\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:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Array of uint8 of dimensions (m, 48) with values 0:3\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:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Array Equivalent to unique(A,'rows')\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\u003eHints:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1) Columns can be merged to form a reduced number of columns 2) Unique has the option to provide an Array and a sorting Index\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":963,"title":"We love vectorized solutions.  Problem 1 : remove the row average.","description":"Given a 2-d matrix, remove the row average from each row.  Your solution MUST be vectorized.  The solution will be tested for accuracy AND speed.  Any for loops will make the solution too slow to pass the speed test.\r\n\r\nExample:\r\n\r\n  a = [ 1 2 ; 3 5 ];\r\n  b = remove_average_vectorized(a);\r\n  % b is [ -0.5 0.5 ; -1 1 ];\r\n","description_html":"\u003cp\u003eGiven a 2-d matrix, remove the row average from each row.  Your solution MUST be vectorized.  The solution will be tested for accuracy AND speed.  Any for loops will make the solution too slow to pass the speed test.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea = [ 1 2 ; 3 5 ];\r\nb = remove_average_vectorized(a);\r\n% b is [ -0.5 0.5 ; -1 1 ];\r\n\u003c/pre\u003e","function_template":"function y = remove_average_vectorized(x)\r\n    % This works but is too slow.\r\n\r\n    for row=1:size(x,1)\r\n      row_average=mean(x(row,:));\r\n      for col=1:size(x,2)\r\n        x(row,col)=x(row,col)-row_average; \r\n      end\r\n    end\r\n  y=x;\r\nend","test_suite":"x = [ 0 1 ; 2 3 ] ;\r\ny_correct = [ -0.5 0.5 ; -0.5 0.5 ] ;\r\ny = remove_average_vectorized(x);\r\nassert(isequal(y,y_correct));\r\n\r\n%% \r\nx = [ 0 1 ; 2 3 ] ;\r\ntimer=tic;\r\ny = remove_average_vectorized(x);\r\nduration=toc(timer)\r\n% You can probably pass this test with a for loop.\r\nassert(duration\u003c0.1,sprintf('Time used %2.3f\\n',duration)); \r\n\r\n%%\r\nx = [ 1:9999 ; 2:10000 ; [ zeros(1,9998) 9999 ]  ];\r\nx = repmat(x,1000,1);\r\ny_correct = [ -4999:1:4999 ; -4999:1:4999 ; [ repmat(-1,1,9998) 9998 ] ];\r\ny_correct = repmat(y_correct,1000,1);\r\ny = remove_average_vectorized(x);\r\nassert(isequal(y,y_correct));\r\n\r\n%%\r\nx = [ 1:9999 ; 2:10000 ; [ zeros(1,9998) 9999 ]  ];\r\nx = repmat(x,1000,1);\r\ntimer=tic;\r\ny = remove_average_vectorized(x);\r\nduration=toc(timer)\r\n% A decent vectorized solution should take around 1 second.\r\nassert(duration\u003c2,sprintf('Time used %2.3f\\n',duration)); ","published":true,"deleted":false,"likes_count":7,"comments_count":12,"created_by":6808,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":885,"test_suite_updated_at":"2012-10-02T05:21:12.000Z","rescore_all_solutions":false,"group_id":12,"created_at":"2012-10-01T06:43:20.000Z","updated_at":"2026-04-10T23:44:29.000Z","published_at":"2012-10-01T07:30:28.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 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for accuracy AND speed. Any for loops will make the solution too slow to pass the speed test.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a = [ 1 2 ; 3 5 ];\\nb = remove_average_vectorized(a);\\n% b is [ -0.5 0.5 ; -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":477,"title":"speed vs size","description":"The given string describes some MATLAB expressions such as 'pause(1)'. Compute its performance score = code size + run time in milliseconds/100. For size, please refer to this link: \r\n\u003chttp://www.mathworks.com/matlabcentral/fileexchange/34754-calculate-size\u003e","description_html":"\u003cp\u003eThe given string describes some MATLAB expressions such as 'pause(1)'. Compute its performance score = code size + run time in milliseconds/100. For size, please refer to this link:  \u003ca href=\"http://www.mathworks.com/matlabcentral/fileexchange/34754-calculate-size\"\u003ehttp://www.mathworks.com/matlabcentral/fileexchange/34754-calculate-size\u003c/a\u003e\u003c/p\u003e","function_template":"function ss = score(str)\r\n  ss = nodesize(str)+time;\r\nend","test_suite":"%%\r\nstr='pause(1)';\r\nss=14;\r\nassert(abs(ss-score(str))\u003c3)\r\n%%\r\nstr='pause(1/2);pause(1/2)';\r\nss=22;\r\nassert(abs(ss-score(str))\u003c3)\r\n%%\r\nstr='pause(1/200);pause(1/200)';\r\nss=12;\r\nassert(abs(ss-score(str))\u003c3)\r\n%%\r\nstr='pause((1/200));pause((1/2))';\r\nss=19;\r\nassert(abs(ss-score(str))\u003c3)\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":27,"test_suite_updated_at":"2012-03-10T07:03:10.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-03-10T07:03:10.000Z","updated_at":"2026-01-01T13:15:56.000Z","published_at":"2012-03-10T07:03:48.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe given string describes some MATLAB expressions such as 'pause(1)'. Compute its performance score = code size + run time in milliseconds/100. For size, please refer to this link: \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/fileexchange/34754-calculate-size\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://www.mathworks.com/matlabcentral/fileexchange/34754-calculate-size\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":850,"title":"Spectral Distance - Speed Scoring","description":"Find quantity of pixels within a spectral distance from a given [r,g,b] spectra.\r\n\r\n*Spectral distance* = sqrt( (r0-ri)^2+(g0-gi)^2+(b0-bi)^2) where [r0,g0,b0] is the target spectra (0:255) and [ri,gi,bi] are from an image pixel.\r\n\r\nTwo warm-up timing prep runs will be executed against a 512x512 sub-section.\r\n\r\nTiming run will be against a 2036x3060 image : concordaerial.png\r\n\r\nA second test will select a random point in a small window to confirm accuracy.\r\nUnfortunately bwdist does not appear to work in Cody.\r\n\r\n\r\n*Ranking* will be based upon speed. Accuracy is still required.\r\n\r\n*Input:* [image array, spectra, threshold distance] \r\n\r\nimage array [ x, y, 3 ]  % Higher order images is a future activity\r\n\r\nspectra [ r g b]\r\n\r\n*Output:* [ N ]  number of pixels within(\u003c=) threshold distance\r\n\r\nPixel count tolerance of 1% is allowed\r\n\r\n\r\nThe right to update the test points/thresholds is reserved in case of shenanigans.","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: 393px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 196.5px; transform-origin: 407px 196.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 238px 8px; transform-origin: 238px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFind quantity of pixels within a spectral distance from a given [r,g,b] spectra.\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: 61px 8px; transform-origin: 61px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eSpectral distance\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: 311.5px 8px; transform-origin: 311.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e = sqrt( (r0-ri)^2+(g0-gi)^2+(b0-bi)^2) where [r0,g0,b0] is the target spectra (0:255) and [ri,gi,bi] are from an image pixel.\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: 246.5px 8px; transform-origin: 246.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eTwo warm-up timing prep runs will be executed against a 512x512 sub-section.\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: 206px 8px; transform-origin: 206px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eTiming run will be against a 2036x3060 image : concordaerial.png\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: 374.5px 8px; transform-origin: 374.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA second test will select a random point in a small window to confirm accuracy. Unfortunately bwdist does not appear to work in Cody.\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: 28.5px 8px; transform-origin: 28.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eRanking\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: 164.5px 8px; transform-origin: 164.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e will be based upon speed. Accuracy is still required.\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: 20px 8px; transform-origin: 20px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eInput:\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: 132.5px 8px; transform-origin: 132.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e [image array, spectra, threshold distance]\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: 196.5px 8px; transform-origin: 196.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eimage array [ x, y, 3 ] % Higher order images is a future activity\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: 46px 8px; transform-origin: 46px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003espectra [ r g 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: 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: 26px 8px; transform-origin: 26px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eOutput:\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: 160.5px 8px; transform-origin: 160.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e [ N ] number of pixels within(\u0026lt;=) threshold distance\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: 118px 8px; transform-origin: 118px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ePixel count tolerance of 1% is allowed\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: 256px 8px; transform-origin: 256px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe right to update the test points/thresholds is reserved in case of shenanigans.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function N = spectral_dist(A,S,d)\r\n% A is array [x,y,3]\r\n% S is the Spectra zero [r g b]\r\n% d is the spectral distance limt - double\r\n  N=0;\r\nend","test_suite":"%%\r\nfeval(@assignin,'caller','score',2000);\r\n%%\r\nglobal As dt\r\n %A=imread('concordaerial.png');\r\n A=imread(fullfile(matlabroot,'toolbox','images','imdata','concordaerial.png'));\r\n size(A); % 2036 x 3060\r\n As=A(1:512,1:512,:);\r\n\r\nS=squeeze(A(1182,1672,:))'; % Golf Course\r\nd=sqrt(3);\r\nN_expect=730;\r\n\r\n% Small warm-up calls 512x512\r\n N = spectral_dist(As,S,d);\r\n N = spectral_dist(As,S,d);\r\n% A big warm-up call\r\n N = spectral_dist(A,S,d);\r\nt0=clock;\r\n N = spectral_dist(A,S,d);\r\ndt=etime(clock,t0)*1000; % ms\r\nfprintf('N= %i  Time to process %.0f msec\\n',N,dt);\r\nPass=0.99*N_expect\u003cN \u0026\u0026 N\u003c1.01*N_expect;\r\nassert(Pass==1,sprintf('N_exp=730  N= %.0f\\n',N))\r\n\r\n%%\r\nglobal As dt\r\ntemp=dt; % anti-cheat\r\n\r\n%randomize random\r\nseed=clock;\r\nseed=1000*seed(6);\r\nrng(seed);\r\n% Select random point in As sub-window for anti-cheat purposes\r\nx=randi(512,1,1);\r\ny=randi(512,1,1);\r\n\r\nS=squeeze(As(x,y,:))'; % \r\nd=sqrt(17);\r\n\r\n N = spectral_dist(As,S,d);\r\n\r\ndt=temp;\r\n\r\n S=double(S);\r\n As=double(As);\r\n N_expect=0;\r\n for i=1:512\r\n  for j=1:512\r\n    dr2=(S(1)-As(i,j,1))^2;\r\n    dg2=(S(2)-As(i,j,2))^2;\r\n    db2=(S(3)-As(i,j,3))^2;\r\n   if sqrt(dr2+dg2+db2)\u003c=d\r\n    N_expect=N_expect+1;\r\n   end\r\n  end\r\n end\r\n\r\nfprintf('x=%i  y=%i  N= %i  N_expect=%i\\n',x,y,N,N_expect);\r\n\r\nPass=0.99*N_expect\u003cN \u0026\u0026 N\u003c1.01*N_expect;\r\n\r\ndt=temp; % anti-cheat\r\n\r\nassert(Pass==1,sprintf('x= %i y=%i N_exp=%.0f  N= %.0f\\n',x,y,N_expect,N))\r\n%%\r\nglobal dt\r\n%Write file based on time in test 1\r\nnet_time=dt;\r\n% net_time in ms\r\n% Create graph data\r\nnet_time=min(2000,net_time); % Limit graph y-axis\r\nfeval(@assignin,'caller','score',floor(net_time));\r\n\r\n%fh=fopen('spectral_dist.m','wt');\r\n%fprintf(fh,'%s\\n',repmat('1;',[1,round(net_time/2)]));\r\n%fclose(fh);\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":10,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":10,"test_suite_updated_at":"2020-10-26T16:33:16.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-07-20T03:11:11.000Z","updated_at":"2020-10-26T16:33:16.000Z","published_at":"2012-07-23T00:43:36.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 quantity of pixels within a spectral distance from a given [r,g,b] spectra.\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\u003eSpectral distance\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = sqrt( (r0-ri)^2+(g0-gi)^2+(b0-bi)^2) where [r0,g0,b0] is the target spectra (0:255) and [ri,gi,bi] are from an image pixel.\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\u003eTwo warm-up timing prep runs will be executed against a 512x512 sub-section.\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\u003eTiming run will be against a 2036x3060 image : concordaerial.png\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 second test will select a random point in a small window to confirm accuracy. Unfortunately bwdist does not appear to work in Cody.\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\u003eRanking\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e will be based upon speed. Accuracy is still required.\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\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [image array, spectra, threshold distance]\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\u003eimage array [ x, y, 3 ] % Higher order images is a future activity\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\u003espectra [ r g 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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [ N ] number of pixels within(\u0026lt;=) threshold distance\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\u003ePixel count tolerance of 1% is allowed\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 right to update the test points/thresholds is reserved in case of shenanigans.\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":539,"title":"Fun Race","description":"* Given two unary functions foo and goo.\r\n* Check whether foo(0) runs faster than goo(0).\r\n* Output 1 if foo is faster, otherwise output 2.\r\n* Please give the answer within 1/5 seconds.","description_html":"\u003cul\u003e\u003cli\u003eGiven two unary functions foo and goo.\u003c/li\u003e\u003cli\u003eCheck whether foo(0) runs faster than goo(0).\u003c/li\u003e\u003cli\u003eOutput 1 if foo is faster, otherwise output 2.\u003c/li\u003e\u003cli\u003ePlease give the answer within 1/5 seconds.\u003c/li\u003e\u003c/ul\u003e","function_template":"function winner = race(foo,goo)\r\n   winner=1;\r\n   winner=2;\r\nend","test_suite":"%%\r\nfoo=@cosh;\r\ngoo=@(x)sqrt(cosh(x)+pi);\r\nwinner=[];\r\nfor k=1:10; winner(end+1)=race(foo,goo); end\r\nassert(all(winner==1))\r\n\r\n%%\r\nfoo=@num2str;\r\ngoo=@log10;\r\nwinner=[];\r\nfor k=1:10; winner(end+1)=race(foo,goo); end\r\nassert(all(winner==2))\r\n\r\n%%\r\nfoo=@gamma;\r\ngoo=@sign;\r\nwinner=[];\r\nfor k=1:10; winner(end+1)=race(foo,goo); end\r\nassert(all(winner==1))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":8,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":"2012-03-30T16:51:50.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-03-30T16:43:29.000Z","updated_at":"2025-05-06T20:02:39.000Z","published_at":"2012-03-30T16:43: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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven two unary functions foo and goo.\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\u003eCheck whether foo(0) runs faster than goo(0).\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\u003eOutput 1 if foo is faster, otherwise output 2.\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\u003ePlease give the answer within 1/5 seconds.\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":1259,"title":"It's race time again! Write a function that is at least twice as fast as the test suite call of repmat().","description":"Given an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x. This must be done in less than half the time that repmat(x, m, n) takes. This is the sequel to \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1237-it-s-race-time-write-a-faster-function-than-the-test-suite-call-of-unique\u003e.\r\n\r\nExample: \r\n  Input: repl_mat(2, 2, 5) \r\n  Output: [2, 2, 2, 2, 2; 2, 2, 2, 2, 2];","description_html":"\u003cp\u003eGiven an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x. This must be done in less than half the time that repmat(x, m, n) takes. This is the sequel to \u003ca href=\"http://www.mathworks.com/matlabcentral/cody/problems/1237-it-s-race-time-write-a-faster-function-than-the-test-suite-call-of-unique\"\u003ehttp://www.mathworks.com/matlabcentral/cody/problems/1237-it-s-race-time-write-a-faster-function-than-the-test-suite-call-of-unique\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eExample: \r\n  Input: repl_mat(2, 2, 5) \r\n  Output: [2, 2, 2, 2, 2; 2, 2, 2, 2, 2];\u003c/p\u003e","function_template":"function y = my_repmat(x, m, n)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1.7;\r\nm = 197;\r\nn = 535;\r\n\r\ntic\r\ny_correct = repmat(x, m, n);\r\nt_repmat = toc\r\n\r\ntic\r\ny_myrepmat = my_repmat(x, m, n);\r\nt_myrepmat = toc\r\n\r\nassert(isequal(y_myrepmat,y_correct) \u0026\u0026 t_myrepmat \u003c t_repmat/2)\r\n\r\n%%\r\nx = -0.3;\r\nm = 1;\r\nn = 5350;\r\n\r\ntic\r\ny_correct = repmat(x, m, n);\r\nt_repmat = toc\r\n\r\ntic\r\ny_myrepmat = my_repmat(x, m, n);\r\nt_myrepmat = toc\r\n\r\nassert(isequal(y_myrepmat,y_correct) \u0026\u0026 t_myrepmat \u003c t_repmat/2)\r\n\r\n%%\r\nx = 0;\r\nm = 14;\r\nn = 5350;\r\n\r\ntic\r\ny_correct = repmat(x, m, n);\r\nt_repmat = toc\r\n\r\ntic\r\ny_myrepmat = my_repmat(x, m, n);\r\nt_myrepmat = toc\r\n\r\nassert(isequal(y_myrepmat,y_correct) \u0026\u0026 t_myrepmat \u003c t_repmat)","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":10338,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":21,"test_suite_updated_at":"2013-02-10T22:09:06.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-02-10T21:58:01.000Z","updated_at":"2013-02-10T22:09:06.000Z","published_at":"2013-02-10T22:09: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\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x. This must be done in less than half the time that repmat(x, m, n) takes. This is the sequel to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1237-it-s-race-time-write-a-faster-function-than-the-test-suite-call-of-unique\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://www.mathworks.com/matlabcentral/cody/problems/1237-it-s-race-time-write-a-faster-function-than-the-test-suite-call-of-unique\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\u003eExample: Input: repl_mat(2, 2, 5) Output: [2, 2, 2, 2, 2; 2, 2, 2, 2, 2];\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":1889,"title":"Get ranking of a combination looking for speed.","description":"I have the numbers pulled without replacement from the set [1 2 3 4 5 6 7 8 9 10 11 12 13];  They are then ordered from least to greatest.\r\n\r\nSo a selection of [3 2 9], [9 2 3] are both considered to be [2 3 9].\r\n\r\nThere are 286 unique selections possible.  These can be ordered in lexicographic order:\r\n\r\n  Element   1 = [ 1  2  3]\r\n  Element   2 = [ 1  2  4]\r\n  Element   3 = [ 1  2  5]\r\n  Element   4 = [ 1  2  6]\r\n  Element   5 = [ 1  2  7]\r\n  Element   6 = [ 1  2  8]\r\n  Element   7 = [ 1  2  9]\r\n  Element   8 = [ 1  2 10]\r\n  Element   9 = [ 1  2 11]\r\n  Element  10 = [ 1  2 12]\r\n  Element  11 = [ 1  2 13]\r\n  Element  12 = [ 1  3  4]\r\n  Element  13 = [ 1  3  5]\r\n  Element  14 = [ 1  3  6]\r\n  Element  15 = [ 1  3  7]\r\n  ...\r\n  Element 285 = [10 12 13]\r\n  Element 286 = [11 12 13]\r\n\r\nGiven the three ordered values as a row vector, return the element number.\r\n\r\nThe test suite only passes if it is faster that my reference code.\r\n\r\n\r\n","description_html":"\u003cp\u003eI have the numbers pulled without replacement from the set [1 2 3 4 5 6 7 8 9 10 11 12 13];  They are then ordered from least to greatest.\u003c/p\u003e\u003cp\u003eSo a selection of [3 2 9], [9 2 3] are both considered to be [2 3 9].\u003c/p\u003e\u003cp\u003eThere are 286 unique selections possible.  These can be ordered in lexicographic order:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eElement   1 = [ 1  2  3]\r\nElement   2 = [ 1  2  4]\r\nElement   3 = [ 1  2  5]\r\nElement   4 = [ 1  2  6]\r\nElement   5 = [ 1  2  7]\r\nElement   6 = [ 1  2  8]\r\nElement   7 = [ 1  2  9]\r\nElement   8 = [ 1  2 10]\r\nElement   9 = [ 1  2 11]\r\nElement  10 = [ 1  2 12]\r\nElement  11 = [ 1  2 13]\r\nElement  12 = [ 1  3  4]\r\nElement  13 = [ 1  3  5]\r\nElement  14 = [ 1  3  6]\r\nElement  15 = [ 1  3  7]\r\n...\r\nElement 285 = [10 12 13]\r\nElement 286 = [11 12 13]\r\n\u003c/pre\u003e\u003cp\u003eGiven the three ordered values as a row vector, return the element number.\u003c/p\u003e\u003cp\u003eThe test suite only passes if it is faster that my reference code.\u003c/p\u003e","function_template":"function value = get3HCRank(vec)\r\n  value = vec;\r\nend","test_suite":"%%\r\nfeval(@assignin,'caller','score',0);\r\n%%\r\n\r\nvec1 = [1 6 13];\r\nvec2 = [1 2 4];\r\nvec3 = [3 5 8];\r\nvec4 = [5 9 11];\r\nanswer1 = 45;\r\nanswer2 = 2;\r\nanswer3 = 133;\r\nanswer4 = 222;\r\n\r\nfor i=1:5 % Warmup Calls to get valid timing\r\n value = get3HCRank(vec1);\r\nend\r\n\r\nta=clock;\r\n\r\nfor i = 1:10000\r\n ansU1=get3HCRank(vec1);\r\n\r\n ansU2=get3HCRank(vec2);\r\n\r\n ansU3=get3HCRank(vec3);\r\n\r\n ansU4=get3HCRank(vec4);\r\nend\r\n\r\nt1=etime(clock,ta);\r\ntiming = t1 * 95;\r\nbenchmark = 100;\r\n\r\nassert(isequal(ansU1,answer1))\r\nassert(isequal(ansU2,answer2))\r\nassert(isequal(ansU3,answer3))\r\nassert(isequal(ansU4,answer4))\r\nassert(timing \u003c benchmark)\r\n\r\nout = timing\r\n\r\nfeval(@assignin,'caller','score',out);","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":240,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":51,"test_suite_updated_at":"2013-09-25T13:09:55.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-09-24T17:56:14.000Z","updated_at":"2026-02-08T20:00:49.000Z","published_at":"2013-09-24T17:56: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\u003eI have the numbers pulled without replacement from the set [1 2 3 4 5 6 7 8 9 10 11 12 13]; They are then ordered from least to greatest.\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\u003eSo a selection of [3 2 9], [9 2 3] are both considered to be [2 3 9].\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\u003eThere are 286 unique selections possible. These can be ordered in lexicographic order:\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[Element   1 = [ 1  2  3]\\nElement   2 = [ 1  2  4]\\nElement   3 = [ 1  2  5]\\nElement   4 = [ 1  2  6]\\nElement   5 = [ 1  2  7]\\nElement   6 = [ 1  2  8]\\nElement   7 = [ 1  2  9]\\nElement   8 = [ 1  2 10]\\nElement   9 = [ 1  2 11]\\nElement  10 = [ 1  2 12]\\nElement  11 = [ 1  2 13]\\nElement  12 = [ 1  3  4]\\nElement  13 = [ 1  3  5]\\nElement  14 = [ 1  3  6]\\nElement  15 = [ 1  3  7]\\n...\\nElement 285 = [10 12 13]\\nElement 286 = [11 12 13]]]\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\u003eGiven the three ordered values as a row vector, return the element 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:t\u003eThe test suite only passes if it is faster that my reference code.\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":44351,"title":"Code breaker, Part I:  Operation Phoenix","description":"You have been tasked with decoding a set of coded messages that have been intercepted.  \r\n\r\nBased on previous intelligence that has been gathered, you can be confident that the messages were encoded using a simple \u003chttps://en.wikipedia.org/wiki/Caesar_cipher Caesar cipher\u003e (a type of \u003chttps://en.wikipedia.org/wiki/Substitution_cipher substitution cipher\u003e), an example of which is the \u003chttps://en.wikipedia.org/wiki/ROT13 ROT13 cipher\u003e (discussed in \u003chttps://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher Cody Challenge Problem 78\u003e).  As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation \u0026 numbers) are unchanged.  Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and may vary between messages (also, here you need to decode, not encode).  \r\n\r\nYou can also assume that the original message will relate to an activity that is referred to by those involved as \"Operation Phoenix\". Therefore the phrase \"Operation Phoenix\" (with that capitalisation) would have appeared at least once in the original message.  \r\n\r\nYour task is to crack the codes and report back in a \u003chttp://au.mathworks.com/help/matlab/ref/struct.html structure array\u003e:  (1) the shifting parameter that had been used in the encoding [as \u003chttp://au.mathworks.com/help/matlab/ref/uint8.html uint8\u003e];  (2)  the decoded message [as \u003chttp://au.mathworks.com/help/matlab/ref/char.html character array\u003e].  \r\nThe name of the structure array shall be \"s\", with respective fields \"shift\" and \"message\".  \r\n\r\nEXAMPLE\r\n\r\nSuppose the original message was _\"Cancel Operation Phoenix immediately \u0026 escape.\"_ and a (right-shifting) ROT1 cipher had been applied.  In that case A→B, B→C, ..., Y→Z, and Z→A;  similarly, a→b, b→c, ..., y→z, and z→a.  (Note that the shifting 'wraps' back around.)  \r\nThus the encoded message would be:  _\"Dbodfm Pqfsbujpo Qipfojy jnnfejbufmz \u0026 ftdbqf.\"_\r\n\r\nThe correct answer would comprise:  \r\n\r\n  s.shift = uint8(1)  \r\n  s.message = 'Cancel Operation Phoenix immediately \u0026 escape.'\r\n\r\n|Note: Many Cody solutions are hard to read and not necessarily computationally efficient. To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable and doesn't generate excessive text output). Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand.|  \r\n\r\nTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \"too slow\".\r\n\r\n----------\r\n\r\nNext problem:  \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44356 Operation Orthos\u003e.\r\n\r\n----------\r\n\r\nStatistics on solutions submitted as at 15 October 2017:\r\n\r\n* *Fastest wall time to decode 5000 messages = 93 milliseconds* , for \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1279303 Solution 1279303\u003e, with a size-based score of 40. \r\n* *Smallest size-based score = 38* , for \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1278780 Solution 1278780\u003e, for which wall time to decode 5000 messages = 515 milliseconds.  \r\n* Best combined score = 49, for \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1279303 Solution 1279303\u003e. ","description_html":"\u003cp\u003eYou have been tasked with decoding a set of coded messages that have been intercepted.\u003c/p\u003e\u003cp\u003eBased on previous intelligence that has been gathered, you can be confident that the messages were encoded using a simple \u003ca href = \"https://en.wikipedia.org/wiki/Caesar_cipher\"\u003eCaesar cipher\u003c/a\u003e (a type of \u003ca href = \"https://en.wikipedia.org/wiki/Substitution_cipher\"\u003esubstitution cipher\u003c/a\u003e), an example of which is the \u003ca href = \"https://en.wikipedia.org/wiki/ROT13\"\u003eROT13 cipher\u003c/a\u003e (discussed in \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher\"\u003eCody Challenge Problem 78\u003c/a\u003e).  As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation \u0026 numbers) are unchanged.  Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and may vary between messages (also, here you need to decode, not encode).\u003c/p\u003e\u003cp\u003eYou can also assume that the original message will relate to an activity that is referred to by those involved as \"Operation Phoenix\". Therefore the phrase \"Operation Phoenix\" (with that capitalisation) would have appeared at least once in the original message.\u003c/p\u003e\u003cp\u003eYour task is to crack the codes and report back in a \u003ca href = \"http://au.mathworks.com/help/matlab/ref/struct.html\"\u003estructure array\u003c/a\u003e:  (1) the shifting parameter that had been used in the encoding [as \u003ca href = \"http://au.mathworks.com/help/matlab/ref/uint8.html\"\u003euint8\u003c/a\u003e];  (2)  the decoded message [as \u003ca href = \"http://au.mathworks.com/help/matlab/ref/char.html\"\u003echaracter array\u003c/a\u003e].  \r\nThe name of the structure array shall be \"s\", with respective fields \"shift\" and \"message\".\u003c/p\u003e\u003cp\u003eEXAMPLE\u003c/p\u003e\u003cp\u003eSuppose the original message was \u003ci\u003e\"Cancel Operation Phoenix immediately \u0026 escape.\"\u003c/i\u003e and a (right-shifting) ROT1 cipher had been applied.  In that case A→B, B→C, ..., Y→Z, and Z→A;  similarly, a→b, b→c, ..., y→z, and z→a.  (Note that the shifting 'wraps' back around.)  \r\nThus the encoded message would be:  \u003ci\u003e\"Dbodfm Pqfsbujpo Qipfojy jnnfejbufmz \u0026 ftdbqf.\"\u003c/i\u003e\u003c/p\u003e\u003cp\u003eThe correct answer would comprise:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003es.shift = uint8(1)  \r\ns.message = 'Cancel Operation Phoenix immediately \u0026 escape.'\r\n\u003c/pre\u003e\u003cp\u003e\u003ctt\u003eNote: Many Cody solutions are hard to read and not necessarily computationally efficient. To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable and doesn't generate excessive text output). Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand.\u003c/tt\u003e\u003c/p\u003e\u003cp\u003eTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \"too slow\".\u003c/p\u003e\u003cp\u003e----------\u003c/p\u003e\u003cp\u003eNext problem:  \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44356\"\u003eOperation Orthos\u003c/a\u003e.\u003c/p\u003e\u003cp\u003e----------\u003c/p\u003e\u003cp\u003eStatistics on solutions submitted as at 15 October 2017:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003eFastest wall time to decode 5000 messages = 93 milliseconds\u003c/b\u003e , for \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1279303\"\u003eSolution 1279303\u003c/a\u003e, with a size-based score of 40.\u003c/li\u003e\u003cli\u003e\u003cb\u003eSmallest size-based score = 38\u003c/b\u003e , for \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1278780\"\u003eSolution 1278780\u003c/a\u003e, for which wall time to decode 5000 messages = 515 milliseconds.\u003c/li\u003e\u003cli\u003eBest combined score = 49, for \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1279303\"\u003eSolution 1279303\u003c/a\u003e.\u003c/li\u003e\u003c/ul\u003e","function_template":"function s = decode(x)\r\n  s = x;\r\nend","test_suite":"%% NOTE:  \r\n% This test suite can be updated if inappropriate 'hacks' \r\n% are discovered in any submitted solutions, \r\n% so your score/size may therefore change over time.  \r\n\r\n\r\n%% Test 1\r\nx = 'Dbodfm Pqfsbujpo Qipfojy jnnfejbufmz \u0026 ftdbqf.';\r\ns_correct.shift = 1;\r\ns_correct.message = 'Cancel Operation Phoenix immediately \u0026 escape.';\r\ns = decode(x);\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\nassert( isequal(class(s.shift), 'uint8') )\r\nassert( isequal(class(s.message), 'char') )\r\n\r\n\r\n%% Test 2\r\nx = 'Vwlyhapvu Wovlupe ilnpuz Ablzkhf!  Vwlyhapvu Wovlupe pz vby avw wypvypaf.';\r\ns_correct.shift = 7;\r\ns_correct.message = 'Operation Phoenix begins Tuesday!  Operation Phoenix is our top priority.';\r\ns = decode(x);\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\nassert( isequal(class(s.shift), 'uint8') )\r\nassert( isequal(class(s.message), 'char') )\r\n\r\n\r\n%% Test 3\r\nx = 'Eatpht cdit iwpi iwt ephhldgs wph qttc rwpcvts ugdb \"Fxeudyn\" id \"Dvcsbwl\".  Diwtglxht Detgpixdc Ewdtcxm xh egdrttsxcv prrdgsxcv id eapc.';\r\ns_correct.shift = 15;\r\ns_correct.message = 'Please note that the password has been changed from \"Qipfojy\" to \"Ogndmhw\".  Otherwise Operation Phoenix is proceeding according to plan.';\r\ns = decode(x);\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\nassert( isequal(class(s.shift), 'uint8') )\r\nassert( isequal(class(s.message), 'char') )\r\n\r\n\r\n%% Test 4\r\nx = 'Mncpyrgml Nfmclgv qryprcb rfpcc bywq yem.  Yjj ncpqmllcj ypc rm pckygl ml bsrw slrgj Mncpyrgml Nfmclgv gq amknjcrcb.';\r\ns_correct.shift = 24;\r\ns_correct.message = 'Operation Phoenix started three days ago.  All personnel are to remain on duty until Operation Phoenix is completed.';\r\ns = decode(x);\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\nassert( isequal(class(s.shift), 'uint8') )\r\nassert( isequal(class(s.message), 'char') )\r\n\r\n\r\n%% Rescoring \r\n% Acknowledgements \r\n% Portions of this timing test code were inspired by:\r\n% (1) Problem 937. \"Rubik's Mini Cube: Solve Randomized Cube in 11 Moves or Less; Score is by Time (msec)\" by Richard Zapor.\r\n% (2) Problem 2733. \"Evil Number\" by Jan Orwat.\r\n% (3) Feedback in comments from Peng Liu.\r\n% (4) Problem Problem 1237. \"It's race time! Write a faster function than the test suite call of unique().\" by Jeremy.\r\n\r\n% Note:  The Time Trial section does not check accuracy; that is done above.\r\n\r\n% Initialise\r\nx = 'Dbodfm Pqfsbujpo Qipfojy jnnfejbufmz \u0026 ftdbqf.';\r\ncutoffTimeBig = 1000; % Maximum allowable walltime (in milliseconds) to run function in a loop with qBig iterations.\r\n\r\nfor dummy = 1 : 20,  disp(' . ');  end;\r\n\r\n% Run once, untimed?\r\nincludeOverheads = false;\r\nif includeOverheads, \r\n    solution = decode( x );\r\nend;\r\n\r\n% *** PRELIMINARY TIMING ***\r\n% In case the submitted function has a lot of text output, \r\n% get an estimate based on just a few iterations\r\n% Initialise\r\nqSmall = 50;\r\nqBig = 5000;\r\nt0 = clock;\r\n\r\n% Loop\r\nfor i = 1 : qSmall\r\n    solution = decode( x );\r\nend;\r\n\r\n% Compute and display elapsed time.\r\ndt = etime(clock, t0) * 1000;\r\ndisp('     -----=====-----     ')\r\nfprintf('Your wall time to decode %u messages = %i msec.\\n\\r', qSmall, floor(dt))\r\nfprintf('Your APPROXIMATE wall time to decode %u messages would be ~ %i msec.\\n\\r', qBig, ceil(dt * qBig / qSmall))\r\ndisp('     -----=====-----     ')\r\nfor dummy = 1 : 20,  disp(' . ');  end;\r\n\r\n% *** 'OFFICIAL' TIMING ***\r\n% Re-initialise timer\r\nt0 = clock;\r\nt0_cpu = cputime;\r\n\r\n% Loop\r\nfor i = 1 : qBig\r\n    solution = decode( x );\r\nend;\r\n\r\n% Compute and display elapsed time.\r\nfor dummy = 1 : 20,  disp(' . ');  end;\r\ndisp('     -----=====|||||=====-----     ')\r\ndt = etime(clock, t0) * 1000;\r\nfprintf('Your wall time to decode %u messages = %i msec.\\n\\r', qBig, floor(dt))\r\n\r\ndt_cpu = (cputime - t0_cpu) * 1000;\r\nfprintf(' ( Your CPU time for this = %i msec. ) \\n\\r', floor(dt_cpu))\r\n\r\nfDecode = @()   decode(x);\r\ndt_timeit = timeit( fDecode ) * 1000;\r\nfprintf(' [ Your ''timeit'' time to decode %u messages = %i msec. ] \\n\\r', qBig, ceil(dt_timeit * qBig))\r\n\r\n% Display a size-based score.\r\nall_nodes = mtree('decode.m', '-file');        % This is the default in Cody.\r\nstr_nodes = mtfind(all_nodes, 'Kind', 'STRING');\r\neq_nodes = mtfind(all_nodes, 'Kind', 'EQUALS');\r\nprint_nodes = mtfind(all_nodes, 'Kind', 'PRINT');\r\nexpr_nodes = mtfind(all_nodes, 'Kind', 'EXPR');\r\n\r\nsize_score = count(all_nodes) ...\r\n +sum(str_nodes.nodesize-1) ...\r\n +2*(count(expr_nodes) ...\r\n +count(print_nodes) ...\r\n -count(eq_nodes));\r\n\r\nfprintf('Your size-based score = %i.\\n\\r', size_score)\r\n\r\n% Report revised performance score.\r\ncombinedScore = size_score  +  min( 200, floor(dt*(500/qBig)) );\r\nfprintf('Your combined score = %i.\\n\\r', combinedScore)\r\ndisp('     -----=====|||||=====-----     ')\r\n\r\n% Now disallow any candidate solutions that are TOO SLOW!\r\nif dt \u003e cutoffTimeBig, \r\n    fprintf('Sorry, your submission is TOO SLOW. It must be able to finish within %u milliseconds.\\n\\r', cutoffTimeBig)\r\nend;\r\n\r\nassert( dt \u003c= cutoffTimeBig, 'Exceeded time limit specified in Test Suite.' )","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":45,"test_suite_updated_at":"2017-10-15T10:19:08.000Z","rescore_all_solutions":false,"group_id":40,"created_at":"2017-09-29T09:20:59.000Z","updated_at":"2026-04-02T08:27:57.000Z","published_at":"2017-09-29T13:45:26.000Z","restored_at":"2017-10-04T19:25:07.000Z","restored_by":null,"spam":false,"simulink":false,"admin_reviewed":true,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou have been tasked with decoding a set of coded messages that have been intercepted.\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\u003eBased on previous intelligence that has been gathered, you can be confident that the messages were encoded using a simple\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/Caesar_cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCaesar cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (a type 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=\\\"https://en.wikipedia.org/wiki/Substitution_cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003esubstitution cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e), an example of which is 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/ROT13\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eROT13 cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (discussed 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://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Challenge Problem 78\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e). As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation \u0026amp; numbers) are unchanged. Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and may vary between messages (also, here you need to decode, not encode).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou can also assume that the original message will relate to an activity that is referred to by those involved as \\\"Operation Phoenix\\\". Therefore the phrase \\\"Operation Phoenix\\\" (with that capitalisation) would have appeared at least once in the original message.\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\u003eYour task is to crack the codes and report back in a\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://au.mathworks.com/help/matlab/ref/struct.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003estructure array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e: (1) the shifting parameter that had been used in the encoding [as\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://au.mathworks.com/help/matlab/ref/uint8.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003euint8\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e]; (2) the decoded message [as\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://au.mathworks.com/help/matlab/ref/char.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003echaracter array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e]. The name of the structure array shall be \\\"s\\\", with respective fields \\\"shift\\\" and \\\"message\\\".\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEXAMPLE\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSuppose the original message was\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\\\"Cancel Operation Phoenix immediately \u0026amp; escape.\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and a (right-shifting) ROT1 cipher had been applied. In that case A→B, B→C, ..., Y→Z, and Z→A; similarly, a→b, b→c, ..., y→z, and z→a. (Note that the shifting 'wraps' back around.) Thus the encoded message would 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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\\\"Dbodfm Pqfsbujpo Qipfojy jnnfejbufmz \u0026amp; ftdbqf.\\\"\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 correct answer would comprise:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[s.shift = uint8(1)  \\ns.message = 'Cancel Operation Phoenix immediately \u0026 escape.']]\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eNote: Many Cody solutions are hard to read and not necessarily computationally efficient. To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable and doesn't generate excessive text output). Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \\\"too slow\\\".\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----------\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\u003eNext problem: \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44356\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOperation Orthos\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\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\u003eStatistics on solutions submitted as at 15 October 2017:\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFastest wall time to decode 5000 messages = 93 milliseconds\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e , for\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1279303\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eSolution 1279303\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, with a size-based score of 40.\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eSmallest size-based score = 38\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e , for\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1278780\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eSolution 1278780\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, for which wall time to decode 5000 messages = 515 milliseconds.\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\u003eBest combined score = 49, for\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1279303\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eSolution 1279303\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\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":42636,"title":"Big Integer Multiplication","description":"Implement big integer multiply.\r\n\r\nInput:\r\n\r\nA, B : N-by-M Matrix, each row represents a positive decimal integer.\r\n\r\nOutput:\r\n\r\nC    : N-by-P Matrix, each row represents the decimal integer A*B.  \r\n\r\nExample 1:\r\n\r\n  a = [1 2 3;0 5 6];\r\n  b = [5 6;9 0];\r\n  c = BigIntMult(a,b)\r\n  c =\r\n     6     8     8     8\r\n     5     0     4     0\r\n\r\n123*56=6888 (c(1,:)), 56*90=5040 (c(2,:))\r\n\r\nExample 2 (singleton expansion):\r\n\r\n  a = [1 2 3;0 5 6];\r\n  b = [5 7];\r\n  c = BigIntMult(a,b)\r\n  c =\r\n     7     0     1     1\r\n     3     1     9     2\r\n\r\n123*57=7011 (c(1,:)), 56*57=3192 (c(2,:))\r\n\r\nNote: \r\n\r\n1.you don't need to remove the leading zeroes.\r\n\r\n2.your score will depend on your solution performance.","description_html":"\u003cp\u003eImplement big integer multiply.\u003c/p\u003e\u003cp\u003eInput:\u003c/p\u003e\u003cp\u003eA, B : N-by-M Matrix, each row represents a positive decimal integer.\u003c/p\u003e\u003cp\u003eOutput:\u003c/p\u003e\u003cp\u003eC    : N-by-P Matrix, each row represents the decimal integer A*B.\u003c/p\u003e\u003cp\u003eExample 1:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea = [1 2 3;0 5 6];\r\nb = [5 6;9 0];\r\nc = BigIntMult(a,b)\r\nc =\r\n   6     8     8     8\r\n   5     0     4     0\r\n\u003c/pre\u003e\u003cp\u003e123*56=6888 (c(1,:)), 56*90=5040 (c(2,:))\u003c/p\u003e\u003cp\u003eExample 2 (singleton expansion):\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea = [1 2 3;0 5 6];\r\nb = [5 7];\r\nc = BigIntMult(a,b)\r\nc =\r\n   7     0     1     1\r\n   3     1     9     2\r\n\u003c/pre\u003e\u003cp\u003e123*57=7011 (c(1,:)), 56*57=3192 (c(2,:))\u003c/p\u003e\u003cp\u003eNote:\u003c/p\u003e\u003cp\u003e1.you don't need to remove the leading zeroes.\u003c/p\u003e\u003cp\u003e2.your score will depend on your solution performance.\u003c/p\u003e","function_template":"function c = BigIntMult(a,b)","test_suite":"%% Coutresy of Alfonso Nieto-Castanon\r\nurlwrite('https://sites.google.com/a/alfnie.com/alfnie/software/SetSolutionScore.p?attredirects=0\u0026amp;d=1','SetSolutionScore.p');\r\nrehash path;\r\n\r\n%%\r\na = [1 2 3;0 5 6];\r\nb = [5 6;9 0];\r\nc = BigIntMult(a,b);\r\nassert(isequal(c(:,find(any(c,1),1):end),[6 8 8 8;5 0 4 0]))\r\n\r\n%%\r\nn = 1e2;\r\nm = 20;\r\na = randi([0 9],n,m);\r\nb = randi([0 9],1,m);\r\nc = BigIntMult(a,b);\r\nfor k = 1:n\r\n    d = c(k,:); d = d(:,find(d,1):end);\r\n assert(isequal(char(multiply(java.math.BigInteger(char(48+a(k,:))),java.math.BigInteger(char(48+b))))-48,d))\r\nend\r\n\r\n%%\r\nn = 1e2;\r\nm = 1e5;\r\na = randi([0 9],n,m);\r\nb = randi([0 9],n,m);\r\nt1 = builtin('tic');\r\nc = BigIntMult(a,b);\r\nscore = builtin('toc',t1);\r\nfor k = randi(n,1,3)\r\n    d = c(k,:); d = d(:,find(d,1):end);\r\nassert(isequal(char(multiply(java.math.BigInteger(char(48+a(k,:))),java.math.BigInteger(char(48+b(k,:)))))-48,d))\r\nend\r\nSetSolutionScore(round(5*score))","published":true,"deleted":false,"likes_count":1,"comments_count":6,"created_by":1434,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":7,"test_suite_updated_at":"2015-09-28T09:34:00.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-09-28T08:47:34.000Z","updated_at":"2015-10-08T18:15:12.000Z","published_at":"2015-09-28T08:47:34.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eImplement big integer multiply.\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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA, B : N-by-M Matrix, each row represents a positive decimal integer.\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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eC : N-by-P Matrix, each row represents the decimal integer A*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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample 1:\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 = [1 2 3;0 5 6];\\nb = [5 6;9 0];\\nc = BigIntMult(a,b)\\nc =\\n   6     8     8     8\\n   5     0     4     0]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e123*56=6888 (c(1,:)), 56*90=5040 (c(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\u003eExample 2 (singleton expansion):\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 = [1 2 3;0 5 6];\\nb = [5 7];\\nc = BigIntMult(a,b)\\nc =\\n   7     0     1     1\\n   3     1     9     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\u003e123*57=7011 (c(1,:)), 56*57=3192 (c(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\u003eNote:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1.you don't need to remove the leading zeroes.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e2.your score will depend on your solution performance.\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":44508,"title":"Curve fitting (non-linear functions) \u0026 function handles","description":"In this problem you are provided some raw data. You need to find a way of summarising the data with just a few parameters, so that it can be reconstructed. You then need to provide a handle to your own (generic) custom function that will indeed reproduce the raw data when provided with the parameters that you determine.\r\nConsider a non-linear scalar function y = mˣ + c. Suppose x is the vector [3 2 1 4]. The function would operate elementwise on x; for example, if m=2 and c=3 then y = [11 7 5 19]. You are provided with both the vector x and the vector y. Every number will be provided in some form of an integer data type. The scalar parameters m and c are both whole numbers (although they're not provided directly).\r\nSo here you should output two things:\r\nthe handle to a generic function that implements the relevant non-linear function (i.e. of the form y = mˣ + c) taking two inputs, namely 1 a set of parameters and 2 the vector x, and outputting the corresponding vector y (in any data type); and\r\na set of parameter values (m and c) wrapped into a single MATLAB variable (of any data type).\r\nAs the parameters will be used in your own function, the data type will be set by you.\r\nSo, for the above example, you could return a function handle @myFunc that you have defined, along with the variable param that has two fields such that param.base = 2 and param.translation = 3.\r\nOr, if you have defined your function differently, then you could return the function handle @myFn along with a cell array variable prms that has four elements such that prms{1}='positive', prms{2}=uint8(3), prms{3} = 'positive' and prms{4} = uint8(2).\r\nAnd so on.\r\nNote 1: the parameter m can be assumed to have values between -30 and +30 (inclusive); the parameter c can be assumed to have values between -10000 and +10000 (inclusive); the elements in x are positive.\r\nNote 2: if the code runs too slowly, then it will also fail the Test Suite.\r\nNote 3: there might not be only one unique pair of the m \u0026 c parameter values that is correct — the individual values of m \u0026 c are not tested here, only the values of y that they predict are examined.\r\nSee also Problem 44507. Curve fitting (linear functions) \u0026 function handles — easier.","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: 633px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 316.5px; transform-origin: 407px 316.5px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIn this problem you are provided some raw data. You need to find a way of summarising the data with just a few parameters, so that it can be reconstructed. You then need to provide a handle to your own (generic) custom function that will indeed reproduce the raw data when provided with the parameters that you determine.\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eConsider a non-linear scalar function\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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; \"\u003ey = mˣ + c\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. Suppose\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ex\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 is the 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: 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003e[3 2 1 4]\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. The function would operate elementwise on\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ex\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; for example, if\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003em=2\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 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: 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ec=3\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 then\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ey = [11 7 5 19]\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. You are provided with both the 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: 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ex\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 and the 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: 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ey\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. Every number will be provided in some form of an\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://au.mathworks.com/help/matlab/matlab_prog/integers.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003einteger\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 data type. The scalar parameters\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003em\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 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: 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ec\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 are both whole numbers (although they're not provided directly).\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eSo here you should output two things:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003col style=\"block-size: 81px; 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 40.5px; transform-origin: 391px 40.5px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 61px; 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 30.5px; text-align: left; transform-origin: 363px 30.5px; white-space: pre-wrap; 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 handle to a\u003c/span\u003e\u003c/span\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=\"\"\u003e \u003c/span\u003e\u003c/span\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=\"font-style: italic; \"\u003egeneric\u003c/span\u003e\u003c/span\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=\"\"\u003e function that implements the relevant non-linear function (i.e. of the form\u003c/span\u003e\u003c/span\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=\"\"\u003e \u003c/span\u003e\u003c/span\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=\"font-style: italic; \"\u003ey = mˣ + c\u003c/span\u003e\u003c/span\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=\"\"\u003e) taking two inputs, namely\u003c/span\u003e\u003c/span\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=\"\"\u003e \u003c/span\u003e\u003c/span\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=\"font-weight: 700; \"\u003e1\u003c/span\u003e\u003c/span\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=\"\"\u003e a set of parameters and\u003c/span\u003e\u003c/span\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=\"\"\u003e \u003c/span\u003e\u003c/span\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=\"font-weight: 700; \"\u003e2\u003c/span\u003e\u003c/span\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=\"\"\u003e the vector\u003c/span\u003e\u003c/span\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=\"\"\u003e \u003c/span\u003e\u003c/span\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=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ex\u003c/span\u003e\u003c/span\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=\"\"\u003e, and outputting the corresponding vector\u003c/span\u003e\u003c/span\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=\"\"\u003e \u003c/span\u003e\u003c/span\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=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ey\u003c/span\u003e\u003c/span\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=\"\"\u003e (in any data type); and\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20px; 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 10px; text-align: left; transform-origin: 363px 10px; white-space: pre-wrap; 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=\"\"\u003ea set of parameter values (m and c) wrapped into a single MATLAB variable (of any data type).\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eAs the parameters will be used in your own function, the data type will be set by you.\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eSo, for the above example, you\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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; \"\u003ecould\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 return a\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://au.mathworks.com/help/matlab/function-handles.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003efunction handle\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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003e@myFunc\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 that you have defined, along with the variable\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eparam\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 that has two\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://au.mathworks.com/help/matlab/structures.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003efields\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 such that\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eparam.base\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 = 2 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: 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eparam.translation\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 = 3.\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eOr, if you have defined your function differently, then you\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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; \"\u003ecould\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 return the\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://au.mathworks.com/help/matlab/function-handles.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003efunction handle\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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003e@myFn\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 along with a\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://au.mathworks.com/help/matlab/cell-arrays.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ecell array\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 variable\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eprms\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 that has four elements such that\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eprms{1}='positive'\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eprms{2}=uint8(3)\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eprms{3} = 'positive'\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 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: 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eprms{4} = uint8(2)\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: 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=\"\"\u003eAnd so on.\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eNote\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; \"\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; font-weight: 700; \"\u003e1\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; \"\u003e: the parameter\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; \"\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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; font-style: italic; \"\u003em\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; \"\u003e can be assumed to have values between -30 and +30 (inclusive); the parameter\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; \"\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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; font-style: italic; \"\u003ec\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; \"\u003e can be assumed to have values between -10000 and +10000 (inclusive); the elements 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; font-style: italic; \"\u003ex\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; \"\u003e are positive.\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eNote\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; \"\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; font-weight: 700; \"\u003e2\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; \"\u003e: if the code runs too slowly, then it will also fail the Test Suite.\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eNote\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; \"\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; font-weight: 700; \"\u003e3\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; \"\u003e: there might not be only one unique pair of the m \u0026amp; c parameter values that is correct — the individual values of m \u0026amp; c are not tested here, only the values of y that they predict are examined.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 20px; 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 10px; transform-origin: 391px 10px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"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 10px; text-align: left; transform-origin: 363px 10px; white-space: pre-wrap; 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=\"\"\u003eSee also\u003c/span\u003e\u003c/span\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=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/44507\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProblem 44507. Curve fitting (linear functions) \u0026amp; function handles\u003c/span\u003e\u003c/span\u003e\u003c/a\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=\"\"\u003e — easier.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"%{\r\n    Some comments about this code....\r\n%}\r\nfunction [afunctionhandle asetofparameters] = generateFit(x, y)    % \u003c---This function is called first by the Test Suite\r\n    % Here you are going to figure out the values of the parameters\r\n    \r\n    afunctionhandle\r\n    asetofparameters\r\n    \r\nfunction nameofyouroutputvectorvariable = nameofyourgenericnonlinearfunction(nameofyourparametersetvariable, nameofyourxvectorvariable)\r\n    % Here you are providing code representing y = mˣ + c.  ","test_suite":"%% Hard-coded m and c (1).\r\nfor i = 1 : 5\r\n    x = uint64(randi(10):60-randi(40));\r\n    m = uint64(2);\r\n    c = uint64(3);\r\n    y_correct = m.^x + c;\r\n    [fh, pars] = generateFit(x, y_correct);\r\n    y = fh(pars, x);\r\n    assert( isequal(y,y_correct) )\r\nend;\r\n\r\n%% Hard-coded m and c (2).\r\nfor i = 1 : 5\r\n    x = uint64(randi(10):40-randi(10));\r\n    m = uint64(3);\r\n    c = uint64(2);\r\n    y_correct = m.^x + c;\r\n    [fh, pars] = generateFit(x, y_correct);\r\n    y = fh(pars, x);\r\n    assert( isequal(y,y_correct) )\r\nend;\r\n\r\n%% Dynamic m and c.\r\nfor i = 1 : 5\r\n    x = int64( randi(5):25-randi(5) );\r\n    m = int64( randi(10) - 5 );\r\n    c = int64( 10000 - randi(20000) );\r\n    y_correct = m.^x + c;\r\n    [fh, pars] = generateFit(x, y_correct);\r\n    y = fh(pars, x);\r\n    assert( isequal(y,y_correct) )\r\nend;\r\n\r\n%% Variable spacing in x vector, and values in reverse sequence.\r\nfor i = 1 : 100      % EDITED 2021-07-19.  Increased iterations from 5 to 100.\r\n    x = int64( +25-randi(5) : -randi(5) : randi(5) );\r\n    m = int64( randi(10) - 5 );\r\n    c = int64( 10000 - randi(20000) );\r\n    y_correct = m.^x + c;\r\n    try      % EDITED 2021-07-19.  Inserted try–catch structure to provide more feedback on failures.\r\n        [fh, pars] = generateFit(x, y_correct);\r\n        y = fh(pars, x);\r\n        assert( isequal(y,y_correct) )\r\n    catch solnErr\r\n        disp(['Error identifier:  ' solnErr.identifier])\r\n        fprintf('m:\\t%d\\r\\n', m)\r\n        fprintf('c:\\t%d\\r\\n', c)\r\n        fprintf('user parameters:\\r\\n')\r\n        pars\r\n        rethrow(solnErr)\r\n    end;\r\nend;\r\n\r\n%% Variable spacing in x vector, and values out of sequence.\r\nfor i = 1 : 100      % EDITED 2021-07-19.  Increased iterations from 5 to 100.\r\n    x = int64( randi(5) : randi(5) : 25-randi(5) );\r\n    els = randperm( length(x) );\r\n    x = x(els);\r\n    m = int64( randi(10)-5 );\r\n    c = int64( 10000 - randi(20000) );\r\n    y_correct = m.^x + c;\r\n    try      % EDITED 2021-07-19.  Inserted try–catch structure to provide more feedback on failures.\r\n        [fh, pars] = generateFit(x, y_correct);\r\n        y = fh(pars, x);\r\n        assert( isequal(y,y_correct) )\r\n    catch solnErr\r\n        disp(['Error identifier:  ' solnErr.identifier])\r\n        fprintf('m:\\t%d\\r\\n', m)\r\n        fprintf('c:\\t%d\\r\\n', c)\r\n        fprintf('user parameters:\\r\\n')\r\n        pars\r\n        rethrow(solnErr)\r\n    end;\r\nend;\r\n\r\n%% Duplicate values in x.\r\nfor i = 1 : 100      % EDITED 2021-07-19.  Increased iterations from 5 to 100.\r\n    x = int64( randi(5) : randi(5) : 25-randi(5) );\r\n    x = repmat(x, [1,50]);\r\n    els = randperm( length(x) );\r\n    x = x(els);\r\n    m = int64( randi(10)-5 );\r\n    c = int64( 10000 - randi(20000) );\r\n    y_correct = m.^x + c;\r\n    try      % EDITED 2021-07-19.  Inserted try–catch structure to provide more feedback on failures.\r\n        [fh, pars] = generateFit(x, y_correct);\r\n        y = fh(pars, x);\r\n        assert( isequal(y,y_correct) )\r\n    catch solnErr\r\n        disp(['Error identifier:  ' solnErr.identifier])\r\n        fprintf('m:\\t%d\\r\\n', m)\r\n        fprintf('c:\\t%d\\r\\n', c)\r\n        fprintf('user parameters:\\r\\n')\r\n        pars\r\n        rethrow(solnErr)\r\n    end;\r\nend;\r\n\r\n%% Different inputs.\r\nfor i = 1 : 5\r\n    x = int64( 1+randi(4) : 2*randi(2)-1 : 25-randi(4) );    % Must be odd step to ensure both odd and even values of x here.\r\n    els = randperm( length(x) );\r\n    x = x(els);\r\n    m = int64( randi(10)-5 );\r\n    c = int64( 10000 - randi(20000) );\r\n    y_correct = m.^x + c;\r\n    [fh, pars] = generateFit(x, y_correct);\r\n    y = fh(pars, x);\r\n    assert( isequal(y,y_correct) , 'Failed test 7a' )\r\n    idx = [1+randi(2) : length(x)-randi(2)];\r\n    z = x(idx);\r\n    y = fh(pars, z);\r\n    assert( isequal(y, y_correct(idx)) , 'Failed test 7b' )\r\n    z = x-1;\r\n    y = fh(pars, z);\r\n    assert( isequal(y, m.^z + c) , 'Failed test 7c' )\r\n    z = x(idx)+1;\r\n    y = fh(pars, z);\r\n    assert( isequal(y, m.^z + c) , 'Failed test 7d' )\r\nend;\r\n\r\n%% Check interchangeability of function handles.  \r\nfor i = 1 : 5\r\n    % Hard-coded m and c (1).\r\n    x1 = int64(randi(10):60-randi(40));\r\n    m = int64(2);\r\n    c = int64(3);\r\n    y1_correct = m.^x1 + c;\r\n    [fh1, pars1] = generateFit(x1, y1_correct);\r\n\r\n    % Hard-coded m and c (2).\r\n    x2 = int64(randi(10):60-randi(40));\r\n    m = int64(3);\r\n    c = int64(2);\r\n    y2_correct = m.^x2 + c;\r\n    [fh2, pars2] = generateFit(x2, y2_correct);\r\n\r\n    % According to the Problem Statament, fh1 and fh2 should be interchangeable.  \r\n    y1 = fh2(pars1, x1);\r\n    assert( isequal(y1,y1_correct) )\r\n    y2 = fh1(pars2, x2);\r\n    assert( isequal(y2,y2_correct) )\r\nend;\r\n\r\n%% Large values of m.\r\nfor i = 1 : 5\r\n    x = int64( randi(3):13-randi(3) );\r\n    m = int64( randi(60) - 30 );\r\n    c = int64( 10000 - randi(20000) );\r\n    y_correct = m.^x + c;\r\n    [fh, pars] = generateFit(x, y_correct);\r\n    y = fh(pars, x);\r\n    assert( isequal(y,y_correct) )\r\nend;\r\n\r\n\r\n%% Check timing\r\ngenerateFit( uint32([1:10]), uint32(7.^[1:10] - 7) );\r\ntic\r\nfor i = 1 : 10\r\n    x = uint64(randi(10):25-randi(10));\r\n    x = repmat(x, [1,100]);\r\n    m = uint64( randi(5) );\r\n    c = uint64( randi(1000) );\r\n    y_correct = m.^x + c;\r\n    for j = 1 : 200\r\n        [fh, pars] = generateFit(x, y_correct);\r\n        y = fh(pars, x);\r\n    end;\r\n    assert( isequal(y,y_correct) )\r\nend;\r\nt = toc\r\nassert( t \u003c 2 )    % Seconds.\r\n\r\n%% Check parameter variable\r\n% Finally, check that the user is sending a small number of parameters to their\r\n% custom function (to be called via the function handle), and not simply sending\r\n% the entire vector y.  \r\nx = uint64(randi(10):60-randi(40));\r\nm = uint64(2);\r\nc = uint64(3);\r\ny_correct = m.^x + c;\r\n[fh, pars] = generateFit(x, y_correct);\r\ny = fh(pars, x);\r\nassert( isequal(y,y_correct) )\r\npw = whos('pars')\r\nassert( pw.bytes \u003c 100 , 'Parameter variable is too big.')\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":4,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":"2021-07-19T02:37:07.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2018-01-30T04:21:49.000Z","updated_at":"2021-07-19T02:37:07.000Z","published_at":"2018-01-30T13:00: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\u003eIn this problem you are provided some raw data. You need to find a way of summarising the data with just a few parameters, so that it can be reconstructed. You then need to provide a handle to your own (generic) custom function that will indeed reproduce the raw data when provided with the parameters that you determine.\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\u003eConsider a non-linear scalar 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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey = mˣ + c\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Suppose\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\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the 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\u003e[3 2 1 4]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. The function would operate elementwise on\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e; for example, if\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003em=2\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\u003ec=3\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e then\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\u003ey = [11 7 5 19]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. You are provided with both the 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\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and the 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\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Every number will be provided in some form of an\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://au.mathworks.com/help/matlab/matlab_prog/integers.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003einteger\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e data type. The scalar parameters\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\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\u003ec\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e are both whole numbers (although they're not provided directly).\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 here you should output two things:\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\u003ethe handle to 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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003egeneric\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e function that implements the relevant non-linear function (i.e. of the form\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\u003ey = mˣ + c\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e) taking two inputs, namely\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\u003e1\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e a set of parameters 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\u003e2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e the 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\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, and outputting the corresponding 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\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (in any data type); and\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\u003ea set of parameter values (m and c) wrapped into a single MATLAB variable (of any data type).\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\u003eAs the parameters will be used in your own function, the data type will be set by 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSo, for the above example, you\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\u003ecould\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e return a\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://au.mathworks.com/help/matlab/function-handles.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003efunction handle\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e@myFunc\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e that you have defined, along with the variable\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\u003eparam\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e that has two\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://au.mathworks.com/help/matlab/structures.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003efields\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e such that\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\u003eparam.base\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = 2 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\u003eparam.translation\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = 3.\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\u003eOr, if you have defined your function differently, then you\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\u003ecould\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e return 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://au.mathworks.com/help/matlab/function-handles.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003efunction handle\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e@myFn\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e along with a\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://au.mathworks.com/help/matlab/cell-arrays.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecell array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e variable\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\u003eprms\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e that has four elements such that\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\u003eprms{1}='positive'\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eprms{2}=uint8(3)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw: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\u003eprms{3} = 'positive'\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\u003eprms{4} = uint8(2)\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\u003eAnd so on.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\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\u003eNote\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\u003e1\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e: the parameter\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:i/\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e can be assumed to have values between -30 and +30 (inclusive); the parameter\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:i/\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ec\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e can be assumed to have values between -10000 and +10000 (inclusive); the elements in\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:i/\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e are positive.\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\u003eNote\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\u003e2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e: if the code runs too slowly, then it will also fail the Test Suite.\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\u003eNote\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\u003e3\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e: there might not be only one unique pair of the m \u0026amp; c parameter values that is correct — the individual values of m \u0026amp; c are not tested here, only the values of y that they predict are examined.\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\u003eSee also\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44507\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 44507. Curve fitting (linear functions) \u0026amp; function handles\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e — easier.\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":44521,"title":"Make your own Test Suite (part 3)","description":"In this task you need to imagine that you — _yes, YOU_ — have developed a problem on Cody for _me_ to solve, and now *you need to implement a robust Test Suite* to check whether _my_ submitted solutions meet _your_ requirements or not, and to be fairly assured that I am not trying to 'game' the system.  \r\n\r\nSo the tables are turned!  You are now in the role of Tester!  I am in the role of Player!  \r\n\r\nThe problem you've set me is to:\r\n\r\n* output the *sine* of an angle, when the angle is specified in degrees as a (scalar) \u003chttps://au.mathworks.com/help/matlab/ref/double.html |double|\u003e, with no restriction in the domain,   \r\n* *without* using |regexp| or |regexpi| or |ans|, \r\n* *within* less than 0.01 seconds (10 milliseconds).\r\n\r\nYou provide me with the following example for the function defined as |s = SINE(a)|:\r\n\r\n % INPUT\r\n a = 45 % degrees\r\n % OUTPUT\r\n s = 1/sqrt(2)\r\n\r\nNow I have responded by submitting a large number of purported 'solutions', some of which are _reasonably accurate_, and others which are either too imprecise or else logically flawed.  \r\n\r\nYour Test Suite (contained within _your_ function |testSuite|) must address each of the elements of your problem specification:  \r\n\r\n# Check that my submitted code reliably returns *sufficiently accurate* values for sine of many different angles.  Use the \u003chttps://au.mathworks.com/help/matlab/ref/assert.html |assert|\u003e function.  \r\n# Ensure that the returned *data type* is suitable.  \r\n# You *cannot* use (or mention) the functions |sind|, |sin|, |cscd| or |cosd| in your Test Suite;  any other functions are allowed.  [ _MOTIVATION:  You shouldn't be exposing an efficient way of solving the problem within your Test Suite, otherwise I can just copy and paste your solution and submit it as my own!_ ]\r\n# You must check that I *haven't used* \"regexp\" or \"regexpi\" or \"ans\".  You could try using the \u003chttps://au.mathworks.com/help/coursework/ug/assessfunctionabsence.html |assessFunctionAbsence|\u003e function in the form |assessFunctionAbsence(..., 'FileName','SINE.m')|, or else you could try 'manually' opening the file |SINE.m| that corresponds to my submitted solution and then parsing it for occurrence of the prohibited function/variable.  \r\n# You must check that my code returns a result within *less than 0.01 seconds* (for a single input of an arbitrary angle).  You could use \u003chttps://au.mathworks.com/help/matlab/ref/tic.html |tic|\u003e \u0026 \u003chttps://au.mathworks.com/help/matlab/ref/toc.html |toc|\u003e or \u003chttps://au.mathworks.com/help/matlab/ref/timeit.html |timeit|\u003e, or a variety of other MATLAB functions (but not |cputime| in this case).  If your Test Suite claims that my submission runs slowly, then you must be confident that it is truly caused only by inefficiency in my submitted code, *not* just general/erratic overheads in 'queuing' or suchlike on the Cody servers.  \r\n# Your |assert| (or other) function must throw \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44357 errors/exceptions\u003e with the following *|error message| text* contents.\r\n\r\n* 'Incorrect value' if the output is too inaccurate.\r\n* 'Incorrect data type' if the output is not appropriate.\r\n* 'Too slow' if my submitted code is too slow.\r\n* 'Banned word' if my submitted code contains the |regexp| or |regexpi| functions or the \u003chttps://au.mathworks.com/help/matlab/ref/ans.html |ans|\u003e variable.  For _this_ infringement, _additional_ text can _also_ (optionally!) be present in the message — for example, 'You cannot do that!  Banned word (regexp/regexpi)' would also be acceptable.\r\n\r\nWhen creating a Test Suite for a Cody problem it is a good habit to try to anticipate the tactics that diverse Players might employ!  \r\n\r\nSee also:\r\n\r\n* \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44631 Problem 44631\u003e (part *0*)\r\n* \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44617 Problem 44617\u003e (part *1*)\r\n* \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44616 Problem 44616\u003e (part *2*)","description_html":"\u003cp\u003eIn this task you need to imagine that you — \u003ci\u003eyes, YOU\u003c/i\u003e — have developed a problem on Cody for \u003ci\u003eme\u003c/i\u003e to solve, and now \u003cb\u003eyou need to implement a robust Test Suite\u003c/b\u003e to check whether \u003ci\u003emy\u003c/i\u003e submitted solutions meet \u003ci\u003eyour\u003c/i\u003e requirements or not, and to be fairly assured that I am not trying to 'game' the system.\u003c/p\u003e\u003cp\u003eSo the tables are turned!  You are now in the role of Tester!  I am in the role of Player!\u003c/p\u003e\u003cp\u003eThe problem you've set me is to:\u003c/p\u003e\u003cul\u003e\u003cli\u003eoutput the \u003cb\u003esine\u003c/b\u003e of an angle, when the angle is specified in degrees as a (scalar) \u003ca href = \"https://au.mathworks.com/help/matlab/ref/double.html\"\u003e\u003ctt\u003edouble\u003c/tt\u003e\u003c/a\u003e, with no restriction in the domain,\u003c/li\u003e\u003cli\u003e\u003cb\u003ewithout\u003c/b\u003e using \u003ctt\u003eregexp\u003c/tt\u003e or \u003ctt\u003eregexpi\u003c/tt\u003e or \u003ctt\u003eans\u003c/tt\u003e,\u003c/li\u003e\u003cli\u003e\u003cb\u003ewithin\u003c/b\u003e less than 0.01 seconds (10 milliseconds).\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eYou provide me with the following example for the function defined as \u003ctt\u003es = SINE(a)\u003c/tt\u003e:\u003c/p\u003e\u003cpre\u003e % INPUT\r\n a = 45 % degrees\r\n % OUTPUT\r\n s = 1/sqrt(2)\u003c/pre\u003e\u003cp\u003eNow I have responded by submitting a large number of purported 'solutions', some of which are \u003ci\u003ereasonably accurate\u003c/i\u003e, and others which are either too imprecise or else logically flawed.\u003c/p\u003e\u003cp\u003eYour Test Suite (contained within \u003ci\u003eyour\u003c/i\u003e function \u003ctt\u003etestSuite\u003c/tt\u003e) must address each of the elements of your problem specification:\u003c/p\u003e\u003col\u003e\u003cli\u003eCheck that my submitted code reliably returns \u003cb\u003esufficiently accurate\u003c/b\u003e values for sine of many different angles.  Use the \u003ca href = \"https://au.mathworks.com/help/matlab/ref/assert.html\"\u003e\u003ctt\u003eassert\u003c/tt\u003e\u003c/a\u003e function.\u003c/li\u003e\u003cli\u003eEnsure that the returned \u003cb\u003edata type\u003c/b\u003e is suitable.\u003c/li\u003e\u003cli\u003eYou \u003cb\u003ecannot\u003c/b\u003e use (or mention) the functions \u003ctt\u003esind\u003c/tt\u003e, \u003ctt\u003esin\u003c/tt\u003e, \u003ctt\u003ecscd\u003c/tt\u003e or \u003ctt\u003ecosd\u003c/tt\u003e in your Test Suite;  any other functions are allowed.  [ \u003ci\u003eMOTIVATION:  You shouldn't be exposing an efficient way of solving the problem within your Test Suite, otherwise I can just copy and paste your solution and submit it as my own!\u003c/i\u003e ]\u003c/li\u003e\u003cli\u003eYou must check that I \u003cb\u003ehaven't used\u003c/b\u003e \"regexp\" or \"regexpi\" or \"ans\".  You could try using the \u003ca href = \"https://au.mathworks.com/help/coursework/ug/assessfunctionabsence.html\"\u003e\u003ctt\u003eassessFunctionAbsence\u003c/tt\u003e\u003c/a\u003e function in the form \u003ctt\u003eassessFunctionAbsence(..., 'FileName','SINE.m')\u003c/tt\u003e, or else you could try 'manually' opening the file \u003ctt\u003eSINE.m\u003c/tt\u003e that corresponds to my submitted solution and then parsing it for occurrence of the prohibited function/variable.\u003c/li\u003e\u003cli\u003eYou must check that my code returns a result within \u003cb\u003eless than 0.01 seconds\u003c/b\u003e (for a single input of an arbitrary angle).  You could use \u003ca href = \"https://au.mathworks.com/help/matlab/ref/tic.html\"\u003e\u003ctt\u003etic\u003c/tt\u003e\u003c/a\u003e \u0026 \u003ca href = \"https://au.mathworks.com/help/matlab/ref/toc.html\"\u003e\u003ctt\u003etoc\u003c/tt\u003e\u003c/a\u003e or \u003ca href = \"https://au.mathworks.com/help/matlab/ref/timeit.html\"\u003e\u003ctt\u003etimeit\u003c/tt\u003e\u003c/a\u003e, or a variety of other MATLAB functions (but not \u003ctt\u003ecputime\u003c/tt\u003e in this case).  If your Test Suite claims that my submission runs slowly, then you must be confident that it is truly caused only by inefficiency in my submitted code, \u003cb\u003enot\u003c/b\u003e just general/erratic overheads in 'queuing' or suchlike on the Cody servers.\u003c/li\u003e\u003cli\u003eYour \u003ctt\u003eassert\u003c/tt\u003e (or other) function must throw \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44357\"\u003eerrors/exceptions\u003c/a\u003e with the following \u003cb\u003e\u003ctt\u003eerror message\u003c/tt\u003e text\u003c/b\u003e contents.\u003c/li\u003e\u003c/ol\u003e\u003cul\u003e\u003cli\u003e'Incorrect value' if the output is too inaccurate.\u003c/li\u003e\u003cli\u003e'Incorrect data type' if the output is not appropriate.\u003c/li\u003e\u003cli\u003e'Too slow' if my submitted code is too slow.\u003c/li\u003e\u003cli\u003e'Banned word' if my submitted code contains the \u003ctt\u003eregexp\u003c/tt\u003e or \u003ctt\u003eregexpi\u003c/tt\u003e functions or the \u003ca href = \"https://au.mathworks.com/help/matlab/ref/ans.html\"\u003e\u003ctt\u003eans\u003c/tt\u003e\u003c/a\u003e variable.  For \u003ci\u003ethis\u003c/i\u003e infringement, \u003ci\u003eadditional\u003c/i\u003e text can \u003ci\u003ealso\u003c/i\u003e (optionally!) be present in the message — for example, 'You cannot do that!  Banned word (regexp/regexpi)' would also be acceptable.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eWhen creating a Test Suite for a Cody problem it is a good habit to try to anticipate the tactics that diverse Players might employ!\u003c/p\u003e\u003cp\u003eSee also:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44631\"\u003eProblem 44631\u003c/a\u003e (part \u003cb\u003e0\u003c/b\u003e)\u003c/li\u003e\u003cli\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44617\"\u003eProblem 44617\u003c/a\u003e (part \u003cb\u003e1\u003c/b\u003e)\u003c/li\u003e\u003cli\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44616\"\u003eProblem 44616\u003c/a\u003e (part \u003cb\u003e2\u003c/b\u003e)\u003c/li\u003e\u003c/ul\u003e","function_template":"function dummy = testSuite()\r\n    \r\n    %% Test 1 — test outputs of submitted SINE function for various input values\r\n    % RATIONALE:  Computing SINE requires relatively simple code, \r\n    %             as the focus in the present task is on implementing a robust Test Suite.  \r\n    % MOTIVATION:  I could be submitting lazy code that only works for \r\n    %              a small number of angles, if that's all you test.\r\n    assert( isequal( SINE(45), 1/sqrt(2) ) , '' )\r\n    assert( isequal( SINE(45), 1/sqrt(2) ) , '' )\r\n    assert( isequal( SINE(45), 1/sqrt(2) ) , '' )\r\n    \r\n    \r\n    %% Test 2 — test for use/presence of  \"regexp\" or \"regexpi\" or \"ans\" in the submission\r\n    % MOTIVATION:  The functions regexp and regexpi are sometimes pertinent to efficient solution of a problem, \r\n    %              but at other times are used to artificially decrease the size of a Cody submission.\r\n    %              If I'm using regexp or regexpi for *this* problem of yours (where neither is relevant), \r\n    %              then it's probably because I'm trying to 'cheat' to get a smaller Cody score.\r\n    %              Use of the ans variable is also generally employed purely to decrease\r\n    %              Cody size, at the expense of clarity in the code.  \r\n    assessFunctionAbsence( '' , 'FileName','SINE.m' )\r\n\r\n    \r\n    %% Test 3 — check the speed of execution of the submission \r\n    % MOTIVATION:  Some code that is rated as \"small\" on Cody is actually quite computationally inefficient, \r\n    %              but it is possible to 'manually' enforce a requirement for Cody submissions to be at least \r\n    %              moderately efficient.  See e.g. Cody Problems 44351, 44356 \u0026 44383.  \r\n    %              So this will balance the Cody focus on small code 'size' with \r\n    %              the desire to ensure code is also computationally efficient.\r\n    toc\r\n    timeit( SINE(45) )\r\n    duration = tic\r\n    assert( duration , '' )\r\n\r\nend\r\n\r\n%{\r\nNOTE:  \r\nThe text \"dummy = \" was added to this Function Template, \r\nbecause Cody was generating a spurious error, namely\r\n        Your problem cannot be published until you:\r\n        •Edit the function name in the test suite to match the function name in the function template\r\nHowever, in the Reference Solution it was confirmed to be unnecessary.  \r\n%}\r\n\r\n%{\r\nFOOTNOTE:  \r\nAlthough 10 milliseconds may not seem like a slow execution time, \r\ncomputing the sine of an angle is a very common task, and a general program \r\nmight need to compute it hundreds, thousands or even millions of times.  \r\nIn the latter case, if each computation of sine were to take more than 10 \r\nmilliseconds, then the hypothetical program would run for several hours.  \r\nBy way of comparison, for a 1×1000000 vector input MATLAB's built-in sin \r\nfunction is currently taking a total of about 10 to 25 milliseconds on Cody, \r\nwhile sind is taking about 20 to 50 milliseconds._  \r\n%}","test_suite":"%% Timing\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(angle);\\n');\r\nfprintf(fileID,'   pause(0.012);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Too slow') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Use of ans\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function ans = SINE(angle)\\n');\r\nfprintf(fileID,'   sind(angle);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    e.message\r\n    assert( contains(e.message, 'Banned word') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Possible false alarm for use of ans\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   % This is a simple problem:  the answer only takes one line!\\n');\r\nfprintf(fileID,'   s = sind(angle);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'pass';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Use of regexp/regexpi (I)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(angle);\\n');\r\nfprintf(fileID,'   dummy = regexp(''Test text'', ''t'');\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    e.message\r\n    assert( contains(e.message, 'Banned word') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Use of regexp/regexpi (II)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(angle);\\n');\r\nfprintf(fileID,'   dummy = regexpi(''Test text'', ''t'');\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    e.message\r\n    assert( contains(e.message, 'Banned word') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Ensure no \"sind\" or \"sin\" or \"cosd\" in _your_ Test Suite\r\n% NOTE:  You may notice that the user function has been named \"SINE\", \r\n%        in uppercase.  That is an extra precaution to avoid accidentally \r\n%        triggering an error due to a banned 'word' (sequence of characters).  \r\n%        Careful choice of code to check for banned _functions_ is better!  \r\nassessFunctionAbsence('sind', 'FileName','testSuite.m')\r\nassessFunctionAbsence('sin',  'FileName','testSuite.m')\r\nassessFunctionAbsence('cscd', 'FileName','testSuite.m')\r\nassessFunctionAbsence('cosd', 'FileName','testSuite.m')\r\n\r\n\r\n%% Exactly right\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(angle);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'pass';\r\nstatus = 'pass';\r\n                    testSuite()\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Sufficiently close (I)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(angle + eps(angle));\\n');\r\nfclose(fileID);\r\nstatus_correct = 'pass';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Sufficiently close (II)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sin(angle * pi / 180);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'pass';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Sufficiently close (III)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = 1 ./ cscd(angle);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'pass';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Insufficiently close (I)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sin(angle * 3.14 / 180);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Insufficiently close (II)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sin(angle * (22/7) / 180);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Sufficiently close (III)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(angle + 10000*eps(angle));\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Completely wrong\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = cosd(angle);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Partly wrong (I)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(angle*sign(angle));\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Partly wrong (II)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = -sind(angle*sign(angle));\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Partly wrong (III)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(angle)*sign(sind(angle));\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% 'Fixed' angles\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(fix(angle));\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% 'Unfixed' angles\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   inc=0;\\n');\r\nfprintf(fileID,'   if mod(angle,1)==0, inc=1; end;\\n');\r\nfprintf(fileID,'   s = sind(angle + inc);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Altered data type (I)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nif rand() \u003c 0.5,\r\n    fprintf(fileID,'   s = int8(sind(angle));\\n');\r\nelse\r\n    fprintf(fileID,'   s = int16(sind(angle));\\n');\r\nend;\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') | ...\r\n            isequal(e.message, 'Incorrect data type') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Altered data type (II)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nif rand() \u003c 0.5,\r\n    fprintf(fileID,'   s = int32(sind(angle));\\n');\r\nelse\r\n    fprintf(fileID,'   s = int64(sind(angle));\\n');\r\nend;\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') | ...\r\n            isequal(e.message, 'Incorrect data type') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Altered data type (III)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(double(int32(angle)));\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Total nonsense (I)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = \"ratio\";\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect data type') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Total nonsense (II)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = \"?\";\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect data type') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Total nonsense (III)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = {1:1E4};\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect data type') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Wrong data type\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = {sind(angle)};\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect data type') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":3,"test_suite_updated_at":"2018-04-18T14:04:26.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-02-13T12:05:07.000Z","updated_at":"2018-05-11T13:20:58.000Z","published_at":"2018-02-20T13:11:28.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 this task you need to imagine that you —\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\u003eyes, YOU\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e — have developed a problem on Cody for\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eme\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to solve, and now\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\u003eyou need to implement a robust Test Suite\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to check whether\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\u003emy\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e submitted solutions meet\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\u003eyour\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e requirements or not, and to be fairly assured that I am not trying to 'game' the 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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSo the tables are turned! You are now in the role of Tester! I am in the role of Player!\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 problem you've set me is to:\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\u003eoutput 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\u003esine\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of an angle, when the angle is specified in degrees as a (scalar)\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://au.mathworks.com/help/matlab/ref/double.html\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003edouble\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, with no restriction in the domain,\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ewithout\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e using\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\u003eregexp\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eregexpi\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eans\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ewithin\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e less than 0.01 seconds (10 milliseconds).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou provide me with the following example for the function defined as\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003es = SINE(a)\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ % INPUT\\n a = 45 % degrees\\n % OUTPUT\\n s = 1/sqrt(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\u003eNow I have responded by submitting a large number of purported 'solutions', some of which 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\u003ereasonably accurate\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, and others which are either too imprecise or else logically flawed.\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\u003eYour Test Suite (contained within\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\u003eyour\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 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\u003etestSuite\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e) must address each of the elements of your problem specification:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCheck that my submitted code reliably returns\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\u003esufficiently accurate\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e values for sine of many different angles. Use 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://au.mathworks.com/help/matlab/ref/assert.html\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eassert\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e function.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEnsure that the returned\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\u003edata type\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is suitable.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou\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\u003ecannot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e use (or mention) the functions\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\u003esind\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esin\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ecscd\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ecosd\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e in your Test Suite; any other functions are allowed. [\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\u003eMOTIVATION: You shouldn't be exposing an efficient way of solving the problem within your Test Suite, otherwise I can just copy and paste your solution and submit it as my own!\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=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou must check that I\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\u003ehaven't used\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \\\"regexp\\\" or \\\"regexpi\\\" or \\\"ans\\\". You could try using 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://au.mathworks.com/help/coursework/ug/assessfunctionabsence.html\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eassessFunctionAbsence\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e function in the form\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\u003eassessFunctionAbsence(..., 'FileName','SINE.m')\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, or else you could try 'manually' opening the file\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\u003eSINE.m\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e that corresponds to my submitted solution and then parsing it for occurrence of the prohibited function/variable.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou must check that my code returns a result within\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\u003eless than 0.01 seconds\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (for a single input of an arbitrary angle). You could use\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://au.mathworks.com/help/matlab/ref/tic.html\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003etic\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e \u0026amp;\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://au.mathworks.com/help/matlab/ref/toc.html\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003etoc\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://au.mathworks.com/help/matlab/ref/timeit.html\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003etimeit\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, or a variety of other MATLAB functions (but not\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\u003ecputime\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e in this case). If your Test Suite claims that my submission runs slowly, then you must be confident that it is truly caused only by inefficiency in my submitted code,\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\u003enot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e just general/erratic overheads in 'queuing' or suchlike on the Cody servers.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYour\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\u003eassert\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (or other) function must throw\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44357\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eerrors/exceptions\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e with the following\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eerror message\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e text\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e contents.\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\u003e'Incorrect value' if the output is too inaccurate.\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\u003e'Incorrect data type' if the output is not appropriate.\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\u003e'Too slow' if my submitted code is too slow.\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\u003e'Banned word' if my submitted code contains the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eregexp\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eregexpi\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e functions or 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://au.mathworks.com/help/matlab/ref/ans.html\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eans\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e variable. For\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ethis\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e infringement,\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\u003eadditional\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e text can\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\u003ealso\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (optionally!) be present in the message — for example, 'You cannot do that! Banned word (regexp/regexpi)' would also be acceptable.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhen creating a Test Suite for a Cody problem it is a good habit to try to anticipate the tactics that diverse Players might employ!\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\u003eSee also:\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:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44631\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 44631\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (part\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\u003e0\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\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44617\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 44617\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (part\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\u003e1\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\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44616\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 44616\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (part\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\u003e2\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\"},{\"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":42674,"title":"Cody meets Xiangqi: foresee the unseen (Part 1)","description":"This is the first part of the Xiangqi series. The second part in this series is: \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42685-cody-meets-xiangqi-foresee-the-unseen-part-2 Cody meets Xiangqi: foresee the unseen (Part 2)\u003e\r\n\r\n\u003chttps://en.wikipedia.org/wiki/Xiangqi Xiangqi\u003e, also known as *Chinese Chess* (and 象棋 in Chinese characters), is one of the most popular board games in China. The modern Xiangqi board contains a middle section which divides two players' sides and is marked the \"Chu River–Han border\", in reference to the Chu–Han Contention between \u003chttps://en.wikipedia.org/wiki/Xiang_Yu Xiang Yu\u003e and \u003chttps://de.wikipedia.org/wiki/Han_Gaozu Liu Bang\u003e, two prominent warlords and opponents who fought thousands of battles against each other for supremacy over China in the late Qin dynasty (206–202 BC). Those interested in the story of the Chu–Han Contention and its relation to Xiangqi are referred to \u003chttps://en.wikipedia.org/wiki/Chu%E2%80%93Han_Contention here\u003e.\r\n\r\nFresh to Xiangqi, Cody becomes interested in Xiangqi by raising a question: _Who is the stronger player of Xiangqi between Xiang Yu and Liu Bang_? To answer this question, Cody designs a match for Xiang Yu and Liu Bang, in which Cody serves as the referee. The smart Cody referee also sets an intelligent rule to determine the winner: \r\n\r\n_In a succession of Xiangqi games, once Xiang Yu wins Na games *consecutively*, whereas Liu Bang has not won Nb games *consecutively*, Cody immediately announces Xiang Yu as the winner. Contrarily, once Liu Bang defeats Xiang Yu Nb times *consecutively*, whereas Xiang Yu has not won Na times *consecutively*, Liu Bang becomes the winner._ \r\n\r\nCody suggests that Na \u003e 1 and Nb \u003e 1, in order to enhance, to some extent, the confidence of the result of the match. Suppose in each individual game, the probability Xiang Yu would win is p, and the probability Liu Bang would win is 1 - p, which implicitly assumes that the probability of a tie is 0 (because they both refuse to draw and will fight to death). Unfortunately, this well-designed match has never taken place. Regretfully, Cody requests us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write a function\r\n\r\n                                sol = Xiangqi(p, Na, Nb)\r\n\r\nwith input: 0 \u003c= p \u003c= 1, Na \u003e 1, Nb \u003e 1, and output: sol --- the probability that Xiang Yu wins. Your solution will be tested against its true value Q (which is computed but hided in the P-file EvaluateSolution.p) according to a hybrid absolute and relative error tolerance criterion:\r\n\r\n                      abs(sol - Q) \u003c= max(AbsTol, RelTol*abs(sol))\r\n\r\nwhere AbsTol and RelTol are absolute and relative error tolerances, respectively, which will be specified in the test suite. You are encouraged to optimize the performance (rather than the usual Cody size) of your code as much as possible, as the score of your solution will be measured based on the *speed* of your code. \r\n\r\nHave fun!\r\n","description_html":"\u003cp\u003eThis is the first part of the Xiangqi series. The second part in this series is: \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42685-cody-meets-xiangqi-foresee-the-unseen-part-2\"\u003eCody meets Xiangqi: foresee the unseen (Part 2)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Xiangqi\"\u003eXiangqi\u003c/a\u003e, also known as \u003cb\u003eChinese Chess\u003c/b\u003e (and 象棋 in Chinese characters), is one of the most popular board games in China. The modern Xiangqi board contains a middle section which divides two players' sides and is marked the \"Chu River–Han border\", in reference to the Chu–Han Contention between \u003ca href = \"https://en.wikipedia.org/wiki/Xiang_Yu\"\u003eXiang Yu\u003c/a\u003e and \u003ca href = \"https://de.wikipedia.org/wiki/Han_Gaozu\"\u003eLiu Bang\u003c/a\u003e, two prominent warlords and opponents who fought thousands of battles against each other for supremacy over China in the late Qin dynasty (206–202 BC). Those interested in the story of the Chu–Han Contention and its relation to Xiangqi are referred to \u003ca href = \"https://en.wikipedia.org/wiki/Chu%E2%80%93Han_Contention\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eFresh to Xiangqi, Cody becomes interested in Xiangqi by raising a question: \u003ci\u003eWho is the stronger player of Xiangqi between Xiang Yu and Liu Bang\u003c/i\u003e? To answer this question, Cody designs a match for Xiang Yu and Liu Bang, in which Cody serves as the referee. The smart Cody referee also sets an intelligent rule to determine the winner:\u003c/p\u003e\u003cp\u003e\u003ci\u003eIn a succession of Xiangqi games, once Xiang Yu wins Na games \u003cb\u003econsecutively\u003c/b\u003e, whereas Liu Bang has not won Nb games \u003cb\u003econsecutively\u003c/b\u003e, Cody immediately announces Xiang Yu as the winner. Contrarily, once Liu Bang defeats Xiang Yu Nb times \u003cb\u003econsecutively\u003c/b\u003e, whereas Xiang Yu has not won Na times \u003cb\u003econsecutively\u003c/b\u003e, Liu Bang becomes the winner.\u003c/i\u003e\u003c/p\u003e\u003cp\u003eCody suggests that Na \u0026gt; 1 and Nb \u0026gt; 1, in order to enhance, to some extent, the confidence of the result of the match. Suppose in each individual game, the probability Xiang Yu would win is p, and the probability Liu Bang would win is 1 - p, which implicitly assumes that the probability of a tie is 0 (because they both refuse to draw and will fight to death). Unfortunately, this well-designed match has never taken place. Regretfully, Cody requests us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write a function\u003c/p\u003e\u003cpre\u003e                                sol = Xiangqi(p, Na, Nb)\u003c/pre\u003e\u003cp\u003ewith input: 0 \u0026lt;= p \u0026lt;= 1, Na \u0026gt; 1, Nb \u0026gt; 1, and output: sol --- the probability that Xiang Yu wins. Your solution will be tested against its true value Q (which is computed but hided in the P-file EvaluateSolution.p) according to a hybrid absolute and relative error tolerance criterion:\u003c/p\u003e\u003cpre\u003e                      abs(sol - Q) \u0026lt;= max(AbsTol, RelTol*abs(sol))\u003c/pre\u003e\u003cp\u003ewhere AbsTol and RelTol are absolute and relative error tolerances, respectively, which will be specified in the test suite. You are encouraged to optimize the performance (rather than the usual Cody size) of your code as much as possible, as the score of your solution will be measured based on the \u003cb\u003espeed\u003c/b\u003e of your code.\u003c/p\u003e\u003cp\u003eHave fun!\u003c/p\u003e","function_template":"function sol = Xiangqi(p, Na, Nb)\r\n  sol = p;\r\nend","test_suite":"%%\r\n% By courtesy of Alfonso Nieto-Castanon\r\nurlwrite('https://sites.google.com/a/alfnie.com/alfnie/software/SetSolutionScore.p?attredirects=0\u0026amp;d=1','SetSolutionScore.p');\r\nrehash path;\r\n\r\n%%\r\nfh = fopen('EvaluateSolution.p','wb');\r\nfwrite(fh, hex2dec(reshape('7630312E30307630302E3030000E601C0AF25FB100000056000000A4000000D6820EB5B30514117A9E6E5DB36898AFFFCC5086DFAF59C2910AEB07B88523DABE546868AC2BDAC3795467A7BCD91A89E2F578F2EDE92D63472A3B8FCA3F216CB3B66B010B5B924A5F514E19B90225B0978A54DA881119917D211CB055361918CAA0670F6D0E8ED17B319492619F4361BFB4C3C31D68E11F4BA084C6456783C358296B3E63E16C78EF2B0279074BCB707265EB4C044BFF7F25BA0A9678B75D36B9ACEE6853',2,[]).')); rehash path; fclose(fh); \r\n\r\n%%\r\np = 0; Na = 2; Nb = 3;\r\nAbsTol = 1e-6; RelTol = 1e-5;\r\nsol = Xiangqi(p, Na, Nb);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\n\r\n%%\r\np = 1; Na = 3; Nb = 2;\r\nAbsTol = 1e-6; RelTol = 1e-5;\r\nsol = Xiangqi(p, Na, Nb);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\n\r\n%%\r\np = 0.4; Na = 2; Nb = 3;\r\nAbsTol = 5e-4; RelTol = 5e-4;\r\nsol = Xiangqi(p, Na, Nb);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\n\r\n%%\r\np = 0.7; Na = 4; Nb = 2;\r\nAbsTol = 5e-4; RelTol = 5e-4;\r\nsol = Xiangqi(p, Na, Nb);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\n\r\n%%\r\np = 0.15; Na = 4; Nb = 2;\r\nAbsTol = 5e-5; RelTol = 1e-6;\r\nt = builtin('tic');\r\nsol = Xiangqi(p, Na, Nb);\r\nscore = builtin('toc',t);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\nSetSolutionScore(round(500*score));","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":9,"test_suite_updated_at":"2015-10-30T08:18:09.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-10-30T05:02:43.000Z","updated_at":"2025-11-30T16:38:45.000Z","published_at":"2015-10-30T05:45:36.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is the first part of the Xiangqi series. The second part in this series is:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42685-cody-meets-xiangqi-foresee-the-unseen-part-2\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody meets Xiangqi: foresee the unseen (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Xiangqi\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eXiangqi\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, also known as\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eChinese Chess\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (and 象棋 in Chinese characters), is one of the most popular board games in China. The modern Xiangqi board contains a middle section which divides two players' sides and is marked the \\\"Chu River–Han border\\\", in reference to the Chu–Han Contention between\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Xiang_Yu\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eXiang Yu\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://de.wikipedia.org/wiki/Han_Gaozu\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eLiu Bang\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, two prominent warlords and opponents who fought thousands of battles against each other for supremacy over China in the late Qin dynasty (206–202 BC). Those interested in the story of the Chu–Han Contention and its relation to Xiangqi are referred to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Chu%E2%80%93Han_Contention\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehere\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFresh to Xiangqi, Cody becomes interested in Xiangqi by raising a question:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eWho is the stronger player of Xiangqi between Xiang Yu and Liu Bang\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e? To answer this question, Cody designs a match for Xiang Yu and Liu Bang, in which Cody serves as the referee. The smart Cody referee also sets an intelligent rule to determine the winner:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eIn a succession of Xiangqi games, once Xiang Yu wins Na games\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econsecutively\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, whereas Liu Bang has not won Nb games\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econsecutively\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, Cody immediately announces Xiang Yu as the winner. Contrarily, once Liu Bang defeats Xiang Yu Nb times\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econsecutively\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, whereas Xiang Yu has not won Na times\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econsecutively\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, Liu Bang becomes the winner.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCody suggests that Na \u0026gt; 1 and Nb \u0026gt; 1, in order to enhance, to some extent, the confidence of the result of the match. Suppose in each individual game, the probability Xiang Yu would win is p, and the probability Liu Bang would win is 1 - p, which implicitly assumes that the probability of a tie is 0 (because they both refuse to draw and will fight to death). Unfortunately, this well-designed match has never taken place. Regretfully, Cody requests us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write a function\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[                                sol = Xiangqi(p, Na, Nb)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewith input: 0 \u0026lt;= p \u0026lt;= 1, Na \u0026gt; 1, Nb \u0026gt; 1, and output: sol --- the probability that Xiang Yu wins. Your solution will be tested against its true value Q (which is computed but hided in the P-file EvaluateSolution.p) according to a hybrid absolute and relative error tolerance criterion:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[                      abs(sol - Q) \u003c= max(AbsTol, RelTol*abs(sol))]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewhere AbsTol and RelTol are absolute and relative error tolerances, respectively, which will be specified in the test suite. You are encouraged to optimize the performance (rather than the usual Cody size) of your code as much as possible, as the score of your solution will be measured based on the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003espeed\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of your code.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHave fun!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44353,"title":"Group-wise Euclidean distance","description":"*Input*:\r\n \r\n* *x* —— An array of size *n-by-d*, where each row vector denotes a point in a d-dimensional space;\r\n* *g* —— A grouping (index) vector g of size *n-by-1*, which divides the points in x into groups. Specifically, the rows in x corresponding to the same group index in g belong to the same group. \r\n\r\n*Output*: \r\n\r\n* *y* —— The group-wise Euclidean distance matrix associated with the points in x. Suppose that m = max(g), then y will be an *m-by-m* matrix, where each element y(i,j) is the Euclidean distance between group i and group j, which is defined as the minimum of the Euclidean distances between any points in group i and any other points in group j. \r\n\r\n*Example*:\r\n\r\nExample 1: n = 6, d = 1\r\n\r\n  g = [2   1   3  2  1].';\r\n  x = [3  10  15  8  5].';\r\n  y = [0   2   5            % y(1,2) = y(2,1) = min(10-3,5-3,10-8,8-5) = 2\r\n       2   0   7            % y(1,3) = y(3,1) = min(15-10,15-5) = 5\r\n       5   7   0];          % y(2,3) = y(3,2) = min(15-3,15-8) = 7\r\n\r\nExample 2: n = 3, d = 2\r\n\r\n  g = [1 2 2].';\r\n  x = [0   0\r\n       5  12\r\n       3   4];\r\n  y = [0  5;\r\n       5  0];    % y(1,2) = y(2,1) = min(sqrt(5^2+12^2),sqrt(3^2+4^2)) = 5\r\n  \r\n*Testing*:\r\n\r\nThe test suite will focus mainly on the large-scale problem dimensions (e.g., large n and/or d). The purpose is to direct attention towards efficient runtime speed of execution. Note that your solution may run into a time-out error if it is not sufficiently efficient (which is why this problem falls into the \u003chttps://www.mathworks.com/matlabcentral/cody/groups/35 Cody5:Hard\u003e category).\r\n\r\n*Scoring*:\r\n\r\nWe have modified Cody's default size-based scoring function into a performance-based scoring system (implemented by our fellow Cody player \u003chttps://www.mathworks.com/matlabcentral/cody/players/3021298-ly-cao LY Cao\u003e), in which the score of your submission equals 5 times the execution time of your solution (which reprents a score resolution of 0.2 seconds and allows for more room for performance improvement). Please ignore the code size and focus only on improving the code performance, as our test suite will reject any submissions running longer than 20 seconds (in contrast to Cody's default 40 seconds timeout limit).  \r\n\r\nPlease be advised that an amazingly fast solution would earn a score \u003c 5, meaning that it completes execution of all test cases within a second!\r\n\r\n*Update* (11/21/2017):\r\nAdditional test cases are added to ban cheater solutions (e.g., hard-coded submissions 1351541, 1351007, 1350563, 1349442, all came from \u003chttps://www.mathworks.com/matlabcentral/cody/players/3931805-marco-tullio Marco Tullio\u003e).\r\n","description_html":"\u003cp\u003e\u003cb\u003eInput\u003c/b\u003e:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003ex\u003c/b\u003e —— An array of size \u003cb\u003en-by-d\u003c/b\u003e, where each row vector denotes a point in a d-dimensional space;\u003c/li\u003e\u003cli\u003e\u003cb\u003eg\u003c/b\u003e —— A grouping (index) vector g of size \u003cb\u003en-by-1\u003c/b\u003e, which divides the points in x into groups. Specifically, the rows in x corresponding to the same group index in g belong to the same group.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e\u003cb\u003eOutput\u003c/b\u003e:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003ey\u003c/b\u003e —— The group-wise Euclidean distance matrix associated with the points in x. Suppose that m = max(g), then y will be an \u003cb\u003em-by-m\u003c/b\u003e matrix, where each element y(i,j) is the Euclidean distance between group i and group j, which is defined as the minimum of the Euclidean distances between any points in group i and any other points in group j.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e:\u003c/p\u003e\u003cp\u003eExample 1: n = 6, d = 1\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eg = [2   1   3  2  1].';\r\nx = [3  10  15  8  5].';\r\ny = [0   2   5            % y(1,2) = y(2,1) = min(10-3,5-3,10-8,8-5) = 2\r\n     2   0   7            % y(1,3) = y(3,1) = min(15-10,15-5) = 5\r\n     5   7   0];          % y(2,3) = y(3,2) = min(15-3,15-8) = 7\r\n\u003c/pre\u003e\u003cp\u003eExample 2: n = 3, d = 2\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eg = [1 2 2].';\r\nx = [0   0\r\n     5  12\r\n     3   4];\r\ny = [0  5;\r\n     5  0];    % y(1,2) = y(2,1) = min(sqrt(5^2+12^2),sqrt(3^2+4^2)) = 5\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eTesting\u003c/b\u003e:\u003c/p\u003e\u003cp\u003eThe test suite will focus mainly on the large-scale problem dimensions (e.g., large n and/or d). The purpose is to direct attention towards efficient runtime speed of execution. Note that your solution may run into a time-out error if it is not sufficiently efficient (which is why this problem falls into the \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/groups/35\"\u003eCody5:Hard\u003c/a\u003e category).\u003c/p\u003e\u003cp\u003e\u003cb\u003eScoring\u003c/b\u003e:\u003c/p\u003e\u003cp\u003eWe have modified Cody's default size-based scoring function into a performance-based scoring system (implemented by our fellow Cody player \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/players/3021298-ly-cao\"\u003eLY Cao\u003c/a\u003e), in which the score of your submission equals 5 times the execution time of your solution (which reprents a score resolution of 0.2 seconds and allows for more room for performance improvement). Please ignore the code size and focus only on improving the code performance, as our test suite will reject any submissions running longer than 20 seconds (in contrast to Cody's default 40 seconds timeout limit).\u003c/p\u003e\u003cp\u003ePlease be advised that an amazingly fast solution would earn a score \u0026lt; 5, meaning that it completes execution of all test cases within a second!\u003c/p\u003e\u003cp\u003e\u003cb\u003eUpdate\u003c/b\u003e (11/21/2017):\r\nAdditional test cases are added to ban cheater solutions (e.g., hard-coded submissions 1351541, 1351007, 1350563, 1349442, all came from \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/players/3931805-marco-tullio\"\u003eMarco Tullio\u003c/a\u003e).\u003c/p\u003e","function_template":"function y = groupDist(x,g)\r\n  y = x;\r\nend","test_suite":"%%\r\nassessFunctionAbsence({'regexp','regexpi','regexprep','str2num','tic','toc','persistent','global','rng','assert','!','system','unix','noCheater'},'FileName','groupDist.m')\r\n\r\n%%\r\nfid = fopen('noCheater.p','Wb');\r\nfwrite(fid, hex2dec(reshape([\r\n    '7630312E30307630302E30300007701CAB777FB100000015000000740000007E3D5C20F'...'\r\n    '5319EEB8B0D3D9C9C87C18B91C13D7310D9D8E837C95E62D49A3FE08B071790DBC222B5'...\r\n    '839E9A19EA6AA7CF3785A7E7CEC1CFE46E0E9A5DB7C82D69A4FAB7BF308D0871C342A5F'...\r\n    'EF9AF61623F1D97F80207388D54ABA3CB3D551617DA33AA3F5040CD425FC9B29E2A4233'...\r\n    'AE7C5ADEF399'],2,[]).')); rehash path; \r\nfclose(fid); \r\nassert(noCheater(),'Cheater detected!')\r\n\r\n%%\r\ng = [2   1   3  2  1].';\r\nx = [3  10  15  8  5].';\r\ny_correct = [0   2   5            \r\n             2   0   7      \r\n             5   7   0]; \r\nassert(isequaln(y_correct,groupDist(x,g)))\r\n\r\n%%\r\ng = [1 2 2].';\r\nx = [0   0\r\n     5  12\r\n     3   4];\r\ny_correct = [0  5;\r\n             5  0];    \r\nassert(isequal(y_correct,groupDist(x,g)))\r\n\r\n%%\r\ng = [2 2 3 3 3 1].';\r\nx = [-5   12\r\n      3    4\r\n     -7  -24\r\n     25    4\r\n      9   40\r\n      0    0];\r\ny_correct = [0    5   25;\r\n             5    0   22\r\n             25  22    0];  \r\nassert(isequal(y_correct,groupDist(x,g)))\r\n\r\n%% Randomized case to disallow hard-coded solution\r\ng = randperm(10).';\r\nx = rand(10,1);\r\na = sortrows([g,x]);\r\ny_correct = abs(a(:,2)-a(:,2).');\r\nassert(isequal(round(y_correct,10),round(groupDist(x,g),10))) \r\n\r\n%% Additional test case to disallow hard-coded solution\r\ng = [1,2,3].';\r\nx = [2,5,10].';\r\ny_correct = [0   3   8            \r\n             3   0   5      \r\n             8   5   0]; \r\nassert(isequaln(y_correct,groupDist(x,g)))\r\n\r\n%%\r\nglobal t\r\nt = zeros(1,3); \r\nrng(923,'twister');\r\nn = 5e3; d = 3; m = 5;\r\nx = rand(n,d);\r\ng = randi(m,n,1); \r\ny_correct = [0,0.00653919638188362,0.00319052186150122,0.00858841434457234,0.00359654235965771\r\n             0.00653919638188362,0,0.00855286615862212,0.00589790293838067,0.00484910151004134\r\n             0.00319052186150122,0.00855286615862212,0,0.00591041083080696,0.00483607360689871\r\n             0.00858841434457234,0.00589790293838067,0.00591041083080696,0,0.00695738487959094\r\n             0.00359654235965771,0.00484910151004134,0.00483607360689871,0.00695738487959094,0];\r\ntic, y = groupDist(x,g); t(1) = toc;\r\nassert(isequal(round(y_correct,10),round(y,10))) \r\n\r\n%%\r\nglobal t\r\nrng(123) \r\nrng(max('cody5'),'combRecursive');\r\nn = 5e3; d = 3; m = 100;\r\nx = 10*rand(n,d);\r\ng = randi(m,n,1); \r\ntic, y = groupDist(x,g); t(2) = toc;\r\nassert(norm(y-y.') \u003c 1e-11 \u0026\u0026 all(~diag(y)) \u0026\u0026 all(size(y)==m) \u0026\u0026 abs(det(y)-0.030846735888559)\u003c1e-8 \u0026\u0026...\r\n    abs(cond(y)-1.606720826682107e+04) \u003c 1e-6 \u0026\u0026 abs(max(nonzeros(y))-1.058563379304832)\u003c1e-10 \u0026\u0026...\r\n    abs(mean(nonzeros(y))-0.419901913602729)\u003c1e-8)\r\n\r\n%%\r\nglobal t \r\nrng(sum('Cody5, Oct. 16, 2017'),'multFibonacci') \r\nn = 5e3; d = 1e2;  m = 100;\r\nx = 5*randn(n,d) + 20;\r\ng = randi(m,n,1); \r\ntic, y = groupDist(x,g); t(3) = toc;\r\nassert(norm(y-y.') \u003c 1e-11 \u0026\u0026 all(~diag(y)) \u0026\u0026 all(size(y)==m) \u0026\u0026 ...\r\n    abs(cond(y)-2.024633860688276e+02) \u003c 1e-8 \u0026\u0026 abs(max(nonzeros(y))-57.768463869822135)\u003c1e-10 \u0026\u0026...\r\n    abs(mean(nonzeros(y))-53.852605466762945)\u003c1e-8) \r\n \r\n%%\r\nglobal t\r\nfid = fopen('score.p','Wb');\r\nfwrite(fid,uint8(sscanf([...\r\n     '7630312E30307630302E3030000B901C454EFFB100000031000001330000018D483A60'...\r\n     '366BC9545F84AE26323B67424D4E8A7A2E5B7D8ACAA45A1C3C5C8B33E245C95243E3CB'...\r\n     'AF5D0D993BDA70B7AB5DA365A83E8CA87FFC45265E23EF80943784C5F48E6E53D5DA34'...\r\n     'F1F2ECD34683EABE3B7461DC9E8004CC50B2A79D73495F6F625B5365602B2E6C6093D2'...\r\n     '997D371DA457CE82327E686AF512A507B2CB62A375BFD1B283DDD2C01EDEF2771EDAA3'...\r\n     '6ABB4852BA4061E20149688E812EB41A9AF8627EF35755492D2830EB8718BCFE88027E'...\r\n     '6EA960B63A3B3E26E0451B1DCF14F3C20E70D9D93B08E7FF4AE8D82E7CC38042FD38F7'...\r\n     'A14D312EF5652823FEB7E8B52AF5C69F5E7D16B116B5F979EDA77459D6BB61B7971A51'...\r\n     '041227DD601319D667DF62E8DA5E381FDD07A2806FE835BD2569E5315CDFC19C6B6A2B'...\r\n     '4F0FF6BA803F1759ACAB133CCFAB6D5A5D002FC2C5F381F0'],'%2X')));\r\nfclose(fid);\r\nscore(round(5*sum(t)))\r\nfprintf('The execution time of test case %d is %.5f seconds \\n',[5:7;t])\r\nfprintf('The total execution time is %.5f seconds \\n',sum(t))\r\nassert(sum(t)\u003c20, 'Sorry, your solution is too slow. The execution time must not exceed 20 seconds.')\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":4,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":75,"test_suite_updated_at":"2017-11-21T22:49:00.000Z","rescore_all_solutions":false,"group_id":35,"created_at":"2017-10-01T04:33:43.000Z","updated_at":"2026-02-03T09:16:35.000Z","published_at":"2017-10-16T01:51:00.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\u003eInput\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e —— An array 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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en-by-d\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, where each row vector denotes a point in a d-dimensional space;\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eg\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e —— A grouping (index) vector g 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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en-by-1\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, which divides the points in x into groups. Specifically, the rows in x corresponding to the same group index in g belong to the same group.\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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e —— The group-wise Euclidean distance matrix associated with the points in x. Suppose that m = max(g), then y will be 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\u003em-by-m\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e matrix, where each element y(i,j) is the Euclidean distance between group i and group j, which is defined as the minimum of the Euclidean distances between any points in group i and any other points in group j.\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\u003cw:r\u003e\u003cw:t\u003e:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample 1: n = 6, d = 1\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[g = [2   1   3  2  1].';\\nx = [3  10  15  8  5].';\\ny = [0   2   5            % y(1,2) = y(2,1) = min(10-3,5-3,10-8,8-5) = 2\\n     2   0   7            % y(1,3) = y(3,1) = min(15-10,15-5) = 5\\n     5   7   0];          % y(2,3) = y(3,2) = min(15-3,15-8) = 7]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample 2: n = 3, d = 2\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[g = [1 2 2].';\\nx = [0   0\\n     5  12\\n     3   4];\\ny = [0  5;\\n     5  0];    % y(1,2) = y(2,1) = min(sqrt(5^2+12^2),sqrt(3^2+4^2)) = 5]]\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\u003eTesting\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe test suite will focus mainly on the large-scale problem dimensions (e.g., large n and/or d). The purpose is to direct attention towards efficient runtime speed of execution. Note that your solution may run into a time-out error if it is not sufficiently efficient (which is why this problem falls into 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://www.mathworks.com/matlabcentral/cody/groups/35\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody5:Hard\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e category).\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\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\u003eWe have modified Cody's default size-based scoring function into a performance-based scoring system (implemented by our fellow Cody player\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/players/3021298-ly-cao\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eLY Cao\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e), in which the score of your submission equals 5 times the execution time of your solution (which reprents a score resolution of 0.2 seconds and allows for more room for performance improvement). Please ignore the code size and focus only on improving the code performance, as our test suite will reject any submissions running longer than 20 seconds (in contrast to Cody's default 40 seconds timeout limit).\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\u003ePlease be advised that an amazingly fast solution would earn a score \u0026lt; 5, meaning that it completes execution of all test cases within a second!\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\u003eUpdate\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (11/21/2017): Additional test cases are added to ban cheater solutions (e.g., hard-coded submissions 1351541, 1351007, 1350563, 1349442, all came from\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/players/3931805-marco-tullio\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMarco Tullio\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\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":44356,"title":"Code breaker, Part II:  Operation Orthos","description":"You have been tasked with decoding several batches of coded messages that have been intercepted.  \r\n\r\nBased on previous intelligence that has been gathered, you can be confident that the messages were all encoded using a simple \u003chttps://en.wikipedia.org/wiki/Caesar_cipher Caesar cipher\u003e (a type of \u003chttps://en.wikipedia.org/wiki/Substitution_cipher substitution cipher\u003e), an example of which is the \u003chttps://en.wikipedia.org/wiki/ROT13 ROT13 cipher\u003e (discussed in \u003chttps://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher Cody Challenge Problem 78\u003e).  As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation \u0026 numbers) are unchanged.  Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and may vary between batches of messages — although it will be the same for all messages in a batch (also, here you need to decode, not encode).  \r\n\r\nYou can also assume that the original batch of messages will relate to an activity that is referred to by those involved as \"Operation Orthos\". However, in their secret internal communications they might not use this exact phrase at all, nor this exact capitalisation.  Therefore you should seek _simultaneous_ occurrence of the separate words \"Operation\" and \"Orthos\" (with any capitalisation) in messages within the given batch.  \r\n\r\nYour task is to crack the codes and report back in a \u003chttp://au.mathworks.com/help/matlab/ref/struct.html structure array\u003e:  (1) the shifting parameter that had been used in the encoding [as \u003chttp://au.mathworks.com/help/matlab/ref/uint8.html uint8\u003e];  (2)  the decoded messages [as a \u003chttp://au.mathworks.com/help/matlab/ref/cell.html?s_tid=doc_ta cell array\u003e (containing \u003chttp://au.mathworks.com/help/matlab/ref/char.html character arrays\u003e)].  \r\nThe name of the structure array shall be \"s\", with respective fields \"shift\" and \"message\".  \r\n\r\nEXAMPLE\r\n\r\nSuppose the batch contained two encoded messages — _\"qspdffe x/ pqfsbujpo\"_ and _\"Psuipt jt HP!\"_ (provided as character arrays within a cell array) — and a (right-shifting) ROT1 cipher had been applied.  In that case A→B, B→C, ..., Y→Z, and Z→A;  similarly, a→b, b→c, ..., y→z, and z→a.  (Note that the shifting 'wraps' back around.)  \r\nThus the original messages would have been:  _\"proceed w/ operation\"_ and _\"Orthos is GO!\"_ .\r\n\r\nThe correct answer would comprise:  \r\n\r\n  s.shift = uint8(1)  \r\n  s.message = {'proceed w/ operation', 'Orthos is GO!'}\r\n\r\nIf the batch of messages cannot be decoded when following the above assumptions, then simply return 'scalar' \u003chttp://au.mathworks.com/help/matlab/ref/nan.html NaN\u003e in both fields (no need for a cell array).  \r\n\r\n|Note:  Many Cody solutions are hard to read and not necessarily computationally efficient.  To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable).  Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand. (Try resubmitting on another day if your code runs slowly, in case it is caused by a server issue.)|  \r\n\r\nTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \"too slow\".  \r\n\r\n----------\r\n\r\nPrevious problem:  \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44351 Operation Phoenix\u003e.  Next problem:  \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44383 Operation Xiangliu\u003e.","description_html":"\u003cp\u003eYou have been tasked with decoding several batches of coded messages that have been intercepted.\u003c/p\u003e\u003cp\u003eBased on previous intelligence that has been gathered, you can be confident that the messages were all encoded using a simple \u003ca href = \"https://en.wikipedia.org/wiki/Caesar_cipher\"\u003eCaesar cipher\u003c/a\u003e (a type of \u003ca href = \"https://en.wikipedia.org/wiki/Substitution_cipher\"\u003esubstitution cipher\u003c/a\u003e), an example of which is the \u003ca href = \"https://en.wikipedia.org/wiki/ROT13\"\u003eROT13 cipher\u003c/a\u003e (discussed in \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher\"\u003eCody Challenge Problem 78\u003c/a\u003e).  As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation \u0026 numbers) are unchanged.  Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and may vary between batches of messages — although it will be the same for all messages in a batch (also, here you need to decode, not encode).\u003c/p\u003e\u003cp\u003eYou can also assume that the original batch of messages will relate to an activity that is referred to by those involved as \"Operation Orthos\". However, in their secret internal communications they might not use this exact phrase at all, nor this exact capitalisation.  Therefore you should seek \u003ci\u003esimultaneous\u003c/i\u003e occurrence of the separate words \"Operation\" and \"Orthos\" (with any capitalisation) in messages within the given batch.\u003c/p\u003e\u003cp\u003eYour task is to crack the codes and report back in a \u003ca href = \"http://au.mathworks.com/help/matlab/ref/struct.html\"\u003estructure array\u003c/a\u003e:  (1) the shifting parameter that had been used in the encoding [as \u003ca href = \"http://au.mathworks.com/help/matlab/ref/uint8.html\"\u003euint8\u003c/a\u003e];  (2)  the decoded messages [as a \u003ca href = \"http://au.mathworks.com/help/matlab/ref/cell.html?s_tid=doc_ta\"\u003ecell array\u003c/a\u003e (containing \u003ca href = \"http://au.mathworks.com/help/matlab/ref/char.html\"\u003echaracter arrays\u003c/a\u003e)].  \r\nThe name of the structure array shall be \"s\", with respective fields \"shift\" and \"message\".\u003c/p\u003e\u003cp\u003eEXAMPLE\u003c/p\u003e\u003cp\u003eSuppose the batch contained two encoded messages — \u003ci\u003e\"qspdffe x/ pqfsbujpo\"\u003c/i\u003e and \u003ci\u003e\"Psuipt jt HP!\"\u003c/i\u003e (provided as character arrays within a cell array) — and a (right-shifting) ROT1 cipher had been applied.  In that case A→B, B→C, ..., Y→Z, and Z→A;  similarly, a→b, b→c, ..., y→z, and z→a.  (Note that the shifting 'wraps' back around.)  \r\nThus the original messages would have been:  \u003ci\u003e\"proceed w/ operation\"\u003c/i\u003e and \u003ci\u003e\"Orthos is GO!\"\u003c/i\u003e .\u003c/p\u003e\u003cp\u003eThe correct answer would comprise:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003es.shift = uint8(1)  \r\ns.message = {'proceed w/ operation', 'Orthos is GO!'}\r\n\u003c/pre\u003e\u003cp\u003eIf the batch of messages cannot be decoded when following the above assumptions, then simply return 'scalar' \u003ca href = \"http://au.mathworks.com/help/matlab/ref/nan.html\"\u003eNaN\u003c/a\u003e in both fields (no need for a cell array).\u003c/p\u003e\u003cp\u003e\u003ctt\u003eNote:  Many Cody solutions are hard to read and not necessarily computationally efficient.  To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable).  Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand. (Try resubmitting on another day if your code runs slowly, in case it is caused by a server issue.)\u003c/tt\u003e\u003c/p\u003e\u003cp\u003eTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \"too slow\".\u003c/p\u003e\u003cp\u003e----------\u003c/p\u003e\u003cp\u003ePrevious problem:  \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44351\"\u003eOperation Phoenix\u003c/a\u003e.  Next problem:  \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44383\"\u003eOperation Xiangliu\u003c/a\u003e.\u003c/p\u003e","function_template":"function s = decode(x)\r\n  s = x;\r\nend","test_suite":"%% NOTE:  \r\n% This test suite can be updated if inappropriate 'hacks' \r\n% are discovered in any submitted solutions, \r\n% so the assessment of your submission may therefore change over time.  \r\nRE = regexp(fileread('decode.m'), '\\w+', 'match');\r\ntabooWords = {'ans', 'assert', 'freepass', 'tic'};\r\ntestResult = cellfun( @(z) ismember(z, tabooWords), RE );\r\nmsg = ['Please do not do that in your code!' char([10 13]) ...\r\n    'Found: ' strjoin(RE(testResult)) '.' char([10 13]) ...\r\n    'Banned word.' char([10 13])];\r\nassert(~any(  cellfun( @(z) ismember(z, tabooWords), RE )  ), msg)\r\n\r\n\r\n%% Test 1\r\nx =                 {'qspdffe x/ pqfsbujpo', 'Psuipt jt HP!'};\r\ns_correct.shift = uint8(1);\r\ns_correct.message = {'proceed w/ operation', 'Orthos is GO!'};\r\ns = decode(x);\r\n%disp(' *** ');  disp(s.message);  disp(' *** ')\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message{1}, s_correct.message{1}) )\r\nassert( isequal(s.message{2}, s_correct.message{2}) )\r\nassert( isequal(s.message, s_correct.message) )\r\nassert( isequal(s, s_correct) )\r\nassert( isequal(class(s.shift), 'uint8') )\r\nassert( isequal(class(s.message), 'cell') )\r\nassert( isequal(class(s.message{1}), 'char') )\r\n\r\n\r\n%% Test 2\r\nx =                 {'Hfqq Ons ts 555-7839 FXFU.', 'twymtx nx ts mtqi', 'bfnynsl ktw dtzw fianhj', 'TUJWFYNTS UTXYUTSJI'};\r\ns_correct.shift = uint8(5);\r\ns_correct.message = {'Call Jin on 555-7839 ASAP.', 'orthos is on hold', 'waiting for your advice', 'OPERATION POSTPONED'};\r\ns = decode(x);\r\n%disp(' *** ');  disp(s.message);  disp(' *** ')\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\n\r\n\r\n%% Test 3\r\nx =                 {'Ocz kvnnrjmy rvn xcvibzy: \"Knpdko\" oj \"Gjlzgk\".', 'Jkzmvodji Kcjzids rvn npxxznnapg. Izso rdgg wz Jmocjn.', 'Edi Uvkxgzout rdgg wz gzvydib Ozvh V'};\r\ns_correct.shift = uint8(21);\r\ns_correct.message = {'The password was changed: \"Psuipt\" to \"Loqelp\".', 'Operation Phoenix was successful. Next will be Orthos.', 'Jin Zapcletzy will be leading Team A'};\r\ns = decode(x);\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\n\r\n\r\n%% Test 4\r\nx =                 {'bxmzzuzs r/ adftae az fdmow', 'adftae etxp oaybxqfq uz 2 iwe', 'abqdmfuaz pmfq eturfqp nmow 2 p.', 'naawe dqoquhqp. fwe Vuz' };\r\ns_correct.shift = uint8(12);\r\ns_correct.message = {'planning f/ orthos on track', 'orthos shld complete in 2 wks', 'operation date shifted back 2 d.', 'books received. tks Jin'};\r\ns = decode(x);\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\n\r\n\r\n%% Test 5\r\nx =                 {'Hdsffafy xgj Ghwjslagf Gjlzgk zsk gxxauasddq ugeewfuwv.  Lzak oadd tw dwv tq Lwse S, kmhhgjlwv tq Lwse T sk fwwvwv.'};\r\ns_correct.shift = uint8(18);\r\ns_correct.message = {'Planning for Operation Orthos has officially commenced.  This will be led by Team A, supported by Team B as needed.'};\r\ns = decode(x);\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\n\r\n\r\n%% Test 6\r\nx = {'Mncpyrgml Nfmclgv qryprcb rfpcc bywq yem.  Yjj ncpqmllcj ypc rm pckygl ml bsrw slrgj Mncpyrgml Nfmclgv gq amknjcrcb.'};\r\ns_correct.shift = nan;\r\ns_correct.message = nan;\r\ns = decode(x);\r\nassert( isnan(s.shift) )\r\nassert( isnan(s.message) )\r\n\r\n\r\n%% Test 7\r\nx =                 {'Iutloxskj vgyycuxj oy tuc \"Ruwkrv\".', 'Vrgt lux uxznuy ruuqy UQ, haz tkkj suxk $$$', 'Ksgor Pot Fgvirkzfe ut xacqxb@sgzncuxqy.ius xk. Zakyjge', 'Zgrqkj zu Zkgs H.  Ngvve zu yavvuxz uvkxgzout....', 'Xk. latjy, vry zxgtylkx zu giiuatz \"YZOBKDSYX\" - ZDY', 'jUT''Z cUXXE'};\r\ns_correct.shift = uint8(6);\r\ns_correct.message = {'Confirmed password is now \"Loqelp\".', 'Plan for orthos looks OK, but need more $$$', 'Email Jin Zapcletzy on ruwkrv@mathworks.com re. Tuesday', 'Talked to Team B.  Happy to support operation....', 'Re. funds, pls transfer to account \"STIVEXMSR\" - TXS', 'dON''T wORRY'};\r\ns = decode(x);\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\n\r\n\r\n%% TIMING \r\n% Note:  The Time Trial section does not check accuracy; that is done above.\r\n\r\n% Acknowledgements  \r\n% Portions of this timing test code were inspired by:\r\n% (1) Problem 937. \"Rubik's Mini Cube: Solve Randomized Cube in 11 Moves or Less; Score is by Time (msec)\" by Richard Zapor.\r\n% (2) Problem 2733. \"Evil Number\" by Jan Orwat.\r\n% (3) Feedback in comments from Peng Liu.\r\n% (4) Problem Problem 1237. \"It's race time! Write a faster function than the test suite call of unique().\" by Jeremy.\r\n\r\n% INITIALISE\r\nx = {'qspdffe x/ pqfsbujpo', 'Psuipt jt HP!'};\r\nqSmall = 50;\r\nqBig = 10000;\r\n%cutoffTimeBig = 10;\r\n\r\n% EDIT (2018-06-17).  Reduced time to pose reasonable challenge.\r\n% Accounted for improving Cody server speed per Problem 44655.\r\ncutoffTimeBig = 3;    % Maximum allowable walltime (in seconds) to run function in a loop with qBig iterations.\r\ntRef = datetime('2018-06-17', 'InputFormat','yyyy-MM-dd');\r\ntNow = datetime('now');\r\nyearsElapsed = (datenum(tNow) - datenum(tRef)) / 365.24;\r\nfprintf('\\r\\n\\r\\n\\r\\nSubmission evaluated for speed on %s.\\r\\n', datestr(tNow, 'dd mmmm yyyy'))\r\nrInf = 0.2;   delta = cutoffTimeBig - rInf;  tau = 3.6;  % Data from Problem 44655, based on Problem 963.\r\nqBig = floor( qBig * (cutoffTimeBig - rInf) * exp(yearsElapsed/tau) / delta );\r\nfprintf('\\r\\n\\r\\n\\r\\nTo account for computational power increases over time, number of iterations increased to %u.\\r\\n', qBig)\r\n% END EDIT (2018-06-17)\r\n\r\nfor dummy = 1 : 10,  disp(' . ');  end;\r\n\r\n% *** PRELIMINARY TIMING WITH timeit ***\r\nfDecode = @()   decode(x);\r\ndt_timeit = timeit( fDecode );\r\nfprintf('APPROXIMATE time to decode %u message batches ~ %2.2f seconds, according to ''timeit''.\\n\\r', qBig, dt_timeit * qBig)\r\n\r\n% *** PRELIMINARY TIMING WITH SHORT LOOP ***\r\n% In case the submitted function has a lot of text output, \r\n% get an estimate based on just a few iterations\r\n% Initialise\r\nt0 = clock;\r\n\r\n% Loop\r\nfor i = 1 : qSmall\r\n    solution = decode( x );\r\nend;\r\n\r\n% Compute and display elapsed time.\r\ndt = etime(clock, t0);\r\ndisp('     -----=====-----     ')\r\n%fprintf('Your wall time to decode %u message batches = %i seconds.\\n\\r', qSmall, floor(dt))\r\nfprintf('APPROXIMATE wall time to decode %u message batches ~ %2.2f seconds, by extrapolating from %u batches.\\n\\r', qBig, dt * qBig / qSmall, qSmall)\r\ndisp('     -----=====-----     ')\r\n\r\n% *** 'OFFICIAL' TIMING ***\r\n% Re-initialise timer\r\nt0 = clock;\r\nt0_cpu = cputime;\r\n\r\n% Loop\r\nfor i = 1 : qBig\r\n    solution = decode( x );\r\nend;\r\n\r\n% Compute and display elapsed time.\r\nfor dummy = 1 : 10,  disp(' . ');  end;\r\ndisp('     -----=====|||||=====-----     ')\r\ndt = etime(clock, t0);\r\nfprintf('Your wall time to decode %u message batches = %2.2f seconds.\\n\\r', qBig, dt)\r\n\r\ndt_cpu = (cputime - t0_cpu);\r\nfprintf(' ( Your CPU time for this = %2.2f seconds. ) \\n\\r', dt_cpu)\r\n\r\n% Display (default) Cody size-based score.\r\nall_nodes = mtree('decode.m', '-file');\r\nsize_score = count(all_nodes);\r\nfprintf('Your Cody-standard size-based score = %i.\\n\\r', size_score)\r\n\r\n% Report revised performance score\r\ncombinedScore = size_score + round(dt * 10);\r\nfprintf('Your combined score = %i.\\n\\r', combinedScore)\r\ndisp('     -----=====|||||=====-----     ')\r\n\r\n% Now disallow any candidate solutions that are TOO SLOW!\r\nif dt \u003e cutoffTimeBig, \r\n    fprintf('Sorry, your submission is TOO SLOW.  It must be able to finish within %u seconds.\\n\\r', cutoffTimeBig)\r\nend;\r\n\r\nassert( dt \u003c= cutoffTimeBig )","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":29,"test_suite_updated_at":"2018-06-17T14:03:55.000Z","rescore_all_solutions":false,"group_id":40,"created_at":"2017-10-03T06:52:32.000Z","updated_at":"2026-04-02T18:15:25.000Z","published_at":"2017-10-03T11:50:21.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\u003eYou have been tasked with decoding several batches of coded messages that have been intercepted.\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\u003eBased on previous intelligence that has been gathered, you can be confident that the messages were all encoded using a simple\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/Caesar_cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCaesar cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (a type 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=\\\"https://en.wikipedia.org/wiki/Substitution_cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003esubstitution cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e), an example of which is 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/ROT13\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eROT13 cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (discussed 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://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Challenge Problem 78\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e). As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation \u0026amp; numbers) are unchanged. Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and may vary between batches of messages — although it will be the same for all messages in a batch (also, here you need to decode, not encode).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou can also assume that the original batch of messages will relate to an activity that is referred to by those involved as \\\"Operation Orthos\\\". However, in their secret internal communications they might not use this exact phrase at all, nor this exact capitalisation. Therefore you should seek\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\u003esimultaneous\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e occurrence of the separate words \\\"Operation\\\" and \\\"Orthos\\\" (with any capitalisation) in messages within the given batch.\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\u003eYour task is to crack the codes and report back in a\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://au.mathworks.com/help/matlab/ref/struct.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003estructure array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e: (1) the shifting parameter that had been used in the encoding [as\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://au.mathworks.com/help/matlab/ref/uint8.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003euint8\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e]; (2) the decoded messages [as a\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://au.mathworks.com/help/matlab/ref/cell.html?s_tid=doc_ta\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecell array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (containing\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://au.mathworks.com/help/matlab/ref/char.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003echaracter arrays\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e)]. The name of the structure array shall be \\\"s\\\", with respective fields \\\"shift\\\" and \\\"message\\\".\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEXAMPLE\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSuppose the batch contained two encoded messages —\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\\\"qspdffe x/ pqfsbujpo\\\"\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\u003e\\\"Psuipt jt HP!\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (provided as character arrays within a cell array) — and a (right-shifting) ROT1 cipher had been applied. In that case A→B, B→C, ..., Y→Z, and Z→A; similarly, a→b, b→c, ..., y→z, and z→a. (Note that the shifting 'wraps' back around.) Thus the original messages would have been: \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\\\"proceed w/ operation\\\"\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\u003e\\\"Orthos is GO!\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e .\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe correct answer would comprise:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[s.shift = uint8(1)  \\ns.message = {'proceed w/ operation', 'Orthos is GO!'}]]\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\u003eIf the batch of messages cannot be decoded when following the above assumptions, then simply return 'scalar'\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://au.mathworks.com/help/matlab/ref/nan.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eNaN\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e in both fields (no need for a cell array).\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eNote: Many Cody solutions are hard to read and not necessarily computationally efficient. To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable). Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand. (Try resubmitting on another day if your code runs slowly, in case it is caused by a server issue.)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \\\"too slow\\\".\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----------\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\u003ePrevious problem: \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44351\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOperation Phoenix\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. Next problem: \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44383\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOperation Xiangliu\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\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":52664,"title":"List the Moran numbers","description":"The quotient of a Moran number and its digit sum is prime. For example, 117 and 481 are Moran numbers because 117/(1+1+7) is 13 and 481/(4+8+1) = 37, and both 13 and 37 are prime. \r\nWrite a function to list the Moran numbers less than or equal to the input number. ","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 72px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 36px; transform-origin: 407px 36px; 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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 363px 8px; transform-origin: 363px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe quotient of a Moran number and its digit sum is prime. For example, 117 and 481 are Moran numbers because 117/(1+1+7) is 13 and 481/(4+8+1) = 37, and both 13 and 37 are prime. \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: 257px 8px; transform-origin: 257px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to list the Moran numbers less than or equal to the input number. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = Moran(n)\r\n  y = f(n);\r\nend","test_suite":"%%\r\nn = 500;\r\ny = Moran(n);\r\ny_correct = [18 21 27 42 45 63 84 111 114 117 133 152 153 156 171 190 195 198 201 207 209 222 228 247 261 266 285 333 370 372 399 402 407 423 444 465 481];\r\nassert(isequal(y,y_correct))\r\n\r\n%% \r\nn = 40332;\r\ny = Moran(n);\r\ny23_correct = [207 1679 3749 4577 8717 14099 18653 19067 22793 24449 25691 26519 26933 29417 29831 32729 33557 35627 37283];\r\nassert(isequal(y(mod(y,23)==0),y23_correct) \u0026\u0026 isequal(y(end),n))\r\n\r\n%%\r\nn = [100000 400000 700000 1e6 4e6 7e6 1e7];\r\ns = [383 1193 1870 2451 8080 12913 17271];\r\nlen_correct = [1915 5967 9352 12259 40403 64567 86356];\r\nsum_correct = [79699686 1044807776 2880495403 5339917218 73480226594 205122929098 389309242207];\r\nsd_correct  = [2.925215086021406e+04 1.171076738381341e+05 2.065163622127620e+05 2.944277010513903e+05 1.177431499460555e+06 2.057551640570258e+06 2.933705654924581e+06];\r\nys_correct  = [11354 28489 48992 71660 99972; 51489 125203 210051 300165 399477; 96325 220734 364473 524186 699739; 129627 308214 513837 741778 999219; 579189 1331117 2176042 3062214 3999644; 1046322 2330397 3782883 5322552 6999255; 1440693 3292137 5341677 7565613 9999882];\r\nfor k = 1:length(n)\r\n    disp(['Test 3.' num2str(k)])\r\n    y = Moran(n(k));\r\n    assert(isequal(length(y),len_correct(k)) \u0026\u0026 isequal(sum(y),sum_correct(k)) \u0026\u0026 abs(std(y)-sd_correct(k))\u003c1e-7 \u0026\u0026 isequal(y(s(k):s(k):end),ys_correct(k,:)));\r\nend\r\n\r\n%%\r\nfiletext = fileread('Moran.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'regexp') || contains(filetext, 'oeis') || contains(filetext, 'persistent'); \r\nassert(~illegal)","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":22,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-09-05T13:52:35.000Z","updated_at":"2025-12-15T19:21:34.000Z","published_at":"2021-09-05T14:10:51.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe quotient of a Moran number and its digit sum is prime. For example, 117 and 481 are Moran numbers because 117/(1+1+7) is 13 and 481/(4+8+1) = 37, and both 13 and 37 are prime. \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 list the Moran numbers less than or equal to the input number. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":1237,"title":"It's race time! Write a faster function than the test suite call of unique().","description":"Write a function to get unique elements of a vector faster than unique()! Input will be a vector (of integers or floating point numbers) of any size. The order of the returned vector is unimportant. \r\n\r\nExample:\r\nInput: x = [1 1 2 2 3 3];\r\nOutput: [1 2 3];\r\n\r\nInput: x = [0.1 3.1 2.1 2.0 3.1];\r\nOutput: [0.1 3.1 2.1 2.0]; % or any order","description_html":"\u003cp\u003eWrite a function to get unique elements of a vector faster than unique()! Input will be a vector (of integers or floating point numbers) of any size. The order of the returned vector is unimportant.\u003c/p\u003e\u003cp\u003eExample:\r\nInput: x = [1 1 2 2 3 3];\r\nOutput: [1 2 3];\u003c/p\u003e\u003cp\u003eInput: x = [0.1 3.1 2.1 2.0 3.1];\r\nOutput: [0.1 3.1 2.1 2.0]; % or any order\u003c/p\u003e","function_template":"function y = my_unique(x)\r\n   y = x;\r\nend","test_suite":"%%\r\nx = rand(10000, 1);\r\nz = rand(10000, 1);\r\nx = vertcat(x, z);\r\ntic\r\ny_correct = unique(x);\r\nt_unique = toc\r\n\r\ntic\r\ny_myunique = my_unique(x);\r\nt_myunique = toc\r\n\r\nassert(isequal(sort(my_unique(x)),y_correct) \u0026\u0026 t_unique \u003e t_myunique)\r\n\r\n%%\r\nx = rand(50000, 1);\r\nz = rand(50000, 1);\r\nx = vertcat(x, z);\r\n\r\ntic\r\ny_correct = unique(x);\r\nt_unique = toc\r\n\r\ntic\r\ny_my_unique = my_unique(x);\r\nt_my_unique = toc\r\n\r\nassert(isequal(sort(my_unique(x)),y_correct) \u0026\u0026 t_unique \u003e t_my_unique)\r\n\r\n%%\r\nx = [1; 2; 3; 4; 2; 3; 4; 5;];\r\n\r\ntic\r\ny_correct = unique(x);\r\nt_unique = toc\r\n\r\ntic\r\ny_my_unique = my_unique(x);\r\nt_my_unique = toc\r\n\r\nassert(isequal(sort(my_unique(x)),y_correct) \u0026\u0026 t_unique \u003e t_my_unique)\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":9,"created_by":10338,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":31,"test_suite_updated_at":"2013-02-03T20:33:40.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-02-01T03:36:13.000Z","updated_at":"2025-09-07T01:43:50.000Z","published_at":"2013-02-01T03:36:13.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function to get unique elements of a vector faster than unique()! Input will be a vector (of integers or floating point numbers) of any size. The order of the returned vector is unimportant.\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: Input: x = [1 1 2 2 3 3]; Output: [1 2 3];\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\u003eInput: x = [0.1 3.1 2.1 2.0 3.1]; Output: [0.1 3.1 2.1 2.0]; % or any order\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":44383,"title":"Code breaker, Part III:  Operation Xiangliu","description":"You have been tasked with decoding several batches of coded messages that have been intercepted.  \r\n\r\nBased on previous intelligence that has been gathered, you can be confident that the messages were all encoded using a simple \u003chttps://en.wikipedia.org/wiki/Caesar_cipher Caesar cipher\u003e (a type of \u003chttps://en.wikipedia.org/wiki/Substitution_cipher substitution cipher\u003e), an example of which is the \u003chttps://en.wikipedia.org/wiki/ROT13 ROT13 cipher\u003e (discussed in \u003chttps://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher Cody Challenge Problem 78\u003e).  As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation, numbers, accented letters) are unchanged.  Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and will vary _between_ (not within) batches — also, here you need to decode, not encode.  \r\n\r\nThese latest activities that you are investigating have been nicknamed 'Operation Xiangliu' by your own organisation.  A few decoding options are at your organisation's disposal:  \r\n\r\n# Test the candidate decodings against all words in a large dictionary — this could work, but it is very slow.\r\n# Test the candidate decodings for the appearance of a name or phrase that is certain to appear regularly (e.g. \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44351 \"Operation Phoenix\"\u003e) — unfortunately as yet there is not enough knowledge of the activities to be sure of a suitable name or phrase to use.  \r\n# Test the candidate decodings against all words in a short list comprising, say, the hundred most frequently used English words.\r\n\r\nThe *third option* will be faster than the first option, and more reliable than the second option, so this is the approach you will be taking.  \r\n\r\nYou have been careful to avoid using 'lemmatised' lists (which contain e.g. the verb \"to be\", rather than the various inflected forms such as \"am\", \"is\", \"are\") like those based on the \u003chttps://web.archive.org/web/20111226085859/http://oxforddictionaries.com/words/the-oec-facts-about-the-language OEC\u003e or \u003chttps://www.wordfrequency.info/free.asp?s=y COCA\u003e, and after setting aside \u003chttp://world-english.org/english500.htm another list\u003e you finally choose the \u003chttp://ucrel.lancs.ac.uk/bncfreq/samples/120.pdf list based on the BNC\u003e as the most reliable, and will use the first 100 words on that list.  \r\nThis list will be available for you to access as an input variable, |bncWordlist|, to your function. Note: (i) some entries on the list are morphemes (e.g. \"\u0026#x200A;n't\u0026#x200A;\" and \"\u0026#x200A;'s\u0026#x200A;\") rather than words;  (ii) some entries appear more than once (representing different grammatical word classes).  Of course, in the original messages any capitalisation might be used.  \r\n\r\nYou have been instructed that your 'certitude' (degree of confidence) in the decoding must be reported for each batch, and shall depend proportionally upon the sum of the characters for the words/morphemes in the decoded message that match words/morphemes in |bncWordlist|.  Being able to match words/morphemes accounting for three-tenths of the characters (excluding spaces) shall correspond to 100% certitude;  matching three-twentieths would be 50% certitude, and so on.  Certitude shall be reported as a percentage, rounded _up_ to the nearest integer, not greater than 100.  You need to maximise your certitude for each batch by appropriate choice of the shifting parameter.   If there are multiple shifts of equal certitude, report both options on different rows (arranged in order of ascending shift parameter).\r\n\r\nYour task is to crack the codes and report back in a \u003chttp://au.mathworks.com/help/matlab/ref/struct.html structure array\u003e: \u0026nbsp; (1) the shifting parameter that had been used in the encoding [as \u003chttp://au.mathworks.com/help/matlab/ref/uint8.html uint8\u003e] (usually scalar, but may be column vector); \u0026nbsp; (2) the decoded messages [as a \u003chttp://au.mathworks.com/help/matlab/ref/cell.html?s_tid=doc_ta cell array\u003e (containing \u003chttp://au.mathworks.com/help/matlab/ref/char.html character arrays\u003e)] (usually an array with a single row, but occasionally with multiple rows); \u0026nbsp; (3) your 'certitude' in the decoding [as \u003chttp://au.mathworks.com/help/matlab/ref/uint8.html uint8\u003e] (always scalar).  \r\nThe name of the structure array shall be |s|, with respective fields |shift|, |message|, and |certitude|.  \r\n\r\n*EXAMPLE 1*\r\n\r\nSuppose the batch contained two encoded messages — _\"Vomftt qvstvfe, pqfo op eppst.\"_ and _\"Ffmt dbo ljmm, opu pomz xpvoe.\"_ (provided as character arrays within a cell array) — and a (right-shifting) ROT1 cipher had been applied.  In that case A→B, B→C, ..., Y→Z, and Z→A;  similarly, a→b, b→c, ..., y→z, and z→a.  \r\nThus the original messages would have been:  _\"Unless pursued, open no doors.\"_ and _\"Eels can kill, not only wound.\"_ .  Twelve of the 51 characters have been matched:  \"no\", \"can\", \"not\", and \"only\".  \r\n\r\nThe correct answer would therefore comprise:  \r\n\r\n  s.shift = uint8(1)  \r\n  s.message = {'Unless pursued, open no doors.', 'Eels can kill, not only wound.'}\r\n  s.certitude = uint8(79)\r\n\r\n*EXAMPLE 2*\r\n\r\nSuppose the batch contained one encoded message — _\"Oa oqvvq'u cnycau dggp: \"Ctu itcvkc ctvku\".\"_ (provided as a character array within a cell array) — and a (right-shifting) ROT2 cipher had been applied.  In that case A→C, B→D, ..., Y→A, and Z→B;  similarly, a→c, b→d, ..., y→a, and z→b.  \r\nThus the original message would have been:  _\"My motto's always been: \"Ars gratia artis\".\"_ .  Eight of the 37 characters have been matched: \"My\", \"\u0026#x200A;'s\u0026#x200A;\", and \"been\".  Note carefully that:  \"\u0026#x200A;'s\u0026#x200A;\" should only be matched once;  \"to\" (in motto), \"be\" (in been), \"at\" (in gratia), \"is\" (in artis) and \"a\" (passim) should _not_ be matched at all;  and \"\u0026#x200A;'\u0026#x200A;\" will only ever be used as an apostrophe (never as a quotation mark).  \r\n\r\nThe correct answer would therefore comprise:  \r\n\r\n  s.shift = uint8(2)  \r\n  s.message = {'My motto''s always been: \"Ars gratia artis\".'}\r\n  s.certitude = uint8(73)\r\n\r\nIf the batch of messages cannot be decoded when following the above assumptions, then return the original encoded message(s) unchanged, with a shift of zero and a certitude of zero.  \r\n\r\n|Note:  Many Cody solutions are hard to read and not necessarily computationally efficient.  To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable).  Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand. (Try resubmitting on another day if your code runs slowly, in case it is caused by a server issue.)|  \r\n\r\nTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \"too slow\".  \r\n\r\n----------\r\n\r\nPrevious problem:  \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44356 Operation Orthos\u003e.  Next problem:  TBA.","description_html":"\u003cp\u003eYou have been tasked with decoding several batches of coded messages that have been intercepted.\u003c/p\u003e\u003cp\u003eBased on previous intelligence that has been gathered, you can be confident that the messages were all encoded using a simple \u003ca href = \"https://en.wikipedia.org/wiki/Caesar_cipher\"\u003eCaesar cipher\u003c/a\u003e (a type of \u003ca href = \"https://en.wikipedia.org/wiki/Substitution_cipher\"\u003esubstitution cipher\u003c/a\u003e), an example of which is the \u003ca href = \"https://en.wikipedia.org/wiki/ROT13\"\u003eROT13 cipher\u003c/a\u003e (discussed in \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher\"\u003eCody Challenge Problem 78\u003c/a\u003e).  As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation, numbers, accented letters) are unchanged.  Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and will vary \u003ci\u003ebetween\u003c/i\u003e (not within) batches — also, here you need to decode, not encode.\u003c/p\u003e\u003cp\u003eThese latest activities that you are investigating have been nicknamed 'Operation Xiangliu' by your own organisation.  A few decoding options are at your organisation's disposal:\u003c/p\u003e\u003col\u003e\u003cli\u003eTest the candidate decodings against all words in a large dictionary — this could work, but it is very slow.\u003c/li\u003e\u003cli\u003eTest the candidate decodings for the appearance of a name or phrase that is certain to appear regularly (e.g. \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44351\"\u003e\"Operation Phoenix\"\u003c/a\u003e) — unfortunately as yet there is not enough knowledge of the activities to be sure of a suitable name or phrase to use.\u003c/li\u003e\u003cli\u003eTest the candidate decodings against all words in a short list comprising, say, the hundred most frequently used English words.\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eThe \u003cb\u003ethird option\u003c/b\u003e will be faster than the first option, and more reliable than the second option, so this is the approach you will be taking.\u003c/p\u003e\u003cp\u003eYou have been careful to avoid using 'lemmatised' lists (which contain e.g. the verb \"to be\", rather than the various inflected forms such as \"am\", \"is\", \"are\") like those based on the \u003ca href = \"https://web.archive.org/web/20111226085859/http://oxforddictionaries.com/words/the-oec-facts-about-the-language\"\u003eOEC\u003c/a\u003e or \u003ca href = \"https://www.wordfrequency.info/free.asp?s=y\"\u003eCOCA\u003c/a\u003e, and after setting aside \u003ca href = \"http://world-english.org/english500.htm\"\u003eanother list\u003c/a\u003e you finally choose the \u003ca href = \"http://ucrel.lancs.ac.uk/bncfreq/samples/120.pdf\"\u003elist based on the BNC\u003c/a\u003e as the most reliable, and will use the first 100 words on that list.  \r\nThis list will be available for you to access as an input variable, \u003ctt\u003ebncWordlist\u003c/tt\u003e, to your function. Note: (i) some entries on the list are morphemes (e.g. \"\u0026#x200A;n't\u0026#x200A;\" and \"\u0026#x200A;'s\u0026#x200A;\") rather than words;  (ii) some entries appear more than once (representing different grammatical word classes).  Of course, in the original messages any capitalisation might be used.\u003c/p\u003e\u003cp\u003eYou have been instructed that your 'certitude' (degree of confidence) in the decoding must be reported for each batch, and shall depend proportionally upon the sum of the characters for the words/morphemes in the decoded message that match words/morphemes in \u003ctt\u003ebncWordlist\u003c/tt\u003e.  Being able to match words/morphemes accounting for three-tenths of the characters (excluding spaces) shall correspond to 100% certitude;  matching three-twentieths would be 50% certitude, and so on.  Certitude shall be reported as a percentage, rounded \u003ci\u003eup\u003c/i\u003e to the nearest integer, not greater than 100.  You need to maximise your certitude for each batch by appropriate choice of the shifting parameter.   If there are multiple shifts of equal certitude, report both options on different rows (arranged in order of ascending shift parameter).\u003c/p\u003e\u003cp\u003eYour task is to crack the codes and report back in a \u003ca href = \"http://au.mathworks.com/help/matlab/ref/struct.html\"\u003estructure array\u003c/a\u003e: \u0026nbsp; (1) the shifting parameter that had been used in the encoding [as \u003ca href = \"http://au.mathworks.com/help/matlab/ref/uint8.html\"\u003euint8\u003c/a\u003e] (usually scalar, but may be column vector); \u0026nbsp; (2) the decoded messages [as a \u003ca href = \"http://au.mathworks.com/help/matlab/ref/cell.html?s_tid=doc_ta\"\u003ecell array\u003c/a\u003e (containing \u003ca href = \"http://au.mathworks.com/help/matlab/ref/char.html\"\u003echaracter arrays\u003c/a\u003e)] (usually an array with a single row, but occasionally with multiple rows); \u0026nbsp; (3) your 'certitude' in the decoding [as \u003ca href = \"http://au.mathworks.com/help/matlab/ref/uint8.html\"\u003euint8\u003c/a\u003e] (always scalar).  \r\nThe name of the structure array shall be \u003ctt\u003es\u003c/tt\u003e, with respective fields \u003ctt\u003eshift\u003c/tt\u003e, \u003ctt\u003emessage\u003c/tt\u003e, and \u003ctt\u003ecertitude\u003c/tt\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eEXAMPLE 1\u003c/b\u003e\u003c/p\u003e\u003cp\u003eSuppose the batch contained two encoded messages — \u003ci\u003e\"Vomftt qvstvfe, pqfo op eppst.\"\u003c/i\u003e and \u003ci\u003e\"Ffmt dbo ljmm, opu pomz xpvoe.\"\u003c/i\u003e (provided as character arrays within a cell array) — and a (right-shifting) ROT1 cipher had been applied.  In that case A→B, B→C, ..., Y→Z, and Z→A;  similarly, a→b, b→c, ..., y→z, and z→a.  \r\nThus the original messages would have been:  \u003ci\u003e\"Unless pursued, open no doors.\"\u003c/i\u003e and \u003ci\u003e\"Eels can kill, not only wound.\"\u003c/i\u003e .  Twelve of the 51 characters have been matched:  \"no\", \"can\", \"not\", and \"only\".\u003c/p\u003e\u003cp\u003eThe correct answer would therefore comprise:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003es.shift = uint8(1)  \r\ns.message = {'Unless pursued, open no doors.', 'Eels can kill, not only wound.'}\r\ns.certitude = uint8(79)\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eEXAMPLE 2\u003c/b\u003e\u003c/p\u003e\u003cp\u003eSuppose the batch contained one encoded message — \u003ci\u003e\"Oa oqvvq'u cnycau dggp: \"Ctu itcvkc ctvku\".\"\u003c/i\u003e (provided as a character array within a cell array) — and a (right-shifting) ROT2 cipher had been applied.  In that case A→C, B→D, ..., Y→A, and Z→B;  similarly, a→c, b→d, ..., y→a, and z→b.  \r\nThus the original message would have been:  \u003ci\u003e\"My motto's always been: \"Ars gratia artis\".\"\u003c/i\u003e .  Eight of the 37 characters have been matched: \"My\", \"\u0026#x200A;'s\u0026#x200A;\", and \"been\".  Note carefully that:  \"\u0026#x200A;'s\u0026#x200A;\" should only be matched once;  \"to\" (in motto), \"be\" (in been), \"at\" (in gratia), \"is\" (in artis) and \"a\" (passim) should \u003ci\u003enot\u003c/i\u003e be matched at all;  and \"\u0026#x200A;'\u0026#x200A;\" will only ever be used as an apostrophe (never as a quotation mark).\u003c/p\u003e\u003cp\u003eThe correct answer would therefore comprise:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003es.shift = uint8(2)  \r\ns.message = {'My motto''s always been: \"Ars gratia artis\".'}\r\ns.certitude = uint8(73)\r\n\u003c/pre\u003e\u003cp\u003eIf the batch of messages cannot be decoded when following the above assumptions, then return the original encoded message(s) unchanged, with a shift of zero and a certitude of zero.\u003c/p\u003e\u003cp\u003e\u003ctt\u003eNote:  Many Cody solutions are hard to read and not necessarily computationally efficient.  To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable).  Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand. (Try resubmitting on another day if your code runs slowly, in case it is caused by a server issue.)\u003c/tt\u003e\u003c/p\u003e\u003cp\u003eTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \"too slow\".\u003c/p\u003e\u003cp\u003e----------\u003c/p\u003e\u003cp\u003ePrevious problem:  \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44356\"\u003eOperation Orthos\u003c/a\u003e.  Next problem:  TBA.\u003c/p\u003e","function_template":"% Comments are nice, aren't they....\r\nfunction s = decode(x, bncWordlist)\r\nend","test_suite":"%% NOTE:  \r\n% This test suite can be updated if inappropriate 'hacks' \r\n% are discovered in any submitted solutions.\r\n% The assessment of your submission may therefore change over time.  \r\n\r\nglobal bncWordlist\r\nbncWordlist = {'the', 'of', 'and', 'a', 'in', 'to', 'it', 'is', 'to', 'was', ...\r\n    'I', 'for', 'that', 'you', 'he', 'be', 'with', 'on', 'by', 'at', ...\r\n    'have', 'are', 'not', 'this', '''s', 'but', 'had', 'they', 'his', ...\r\n    'from', 'she', 'that', 'which', 'or', 'we', '''s', 'an', 'n''t', 'were', ...\r\n    'as', 'do', 'been', 'their', 'has', 'would', 'there', 'what', 'will', 'all', ...\r\n    'if', 'can', 'her', 'said', 'who', 'one', 'so', 'up', 'as', 'them', 'some', ...\r\n    'when', 'could', 'him', 'into', 'its', 'then', 'two', 'out', 'time', ...\r\n    'my', 'about', 'did', 'your', 'now', 'me', 'no', 'other', 'only', 'just', ...\r\n    'more', 'these', 'also', 'people', 'know', 'any', 'first', 'see', 'very', 'new', ...\r\n    'may', 'well', 'should', 'her', 'like', 'than', 'how', 'get', 'way', 'one', 'our'};\r\n\r\n\r\n%% Anti-hacking\r\n% EDIT (2019-07-02). Anti-hacking provision\r\n% Ensure only builtin functions will be called.\r\n! rm -v fileread.m\r\n! rm -v assert.m\r\n% END EDIT (2019-07-02)\r\n% EDIT (2018-06-18).  Anti-hacking provision\r\nRE = regexp(fileread('decode.m'), '\\w+', 'match');\r\ntabooWords = {'ans', 'assert', 'freepass', 'tic'};\r\ntestResult = cellfun( @(z) ismember(z, tabooWords), RE );\r\nmsg = ['Please do not do that in your code!' char([10 13]) ...\r\n    'Found: ' strjoin(RE(testResult)) '.' char([10 13]) ...\r\n    'Banned word.' char([10 13])];\r\nassert(~any(  cellfun( @(z) ismember(z, tabooWords), RE )  ), msg)\r\n\r\nfor j = 1 : randi(10)\r\n    decode({'Pizza for dinner.'}, {'mozzarella', 'mushrooms'});\r\nend;\r\n% END EDIT (2018-06-18)\r\n\r\n\r\n%% Test 1\r\nglobal bncWordlist\r\nx =                 {'Vomftt qvstvfe, pqfo op eppst.', 'Ffmt dbo ljmm, opu pomz xpvoe.'};\r\ns_correct.shift = uint8(1);\r\ns_correct.message = {'Unless pursued, open no doors.', 'Eels can kill, not only wound.'};\r\ns_correct.certitude = uint8(79);\r\ns = decode(x, bncWordlist);\r\n%disp(' *** ');  disp(s.message);  disp(' *** ')\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.' )\r\nassert( isequal(s.message{1}, s_correct.message{1}), 'Wrong message{1}.' )\r\nassert( isequal(s.message{2}, s_correct.message{2}), 'Wrong message{2}.' )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.' )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.' )\r\nassert( isequal(s, s_correct), 'Wrong s.' )\r\nassert( isequal(class(s.shift), 'uint8'), 'Wrong class.' )\r\nassert( isequal(class(s.message), 'cell'), 'Wrong class.'  )\r\nassert( isequal(class(s.message{1}), 'char'), 'Wrong class.'  )\r\nassert( isequal(class(s.certitude), 'uint8'), 'Wrong class.'  )\r\n\r\n\r\n%% Test 2\r\nglobal bncWordlist\r\nx =                 {'Doo zduiduh lv edvhg rq ghfhswlrq.', ...\r\n    'Khqfh, zkhq deoh wr dwwdfn, zh pxvw vhhp xqdeoh;  zkhq xvlqj rxu irufhv, zh pxvw vhhp lqdfwlyh;  zkhq zh duh qhdu, zh pxvw pdnh wkh hqhpb eholhyh zh duh idu dzdb; zkhq idu dzdb, zh pxvw pdnh klp eholhyh zh duh qhdu.'};\r\ns_correct.shift = uint8(3);\r\ns_correct.message = {'All warfare is based on deception.', ...\r\n    'Hence, when able to attack, we must seem unable;  when using our forces, we must seem inactive;  when we are near, we must make the enemy believe we are far away; when far away, we must make him believe we are near.'};\r\ns_correct.certitude = uint8(95);\r\ns = decode(x, bncWordlist);\r\n%disp(' *** ');  disp(s.message);  disp(' *** ')\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.'  )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.'  )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.'  )\r\n\r\n\r\n%% Test 3\r\nglobal bncWordlist\r\nx =                 {'Elia lrq yxfqp ql bkqfzb qeb bkbjv.  Cbfdk afploabo, xka zorpe efj.', ...\r\n    'Fc eb fp pbzrob xq xii mlfkqp, yb mobmxoba clo efj.  Fc eb fp fk prmboflo pqobkdqe, bsxab efj.'};\r\ns_correct.shift = uint8(23);\r\ns_correct.message = {'Hold out baits to entice the enemy.  Feign disorder, and crush him.', ...\r\n    'If he is secure at all points, be prepared for him.  If he is in superior strength, evade him.'};\r\ns_correct.certitude = uint8(100);\r\ns = decode(x, bncWordlist);\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.'  )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.'  )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.'  )\r\n\r\n\r\n%% Test 4\r\nglobal bncWordlist\r\nx =                 {'Ax qgmj ghhgfwfl ak gx uzgdwjau lwehwj, kwwc lg ajjalslw zae.  Hjwlwfv lg tw owsc, lzsl zw esq yjgo sjjgysfl.', ...\r\n    'Ax zw ak lscafy zak wskw, yanw zae fg jwkl.', ...\r\n    'Ax zak xgjuwk sjw mfalwv, kwhsjslw lzwe.', ...\r\n    'Sllsuc zae ozwjw zw ak mfhjwhsjwv, shhwsj ozwjw qgm sjw fgl wphwulwv.'};\r\ns_correct.shift = uint8(18);\r\ns_correct.message = {'If your opponent is of choleric temper, seek to irritate him.  Pretend to be weak, that he may grow arrogant.', ...\r\n    'If he is taking his ease, give him no rest.', ...\r\n    'If his forces are united, separate them.', ...\r\n    'Attack him where he is unprepared, appear where you are not expected.'};\r\ns_correct.certitude = uint8(100);\r\ns = decode(x, bncWordlist);\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.'  )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.'  )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.'  )\r\n\r\n\r\n%% Test 5\r\nglobal bncWordlist\r\nx =                 {'Aes cèwo vo foxd bémyvdo vo dowzy', ...\r\n    'Yx wo dbksdo no dbkîdbo aekxn to dbksdo no vk népksdo ne csvoxmo / Vo csvoxmo ocd n''yb, wksc t''ks mryscs vk mknoxmo', ... \r\n    'Mrkaeo wyd, mrkaeo zrbkco nsdc kfom owzrkco / Pksd no Mvkeno WM, vo mywwkxny no vk zrbkco', ...\r\n    'Mkb t''cesc ex WM n''kddkaeo, ckxc dsmc, kedroxdsaeo zkc ox dym / Zbêd à pbkzzob ceb vo lokd zyeb vo wyefowoxd rsz-ryz', ...\r\n    'Ne bkz n''kddkaeo aes pbkzzo, ézkdo, wkdbkaeo od zkdkdbkaeo / Zvec no ckxq de mvkaeoc, t''cesc WM noc Mkbzkdoc', ...\r\n    'Vo zénkqyqeo ox fyqeo ke xyw no myno Cyvkkb ye Mvkeno WM / Do zbyzyco n''émyedob moms / Ae''yx ézovvo voc fyiovvoc, nèc ae''yx cyxxo voc myxcyxxoc'};\r\ns_correct.shift = uint8([0 21]');\r\n% TIP:  The original message was not English!\r\ns_correct.message(1, :) = {'Aes cèwo vo foxd bémyvdo vo dowzy', ... \r\n    'Yx wo dbksdo no dbkîdbo aekxn to dbksdo no vk népksdo ne csvoxmo / Vo csvoxmo ocd n''yb, wksc t''ks mryscs vk mknoxmo', ... \r\n    'Mrkaeo wyd, mrkaeo zrbkco nsdc kfom owzrkco / Pksd no Mvkeno WM, vo mywwkxny no vk zrbkco', ... \r\n    'Mkb t''cesc ex WM n''kddkaeo, ckxc dsmc, kedroxdsaeo zkc ox dym / Zbêd à pbkzzob ceb vo lokd zyeb vo wyefowoxd rsz-ryz', ... \r\n    'Ne bkz n''kddkaeo aes pbkzzo, ézkdo, wkdbkaeo od zkdkdbkaeo / Zvec no ckxq de mvkaeoc, t''cesc WM noc Mkbzkdoc', ... \r\n    'Vo zénkqyqeo ox fyqeo ke xyw no myno Cyvkkb ye Mvkeno WM / Do zbyzyco n''émyedob moms / Ae''yx ézovvo voc fyiovvoc, nèc ae''yx cyxxo voc myxcyxxoc'}\r\ns_correct.message(2, :) = {'Fjx hèbt at ktci gérdait at itbed', ... \r\n    'Dc bt igpxit st igpîigt fjpcs yt igpxit st ap séupxit sj hxatcrt / At hxatcrt thi s''dg, bpxh y''px rwdxhx ap rpstcrt', ... \r\n    'Rwpfjt bdi, rwpfjt ewgpht sxih pktr tbewpht / Upxi st Rapjst BR, at rdbbpcsd st ap ewgpht', ... \r\n    'Rpg y''hjxh jc BR s''piipfjt, hpch ixrh, pjiwtcixfjt eph tc idr / Egêi à ugpeetg hjg at qtpi edjg at bdjktbtci wxe-wde', ... \r\n    'Sj gpe s''piipfjt fjx ugpeet, éepit, bpigpfjt ti epipigpfjt / Eajh st hpcv ij rapfjth, y''hjxh BR sth Rpgepith', ... \r\n    'At eéspvdvjt tc kdvjt pj cdb st rdst Hdappg dj Rapjst BR / It egdedht s''érdjitg rtrx / Fj''dc éetaat ath kdntaath, sèh fj''dc hdcct ath rdchdccth'}\r\ns_correct.certitude = uint8(11);\r\ns = decode(x, bncWordlist);\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.'  )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.'  )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.'  )\r\n\r\n\r\n%% Test 6\r\nglobal bncWordlist\r\nx =                 {'Brvdujcnm mrbxamna yxbcdujcnb ynaonlc mrblryurwn;  brvdujcnm onja yxbcdujcnb lxdajpn;  brvdujcnm fnjtwnbb yxbcdujcnb bcanwpcq.' ...\r\n    'X mrerwn jac xo bdkcunch jwm bnlanlh!'};\r\ns_correct.shift = uint8(9);\r\ns_correct.message = {'Simulated disorder postulates perfect discipline;  simulated fear postulates courage;  simulated weakness postulates strength.' ...\r\n    'O divine art of subtlety and secrecy!'};\r\ns_correct.certitude = uint8(12);\r\ns = decode(x, bncWordlist);\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.'  )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.'  )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.'  )\r\n\r\n\r\n%% Test 7\r\nglobal bncWordlist\r\nx =                 {'Nv treefk vekvi zekf rcczretv nzky evzxysfizex gizetvj lekzc nv riv rthlrzekvu nzky kyvzi uvjzxej.', ... \r\n    'Nv riv efk wzk kf cvru re ridp fe kyv drity lecvjj nv riv wrdzczri nzky kyv wrtv fw kyv tflekip — zkj dflekrzej reu wfivjkj, zkj gzkwrccj reu givtzgztvj, zkj drijyvj reu jnrdgj.', ... \r\n    'Nv jyrcc sv lerscv kf klie erklirc rumrekrxvj kf rttflek lecvjj nv drbv ljv fw cftrc xlzuvj.'};\r\ns_correct.shift = uint8(17);\r\ns_correct.message = {'We cannot enter into alliance with neighboring princes until we are acquainted with their designs.', ...  \r\n    'We are not fit to lead an army on the march unless we are familiar with the face of the country — its mountains and forests, its pitfalls and precipices, its marshes and swamps.', ...  \r\n    'We shall be unable to turn natural advantages to account unless we make use of local guides.'};\r\ns_correct.certitude = uint8(97);\r\ns = decode(x, bncWordlist);\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.'  )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.'  )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.'  )\r\n\r\n\r\n%% Test 8\r\nglobal bncWordlist\r\nx =                 {'Oa oqvvq''u cnycau dggp: \"Ctu itcvkc ctvku\".'};\r\ns_correct.shift = uint8(2);\r\ns_correct.message = {'My motto''s always been: \"Ars gratia artis\".'};\r\ns_correct.certitude = uint8(73);\r\ns = decode(x, bncWordlist);\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.'  )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.'  )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.'  )\r\n\r\n\r\n%% Test 9\r\nglobal bncWordlist\r\nx =                 {'Bestow rewards without regard 2 rule;  issue orders without regard 2 previous arrangements', ...\r\n    '\"Let advance bee richly rewarded \u0026 retreat bee heavily punished.\"', ...\r\n    ' Qwertyuiop''asdfghjkl.   Zxcvbnm-0123456789 = pass. ', ...\r\n    'αβγδ — persimon–apricot hybrid.', ...\r\n    'aIanasatbebydoheifinisitmemynoofonor''ssotoupweallandanyarebutcandidforgethadhasherhimhishowitsmaynewnotnown''toneouroutseeshethetwowaswaywhoyoualsobeenfromhaveintojustknowlikemoreonlysaidsomethanthatthemthentheythistimeverywellwerewhatwhenwillwithyouraboutcouldfirstothertheirtherethesewhichwouldpeopleshould'};\r\ns_correct.shift = uint8(0);\r\ns_correct.message = x;\r\ns_correct.certitude = uint8(0);\r\ns = decode(x, bncWordlist);\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.'  )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.'  )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.'  )\r\n\r\n\r\n%% TIMING \r\n% Note:  The Time Trial section does not check accuracy; that is done above.\r\n\r\n% Acknowledgements  \r\n% Portions of this timing test code were inspired by:\r\n% (1) Problem 937. \"Rubik's Mini Cube: Solve Randomized Cube in 11 Moves or Less; Score is by Time (msec)\" by Richard Zapor.\r\n% (2) Problem 2733. \"Evil Number\" by Jan Orwat.\r\n% (3) Feedback in comments from Peng Liu.\r\n% (4) Problem Problem 1237. \"It's race time! Write a faster function than the test suite call of unique().\" by Jeremy.\r\n\r\n% INITIALISE\r\nglobal bncWordlist\r\nx =                 {'Vomftt qvstvfe, pqfo op eppst.', 'Ffmt dbo ljmm, opu pomz xpvoe.'};\r\nqSmall = 50;\r\nqBig = 1000;\r\n%cutoffTimeBig = 10;    % Maximum allowable walltime (in seconds) to run function in a loop with qBig iterations.\r\n\r\n% EDIT (2018-06-17).  Reduced time [slightly] to pose reasonable challenge.\r\n% Accounted for improving Cody server speed per Problem 44655.\r\ncutoffTimeBig = 8;    % Maximum allowable walltime (in seconds) to run function in a loop with qBig iterations.\r\ntRef = datetime('2018-06-17', 'InputFormat','yyyy-MM-dd');\r\ntNow = datetime('now');\r\nyearsElapsed = (datenum(tNow) - datenum(tRef)) / 365.24;\r\ndisp(' . ');\r\nfprintf('\\r\\n\\r\\n\\r\\nSubmission evaluated for speed on %s.\\r\\n', datestr(tNow, 'dd mmmm yyyy'))\r\nrInf = 0.2;   delta = cutoffTimeBig - rInf;  tau = 3.6;  % Data from Problem 44655, based on Problem 963.\r\nqBig = ceil( qBig * (cutoffTimeBig - rInf) * exp(yearsElapsed/tau) / delta );\r\nfprintf('\\r\\n\\r\\n\\r\\nTo account for computational power increases over time, number of iterations increased to %u.\\r\\n', qBig)\r\n% END EDIT (2018-06-17)\r\n\r\n\r\n% *** PRELIMINARY TIMING WITH timeit ***\r\nfDecode = @()   decode(x, bncWordlist);\r\ndt_timeit = timeit( fDecode );\r\nfor dummy = 1 : 10,  disp(' . ');  end;\r\nfprintf('APPROXIMATE time to decode %u message batches ~ %2.2f seconds, according to ''timeit''.\\n\\r', qBig, dt_timeit * qBig)\r\n\r\n% *** PRELIMINARY TIMING WITH SHORT LOOP ***\r\n% In case the submitted function has a lot of text output, \r\n% get an estimate based on just a few iterations\r\n% Initialise\r\nt0 = clock;\r\n\r\n% Loop\r\nfor i = 1 : qSmall\r\n    solution = decode(x, bncWordlist);\r\nend;\r\n\r\n% Compute and display elapsed time.\r\ndt = etime(clock, t0);\r\nfor dummy = 1 : 10,  disp(' . ');  end;\r\n%fprintf('Your wall time to decode %u message batches = %i seconds.\\n\\r', qSmall, floor(dt))\r\nfprintf('APPROXIMATE wall time to decode %u message batches ~ %2.2f seconds, by extrapolating from %u batches.\\n\\r', qBig, dt * qBig / qSmall, qSmall)\r\n\r\n% *** 'OFFICIAL' TIMING ***\r\n% Re-initialise timer\r\nt0 = clock;\r\nt0_cpu = cputime;\r\n\r\n% Loop\r\nfor i = 1 : qBig\r\n    % EDIT (2018-06-17).   Ensure each case is unique.\r\n    characters = ['  ,   .' char(randi([97,122], [1,23]))];\r\n    x{2} = characters( randperm(30) );\r\n    % END EDIT (2018-06-17)\r\n    solution = decode(x, bncWordlist);\r\nend;\r\n\r\n% Compute and display elapsed time.\r\ndt = etime(clock, t0);\r\nfor dummy = 1 : 10,  disp(' . ');  end;\r\nfprintf('Your wall time to decode %u message batches = %2.2f seconds.\\n\\r', qBig, dt)\r\n\r\ndt_cpu = (cputime - t0_cpu);\r\nfprintf(' ( Your CPU time for this = %2.2f seconds. ) \\n\\r', dt_cpu)\r\n\r\n% Display (default) Cody size-based score.\r\nall_nodes = mtree('decode.m', '-file');\r\nsize_score = count(all_nodes);\r\nfprintf('Your Cody-standard size-based score = %i.\\n\\r', size_score)\r\n\r\n% Report revised performance score\r\ncombinedScore = size_score + round(dt * 10);\r\nfprintf('Your combined score = %i.\\n\\r', combinedScore)\r\ndisp('     -----=====|||||=====-----     ')\r\n\r\n% Now disallow any candidate solutions that are TOO SLOW!\r\nif dt \u003e cutoffTimeBig, \r\n    fprintf('Sorry, your submission is TOO SLOW.  It must be able to finish within %u seconds.\\n\\r', cutoffTimeBig)\r\nend;\r\n\r\nassert( dt \u003c= cutoffTimeBig, 'Exceeded time limit specified in Test Suite.' )","published":true,"deleted":false,"likes_count":2,"comments_count":16,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":13,"test_suite_updated_at":"2019-07-02T13:23:18.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2017-10-12T23:17:24.000Z","updated_at":"2026-04-02T20:05:58.000Z","published_at":"2017-10-15T06:52:40.000Z","restored_at":"2017-10-25T07:03:11.000Z","restored_by":null,"spam":false,"simulink":false,"admin_reviewed":true,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou have been tasked with decoding several batches of coded messages that have been intercepted.\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\u003eBased on previous intelligence that has been gathered, you can be confident that the messages were all encoded using a simple\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/Caesar_cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCaesar cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (a type 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=\\\"https://en.wikipedia.org/wiki/Substitution_cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003esubstitution cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e), an example of which is 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/ROT13\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eROT13 cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (discussed 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://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Challenge Problem 78\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e). As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation, numbers, accented letters) are unchanged. Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and will vary\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\u003ebetween\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (not within) batches — also, here you need to decode, not encode.\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\u003eThese latest activities that you are investigating have been nicknamed 'Operation Xiangliu' by your own organisation. A few decoding options are at your organisation's disposal:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTest the candidate decodings against all words in a large dictionary — this could work, but it is very slow.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTest the candidate decodings for the appearance of a name or phrase that is certain to appear regularly (e.g.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44351\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\\\"Operation Phoenix\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e) — unfortunately as yet there is not enough knowledge of the activities to be sure of a suitable name or phrase to use.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTest the candidate decodings against all words in a short list comprising, say, the hundred most frequently used English 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\u003eThe\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\u003ethird option\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e will be faster than the first option, and more reliable than the second option, so this is the approach you will be taking.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou have been careful to avoid using 'lemmatised' lists (which contain e.g. the verb \\\"to be\\\", rather than the various inflected forms such as \\\"am\\\", \\\"is\\\", \\\"are\\\") like those based on the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://web.archive.org/web/20111226085859/http://oxforddictionaries.com/words/the-oec-facts-about-the-language\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOEC\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.wordfrequency.info/free.asp?s=y\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCOCA\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, and after setting aside\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://world-english.org/english500.htm\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eanother list\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e you finally choose 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://ucrel.lancs.ac.uk/bncfreq/samples/120.pdf\\\"\u003e\u003cw:r\u003e\u003cw:t\u003elist based on the BNC\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e as the most reliable, and will use the first 100 words on that list. This list will be available for you to access as an input variable,\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\u003ebncWordlist\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, to your function. Note: (i) some entries on the list are morphemes (e.g. \\\" n't \\\" and \\\" 's \\\") rather than words; (ii) some entries appear more than once (representing different grammatical word classes). Of course, in the original messages any capitalisation might be used.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou have been instructed that your 'certitude' (degree of confidence) in the decoding must be reported for each batch, and shall depend proportionally upon the sum of the characters for the words/morphemes in the decoded message that match words/morphemes 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\u003ebncWordlist\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Being able to match words/morphemes accounting for three-tenths of the characters (excluding spaces) shall correspond to 100% certitude; matching three-twentieths would be 50% certitude, and so on. Certitude shall be reported as a percentage, rounded\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\u003eup\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to the nearest integer, not greater than 100. You need to maximise your certitude for each batch by appropriate choice of the shifting parameter. If there are multiple shifts of equal certitude, report both options on different rows (arranged in order of ascending shift parameter).\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\u003eYour task is to crack the codes and report back in a\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://au.mathworks.com/help/matlab/ref/struct.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003estructure array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e: (1) the shifting parameter that had been used in the encoding [as\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://au.mathworks.com/help/matlab/ref/uint8.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003euint8\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e] (usually scalar, but may be column vector); (2) the decoded messages [as a\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://au.mathworks.com/help/matlab/ref/cell.html?s_tid=doc_ta\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecell array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (containing\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://au.mathworks.com/help/matlab/ref/char.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003echaracter arrays\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e)] (usually an array with a single row, but occasionally with multiple rows); (3) your 'certitude' in the decoding [as\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://au.mathworks.com/help/matlab/ref/uint8.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003euint8\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e] (always scalar). The name of the structure array shall be\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003es\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, with respective fields\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\u003eshift\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003emessage\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\u003ecertitude\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 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSuppose the batch contained two encoded messages —\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\\\"Vomftt qvstvfe, pqfo op eppst.\\\"\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\u003e\\\"Ffmt dbo ljmm, opu pomz xpvoe.\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (provided as character arrays within a cell array) — and a (right-shifting) ROT1 cipher had been applied. In that case A→B, B→C, ..., Y→Z, and Z→A; similarly, a→b, b→c, ..., y→z, and z→a. Thus the original messages would have been: \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\\\"Unless pursued, open no doors.\\\"\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\u003e\\\"Eels can kill, not only wound.\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e . Twelve of the 51 characters have been matched: \\\"no\\\", \\\"can\\\", \\\"not\\\", and \\\"only\\\".\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 correct answer would therefore comprise:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[s.shift = uint8(1)  \\ns.message = {'Unless pursued, open no doors.', 'Eels can kill, not only wound.'}\\ns.certitude = uint8(79)]]\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 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\u003eSuppose the batch contained one encoded message —\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\\\"Oa oqvvq'u cnycau dggp: \\\"Ctu itcvkc ctvku\\\".\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (provided as a character array within a cell array) — and a (right-shifting) ROT2 cipher had been applied. In that case A→C, B→D, ..., Y→A, and Z→B; similarly, a→c, b→d, ..., y→a, and z→b. Thus the original message would have been: \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\\\"My motto's always been: \\\"Ars gratia artis\\\".\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e . Eight of the 37 characters have been matched: \\\"My\\\", \\\" 's \\\", and \\\"been\\\". Note carefully that: \\\" 's \\\" should only be matched once; \\\"to\\\" (in motto), \\\"be\\\" (in been), \\\"at\\\" (in gratia), \\\"is\\\" (in artis) and \\\"a\\\" (passim) should\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\u003enot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e be matched at all; and \\\" ' \\\" will only ever be used as an apostrophe (never as a quotation mark).\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 correct answer would therefore comprise:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[s.shift = uint8(2)  \\ns.message = {'My motto''s always been: \\\"Ars gratia artis\\\".'}\\ns.certitude = uint8(73)]]\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\u003eIf the batch of messages cannot be decoded when following the above assumptions, then return the original encoded message(s) unchanged, with a shift of zero and a certitude of zero.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eNote: Many Cody solutions are hard to read and not necessarily computationally efficient. To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable). Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand. (Try resubmitting on another day if your code runs slowly, in case it is caused by a server issue.)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \\\"too slow\\\".\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----------\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\u003ePrevious problem: \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44356\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOperation Orthos\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. Next problem: TBA.\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":1139,"title":"Rubik's Cube: 30 Moves or Less : Contest Scoring (Time/Size/Moves)","description":"This Challenge is to solve a thoroughly scrambled Rubik's cube with the best score (30 moves max). Score is Moves + Size/2000 + e^(avg time sec / 3).\r\n\r\nRubik's Cube can be solved in 20 moves or less from any position.  The \u003chttp://kociemba.org/cube.htm Kociemba Two Phase algorithm\u003e can solve the Cube in 30 moves or less.  The basic theory is that any cube can transition to an H-cube by 12 moves using all possible 18 move types.  An H-cube is defined as having no rotations or flips of corners or edges, respectively, and has all middle edges in the middle row. The cube can be solved from any H-cube state in 18 moves or less using only the moves U U' U2 D D' D2 F2 L2 R2 B2. \u003chttp://kociemba.org/math/CubeDefs.htm#faceturns Definitions of Moves / Rotates / Flips for Corners and Edges\u003e. The Two-Phase algorithm typically solves in 24 moves or less.\r\n\r\n\u003c\u003chttps://sites.google.com/site/razapor/matlab_cody/cube_small.gif\u003e\u003e\r\n\r\n\u003c\u003chttps://sites.google.com/site/razapor/matlab_cody/Cube_Map48_200.png\u003e\u003e\r\n\r\nRubik's Cube has 48 faces that are assigned to a vector as in the above figure.\r\nU refers to the White face, F-Blue, L-Red, R-Orange, D-Yellow, and B-Green. Moves (1-6 UFDLBR 7-12 U'F'D'L'B'R' 13-18 U2F2D2L2B2R2) are clockwise looking towards the center, primes are CCW (eq U'), and twos are a half turn of a face.\r\n\r\n  The color to numeric coding is [RWBYGO] [012345]. \r\n  A solved cube is [0000 0000 1111 1111 2222 2222 3333 3333 4444 4444 5555 5555]\r\n\r\n*Input:* Cube\r\n\r\nCube is a 48 long row vector of values 0 thru 5.\r\n  \r\n*Output:* Move_Vector\r\n\r\nMove_Vector is an empty to 30 element vector of values 1:18\r\n\r\n*Constraint:* Solution must be 30 moves or less\r\n\r\n*Scoring:* Moves + Size / 2000 + e^(avg time sec / 3 )\r\n\r\n\u003chttp://cube20.org/src/ Two Phase Source code\u003e is fairly complex and may require a 500MB database file. Its goal is to find solutions of 20 or less starting with Two Phase.\r\n\r\n\u003chttps://sites.google.com/site/razapor/matlab_cody/Cube30rev001.ppt?attredirects=0\u0026d=1 30 move Cube Solution in Matlab (rought draft)\u003e","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: 957.7px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 478.85px; transform-origin: 407px 478.85px; 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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 368.333px 7.91667px; transform-origin: 368.333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis Challenge is to solve a thoroughly scrambled Rubik's cube with the best score (30 moves max). Score is Moves + Size/2000 + e^(avg time sec / 3).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 126px; 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 63px; text-align: left; transform-origin: 384px 63px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 219.95px 7.91667px; transform-origin: 219.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eRubik's Cube can be solved in 20 moves or less from any position. 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.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://kociemba.org/cube.htm\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eKociemba Two Phase algorithm\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: 63.7px 7.91667px; transform-origin: 63.7px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e can solve the Cube in 30 moves or less. The basic theory is that any cube can transition to an H-cube by 12 moves using all possible 18 move types. An H-cube is defined as having no rotations or flips of corners or edges, respectively, and has all middle edges in the middle row. The cube can be solved from any H-cube state in 18 moves or less using only the moves U U' U2 D D' D2 F2 L2 R2 B2.\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.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://kociemba.org/math/CubeDefs.htm#faceturns\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eDefinitions of Moves / Rotates / Flips for Corners and Edges\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: 151.317px 7.91667px; transform-origin: 151.317px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The Two-Phase algorithm typically solves in 24 moves or less.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 134.917px; 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 67.4667px; text-align: center; transform-origin: 384px 67.4667px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"data:image/gif;base64,R0lGODlhhACBAPcAAFIBBYKCggAAjsfHvZZOTubm2KOioo4AAD09lgAAyqccHJ+xsfPz5cYAACMjldfXygEBrJKSkuLx8QQEU6yuu4UUFLmxsa2tpxAQnOQAAN/f0c3NxGVlaOnp6aoAAZqamv7+8gAAnAAA7AAAvImJibSlpbW4uJaWoCkpQ1EdHe7u4La2qsEKCqeTkwAAcrm5s9HZ2YGBlMLCwktLc+Li4qWlqpsAAFpaigAA3Zs1NPn569IAAMjQ0A8PtJCQnPLy8qqqqvMAAMrKynJycrMJCfr6+gwMpauwsMm6utTf32kAAJ2Dgw8PjKampp0lJenw7zc3igAAspWVla0MDO/v8LsAAAAAowAA/w8Puw4Oe7q6urzFxXBbYNnk5NXV1a6ursbNzfT//7a2tYeHhwAAlJQAAEhIiQAA1ZwgIM0AACkpjOn29gICZBkZleoAAJptbe7u7rUAAJ2dnQAA8wAAw46Ojriko3gfHwAAfdnZ2aQAAm1tkAAA49wAANHR0fX19f8AAHd5eXdjY30EBLgMDAcHtAYGpr6+vrKyst7e3qukpPDw6Z6Xl8bGxubm5rOurs7Ozf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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z0Q9kDQQYc+WtOkY6yBrB9I19cjGwB6Xb3iBvkOe0J+mCapc2hoa4wdaPj5AWSDvuf7PBzM/9vyiYge3UV4jRAQiRAdQ3MehYnvXexQD58C8EERXAPggh3l50l9wA7Xc/Q7ZwB3O7+rsO4AMMoH8QAQPxdm90NFN8MHvGR4AQQXojVni4NQF7oAEOSBF31miYd0QQIH0XeBFvMHfBE3TeB34feBGidn6UBQUrkH8neBEt4HUjSHY3N4AvuBGI0Gx0tztn4ABJd4MeAW47mDdH94NA+BHwZnm6IwJGoHVHKBIDdwBRoHYm+IQh8QNcMANBZIVc2IVe+IVgGIZiOIZkWIZmeIZomIZquIZs2IYJERAAOw==\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 242.917px; 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 121.467px; text-align: center; transform-origin: 384px 121.467px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADtCAIAAAB1W61MAAA8KklEQVR42u2dB1gUx/vHX6QevSkW7CZ2Y2KLiS3RGKPGHkKiMWpU7F1EmiDSpbdDQIpi12iM2LuCAmIDVFCKoPR29Hbvf3fvgAPu4FhCwv3+u888PndzO9/bdT7MvDvznTkICQnx8/Pzl+TD29s7JiYG23cQIikpKe1RIIoTIu28jCtXrvj4+Eh0dRA4EVABr2Ik+nBxcYmKimpnjRIiSUlJ7VEgihMi7byMv//+283NTdJrhICKAYsBiwGLAYsBq1OBVVtelpudlZ2bV17LbSNY3PLiotLyKsGsytLS7Kys3PyCai5XDLCEKPA/qCovLMgrLqtgwJJIsDLfXFsyeYRO1x5aXbW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2N9ddBA/tOlMYw9aYVY8bt/L5E/eWIC+rdOhCce17CR7WLTw+1tevpbdx1rkLEZFl1Wc4ZosYzqWqxbp2vKngyxlmLAkoThhqae98yZB1kg2JcZg2/c/djn+7sYi97n3bTBsf6qFo8+oJ4AyMZPKeh97sd3viwzEXuQkg2enPnzyOqqvKSCd0mFqUVV1bU1Ze+zb0126xGcUR733Ey6PsZ6HF6axcRYnR8sEZ73oTZE3curWCnyWyxzjRsf43zD5oi1z7vv8hJE9ysLeOu3BgUaVCFanvhc0FLcLMaSUrBW1rTX1LbXkLblt1g9bUhM1z66WVN8f5iVFAG99IHhD4srw+6vrJdiwOqsYInyvO+BQSHrn3+MZD92PPjQ4WJKzN1YX+19IjzvovZ5JweiFFzj39QU3By0v/GgubDlX9SPJBJq8rYJGRkJtvJUKyjtNP5+Pic945bdvYPh2XkZGedH2gGzmEIyukIhnndq6/ZpJwy8on08H3s73jfsadWwNkbcfd7JjSG01920+j14TKPfXG15SsdcesbZ7dvPzqgfeWfZDtl57yA72tf62h8aVrKCAx8MWJ06eBfpeTfm/84bmfbR3efdiIrALNsyCW3ceK7QXGC+kpkrlCSwGHfDfw5WSEiIn5+fvyQfxw8f13PXU7NRU7Olm5zV1Barqe1RU7Onq2BPFV9MSdnST7t9dh8JOCLR1UHgRED1f5BylCjEvsbMAAAAAElFTkSuQmCC\" data-image-state=\"image-loaded\"\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.667px 7.91667px; transform-origin: 376.667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eRubik's Cube has 48 faces that are assigned to a vector as in the above figure. U refers to the White face, F-Blue, L-Red, R-Orange, D-Yellow, and B-Green. Moves (1-6 UFDLBR 7-12 U'F'D'L'B'R' 13-18 U2F2D2L2B2R2) are clockwise looking towards the center, primes are CCW (eq U'), and twos are a half turn of a face.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 40.8667px; 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 20.4333px; transform-origin: 404px 20.4333px; 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.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; 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: 192.5px 7.91667px; transform-origin: 192.5px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 15.4px 7.91667px; transform-origin: 15.4px 7.91667px; \"\u003eThe \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: 177.1px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 177.1px 7.91667px; \"\u003ecolor to numeric coding is [RWBYGO] [012345]. \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.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; 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: 300.3px 7.91667px; transform-origin: 300.3px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 7.91667px; transform-origin: 7.7px 7.91667px; \"\u003eA \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: 292.6px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 292.6px 7.91667px; \"\u003esolved cube is [0000 0000 1111 1111 2222 2222 3333 3333 4444 4444 5555 5555]\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: 19.4333px 7.91667px; transform-origin: 19.4333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eInput:\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: 18.6833px 7.91667px; transform-origin: 18.6833px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e Cube\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: 146.25px 7.91667px; transform-origin: 146.25px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCube is a 48 long row vector of values 0 thru 5.\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: 25.2667px 7.91667px; transform-origin: 25.2667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eOutput:\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: 42.8px 7.91667px; transform-origin: 42.8px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e Move_Vector\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: 189.433px 7.91667px; transform-origin: 189.433px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eMove_Vector is an empty to 30 element vector of values 1:18\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: 37.3333px 7.91667px; transform-origin: 37.3333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eConstraint:\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: 108.917px 7.91667px; transform-origin: 108.917px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e Solution must be 30 moves or less\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: 28.3833px 7.91667px; transform-origin: 28.3833px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eScoring:\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: 136.3px 7.91667px; transform-origin: 136.3px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e Moves + Size / 2000 + e^(avg time sec / 3 )\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\u003ca target='_blank' href = \"http://cube20.org/src/\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eTwo Phase Source code\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: 301.833px 7.91667px; transform-origin: 301.833px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is fairly complex and may require a 500MB database file. Its goal is to find solutions of 20 or less starting with Two Phase.\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\u003ca target='_blank' href = \"https://sites.google.com/site/razapor/matlab_cody/Cube30rev001.ppt?attredirects=0\u0026amp;d=1\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003e30 move Cube Solution in Matlab (rought draft)\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [v]=Rubik_Solver(cube)\r\n% moves 1-6 UFDLBR 7-12 U'F;D'L'B'R' 13-18 U2F2D2L2B2R2\r\n% Return v as a numeric row vector of k values in range 1:18\r\n  v=[];\r\nend","test_suite":"%%\r\nfeval(@assignin,'caller','score',100);\r\n%%\r\nvf=[ 17 2 3 20 5 22 7 8 11 13 16 10 15 9 12 14 41 18 19 44 21 46 23 24 25 26 27 28 29 30 31 32 33 34 6 36 4 38 39 1 40 42 43 37 45 35 47 48; \r\n  1 2 3 4 5 25 28 30 9 10 8 12 7 14 15 6 19 21 24 18 23 17 20 22 43 26 27 42 29 41 31 32 33 34 35 36 37 38 39 40 11 13 16 44 45 46 47 48 ;\r\n  1 2 38 4 36 6 7 33 9 10 11 12 13 14 15 16 17 18 3 20 5 22 23 8 27 29 32 26 31 25 28 30 48 34 35 45 37 43 39 40 41 42 19 44 21 46 47 24 ;\r\n  3 5 8 2 7 1 4 6 33 34 35 12 13 14 15 16 9 10 11 20 21 22 23 24 17 18 19 28 29 30 31 32 25 26 27 36 37 38 39 40 41 42 43 44 45 46 47 48 ;\r\n  14 12 9 4 5 6 7 8 46 10 11 47 13 48 15 16 17 18 19 20 21 22 23 24 25 26 1 28 2 30 31 3 35 37 40 34 39 33 36 38 41 42 43 44 45 32 29 27 ;\r\n  1 2 3 4 5 6 7 8 9 10 11 12 13 22 23 24 17 18 19 20 21 30 31 32 25 26 27 28 29 38 39 40 33 34 35 36 37 14 15 16 43 45 48 42 47 41 44 46 ;\r\n  40 2 3 37 5 35 7 8 14 12 9 15 10 16 13 11 1 18 19 4 21 6 23 24 25 26 27 28 29 30 31 32 33 34 46 36 44 38 39 41 17 42 43 20 45 22 47 48 ;\r\n  1 2 3 4 5 16 13 11 9 10 41 12 42 14 15 43 22 20 17 23 18 24 21 19 6 26 27 7 29 8 31 32 33 34 35 36 37 38 39 40 30 28 25 44 45 46 47 48 ;\r\n  1 2 19 4 21 6 7 24 9 10 11 12 13 14 15 16 17 18 43 20 45 22 23 48 30 28 25 31 26 32 29 27 8 34 35 5 37 3 39 40 41 42 38 44 36 46 47 33 ;\r\n  6 4 1 7 2 8 5 3 17 18 19 12 13 14 15 16 25 26 27 20 21 22 23 24 33 34 35 28 29 30 31 32 9 10 11 36 37 38 39 40 41 42 43 44 45 46 47 48 ;\r\n  27 29 32 4 5 6 7 8 3 10 11 2 13 1 15 16 17 18 19 20 21 22 23 24 25 26 48 28 47 30 31 46 38 36 33 39 34 40 37 35 41 42 43 44 45 9 12 14 ;\r\n  1 2 3 4 5 6 7 8 9 10 11 12 13 38 39 40 17 18 19 20 21 14 15 16 25 26 27 28 29 22 23 24 33 34 35 36 37 30 31 32 46 44 41 47 42 48 45 43 ;\r\n  41 2 3 44 5 46 7 8 16 15 14 13 12 11 10 9 40 18 19 37 21 35 23 24 25 26 27 28 29 30 31 32 33 34 22 36 20 38 39 17 1 42 43 4 45 6 47 48 ;\r\n  1 2 3 4 5 43 42 41 9 10 30 12 28 14 15 25 24 23 22 21 20 19 18 17 16 26 27 13 29 11 31 32 33 34 35 36 37 38 39 40 8 7 6 44 45 46 47 48 ;\r\n  1 2 43 4 45 6 7 48 9 10 11 12 13 14 15 16 17 18 38 20 36 22 23 33 32 31 30 29 28 27 26 25 24 34 35 21 37 19 39 40 41 42 3 44 5 46 47 8 ;\r\n  8 7 6 5 4 3 2 1 25 26 27 12 13 14 15 16 33 34 35 20 21 22 23 24 9 10 11 28 29 30 31 32 17 18 19 36 37 38 39 40 41 42 43 44 45 46 47 48 ;\r\n  48 47 46 4 5 6 7 8 32 10 11 29 13 27 15 16 17 18 19 20 21 22 23 24 25 26 14 28 12 30 31 9 40 39 38 37 36 35 34 33 41 42 43 44 45 3 2 1 ; \r\n  1 2 3 4 5 6 7 8 9 10 11 12 13 30 31 32 17 18 19 20 21 38 39 40 25 26 27 28 29 14 15 16 33 34 35 36 37 22 23 24 48 47 46 45 44 43 42 41 ];\r\n\r\n cube_orig=[zeros(1,8) ones(1,8) ones(1,8)*2 ones(1,8)*3 ones(1,8)*4 ones(1,8)*5]; \r\n tsum=0;\r\n msum=0;\r\n Lbest=30;\r\n for cube_sets=1:4\r\n  if cube_sets==2\r\n   tsum=0;\r\n   msum=0;\r\n  end\r\n encode=randi(18,1,80);\r\n fprintf('Encode: ');fprintf('%i ',encode);fprintf('\\n')\r\n r=cube_orig;\r\n for i= encode\r\n  r=r(vf(i,:));\r\n end\r\n encode=[]; % anti-shortcut\r\n encode_str='';\r\n cube=r;\r\n fprintf('%i',r);fprintf('\\n')\r\n\r\n% Time function\r\n ta=clock;\r\n [v]=Rubik_Solver(cube);\r\n t1=etime(clock,ta)*1000; % time in msec\r\n tsum=tsum+t1;\r\n Lv=length(v);\r\n msum=msum+Lv;\r\n assert(Lv\u003c=30)\r\n \r\n fprintf('Time: %.0f msec  Total Time %.0f\\n',t1,tsum)\r\n \r\n fprintf('Solution length %i\\n',length(v))\r\n fprintf('%i ',v);fprintf('\\n')\r\n \r\n r=cube;\r\n for i=v\r\n  r=r(vf(i,:));\r\n end\r\n \r\n fprintf('Solved Cube\\n');fprintf('%i',r);fprintf('\\n')\r\n\r\n tf=isequal(r,cube_orig);\r\n fprintf('Solved %i Moves %i \\n\\n\\n\\n',tf, Lv)\r\n assert(tf)\r\n assert(~isequal(1,2))\r\n if Lv\u003cLbest,Lbest=Lv;end\r\n \r\n end % cubesets\r\n\r\n msiz=mtree('Rubik_Solver.m','-file').count\r\n tsum=tsum/3000; % avg in seconds\r\n msum=msum/3;\r\n\r\nscore=msum+msiz/2000+exp(tsum/3);\r\n\r\nfprintf('Size %.0f  Avg Time %5.2f  Moves Avg %5.1f\\n',msiz,tsum,msum)\r\n\r\nfeval(  @assignin,'caller','score',floor(min( 100,score ))  );\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-12-25T04:50:18.000Z","updated_at":"2025-12-16T02:49:54.000Z","published_at":"2012-12-25T05:21:15.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is to solve a thoroughly scrambled Rubik's cube with the best score (30 moves max). Score is Moves + Size/2000 + e^(avg time sec / 3).\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\u003eRubik's Cube can be solved in 20 moves or less from any position. 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://kociemba.org/cube.htm\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eKociemba Two Phase algorithm\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e can solve the Cube in 30 moves or less. The basic theory is that any cube can transition to an H-cube by 12 moves using all possible 18 move types. An H-cube is defined as having no rotations or flips of corners or edges, respectively, and has all middle edges in the middle row. The cube can be solved from any H-cube state in 18 moves or less using only the moves U U' U2 D D' D2 F2 L2 R2 B2.\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://kociemba.org/math/CubeDefs.htm#faceturns\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eDefinitions of Moves / Rotates / Flips for Corners and Edges\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The Two-Phase algorithm typically solves in 24 moves or less.\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=\\\"center\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"center\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId2\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRubik's Cube has 48 faces that are assigned to a vector as in the above figure. U refers to the White face, F-Blue, L-Red, R-Orange, D-Yellow, and B-Green. Moves (1-6 UFDLBR 7-12 U'F'D'L'B'R' 13-18 U2F2D2L2B2R2) are clockwise looking towards the center, primes are CCW (eq U'), and twos are a half turn of a face.\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[The color to numeric coding is [RWBYGO] [012345]. \\nA solved cube is [0000 0000 1111 1111 2222 2222 3333 3333 4444 4444 5555 5555]]]\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\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Cube\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\u003eCube is a 48 long row vector of values 0 thru 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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Move_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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMove_Vector is an empty to 30 element vector of values 1:18\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\u003eConstraint:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Solution must be 30 moves or less\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\u003eScoring:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Moves + Size / 2000 + e^(avg time sec / 3 )\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:hyperlink w:docLocation=\\\"http://cube20.org/src/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eTwo Phase Source code\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is fairly complex and may require a 500MB database file. Its goal is to find solutions of 20 or less starting with Two Phase.\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:hyperlink w:docLocation=\\\"https://sites.google.com/site/razapor/matlab_cody/Cube30rev001.ppt?attredirects=0\u0026amp;d=1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e30 move Cube Solution in Matlab (rought draft)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.gif\",\"relationshipId\":\"rId1\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.png\",\"relationshipId\":\"rId2\"}]},{\"partUri\":\"/media/image1.gif\",\"contentType\":\"image/gif\",\"content\":\"data:image/gif;base64,R0lGODlhhACBAPcAAFIBBYKCggAAjsfHvZZOTubm2KOioo4AAD09lgAAyqccHJ+xsfPz5cYAACMjldfXygEBrJKSkuLx8QQEU6yuu4UUFLmxsa2tpxAQnOQAAN/f0c3NxGVlaOnp6aoAAZqamv7+8gAAnAAA7AAAvImJibSlpbW4uJaWoCkpQ1EdHe7u4La2qsEKCqeTkwAAcrm5s9HZ2YGBlMLCwktLc+Li4qWlqpsAAFpaigAA3Zs1NPn569IAAMjQ0A8PtJCQnPLy8qqqqvMAAMrKynJycrMJCfr6+gwMpauwsMm6utTf32kAAJ2Dgw8PjKampp0lJenw7zc3igAAspWVla0MDO/v8LsAAAAAowAA/w8Puw4Oe7q6urzFxXBbYNnk5NXV1a6ursbNzfT//7a2tYeHhwAAlJQAAEhIiQAA1ZwgIM0AACkpjOn29gICZBkZleoAAJptbe7u7rUAAJ2dnQAA8wAAw46Ojriko3gfHwAAfdnZ2aQAAm1tkAAA49wAANHR0fX19f8AAHd5eXdjY30EBLgMDAcHtAYGpr6+vrKyst7e3qukpPDw6Z6Xl8bGxubm5rOurs7Ozf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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7ZwB3O7+rsO4AMMoH8QAQPxdm90NFN8MHvGR4AQQXojVni4NQF7oAEOSBF31miYd0QQIH0XeBFvMHfBE3TeB34feBGidn6UBQUrkH8neBEt4HUjSHY3N4AvuBGI0Gx0tztn4ABJd4MeAW47mDdH94NA+BHwZnm6IwJGoHVHKBIDdwBRoHYm+IQh8QNcMANBZIVc2IVe+IVgGIZiOIZkWIZmeIZomIZquIZs2IYJERAAOw==\",\"relationship\":null},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADtCAIAAAB1W61MAAA8KklEQVR42u2dB1gUx/vHX6QevSkW7CZ2Y2KLiS3RGKPGHkKiMWpU7F1EmiDSpbdDQIpi12iM2LuCAmIDVFCKoPR29Hbvf3fvgAPu4FhCwv3+u888PndzO9/bdT7MvDvznTkICQnx8/Pzl+TD29s7JiYG23cQIikpKe1RIIoTIu28jCtXrvj4+Eh0dRA4EVABr2Ik+nBxcYmKimpnjRIiSUlJ7VEgihMi7byMv//+283NTdJrhICKAYsBiwGLAYsBq1OBVVtelpudlZ2bV17LbSNY3PLiotLyKsGsytLS7Kys3PyCai5XDLCEKPA/qCovLMgrLqtgwJJIsDLfXFsyeYRO1x5aXbWm6e9JK+SKC1Zl6WnPPd1kWasPnK9H9Poxtxlffq7bq6eqqsr8tY5ZlS2CVVt12suom6yCgELDEWSsBwDfr7etZcCSPLDyX03upzReb19GcUVh4sOvBqh+9YezOGBVZj7VmzKi74BhvTU0fjE5wc8tTjCY953LifBybmX4aWdVgMXmgS2AFXxgfa+BQ3qrCyjUHWmPjo7rN2jYoG5jfzFmwJI8sOL/smIp9riaUsZ7+/iYiZLWqOjMmlbByom/4+B7tKa6eMP0wfN3hvI7r9rqqsryulNK1nylqjV1fakosGrLbl06xSnK2jBjSL1C3ZG3fPqo9QdP7Vv15fCFuxmwJA+sqKN7FFkDInL4IU5+7GlFVeXQqFyxY6zSVZMGNcOCx02B3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X+19IjzvovZ5JweiFFzj39QU3By0v/GgubDlX9SPJBJq8rYJGRkJtvJUKyjtNP5+Pic945bdvYPh2XkZGedH2gGzmEIyukIhnndq6/ZpJwy8on08H3s73jfsadWwNkbcfd7JjSG01920+j14TKPfXG15SsdcesbZ7dvPzqgfeWfZDtl57yA72tf62h8aVrKCAx8MWJ06eBfpeTfm/84bmfbR3efdiIrALNsyCW3ceK7QXGC+kpkrlCSwGHfDfw5WSEiIn5+fvyQfxw8f13PXU7NRU7Olm5zV1Barqe1RU7Onq2BPFV9MSdnST7t9dh8JOCLR1UHgRED1f5BylCjEvsbMAAAAAElFTkSuQmCC\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42765,"title":"Maximize Non-Co-Planar Points in an N-Cube","description":"This Challenge is to find a set with the maximum number of integer points that create planar surfaces with a maximum of three points from the set. No four points may be co-planar.\r\nGiven the size N and the number of expected points Q find a set of Q points. Only N=2/Q=5 and N=3/Q=8 will be tested. N=4/Q=10 or N=5/Q=13 are too large to process.\r\n\r\n  N=2 contains 8 points [0,0,0;0,1,0;1,0,0;1,1,0;0,0,1;0,1,1;1,0,1;1,1,1]\r\n  N=3 contains 27 points [0,0,0;0,0,1;0,0,2;...2,2,2]\r\n\r\nOutput is a Qx3 matrix of the non-co-planar points.\r\n\r\nReference: The \u003chttp://68.173.157.131/Contest/Tetrahedra March 2016 Al Zimmermann Non-Coplanar contest\u003e is N=primes less than 100. Maximize the number of points in an NxNxN cube with no 4 points in a common plane.\r\n\r\nTheory: The N=2 and N=3 cases can be processed by brute force if care is taken. Assumption of [0,0,0] greatly reduces number of cases. Solving \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42762-is-3d-point-set-co-planar Cody Co-Planar Check\u003e may improve speed. ","description_html":"\u003cp\u003eThis Challenge is to find a set with the maximum number of integer points that create planar surfaces with a maximum of three points from the set. No four points may be co-planar.\r\nGiven the size N and the number of expected points Q find a set of Q points. Only N=2/Q=5 and N=3/Q=8 will be tested. N=4/Q=10 or N=5/Q=13 are too large to process.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eN=2 contains 8 points [0,0,0;0,1,0;1,0,0;1,1,0;0,0,1;0,1,1;1,0,1;1,1,1]\r\nN=3 contains 27 points [0,0,0;0,0,1;0,0,2;...2,2,2]\r\n\u003c/pre\u003e\u003cp\u003eOutput is a Qx3 matrix of the non-co-planar points.\u003c/p\u003e\u003cp\u003eReference: The \u003ca href = \"http://68.173.157.131/Contest/Tetrahedra\"\u003eMarch 2016 Al Zimmermann Non-Coplanar contest\u003c/a\u003e is N=primes less than 100. Maximize the number of points in an NxNxN cube with no 4 points in a common plane.\u003c/p\u003e\u003cp\u003eTheory: The N=2 and N=3 cases can be processed by brute force if care is taken. Assumption of [0,0,0] greatly reduces number of cases. Solving \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42762-is-3d-point-set-co-planar\"\u003eCody Co-Planar Check\u003c/a\u003e may improve speed.\u003c/p\u003e","function_template":"function m=MaxNonCoplanarPts(N,Q);\r\n% Place Q or more points in an 0:N-1 #D grid such that each plane created uses only 3 points from the set provided\r\n% N is Cube size\r\n% Q is expected number of points in solution\r\n% Hint: Point [0,0,0] can be assumed to be in the solution for N=2 and N=3\r\n% N=3 is the 27 points [0,0,0;0,0,1;0,0,2;...2,2,2]\r\n  m=[];\r\nend","test_suite":"%%\r\nN=2;\r\nQ=5;\r\nm=MaxNonCoplanarPts(N,Q);\r\nm=floor(abs(m))\r\n% Perform m check\r\nvalid=1;\r\nif size(m,1)\u003cQ,valid=0;end % Must be Q pts or more\r\nif max(m(:))\u003eN-1,valid=0;end\r\npset=nchoosek(1:size(m,1),4);\r\nfor i=1:length(pset)\r\n m4=m(pset(i,:),:);\r\n% Coplanar check method courtesy of Tim\r\n if ~det([m4 ones(4,1)]) % coplanar det=0\r\n  valid=0;\r\n  break\r\n end\r\nend\r\nassert(isequal(1,valid))\r\n%%\r\nN=3;\r\nQ=8;\r\nm=MaxNonCoplanarPts(N,Q);\r\nm=floor(abs(m))\r\n% Perform m check\r\nvalid=1;\r\nif size(m,1)\u003cQ,valid=0;end % Must be Q pts or more\r\nif max(m(:))\u003eN-1,valid=0;end\r\npset=nchoosek(1:size(m,1),4);\r\nfor i=1:length(pset)\r\n m4=m(pset(i,:),:);\r\n% Coplanar check method courtesy of Tim\r\n if ~det([m4 ones(4,1)]) % coplanar det=0\r\n  valid=0;\r\n  break\r\n end\r\nend\r\nassert(isequal(1,valid))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":6,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-03-07T00:22:02.000Z","updated_at":"2016-03-07T01:01:33.000Z","published_at":"2016-03-07T01:01: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\u003eThis Challenge is to find a set with the maximum number of integer points that create planar surfaces with a maximum of three points from the set. No four points may be co-planar. Given the size N and the number of expected points Q find a set of Q points. Only N=2/Q=5 and N=3/Q=8 will be tested. N=4/Q=10 or N=5/Q=13 are too large to process.\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=2 contains 8 points [0,0,0;0,1,0;1,0,0;1,1,0;0,0,1;0,1,1;1,0,1;1,1,1]\\nN=3 contains 27 points [0,0,0;0,0,1;0,0,2;...2,2,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\u003eOutput is a Qx3 matrix of the non-co-planar points.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eReference: 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://68.173.157.131/Contest/Tetrahedra\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMarch 2016 Al Zimmermann Non-Coplanar contest\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is N=primes less than 100. Maximize the number of points in an NxNxN cube with no 4 points in a common plane.\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\u003eTheory: The N=2 and N=3 cases can be processed by brute force if care is taken. Assumption of [0,0,0] greatly reduces number of cases. Solving\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/42762-is-3d-point-set-co-planar\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Co-Planar Check\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e may improve speed.\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":1122,"title":"USC Fall 2012 ACM: Rover Maze","description":"This Challenge is to solve Question F, Martian Pits, of the \u003chttp://contest.usc.edu/index.php/Fall12/Home USC ACM Fall 2012 Contest\u003e.\r\n\r\nThe task is to determine the minimum time for the Rover to drive from its current position to a Goal location. The Rover must STOP on the Goal location. Commands are processed at 1 Cmd per sec. Rover must stay on array.\r\n\r\nThis is an intriguing Maze problem that incorporates turn penalties, variable speed forward, and a fixed reverse speed.\r\n\r\n  Initial conditions are Rover Stopped and Facing +Y.\r\n  Commands are processed at 1 second intervals\r\n  \r\n  Commands and their attributes:\r\n  FORWARD: Starts rolling forward at 1 cm/s\r\n  BACKWARDS: Roll backwards at 1 cm/s\r\n  FASTER: Increase forward speed by 1 cm/s up to 5 cm/s\r\n  SLOWER: Decrease forward speed by 1 cm/s down to 0 cm/s. At 0 cm/s Rover is \"Stopped\"\r\n  STOP: Halts rover movement\r\n  RIGHT: Turn rover 90 degrees to the right\r\n  LEFT: Turn the rover 90 degrees to the left\r\n  NOOP: No change in anything \r\n\r\n\r\n  Commands FORWARD, BACKWARDS, RIGHT, LEFT only take effect if the rover is stopped. A moving rover ignores these commands.\r\n\r\n  Commands FASTER and SLOWER only take effect if the rover is moving forward.\r\n\r\n\r\n*Input: [Char array]* \".\" is Flat ground, \"P\" Pit, \"R\" Rover start location, \"D\" is Destination.  Matrix max dim 50, min 1. \r\n\r\n*Output: [T]*; Drive Time to destination; -1 if not possible\r\n\r\n*Scoring: Time (msec)*\r\n\r\n\r\nThe full \u003chttp://contest.usc.edu/index.php/Fall12/Home?action=download\u0026upname=pits.in.txt USC data file\u003e\r\n\r\n*Example:*\r\n\r\n*Input: [A]*\r\n\r\n  ...................D\r\n  .P......P.P.........\r\n  .P...PPPP.P.........\r\n  .P...P....P.........\r\n  .P...P.PPPP.........\r\n  .P.PPP.P............\r\n  .P.P...P............\r\n  .PPP.PPPPPPPPPPPPPPP\r\n  ....R...............\r\n  PPPPPPPPPPPPPPPPPPPP\r\n\r\n*Output: [19]* as the best path is L, Fwd, Faster, Slower, Stop to (9,1). The cmds to reach (1,1) are R, Fwd, Faster, Faster, Slower, Stop. Cmds to optimally reach (1,20) are R, Fwd, Faster, Faster, Faster, Faster, Slower, Stop. \r\n\r\nOnce again my code is large thus the contest will be scored based on Processing Time.\r\n\r\n*Hints:* One Speed-Up method is to do an initial Start/Finish connectivity check.\r\n \r\n\r\n\u003chttp://contest.usc.edu/index.php/Fall12/Home?action=download\u0026upname=pits.yucheng.cpp.txt Martian Pits C solution\u003e.  Time to Solve: 40 minutes. Only three solved this puzzle during the contest. Start.","description_html":"\u003cp\u003eThis Challenge is to solve Question F, Martian Pits, of the \u003ca href=\"http://contest.usc.edu/index.php/Fall12/Home\"\u003eUSC ACM Fall 2012 Contest\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eThe task is to determine the minimum time for the Rover to drive from its current position to a Goal location. The Rover must STOP on the Goal location. Commands are processed at 1 Cmd per sec. Rover must stay on array.\u003c/p\u003e\u003cp\u003eThis is an intriguing Maze problem that incorporates turn penalties, variable speed forward, and a fixed reverse speed.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInitial conditions are Rover Stopped and Facing +Y.\r\nCommands are processed at 1 second intervals\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eCommands and their attributes:\r\nFORWARD: Starts rolling forward at 1 cm/s\r\nBACKWARDS: Roll backwards at 1 cm/s\r\nFASTER: Increase forward speed by 1 cm/s up to 5 cm/s\r\nSLOWER: Decrease forward speed by 1 cm/s down to 0 cm/s. At 0 cm/s Rover is \"Stopped\"\r\nSTOP: Halts rover movement\r\nRIGHT: Turn rover 90 degrees to the right\r\nLEFT: Turn the rover 90 degrees to the left\r\nNOOP: No change in anything \r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eCommands FORWARD, BACKWARDS, RIGHT, LEFT only take effect if the rover is stopped. A moving rover ignores these commands.\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eCommands FASTER and SLOWER only take effect if the rover is moving forward.\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eInput: [Char array]\u003c/b\u003e \".\" is Flat ground, \"P\" Pit, \"R\" Rover start location, \"D\" is Destination.  Matrix max dim 50, min 1.\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput: [T]\u003c/b\u003e; Drive Time to destination; -1 if not possible\u003c/p\u003e\u003cp\u003e\u003cb\u003eScoring: 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=pits.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: [A]\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e...................D\r\n.P......P.P.........\r\n.P...PPPP.P.........\r\n.P...P....P.........\r\n.P...P.PPPP.........\r\n.P.PPP.P............\r\n.P.P...P............\r\n.PPP.PPPPPPPPPPPPPPP\r\n....R...............\r\nPPPPPPPPPPPPPPPPPPPP\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eOutput: [19]\u003c/b\u003e as the best path is L, Fwd, Faster, Slower, Stop to (9,1). The cmds to reach (1,1) are R, Fwd, Faster, Faster, Slower, Stop. Cmds to optimally reach (1,20) are R, Fwd, Faster, Faster, Faster, Faster, Slower, Stop.\u003c/p\u003e\u003cp\u003eOnce again my code is large thus the contest will be scored based on Processing Time.\u003c/p\u003e\u003cp\u003e\u003cb\u003eHints:\u003c/b\u003e One Speed-Up method is to do an initial Start/Finish connectivity check.\u003c/p\u003e\u003cp\u003e\u003ca href=\"http://contest.usc.edu/index.php/Fall12/Home?action=download\u0026amp;upname=pits.yucheng.cpp.txt\"\u003eMartian Pits C solution\u003c/a\u003e.  Time to Solve: 40 minutes. Only three solved this puzzle during the contest. Start.\u003c/p\u003e","function_template":"function t=Pits(A)\r\n  t=-1;\r\n\r\nend","test_suite":"feval(@assignin,'caller','score',1000);\r\n%%\r\nurlwrite('http://contest.usc.edu/index.php/Fall12/Home?action=download\u0026upname=pits.in.txt','pits.in.txt');\r\n%%\r\n fid=fopen('pits.in.txt','r');\r\n t_expect=[19 2 2 3 -1 7 14 23 401 200 42 -1 27 -1];\r\n \r\n t1=0;\r\n qty=fscanf(fid,'%i',1);\r\nfor q=1:qty %qty\r\n  n = fscanf(fid,'%f %f\\n',2)'; % array size\r\n  A=zeros(n);\r\n  for i=1:n(1)\r\n   strv=fgetl(fid);\r\n   %A(i,:)=strv-'.';\r\n   A(i,:)=strv;\r\n  end\r\n\r\n  ta=clock;\r\n   [t]=Pits(char(A)) ;\r\n  t1=t1+etime(clock,ta)*1000; % Time in msec\r\n   \r\n  fprintf('%2i  Cmds %3.0f  Sum Time %.0f \\n',q,t,t1)\r\n\r\n  %isequal(t,t_expect(q))\r\n\r\n  assert(isequal(t,t_expect(q)));\r\n\r\nend % q\r\n\r\nt2=min(1000,t1);\r\nfprintf('Actual Time = %.1f msec\\n',t1)\r\nfeval(@assignin,'caller','score',floor(t2));","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":3,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-12-14T01:14:38.000Z","updated_at":"2012-12-14T02:24:14.000Z","published_at":"2012-12-14T02:24: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 F, Martian Pits, 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\u003eThe task is to determine the minimum time for the Rover to drive from its current position to a Goal location. The Rover must STOP on the Goal location. Commands are processed at 1 Cmd per sec. Rover must stay on array.\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 an intriguing Maze problem that incorporates turn penalties, variable speed forward, and a fixed reverse speed.\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[Initial conditions are Rover Stopped and Facing +Y.\\nCommands are processed at 1 second intervals\\n\\nCommands and their attributes:\\nFORWARD: Starts rolling forward at 1 cm/s\\nBACKWARDS: Roll backwards at 1 cm/s\\nFASTER: Increase forward speed by 1 cm/s up to 5 cm/s\\nSLOWER: Decrease forward speed by 1 cm/s down to 0 cm/s. At 0 cm/s Rover is \\\"Stopped\\\"\\nSTOP: Halts rover movement\\nRIGHT: Turn rover 90 degrees to the right\\nLEFT: Turn the rover 90 degrees to the left\\nNOOP: No change in anything \\n\\nCommands FORWARD, BACKWARDS, RIGHT, LEFT only take effect if the rover is stopped. A moving rover ignores these commands.\\n\\nCommands FASTER and SLOWER only take effect if the rover is moving forward.]]\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\u003eInput: [Char array]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \\\".\\\" is Flat ground, \\\"P\\\" Pit, \\\"R\\\" Rover start location, \\\"D\\\" is Destination. Matrix max dim 50, min 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\u003eOutput: [T]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e; Drive Time to destination; -1 if not possible\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: 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=pits.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: [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[...................D\\n.P......P.P.........\\n.P...PPPP.P.........\\n.P...P....P.........\\n.P...P.PPPP.........\\n.P.PPP.P............\\n.P.P...P............\\n.PPP.PPPPPPPPPPPPPPP\\n....R...............\\nPPPPPPPPPPPPPPPPPPPP]]\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\u003eOutput: [19]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e as the best path is L, Fwd, Faster, Slower, Stop to (9,1). The cmds to reach (1,1) are R, Fwd, Faster, Faster, Slower, Stop. Cmds to optimally reach (1,20) are R, Fwd, Faster, Faster, Faster, Faster, Slower, Stop.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOnce again my code is large thus the contest will be scored based on Processing 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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHints:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e One Speed-Up method is to do an initial Start/Finish connectivity check.\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=pits.yucheng.cpp.txt\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMartian Pits C solution\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. Time to Solve: 40 minutes. Only three solved this puzzle during the contest. Start.\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":1138,"title":"Rubik's Cube: 30 Moves or Less: Minimum Avg Time","description":"This Challenge is to solve a thoroughly scrambled Rubik's cube in the minimum time (30 moves max).\r\n\r\nRubik's Cube can be solved in 20 moves or less from any position.  The \u003chttp://kociemba.org/cube.htm Kociemba Two Phase algorithm\u003e can solve the Cube in 30 moves or less.  The basic theory is that any cube can transition to an H-cube by 12 moves using all possible 18 move types.  An H-cube is defined as having no rotations or flips of corners or edges, respectively, and has all middle edges in the middle row. The cube can be solved from any H-cube state in 18 moves or less using only the moves U U' U2 D D' D2 F2 L2 R2 B2. \u003chttp://kociemba.org/math/CubeDefs.htm#faceturns Definitions of Moves / Rotates / Flips for Corners and Edges\u003e. The Two-Phase algorithm typically solves in 24 moves or less.\r\n\r\n\u003c\u003chttps://sites.google.com/site/razapor/matlab_cody/cube_small.gif\u003e\u003e\r\n\r\n\u003c\u003chttps://sites.google.com/site/razapor/matlab_cody/Cube_Map48_200.png\u003e\u003e\r\n\r\nRubik's Cube has 48 faces that are assigned to a vector as in the above figure.\r\nU refers to the White face, F-Blue, L-Red, R-Orange, D-Yellow, and B-Green. Moves (1-6 UFDLBR 7-12 U'F'D'L'B'R' 13-18 U2F2D2L2B2R2) are clockwise looking towards the center, primes are CCW (eq U'), and twos are a half turn of a face.\r\n\r\n  The color to numeric coding is [RWBYGO] [012345]. \r\n  A solved cube is [0000 0000 1111 1111 2222 2222 3333 3333 4444 4444 5555 5555]\r\n\r\n*Input:* Cube\r\n\r\nCube is a 48 long row vector of values 0 thru 5.\r\n  \r\n*Output:* Move_Vector\r\n\r\nMove_Vector is an empty to 30 element vector of values 1:18\r\n\r\n*Constraint:* Solution must be 30 moves or less\r\n\r\n*Scoring:* Average Time of Cubes 2 thru 4 (msec)\r\n\r\n\u003chttp://cube20.org/src/ Two Phase Source code\u003e is fairly complex and may require a 500MB database file. Its goal is to find solutions of 20 or less starting with Two Phase.\r\n\r\n\u003chttps://sites.google.com/site/razapor/matlab_cody/Cube30rev001.ppt?attredirects=0\u0026d=1 30 move Cube Solution in Matlab (rought draft)\u003e","description_html":"\u003cp\u003eThis Challenge is to solve a thoroughly scrambled Rubik's cube in the minimum time (30 moves max).\u003c/p\u003e\u003cp\u003eRubik's Cube can be solved in 20 moves or less from any position.  The \u003ca href=\"http://kociemba.org/cube.htm\"\u003eKociemba Two Phase algorithm\u003c/a\u003e can solve the Cube in 30 moves or less.  The basic theory is that any cube can transition to an H-cube by 12 moves using all possible 18 move types.  An H-cube is defined as having no rotations or flips of corners or edges, respectively, and has all middle edges in the middle row. The cube can be solved from any H-cube state in 18 moves or less using only the moves U U' U2 D D' D2 F2 L2 R2 B2. \u003ca href=\"http://kociemba.org/math/CubeDefs.htm#faceturns\"\u003eDefinitions of Moves / Rotates / Flips for Corners and Edges\u003c/a\u003e. The Two-Phase algorithm typically solves in 24 moves or less.\u003c/p\u003e\u003cimg src=\"https://sites.google.com/site/razapor/matlab_cody/cube_small.gif\"\u003e\u003cimg src=\"https://sites.google.com/site/razapor/matlab_cody/Cube_Map48_200.png\"\u003e\u003cp\u003eRubik's Cube has 48 faces that are assigned to a vector as in the above figure.\r\nU refers to the White face, F-Blue, L-Red, R-Orange, D-Yellow, and B-Green. Moves (1-6 UFDLBR 7-12 U'F'D'L'B'R' 13-18 U2F2D2L2B2R2) are clockwise looking towards the center, primes are CCW (eq U'), and twos are a half turn of a face.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eThe color to numeric coding is [RWBYGO] [012345]. \r\nA solved cube is [0000 0000 1111 1111 2222 2222 3333 3333 4444 4444 5555 5555]\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e Cube\u003c/p\u003e\u003cp\u003eCube is a 48 long row vector of values 0 thru 5.\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e Move_Vector\u003c/p\u003e\u003cp\u003eMove_Vector is an empty to 30 element vector of values 1:18\u003c/p\u003e\u003cp\u003e\u003cb\u003eConstraint:\u003c/b\u003e Solution must be 30 moves or less\u003c/p\u003e\u003cp\u003e\u003cb\u003eScoring:\u003c/b\u003e Average Time of Cubes 2 thru 4 (msec)\u003c/p\u003e\u003cp\u003e\u003ca href=\"http://cube20.org/src/\"\u003eTwo Phase Source code\u003c/a\u003e is fairly complex and may require a 500MB database file. Its goal is to find solutions of 20 or less starting with Two Phase.\u003c/p\u003e\u003cp\u003e\u003ca href=\"https://sites.google.com/site/razapor/matlab_cody/Cube30rev001.ppt?attredirects=0\u0026amp;d=1\"\u003e30 move Cube Solution in Matlab (rought draft)\u003c/a\u003e\u003c/p\u003e","function_template":"function [v]=Rubik_Solver(cube)\r\n% moves 1-6 UFDLBR 7-12 U'F;D'L'B'R' 13-18 U2F2D2L2B2R2\r\n% Return v as a numeric row vector of k values in range 1:18\r\n  v=[];\r\nend","test_suite":"%%\r\n% Thanks to Alfonso Nieto-Castanon\r\nurlwrite('https://sites.google.com/a/alfnie.com/alfnie/software/SetSolutionScore.p?attredirects=0\u0026amp;d=1','SetSolutionScore.p');\r\nrehash path;\r\n%%\r\n%feval(@assignin,'caller','score',20000); % msec\r\n%%\r\nvf=[ 17 2 3 20 5 22 7 8 11 13 16 10 15 9 12 14 41 18 19 44 21 46 23 24 25 26 27 28 29 30 31 32 33 34 6 36 4 38 39 1 40 42 43 37 45 35 47 48; \r\n  1 2 3 4 5 25 28 30 9 10 8 12 7 14 15 6 19 21 24 18 23 17 20 22 43 26 27 42 29 41 31 32 33 34 35 36 37 38 39 40 11 13 16 44 45 46 47 48 ;\r\n  1 2 38 4 36 6 7 33 9 10 11 12 13 14 15 16 17 18 3 20 5 22 23 8 27 29 32 26 31 25 28 30 48 34 35 45 37 43 39 40 41 42 19 44 21 46 47 24 ;\r\n  3 5 8 2 7 1 4 6 33 34 35 12 13 14 15 16 9 10 11 20 21 22 23 24 17 18 19 28 29 30 31 32 25 26 27 36 37 38 39 40 41 42 43 44 45 46 47 48 ;\r\n  14 12 9 4 5 6 7 8 46 10 11 47 13 48 15 16 17 18 19 20 21 22 23 24 25 26 1 28 2 30 31 3 35 37 40 34 39 33 36 38 41 42 43 44 45 32 29 27 ;\r\n  1 2 3 4 5 6 7 8 9 10 11 12 13 22 23 24 17 18 19 20 21 30 31 32 25 26 27 28 29 38 39 40 33 34 35 36 37 14 15 16 43 45 48 42 47 41 44 46 ;\r\n  40 2 3 37 5 35 7 8 14 12 9 15 10 16 13 11 1 18 19 4 21 6 23 24 25 26 27 28 29 30 31 32 33 34 46 36 44 38 39 41 17 42 43 20 45 22 47 48 ;\r\n  1 2 3 4 5 16 13 11 9 10 41 12 42 14 15 43 22 20 17 23 18 24 21 19 6 26 27 7 29 8 31 32 33 34 35 36 37 38 39 40 30 28 25 44 45 46 47 48 ;\r\n  1 2 19 4 21 6 7 24 9 10 11 12 13 14 15 16 17 18 43 20 45 22 23 48 30 28 25 31 26 32 29 27 8 34 35 5 37 3 39 40 41 42 38 44 36 46 47 33 ;\r\n  6 4 1 7 2 8 5 3 17 18 19 12 13 14 15 16 25 26 27 20 21 22 23 24 33 34 35 28 29 30 31 32 9 10 11 36 37 38 39 40 41 42 43 44 45 46 47 48 ;\r\n  27 29 32 4 5 6 7 8 3 10 11 2 13 1 15 16 17 18 19 20 21 22 23 24 25 26 48 28 47 30 31 46 38 36 33 39 34 40 37 35 41 42 43 44 45 9 12 14 ;\r\n  1 2 3 4 5 6 7 8 9 10 11 12 13 38 39 40 17 18 19 20 21 14 15 16 25 26 27 28 29 22 23 24 33 34 35 36 37 30 31 32 46 44 41 47 42 48 45 43 ;\r\n  41 2 3 44 5 46 7 8 16 15 14 13 12 11 10 9 40 18 19 37 21 35 23 24 25 26 27 28 29 30 31 32 33 34 22 36 20 38 39 17 1 42 43 4 45 6 47 48 ;\r\n  1 2 3 4 5 43 42 41 9 10 30 12 28 14 15 25 24 23 22 21 20 19 18 17 16 26 27 13 29 11 31 32 33 34 35 36 37 38 39 40 8 7 6 44 45 46 47 48 ;\r\n  1 2 43 4 45 6 7 48 9 10 11 12 13 14 15 16 17 18 38 20 36 22 23 33 32 31 30 29 28 27 26 25 24 34 35 21 37 19 39 40 41 42 3 44 5 46 47 8 ;\r\n  8 7 6 5 4 3 2 1 25 26 27 12 13 14 15 16 33 34 35 20 21 22 23 24 9 10 11 28 29 30 31 32 17 18 19 36 37 38 39 40 41 42 43 44 45 46 47 48 ;\r\n  48 47 46 4 5 6 7 8 32 10 11 29 13 27 15 16 17 18 19 20 21 22 23 24 25 26 14 28 12 30 31 9 40 39 38 37 36 35 34 33 41 42 43 44 45 3 2 1 ; \r\n  1 2 3 4 5 6 7 8 9 10 11 12 13 30 31 32 17 18 19 20 21 38 39 40 25 26 27 28 29 14 15 16 33 34 35 36 37 22 23 24 48 47 46 45 44 43 42 41 ];\r\n\r\n cube_orig=[zeros(1,8) ones(1,8) ones(1,8)*2 ones(1,8)*3 ones(1,8)*4 ones(1,8)*5]; \r\n tsum=0;\r\n Lbest=30;\r\n for cube_sets=1:4\r\n  if cube_sets==2,tsum=0;end\r\n encode=randi(18,1,80);\r\n fprintf('Encode: ');fprintf('%i ',encode);fprintf('\\n')\r\n r=cube_orig;\r\n for i= encode\r\n  r=r(vf(i,:));\r\n end\r\n encode=[]; % anti-shortcut\r\n encode_str='';\r\n cube=r;\r\n fprintf('%i',r);fprintf('\\n')\r\n\r\n% Time function\r\n ta=clock;\r\n [v]=Rubik_Solver(cube);\r\n t1=etime(clock,ta)*1000; % time in msec\r\n tsum=tsum+t1;\r\n Lv=length(v);\r\n assert(Lv\u003c=30)\r\n \r\n fprintf('Time: %.0f msec  Total Time %.0f\\n',t1,tsum)\r\n \r\n fprintf('Solution length %i\\n',length(v))\r\n fprintf('%i ',v);fprintf('\\n')\r\n \r\n r=cube;\r\n for i=v\r\n  r=r(vf(i,:));\r\n end\r\n \r\n fprintf('Solved Cube\\n');fprintf('%i',r);fprintf('\\n')\r\n\r\n tf=isequal(r,cube_orig);\r\n fprintf('Solved %i Moves %i \\n\\n\\n\\n',tf, Lv)\r\n assert(tf)\r\n assert(~isequal(1,2))\r\n if Lv\u003cLbest,Lbest=Lv;end\r\n \r\n end % cubesets\r\n\r\n %msiz=mtree('Rubik_Solver.m','-file').count\r\n\r\nfeval(  @assignin,'caller','score',floor(min( 20000,tsum/3 ))  );\r\nfprintf('\\n\\nScore %i\\n',floor(min( 20000,tsum/3 )));\r\nSetSolutionScore(floor(min( 20000,tsum/3 )));","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1,"test_suite_updated_at":"2016-12-23T22:06:57.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-12-25T03:53:42.000Z","updated_at":"2026-02-03T07:18:48.000Z","published_at":"2012-12-25T05:17:49.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.gif\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/media/image1.png\"}],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is to solve a thoroughly scrambled Rubik's cube in the minimum time (30 moves max).\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\u003eRubik's Cube can be solved in 20 moves or less from any position. 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://kociemba.org/cube.htm\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eKociemba Two Phase algorithm\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e can solve the Cube in 30 moves or less. The basic theory is that any cube can transition to an H-cube by 12 moves using all possible 18 move types. An H-cube is defined as having no rotations or flips of corners or edges, respectively, and has all middle edges in the middle row. The cube can be solved from any H-cube state in 18 moves or less using only the moves U U' U2 D D' D2 F2 L2 R2 B2.\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://kociemba.org/math/CubeDefs.htm#faceturns\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eDefinitions of Moves / Rotates / Flips for Corners and Edges\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The Two-Phase algorithm typically solves in 24 moves or less.\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:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId2\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRubik's Cube has 48 faces that are assigned to a vector as in the above figure. U refers to the White face, F-Blue, L-Red, R-Orange, D-Yellow, and B-Green. Moves (1-6 UFDLBR 7-12 U'F'D'L'B'R' 13-18 U2F2D2L2B2R2) are clockwise looking towards the center, primes are CCW (eq U'), and twos are a half turn of a face.\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[The color to numeric coding is [RWBYGO] [012345]. \\nA solved cube is [0000 0000 1111 1111 2222 2222 3333 3333 4444 4444 5555 5555]]]\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\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Cube\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\u003eCube is a 48 long row vector of values 0 thru 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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Move_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\u003eMove_Vector is an empty to 30 element vector of values 1:18\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\u003eConstraint:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Solution must be 30 moves or less\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:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Average Time of Cubes 2 thru 4 (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:hyperlink w:docLocation=\\\"http://cube20.org/src/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eTwo Phase Source code\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is fairly complex and may require a 500MB database file. Its goal is to find solutions of 20 or less starting with Two Phase.\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=\\\"https://sites.google.com/site/razapor/matlab_cody/Cube30rev001.ppt?attredirects=0\u0026amp;d=1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e30 move Cube Solution in Matlab (rought draft)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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,R0lGODlhhACBAPcAAFIBBYKCggAAjsfHvZZOTubm2KOioo4AAD09lgAAyqccHJ+xsfPz5cYAACMjldfXygEBrJKSkuLx8QQEU6yuu4UUFLmxsa2tpxAQnOQAAN/f0c3NxGVlaOnp6aoAAZqamv7+8gAAnAAA7AAAvImJibSlpbW4uJaWoCkpQ1EdHe7u4La2qsEKCqeTkwAAcrm5s9HZ2YGBlMLCwktLc+Li4qWlqpsAAFpaigAA3Zs1NPn569IAAMjQ0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VCKCdyGed5OGrtDtoZNLuN0o1+4id/SjkqKNuqadcr1jXcZMYCLZCOZfCcLq99+7yIsM3veC/kXjK4+3EZG7zZvU1Dd2pE30QJ/w4sqzt5byfzFgD/xy83RtxbP638hgwOrEYAn1vJs3BO/O4Y7HE6OycsInOMkI346btLjIbnscVlD6IbO8gu9YNxaMnAbdLqx+HLOzoT9tZvQDq/6+Ly9NPqgEe7rYUWBJE22b9chnpVVBV+oso0aw4EpQbWX82LqfMmDA6uwtViPP+6uD/CWExnXbcZsoXkx7cSV8tYhdk/ktlrZDg2N9ddBA/tOlMYw9aYVY8bt/L5E/eWIC+rdOhCce17CR7WLTw+1tevpbdx1rkLEZFl1Wc4ZosYzqWqxbp2vKngyxlmLAkoThhqae98yZB1kg2JcZg2/c/djn+7sYi97n3bTBsf6qFo8+oJ4AyMZPKeh97sd3viwzEXuQkg2enPnzyOqqvKSCd0mFqUVV1bU1Ze+zb0126xGcUR733Ey6PsZ6HF6axcRYnR8sEZ73oTZE3curWCnyWyxzjRsf43zD5oi1z7vv8hJE9ysLeOu3BgUaVCFanvhc0FLcLMaSUrBW1rTX1LbXkLblt1g9bUhM1z66WVN8f5iVFAG99IHhD4srw+6vrJdiwOqsYInyvO+BQSHrn3+MZD92PPjQ4WJKzN1YX+19IjzvovZ5JweiFFzj39QU3By0v/GgubDlX9SPJBJq8rYJGRkJtvJUKyjtNP5+Pic945bdvYPh2XkZGedH2gGzmEIyukIhnndq6/ZpJwy8on08H3s73jfsadWwNkbcfd7JjSG01920+j14TKPfXG15SsdcesbZ7dvPzqgfeWfZDtl57yA72tf62h8aVrKCAx8MWJ06eBfpeTfm/84bmfbR3efdiIrALNsyCW3ceK7QXGC+kpkrlCSwGHfDfw5WSEiIn5+fvyQfxw8f13PXU7NRU7Olm5zV1Barqe1RU7Onq2BPFV9MSdnST7t9dh8JOCLR1UHgRED1f5BylCjEvsbMAAAAAElFTkSuQmCC\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":1693,"title":"Calculate distance travelled when given radius and rotations","description":"When given radius of wheel and number of rotations calculate total distance travelled\r\nconsider pi=3.14","description_html":"\u003cp\u003eWhen given radius of wheel and number of rotations calculate total distance travelled\r\nconsider pi=3.14\u003c/p\u003e","function_template":"function y = calci_dist(r,n)\r\n  y = 1;\r\nend","test_suite":"%%\r\nr = 1;\r\nn = 1;\r\ny_correct = 6.28;\r\nassert(isequal(calci_dist(r,n),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":14448,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":242,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-07-02T09:00:14.000Z","updated_at":"2026-03-09T20:57:39.000Z","published_at":"2013-07-02T09:02:09.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\u003eWhen given radius of wheel and number of rotations calculate total distance travelled consider pi=3.14\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":956,"title":"Unique: Enhanced Performance - Large and Wide Array - Speed Improvement (66% savings)","description":"The Challenge is to perform very fast unique function for a long and wide array.\r\n\r\nThe data is small integer representing data permutations of items like DNA and Rubik's cube faces.\r\n\r\n*Input:* Array of uint8 of dimensions (m, 48) with values 0:3\r\n\r\n*Output:* Array Equivalent to unique(A,'rows')\r\n\r\n*Hints:*\r\n\r\n1) Columns can be merged to form a reduced number of columns\r\n2) Unique has the option to provide an Array and a sorting Index","description_html":"\u003cp\u003eThe Challenge is to perform very fast unique function for a long and wide array.\u003c/p\u003e\u003cp\u003eThe data is small integer representing data permutations of items like DNA and Rubik's cube faces.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e Array of uint8 of dimensions (m, 48) with values 0:3\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e Array Equivalent to unique(A,'rows')\u003c/p\u003e\u003cp\u003e\u003cb\u003eHints:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e1) Columns can be merged to form a reduced number of columns\r\n2) Unique has the option to provide an Array and a sorting Index\u003c/p\u003e","function_template":"function ans = unique_rows_fast(a)\r\n  unique(a,'rows');\r\nend","test_suite":"%%\r\nfeval(@assignin,'caller','score',20000);\r\n%%\r\n% Warm-Up Calls and functionality check\r\ntic\r\nc=randi(4,1024,48,'uint8')-1;\r\nout = unique_rows_fast(c);\r\nassert(isequal(unique(c,'rows'),out)) \r\n\r\nc=randi(4,2048,48,'uint8')-1;\r\nout = unique_rows_fast(c);\r\nassert(isequal(unique(c,'rows'),out)) \r\n\r\nc=randi(4,4096,48,'uint8')-1;\r\nout = unique_rows_fast(c);\r\nassert(isequal(unique(c,'rows'),out)) \r\ntoc\r\n%%\r\ntic\r\nc=randi(4,4000000,48,'uint8')-1;\r\ntoc\r\n\r\nta=clock;\r\nout = unique_rows_fast(c);\r\nt1=etime(clock,ta)*1000;\r\n\r\ntic\r\nassert(isequal(unique(c,'rows'),out)) %\r\ntoc\r\n\r\nt2=min(20000,t1); % unique scores 18.1 sec\r\nfprintf('Actual Time = %.0f msec\\n',t1)\r\nfeval(@assignin,'caller','score',floor(t2));","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":20,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-09-24T03:51:17.000Z","updated_at":"2026-01-21T12:09:19.000Z","published_at":"2012-09-24T05:40: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\",\"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\u003eThe Challenge is to perform very fast unique function for a long and wide array.\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 data is small integer representing data permutations of items like DNA and Rubik's cube faces.\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:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Array of uint8 of dimensions (m, 48) with values 0:3\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:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Array Equivalent to unique(A,'rows')\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\u003eHints:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1) Columns can be merged to form a reduced number of columns 2) Unique has the option to provide an Array and a sorting Index\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":955,"title":"ismember: Enhanced Time Performance for 'rows'  - Speed Scoring (90% savings)","description":"The Challenge is to perform very fast the 'ismember' function for a long and wide array.\r\n\r\nThe data is small integer representing data permutations of items like DNA and Rubik's cube faces and orientations.\r\n\r\n*Input:* Array of uint8 of dimensions (m, 16) with values 0:3\r\n\r\n*Output:* Array Equivalent to ismember(A,B,'rows')\r\n\r\n*Hints:*\r\n\r\n1) Columns can be merged to form a reduced number of columns\r\n2) Unique has the option to provide an Array and a sorting Index","description_html":"\u003cp\u003eThe Challenge is to perform very fast the 'ismember' function for a long and wide array.\u003c/p\u003e\u003cp\u003eThe data is small integer representing data permutations of items like DNA and Rubik's cube faces and orientations.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e Array of uint8 of dimensions (m, 16) with values 0:3\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e Array Equivalent to ismember(A,B,'rows')\u003c/p\u003e\u003cp\u003e\u003cb\u003eHints:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e1) Columns can be merged to form a reduced number of columns\r\n2) Unique has the option to provide an Array and a sorting Index\u003c/p\u003e","function_template":"function idx = ismember_fast_rows(a,b)\r\n idx=ismember(a,b,'rows');\r\nend","test_suite":"%%\r\nfeval(@assignin,'caller','score',40000);\r\n%%\r\n% Functionality Tests\r\nL=128;\r\na=randi(4,L,16,'uint8')-1;\r\nb=randi(4,L,16,'uint8')-1;\r\nassert(isequal(ismember(a,b,'rows'),ismember_fast_rows(a,b)))\r\n\r\nb=a;\r\nassert(isequal(ismember(a,b,'rows'),ismember_fast_rows(a,b)))\r\n\r\nL=256;\r\na=randi(4,L,16,'uint8')-1;\r\nb=randi(4,L,16,'uint8')-1;\r\na(16:32,:)=b(32:48,:);\r\nassert(isequal(ismember(a,b,'rows'),ismember_fast_rows(a,b)))\r\n\r\n%%\r\nL=4000000;  % ismember 40    fast 5.2\r\n% 34 sec 4M\r\ntic\r\na=randi(4,L,16,'uint8')-1;\r\nb=randi(4,L,16,'uint8')-1;\r\ntoc\r\n\r\n\r\nta=clock;\r\nidx = ismember_fast_rows(a,b);\r\nt1=etime(clock,ta)*1000;\r\n\r\nfprintf('Elapsed time = %.0f msec\\n',t1)\r\n\r\n%assert(isequal(ismember(a,b,'rows'),idx))\r\n\r\nt2=min(40000,t1); % ismember scores 40000 msec\r\nfeval(@assignin,'caller','score',floor(t2));\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":6,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":19,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-09-24T02:05:42.000Z","updated_at":"2025-06-08T09:02:05.000Z","published_at":"2012-09-24T05:39: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\",\"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\u003eThe Challenge is to perform very fast the 'ismember' function for a long and wide array.\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 data is small integer representing data permutations of items like DNA and Rubik's cube faces and orientations.\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:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Array of uint8 of dimensions (m, 16) with values 0:3\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:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Array Equivalent to ismember(A,B,'rows')\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\u003eHints:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1) Columns can be merged to form a reduced number of columns 2) Unique has the option to provide an Array and a sorting Index\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":952,"title":"Unique: Enhanced Performance - Avoiding Memory Crash","description":"The Challenge is to create the unique array for a long and wide array.\r\n\r\nDifficulties are that the normal unique(a,'rows') function call will suffer a Memory crash on Cody. c=randi(4,9000000,48,'uint8')-1;\r\n\r\nThe second part of the challenge is Execution Speed.\r\n\r\nThe data is small integer representing data permutations of items like DNA and Rubik's cube faces.\r\n\r\n*Input:* Array of uint8 of dimensions (m, 48) with values 0:3\r\n\r\n*Output:* Array Equivalent to unique(A,'rows')\r\n\r\nHints:\r\n\r\n1) Columns can be merged to form a reduced number of columns\r\n2) Unique has the option to provide an Array and a sorting Index","description_html":"\u003cp\u003eThe Challenge is to create the unique array for a long and wide array.\u003c/p\u003e\u003cp\u003eDifficulties are that the normal unique(a,'rows') function call will suffer a Memory crash on Cody. c=randi(4,9000000,48,'uint8')-1;\u003c/p\u003e\u003cp\u003eThe second part of the challenge is Execution Speed.\u003c/p\u003e\u003cp\u003eThe data is small integer representing data permutations of items like DNA and Rubik's cube faces.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e Array of uint8 of dimensions (m, 48) with values 0:3\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e Array Equivalent to unique(A,'rows')\u003c/p\u003e\u003cp\u003eHints:\u003c/p\u003e\u003cp\u003e1) Columns can be merged to form a reduced number of columns\r\n2) Unique has the option to provide an Array and a sorting Index\u003c/p\u003e","function_template":"function ans = unique_rows_fast(a)\r\n  unique(a,'rows');\r\nend","test_suite":"%%\r\nfeval(@assignin,'caller','score',40000);\r\n%%\r\n% Warm-Up Calls and functionality check\r\ntic\r\nc=randi(4,1024,48,'uint8')-1;\r\nout = unique_rows_fast(c);\r\nassert(isequal(unique(c,'rows'),out)) \r\n\r\nc=randi(4,2048,48,'uint8')-1;\r\nout = unique_rows_fast(c);\r\nassert(isequal(unique(c,'rows'),out)) \r\n\r\nc=randi(4,4096,48,'uint8')-1;\r\nout = unique_rows_fast(c);\r\nassert(isequal(unique(c,'rows'),out)) \r\ntoc\r\n%%\r\ntic\r\nc=randi(4,9000000,48,'uint8')-1;\r\ntoc\r\n\r\nta=clock;\r\nout = unique_rows_fast(c);\r\nt1=etime(clock,ta)*1000;\r\n\r\n%assert(isequal(unique(c,'rows'),out)) % avoid time-out vs mem \r\nt2=min(40000,t1); % unique scores memory crash\r\nfprintf('Actual Time = %.0f msec\\n',t1)\r\nfeval(@assignin,'caller','score',floor(t2));\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":15,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-09-19T13:54:20.000Z","updated_at":"2025-12-07T18:19:10.000Z","published_at":"2012-09-24T05:41: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\u003eThe Challenge is to create the unique array for a long and wide array.\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\u003eDifficulties are that the normal unique(a,'rows') function call will suffer a Memory crash on Cody. c=randi(4,9000000,48,'uint8')-1;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe second part of the challenge is Execution Speed.\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 data is small integer representing data permutations of items like DNA and Rubik's cube faces.\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:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Array of uint8 of dimensions (m, 48) with values 0:3\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:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Array Equivalent to unique(A,'rows')\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\u003eHints:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1) Columns can be merged to form a reduced number of columns 2) Unique has the option to provide an Array and a sorting Index\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":963,"title":"We love vectorized solutions.  Problem 1 : remove the row average.","description":"Given a 2-d matrix, remove the row average from each row.  Your solution MUST be vectorized.  The solution will be tested for accuracy AND speed.  Any for loops will make the solution too slow to pass the speed test.\r\n\r\nExample:\r\n\r\n  a = [ 1 2 ; 3 5 ];\r\n  b = remove_average_vectorized(a);\r\n  % b is [ -0.5 0.5 ; -1 1 ];\r\n","description_html":"\u003cp\u003eGiven a 2-d matrix, remove the row average from each row.  Your solution MUST be vectorized.  The solution will be tested for accuracy AND speed.  Any for loops will make the solution too slow to pass the speed test.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea = [ 1 2 ; 3 5 ];\r\nb = remove_average_vectorized(a);\r\n% b is [ -0.5 0.5 ; -1 1 ];\r\n\u003c/pre\u003e","function_template":"function y = remove_average_vectorized(x)\r\n    % This works but is too slow.\r\n\r\n    for row=1:size(x,1)\r\n      row_average=mean(x(row,:));\r\n      for col=1:size(x,2)\r\n        x(row,col)=x(row,col)-row_average; \r\n      end\r\n    end\r\n  y=x;\r\nend","test_suite":"x = [ 0 1 ; 2 3 ] ;\r\ny_correct = [ -0.5 0.5 ; -0.5 0.5 ] ;\r\ny = remove_average_vectorized(x);\r\nassert(isequal(y,y_correct));\r\n\r\n%% \r\nx = [ 0 1 ; 2 3 ] ;\r\ntimer=tic;\r\ny = remove_average_vectorized(x);\r\nduration=toc(timer)\r\n% You can probably pass this test with a for loop.\r\nassert(duration\u003c0.1,sprintf('Time used %2.3f\\n',duration)); \r\n\r\n%%\r\nx = [ 1:9999 ; 2:10000 ; [ zeros(1,9998) 9999 ]  ];\r\nx = repmat(x,1000,1);\r\ny_correct = [ -4999:1:4999 ; -4999:1:4999 ; [ repmat(-1,1,9998) 9998 ] ];\r\ny_correct = repmat(y_correct,1000,1);\r\ny = remove_average_vectorized(x);\r\nassert(isequal(y,y_correct));\r\n\r\n%%\r\nx = [ 1:9999 ; 2:10000 ; [ zeros(1,9998) 9999 ]  ];\r\nx = repmat(x,1000,1);\r\ntimer=tic;\r\ny = remove_average_vectorized(x);\r\nduration=toc(timer)\r\n% A decent vectorized solution should take around 1 second.\r\nassert(duration\u003c2,sprintf('Time used %2.3f\\n',duration)); ","published":true,"deleted":false,"likes_count":7,"comments_count":12,"created_by":6808,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":885,"test_suite_updated_at":"2012-10-02T05:21:12.000Z","rescore_all_solutions":false,"group_id":12,"created_at":"2012-10-01T06:43:20.000Z","updated_at":"2026-04-10T23:44:29.000Z","published_at":"2012-10-01T07:30:28.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 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for accuracy AND speed. Any for loops will make the solution too slow to pass the speed test.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a = [ 1 2 ; 3 5 ];\\nb = remove_average_vectorized(a);\\n% b is [ -0.5 0.5 ; -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":477,"title":"speed vs size","description":"The given string describes some MATLAB expressions such as 'pause(1)'. Compute its performance score = code size + run time in milliseconds/100. For size, please refer to this link: \r\n\u003chttp://www.mathworks.com/matlabcentral/fileexchange/34754-calculate-size\u003e","description_html":"\u003cp\u003eThe given string describes some MATLAB expressions such as 'pause(1)'. Compute its performance score = code size + run time in milliseconds/100. For size, please refer to this link:  \u003ca href=\"http://www.mathworks.com/matlabcentral/fileexchange/34754-calculate-size\"\u003ehttp://www.mathworks.com/matlabcentral/fileexchange/34754-calculate-size\u003c/a\u003e\u003c/p\u003e","function_template":"function ss = score(str)\r\n  ss = nodesize(str)+time;\r\nend","test_suite":"%%\r\nstr='pause(1)';\r\nss=14;\r\nassert(abs(ss-score(str))\u003c3)\r\n%%\r\nstr='pause(1/2);pause(1/2)';\r\nss=22;\r\nassert(abs(ss-score(str))\u003c3)\r\n%%\r\nstr='pause(1/200);pause(1/200)';\r\nss=12;\r\nassert(abs(ss-score(str))\u003c3)\r\n%%\r\nstr='pause((1/200));pause((1/2))';\r\nss=19;\r\nassert(abs(ss-score(str))\u003c3)\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":27,"test_suite_updated_at":"2012-03-10T07:03:10.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-03-10T07:03:10.000Z","updated_at":"2026-01-01T13:15:56.000Z","published_at":"2012-03-10T07:03:48.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe given string describes some MATLAB expressions such as 'pause(1)'. Compute its performance score = code size + run time in milliseconds/100. For size, please refer to this link: \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/fileexchange/34754-calculate-size\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://www.mathworks.com/matlabcentral/fileexchange/34754-calculate-size\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":850,"title":"Spectral Distance - Speed Scoring","description":"Find quantity of pixels within a spectral distance from a given [r,g,b] spectra.\r\n\r\n*Spectral distance* = sqrt( (r0-ri)^2+(g0-gi)^2+(b0-bi)^2) where [r0,g0,b0] is the target spectra (0:255) and [ri,gi,bi] are from an image pixel.\r\n\r\nTwo warm-up timing prep runs will be executed against a 512x512 sub-section.\r\n\r\nTiming run will be against a 2036x3060 image : concordaerial.png\r\n\r\nA second test will select a random point in a small window to confirm accuracy.\r\nUnfortunately bwdist does not appear to work in Cody.\r\n\r\n\r\n*Ranking* will be based upon speed. Accuracy is still required.\r\n\r\n*Input:* [image array, spectra, threshold distance] \r\n\r\nimage array [ x, y, 3 ]  % Higher order images is a future activity\r\n\r\nspectra [ r g b]\r\n\r\n*Output:* [ N ]  number of pixels within(\u003c=) threshold distance\r\n\r\nPixel count tolerance of 1% is allowed\r\n\r\n\r\nThe right to update the test points/thresholds is reserved in case of shenanigans.","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: 393px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 196.5px; transform-origin: 407px 196.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 238px 8px; transform-origin: 238px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFind quantity of pixels within a spectral distance from a given [r,g,b] spectra.\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: 61px 8px; transform-origin: 61px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eSpectral distance\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: 311.5px 8px; transform-origin: 311.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e = sqrt( (r0-ri)^2+(g0-gi)^2+(b0-bi)^2) where [r0,g0,b0] is the target spectra (0:255) and [ri,gi,bi] are from an image pixel.\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: 246.5px 8px; transform-origin: 246.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eTwo warm-up timing prep runs will be executed against a 512x512 sub-section.\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: 206px 8px; transform-origin: 206px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eTiming run will be against a 2036x3060 image : concordaerial.png\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: 374.5px 8px; transform-origin: 374.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA second test will select a random point in a small window to confirm accuracy. Unfortunately bwdist does not appear to work in Cody.\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: 28.5px 8px; transform-origin: 28.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eRanking\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: 164.5px 8px; transform-origin: 164.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e will be based upon speed. Accuracy is still required.\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: 20px 8px; transform-origin: 20px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eInput:\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: 132.5px 8px; transform-origin: 132.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e [image array, spectra, threshold distance]\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: 196.5px 8px; transform-origin: 196.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eimage array [ x, y, 3 ] % Higher order images is a future activity\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: 46px 8px; transform-origin: 46px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003espectra [ r g 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: 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: 26px 8px; transform-origin: 26px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eOutput:\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: 160.5px 8px; transform-origin: 160.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e [ N ] number of pixels within(\u0026lt;=) threshold distance\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: 118px 8px; transform-origin: 118px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ePixel count tolerance of 1% is allowed\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: 256px 8px; transform-origin: 256px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe right to update the test points/thresholds is reserved in case of shenanigans.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function N = spectral_dist(A,S,d)\r\n% A is array [x,y,3]\r\n% S is the Spectra zero [r g b]\r\n% d is the spectral distance limt - double\r\n  N=0;\r\nend","test_suite":"%%\r\nfeval(@assignin,'caller','score',2000);\r\n%%\r\nglobal As dt\r\n %A=imread('concordaerial.png');\r\n A=imread(fullfile(matlabroot,'toolbox','images','imdata','concordaerial.png'));\r\n size(A); % 2036 x 3060\r\n As=A(1:512,1:512,:);\r\n\r\nS=squeeze(A(1182,1672,:))'; % Golf Course\r\nd=sqrt(3);\r\nN_expect=730;\r\n\r\n% Small warm-up calls 512x512\r\n N = spectral_dist(As,S,d);\r\n N = spectral_dist(As,S,d);\r\n% A big warm-up call\r\n N = spectral_dist(A,S,d);\r\nt0=clock;\r\n N = spectral_dist(A,S,d);\r\ndt=etime(clock,t0)*1000; % ms\r\nfprintf('N= %i  Time to process %.0f msec\\n',N,dt);\r\nPass=0.99*N_expect\u003cN \u0026\u0026 N\u003c1.01*N_expect;\r\nassert(Pass==1,sprintf('N_exp=730  N= %.0f\\n',N))\r\n\r\n%%\r\nglobal As dt\r\ntemp=dt; % anti-cheat\r\n\r\n%randomize random\r\nseed=clock;\r\nseed=1000*seed(6);\r\nrng(seed);\r\n% Select random point in As sub-window for anti-cheat purposes\r\nx=randi(512,1,1);\r\ny=randi(512,1,1);\r\n\r\nS=squeeze(As(x,y,:))'; % \r\nd=sqrt(17);\r\n\r\n N = spectral_dist(As,S,d);\r\n\r\ndt=temp;\r\n\r\n S=double(S);\r\n As=double(As);\r\n N_expect=0;\r\n for i=1:512\r\n  for j=1:512\r\n    dr2=(S(1)-As(i,j,1))^2;\r\n    dg2=(S(2)-As(i,j,2))^2;\r\n    db2=(S(3)-As(i,j,3))^2;\r\n   if sqrt(dr2+dg2+db2)\u003c=d\r\n    N_expect=N_expect+1;\r\n   end\r\n  end\r\n end\r\n\r\nfprintf('x=%i  y=%i  N= %i  N_expect=%i\\n',x,y,N,N_expect);\r\n\r\nPass=0.99*N_expect\u003cN \u0026\u0026 N\u003c1.01*N_expect;\r\n\r\ndt=temp; % anti-cheat\r\n\r\nassert(Pass==1,sprintf('x= %i y=%i N_exp=%.0f  N= %.0f\\n',x,y,N_expect,N))\r\n%%\r\nglobal dt\r\n%Write file based on time in test 1\r\nnet_time=dt;\r\n% net_time in ms\r\n% Create graph data\r\nnet_time=min(2000,net_time); % Limit graph y-axis\r\nfeval(@assignin,'caller','score',floor(net_time));\r\n\r\n%fh=fopen('spectral_dist.m','wt');\r\n%fprintf(fh,'%s\\n',repmat('1;',[1,round(net_time/2)]));\r\n%fclose(fh);\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":10,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":10,"test_suite_updated_at":"2020-10-26T16:33:16.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-07-20T03:11:11.000Z","updated_at":"2020-10-26T16:33:16.000Z","published_at":"2012-07-23T00:43:36.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 quantity of pixels within a spectral distance from a given [r,g,b] spectra.\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\u003eSpectral distance\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = sqrt( (r0-ri)^2+(g0-gi)^2+(b0-bi)^2) where [r0,g0,b0] is the target spectra (0:255) and [ri,gi,bi] are from an image pixel.\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\u003eTwo warm-up timing prep runs will be executed against a 512x512 sub-section.\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\u003eTiming run will be against a 2036x3060 image : concordaerial.png\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 second test will select a random point in a small window to confirm accuracy. Unfortunately bwdist does not appear to work in Cody.\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\u003eRanking\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e will be based upon speed. Accuracy is still required.\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\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [image array, spectra, threshold distance]\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\u003eimage array [ x, y, 3 ] % Higher order images is a future activity\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\u003espectra [ r g 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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [ N ] number of pixels within(\u0026lt;=) threshold distance\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\u003ePixel count tolerance of 1% is allowed\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 right to update the test points/thresholds is reserved in case of shenanigans.\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":539,"title":"Fun Race","description":"* Given two unary functions foo and goo.\r\n* Check whether foo(0) runs faster than goo(0).\r\n* Output 1 if foo is faster, otherwise output 2.\r\n* Please give the answer within 1/5 seconds.","description_html":"\u003cul\u003e\u003cli\u003eGiven two unary functions foo and goo.\u003c/li\u003e\u003cli\u003eCheck whether foo(0) runs faster than goo(0).\u003c/li\u003e\u003cli\u003eOutput 1 if foo is faster, otherwise output 2.\u003c/li\u003e\u003cli\u003ePlease give the answer within 1/5 seconds.\u003c/li\u003e\u003c/ul\u003e","function_template":"function winner = race(foo,goo)\r\n   winner=1;\r\n   winner=2;\r\nend","test_suite":"%%\r\nfoo=@cosh;\r\ngoo=@(x)sqrt(cosh(x)+pi);\r\nwinner=[];\r\nfor k=1:10; winner(end+1)=race(foo,goo); end\r\nassert(all(winner==1))\r\n\r\n%%\r\nfoo=@num2str;\r\ngoo=@log10;\r\nwinner=[];\r\nfor k=1:10; winner(end+1)=race(foo,goo); end\r\nassert(all(winner==2))\r\n\r\n%%\r\nfoo=@gamma;\r\ngoo=@sign;\r\nwinner=[];\r\nfor k=1:10; winner(end+1)=race(foo,goo); end\r\nassert(all(winner==1))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":8,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":"2012-03-30T16:51:50.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-03-30T16:43:29.000Z","updated_at":"2025-05-06T20:02:39.000Z","published_at":"2012-03-30T16:43: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=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven two unary functions foo and goo.\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\u003eCheck whether foo(0) runs faster than goo(0).\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\u003eOutput 1 if foo is faster, otherwise output 2.\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\u003ePlease give the answer within 1/5 seconds.\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":1259,"title":"It's race time again! Write a function that is at least twice as fast as the test suite call of repmat().","description":"Given an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x. This must be done in less than half the time that repmat(x, m, n) takes. This is the sequel to \u003chttp://www.mathworks.com/matlabcentral/cody/problems/1237-it-s-race-time-write-a-faster-function-than-the-test-suite-call-of-unique\u003e.\r\n\r\nExample: \r\n  Input: repl_mat(2, 2, 5) \r\n  Output: [2, 2, 2, 2, 2; 2, 2, 2, 2, 2];","description_html":"\u003cp\u003eGiven an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x. This must be done in less than half the time that repmat(x, m, n) takes. This is the sequel to \u003ca href=\"http://www.mathworks.com/matlabcentral/cody/problems/1237-it-s-race-time-write-a-faster-function-than-the-test-suite-call-of-unique\"\u003ehttp://www.mathworks.com/matlabcentral/cody/problems/1237-it-s-race-time-write-a-faster-function-than-the-test-suite-call-of-unique\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eExample: \r\n  Input: repl_mat(2, 2, 5) \r\n  Output: [2, 2, 2, 2, 2; 2, 2, 2, 2, 2];\u003c/p\u003e","function_template":"function y = my_repmat(x, m, n)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1.7;\r\nm = 197;\r\nn = 535;\r\n\r\ntic\r\ny_correct = repmat(x, m, n);\r\nt_repmat = toc\r\n\r\ntic\r\ny_myrepmat = my_repmat(x, m, n);\r\nt_myrepmat = toc\r\n\r\nassert(isequal(y_myrepmat,y_correct) \u0026\u0026 t_myrepmat \u003c t_repmat/2)\r\n\r\n%%\r\nx = -0.3;\r\nm = 1;\r\nn = 5350;\r\n\r\ntic\r\ny_correct = repmat(x, m, n);\r\nt_repmat = toc\r\n\r\ntic\r\ny_myrepmat = my_repmat(x, m, n);\r\nt_myrepmat = toc\r\n\r\nassert(isequal(y_myrepmat,y_correct) \u0026\u0026 t_myrepmat \u003c t_repmat/2)\r\n\r\n%%\r\nx = 0;\r\nm = 14;\r\nn = 5350;\r\n\r\ntic\r\ny_correct = repmat(x, m, n);\r\nt_repmat = toc\r\n\r\ntic\r\ny_myrepmat = my_repmat(x, m, n);\r\nt_myrepmat = toc\r\n\r\nassert(isequal(y_myrepmat,y_correct) \u0026\u0026 t_myrepmat \u003c t_repmat)","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":10338,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":21,"test_suite_updated_at":"2013-02-10T22:09:06.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-02-10T21:58:01.000Z","updated_at":"2013-02-10T22:09:06.000Z","published_at":"2013-02-10T22:09: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\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x. This must be done in less than half the time that repmat(x, m, n) takes. This is the sequel to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/1237-it-s-race-time-write-a-faster-function-than-the-test-suite-call-of-unique\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://www.mathworks.com/matlabcentral/cody/problems/1237-it-s-race-time-write-a-faster-function-than-the-test-suite-call-of-unique\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\u003eExample: Input: repl_mat(2, 2, 5) Output: [2, 2, 2, 2, 2; 2, 2, 2, 2, 2];\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":1889,"title":"Get ranking of a combination looking for speed.","description":"I have the numbers pulled without replacement from the set [1 2 3 4 5 6 7 8 9 10 11 12 13];  They are then ordered from least to greatest.\r\n\r\nSo a selection of [3 2 9], [9 2 3] are both considered to be [2 3 9].\r\n\r\nThere are 286 unique selections possible.  These can be ordered in lexicographic order:\r\n\r\n  Element   1 = [ 1  2  3]\r\n  Element   2 = [ 1  2  4]\r\n  Element   3 = [ 1  2  5]\r\n  Element   4 = [ 1  2  6]\r\n  Element   5 = [ 1  2  7]\r\n  Element   6 = [ 1  2  8]\r\n  Element   7 = [ 1  2  9]\r\n  Element   8 = [ 1  2 10]\r\n  Element   9 = [ 1  2 11]\r\n  Element  10 = [ 1  2 12]\r\n  Element  11 = [ 1  2 13]\r\n  Element  12 = [ 1  3  4]\r\n  Element  13 = [ 1  3  5]\r\n  Element  14 = [ 1  3  6]\r\n  Element  15 = [ 1  3  7]\r\n  ...\r\n  Element 285 = [10 12 13]\r\n  Element 286 = [11 12 13]\r\n\r\nGiven the three ordered values as a row vector, return the element number.\r\n\r\nThe test suite only passes if it is faster that my reference code.\r\n\r\n\r\n","description_html":"\u003cp\u003eI have the numbers pulled without replacement from the set [1 2 3 4 5 6 7 8 9 10 11 12 13];  They are then ordered from least to greatest.\u003c/p\u003e\u003cp\u003eSo a selection of [3 2 9], [9 2 3] are both considered to be [2 3 9].\u003c/p\u003e\u003cp\u003eThere are 286 unique selections possible.  These can be ordered in lexicographic order:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eElement   1 = [ 1  2  3]\r\nElement   2 = [ 1  2  4]\r\nElement   3 = [ 1  2  5]\r\nElement   4 = [ 1  2  6]\r\nElement   5 = [ 1  2  7]\r\nElement   6 = [ 1  2  8]\r\nElement   7 = [ 1  2  9]\r\nElement   8 = [ 1  2 10]\r\nElement   9 = [ 1  2 11]\r\nElement  10 = [ 1  2 12]\r\nElement  11 = [ 1  2 13]\r\nElement  12 = [ 1  3  4]\r\nElement  13 = [ 1  3  5]\r\nElement  14 = [ 1  3  6]\r\nElement  15 = [ 1  3  7]\r\n...\r\nElement 285 = [10 12 13]\r\nElement 286 = [11 12 13]\r\n\u003c/pre\u003e\u003cp\u003eGiven the three ordered values as a row vector, return the element number.\u003c/p\u003e\u003cp\u003eThe test suite only passes if it is faster that my reference code.\u003c/p\u003e","function_template":"function value = get3HCRank(vec)\r\n  value = vec;\r\nend","test_suite":"%%\r\nfeval(@assignin,'caller','score',0);\r\n%%\r\n\r\nvec1 = [1 6 13];\r\nvec2 = [1 2 4];\r\nvec3 = [3 5 8];\r\nvec4 = [5 9 11];\r\nanswer1 = 45;\r\nanswer2 = 2;\r\nanswer3 = 133;\r\nanswer4 = 222;\r\n\r\nfor i=1:5 % Warmup Calls to get valid timing\r\n value = get3HCRank(vec1);\r\nend\r\n\r\nta=clock;\r\n\r\nfor i = 1:10000\r\n ansU1=get3HCRank(vec1);\r\n\r\n ansU2=get3HCRank(vec2);\r\n\r\n ansU3=get3HCRank(vec3);\r\n\r\n ansU4=get3HCRank(vec4);\r\nend\r\n\r\nt1=etime(clock,ta);\r\ntiming = t1 * 95;\r\nbenchmark = 100;\r\n\r\nassert(isequal(ansU1,answer1))\r\nassert(isequal(ansU2,answer2))\r\nassert(isequal(ansU3,answer3))\r\nassert(isequal(ansU4,answer4))\r\nassert(timing \u003c benchmark)\r\n\r\nout = timing\r\n\r\nfeval(@assignin,'caller','score',out);","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":240,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":51,"test_suite_updated_at":"2013-09-25T13:09:55.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-09-24T17:56:14.000Z","updated_at":"2026-02-08T20:00:49.000Z","published_at":"2013-09-24T17:56: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\u003eI have the numbers pulled without replacement from the set [1 2 3 4 5 6 7 8 9 10 11 12 13]; They are then ordered from least to greatest.\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\u003eSo a selection of [3 2 9], [9 2 3] are both considered to be [2 3 9].\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\u003eThere are 286 unique selections possible. These can be ordered in lexicographic order:\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[Element   1 = [ 1  2  3]\\nElement   2 = [ 1  2  4]\\nElement   3 = [ 1  2  5]\\nElement   4 = [ 1  2  6]\\nElement   5 = [ 1  2  7]\\nElement   6 = [ 1  2  8]\\nElement   7 = [ 1  2  9]\\nElement   8 = [ 1  2 10]\\nElement   9 = [ 1  2 11]\\nElement  10 = [ 1  2 12]\\nElement  11 = [ 1  2 13]\\nElement  12 = [ 1  3  4]\\nElement  13 = [ 1  3  5]\\nElement  14 = [ 1  3  6]\\nElement  15 = [ 1  3  7]\\n...\\nElement 285 = [10 12 13]\\nElement 286 = [11 12 13]]]\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\u003eGiven the three ordered values as a row vector, return the element 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:t\u003eThe test suite only passes if it is faster that my reference code.\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":44351,"title":"Code breaker, Part I:  Operation Phoenix","description":"You have been tasked with decoding a set of coded messages that have been intercepted.  \r\n\r\nBased on previous intelligence that has been gathered, you can be confident that the messages were encoded using a simple \u003chttps://en.wikipedia.org/wiki/Caesar_cipher Caesar cipher\u003e (a type of \u003chttps://en.wikipedia.org/wiki/Substitution_cipher substitution cipher\u003e), an example of which is the \u003chttps://en.wikipedia.org/wiki/ROT13 ROT13 cipher\u003e (discussed in \u003chttps://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher Cody Challenge Problem 78\u003e).  As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation \u0026 numbers) are unchanged.  Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and may vary between messages (also, here you need to decode, not encode).  \r\n\r\nYou can also assume that the original message will relate to an activity that is referred to by those involved as \"Operation Phoenix\". Therefore the phrase \"Operation Phoenix\" (with that capitalisation) would have appeared at least once in the original message.  \r\n\r\nYour task is to crack the codes and report back in a \u003chttp://au.mathworks.com/help/matlab/ref/struct.html structure array\u003e:  (1) the shifting parameter that had been used in the encoding [as \u003chttp://au.mathworks.com/help/matlab/ref/uint8.html uint8\u003e];  (2)  the decoded message [as \u003chttp://au.mathworks.com/help/matlab/ref/char.html character array\u003e].  \r\nThe name of the structure array shall be \"s\", with respective fields \"shift\" and \"message\".  \r\n\r\nEXAMPLE\r\n\r\nSuppose the original message was _\"Cancel Operation Phoenix immediately \u0026 escape.\"_ and a (right-shifting) ROT1 cipher had been applied.  In that case A→B, B→C, ..., Y→Z, and Z→A;  similarly, a→b, b→c, ..., y→z, and z→a.  (Note that the shifting 'wraps' back around.)  \r\nThus the encoded message would be:  _\"Dbodfm Pqfsbujpo Qipfojy jnnfejbufmz \u0026 ftdbqf.\"_\r\n\r\nThe correct answer would comprise:  \r\n\r\n  s.shift = uint8(1)  \r\n  s.message = 'Cancel Operation Phoenix immediately \u0026 escape.'\r\n\r\n|Note: Many Cody solutions are hard to read and not necessarily computationally efficient. To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable and doesn't generate excessive text output). Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand.|  \r\n\r\nTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \"too slow\".\r\n\r\n----------\r\n\r\nNext problem:  \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44356 Operation Orthos\u003e.\r\n\r\n----------\r\n\r\nStatistics on solutions submitted as at 15 October 2017:\r\n\r\n* *Fastest wall time to decode 5000 messages = 93 milliseconds* , for \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1279303 Solution 1279303\u003e, with a size-based score of 40. \r\n* *Smallest size-based score = 38* , for \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1278780 Solution 1278780\u003e, for which wall time to decode 5000 messages = 515 milliseconds.  \r\n* Best combined score = 49, for \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1279303 Solution 1279303\u003e. ","description_html":"\u003cp\u003eYou have been tasked with decoding a set of coded messages that have been intercepted.\u003c/p\u003e\u003cp\u003eBased on previous intelligence that has been gathered, you can be confident that the messages were encoded using a simple \u003ca href = \"https://en.wikipedia.org/wiki/Caesar_cipher\"\u003eCaesar cipher\u003c/a\u003e (a type of \u003ca href = \"https://en.wikipedia.org/wiki/Substitution_cipher\"\u003esubstitution cipher\u003c/a\u003e), an example of which is the \u003ca href = \"https://en.wikipedia.org/wiki/ROT13\"\u003eROT13 cipher\u003c/a\u003e (discussed in \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher\"\u003eCody Challenge Problem 78\u003c/a\u003e).  As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation \u0026 numbers) are unchanged.  Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and may vary between messages (also, here you need to decode, not encode).\u003c/p\u003e\u003cp\u003eYou can also assume that the original message will relate to an activity that is referred to by those involved as \"Operation Phoenix\". Therefore the phrase \"Operation Phoenix\" (with that capitalisation) would have appeared at least once in the original message.\u003c/p\u003e\u003cp\u003eYour task is to crack the codes and report back in a \u003ca href = \"http://au.mathworks.com/help/matlab/ref/struct.html\"\u003estructure array\u003c/a\u003e:  (1) the shifting parameter that had been used in the encoding [as \u003ca href = \"http://au.mathworks.com/help/matlab/ref/uint8.html\"\u003euint8\u003c/a\u003e];  (2)  the decoded message [as \u003ca href = \"http://au.mathworks.com/help/matlab/ref/char.html\"\u003echaracter array\u003c/a\u003e].  \r\nThe name of the structure array shall be \"s\", with respective fields \"shift\" and \"message\".\u003c/p\u003e\u003cp\u003eEXAMPLE\u003c/p\u003e\u003cp\u003eSuppose the original message was \u003ci\u003e\"Cancel Operation Phoenix immediately \u0026 escape.\"\u003c/i\u003e and a (right-shifting) ROT1 cipher had been applied.  In that case A→B, B→C, ..., Y→Z, and Z→A;  similarly, a→b, b→c, ..., y→z, and z→a.  (Note that the shifting 'wraps' back around.)  \r\nThus the encoded message would be:  \u003ci\u003e\"Dbodfm Pqfsbujpo Qipfojy jnnfejbufmz \u0026 ftdbqf.\"\u003c/i\u003e\u003c/p\u003e\u003cp\u003eThe correct answer would comprise:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003es.shift = uint8(1)  \r\ns.message = 'Cancel Operation Phoenix immediately \u0026 escape.'\r\n\u003c/pre\u003e\u003cp\u003e\u003ctt\u003eNote: Many Cody solutions are hard to read and not necessarily computationally efficient. To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable and doesn't generate excessive text output). Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand.\u003c/tt\u003e\u003c/p\u003e\u003cp\u003eTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \"too slow\".\u003c/p\u003e\u003cp\u003e----------\u003c/p\u003e\u003cp\u003eNext problem:  \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44356\"\u003eOperation Orthos\u003c/a\u003e.\u003c/p\u003e\u003cp\u003e----------\u003c/p\u003e\u003cp\u003eStatistics on solutions submitted as at 15 October 2017:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003eFastest wall time to decode 5000 messages = 93 milliseconds\u003c/b\u003e , for \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1279303\"\u003eSolution 1279303\u003c/a\u003e, with a size-based score of 40.\u003c/li\u003e\u003cli\u003e\u003cb\u003eSmallest size-based score = 38\u003c/b\u003e , for \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1278780\"\u003eSolution 1278780\u003c/a\u003e, for which wall time to decode 5000 messages = 515 milliseconds.\u003c/li\u003e\u003cli\u003eBest combined score = 49, for \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1279303\"\u003eSolution 1279303\u003c/a\u003e.\u003c/li\u003e\u003c/ul\u003e","function_template":"function s = decode(x)\r\n  s = x;\r\nend","test_suite":"%% NOTE:  \r\n% This test suite can be updated if inappropriate 'hacks' \r\n% are discovered in any submitted solutions, \r\n% so your score/size may therefore change over time.  \r\n\r\n\r\n%% Test 1\r\nx = 'Dbodfm Pqfsbujpo Qipfojy jnnfejbufmz \u0026 ftdbqf.';\r\ns_correct.shift = 1;\r\ns_correct.message = 'Cancel Operation Phoenix immediately \u0026 escape.';\r\ns = decode(x);\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\nassert( isequal(class(s.shift), 'uint8') )\r\nassert( isequal(class(s.message), 'char') )\r\n\r\n\r\n%% Test 2\r\nx = 'Vwlyhapvu Wovlupe ilnpuz Ablzkhf!  Vwlyhapvu Wovlupe pz vby avw wypvypaf.';\r\ns_correct.shift = 7;\r\ns_correct.message = 'Operation Phoenix begins Tuesday!  Operation Phoenix is our top priority.';\r\ns = decode(x);\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\nassert( isequal(class(s.shift), 'uint8') )\r\nassert( isequal(class(s.message), 'char') )\r\n\r\n\r\n%% Test 3\r\nx = 'Eatpht cdit iwpi iwt ephhldgs wph qttc rwpcvts ugdb \"Fxeudyn\" id \"Dvcsbwl\".  Diwtglxht Detgpixdc Ewdtcxm xh egdrttsxcv prrdgsxcv id eapc.';\r\ns_correct.shift = 15;\r\ns_correct.message = 'Please note that the password has been changed from \"Qipfojy\" to \"Ogndmhw\".  Otherwise Operation Phoenix is proceeding according to plan.';\r\ns = decode(x);\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\nassert( isequal(class(s.shift), 'uint8') )\r\nassert( isequal(class(s.message), 'char') )\r\n\r\n\r\n%% Test 4\r\nx = 'Mncpyrgml Nfmclgv qryprcb rfpcc bywq yem.  Yjj ncpqmllcj ypc rm pckygl ml bsrw slrgj Mncpyrgml Nfmclgv gq amknjcrcb.';\r\ns_correct.shift = 24;\r\ns_correct.message = 'Operation Phoenix started three days ago.  All personnel are to remain on duty until Operation Phoenix is completed.';\r\ns = decode(x);\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\nassert( isequal(class(s.shift), 'uint8') )\r\nassert( isequal(class(s.message), 'char') )\r\n\r\n\r\n%% Rescoring \r\n% Acknowledgements \r\n% Portions of this timing test code were inspired by:\r\n% (1) Problem 937. \"Rubik's Mini Cube: Solve Randomized Cube in 11 Moves or Less; Score is by Time (msec)\" by Richard Zapor.\r\n% (2) Problem 2733. \"Evil Number\" by Jan Orwat.\r\n% (3) Feedback in comments from Peng Liu.\r\n% (4) Problem Problem 1237. \"It's race time! Write a faster function than the test suite call of unique().\" by Jeremy.\r\n\r\n% Note:  The Time Trial section does not check accuracy; that is done above.\r\n\r\n% Initialise\r\nx = 'Dbodfm Pqfsbujpo Qipfojy jnnfejbufmz \u0026 ftdbqf.';\r\ncutoffTimeBig = 1000; % Maximum allowable walltime (in milliseconds) to run function in a loop with qBig iterations.\r\n\r\nfor dummy = 1 : 20,  disp(' . ');  end;\r\n\r\n% Run once, untimed?\r\nincludeOverheads = false;\r\nif includeOverheads, \r\n    solution = decode( x );\r\nend;\r\n\r\n% *** PRELIMINARY TIMING ***\r\n% In case the submitted function has a lot of text output, \r\n% get an estimate based on just a few iterations\r\n% Initialise\r\nqSmall = 50;\r\nqBig = 5000;\r\nt0 = clock;\r\n\r\n% Loop\r\nfor i = 1 : qSmall\r\n    solution = decode( x );\r\nend;\r\n\r\n% Compute and display elapsed time.\r\ndt = etime(clock, t0) * 1000;\r\ndisp('     -----=====-----     ')\r\nfprintf('Your wall time to decode %u messages = %i msec.\\n\\r', qSmall, floor(dt))\r\nfprintf('Your APPROXIMATE wall time to decode %u messages would be ~ %i msec.\\n\\r', qBig, ceil(dt * qBig / qSmall))\r\ndisp('     -----=====-----     ')\r\nfor dummy = 1 : 20,  disp(' . ');  end;\r\n\r\n% *** 'OFFICIAL' TIMING ***\r\n% Re-initialise timer\r\nt0 = clock;\r\nt0_cpu = cputime;\r\n\r\n% Loop\r\nfor i = 1 : qBig\r\n    solution = decode( x );\r\nend;\r\n\r\n% Compute and display elapsed time.\r\nfor dummy = 1 : 20,  disp(' . ');  end;\r\ndisp('     -----=====|||||=====-----     ')\r\ndt = etime(clock, t0) * 1000;\r\nfprintf('Your wall time to decode %u messages = %i msec.\\n\\r', qBig, floor(dt))\r\n\r\ndt_cpu = (cputime - t0_cpu) * 1000;\r\nfprintf(' ( Your CPU time for this = %i msec. ) \\n\\r', floor(dt_cpu))\r\n\r\nfDecode = @()   decode(x);\r\ndt_timeit = timeit( fDecode ) * 1000;\r\nfprintf(' [ Your ''timeit'' time to decode %u messages = %i msec. ] \\n\\r', qBig, ceil(dt_timeit * qBig))\r\n\r\n% Display a size-based score.\r\nall_nodes = mtree('decode.m', '-file');        % This is the default in Cody.\r\nstr_nodes = mtfind(all_nodes, 'Kind', 'STRING');\r\neq_nodes = mtfind(all_nodes, 'Kind', 'EQUALS');\r\nprint_nodes = mtfind(all_nodes, 'Kind', 'PRINT');\r\nexpr_nodes = mtfind(all_nodes, 'Kind', 'EXPR');\r\n\r\nsize_score = count(all_nodes) ...\r\n +sum(str_nodes.nodesize-1) ...\r\n +2*(count(expr_nodes) ...\r\n +count(print_nodes) ...\r\n -count(eq_nodes));\r\n\r\nfprintf('Your size-based score = %i.\\n\\r', size_score)\r\n\r\n% Report revised performance score.\r\ncombinedScore = size_score  +  min( 200, floor(dt*(500/qBig)) );\r\nfprintf('Your combined score = %i.\\n\\r', combinedScore)\r\ndisp('     -----=====|||||=====-----     ')\r\n\r\n% Now disallow any candidate solutions that are TOO SLOW!\r\nif dt \u003e cutoffTimeBig, \r\n    fprintf('Sorry, your submission is TOO SLOW. It must be able to finish within %u milliseconds.\\n\\r', cutoffTimeBig)\r\nend;\r\n\r\nassert( dt \u003c= cutoffTimeBig, 'Exceeded time limit specified in Test Suite.' )","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":45,"test_suite_updated_at":"2017-10-15T10:19:08.000Z","rescore_all_solutions":false,"group_id":40,"created_at":"2017-09-29T09:20:59.000Z","updated_at":"2026-04-02T08:27:57.000Z","published_at":"2017-09-29T13:45:26.000Z","restored_at":"2017-10-04T19:25:07.000Z","restored_by":null,"spam":false,"simulink":false,"admin_reviewed":true,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou have been tasked with decoding a set of coded messages that have been intercepted.\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\u003eBased on previous intelligence that has been gathered, you can be confident that the messages were encoded using a simple\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/Caesar_cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCaesar cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (a type 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=\\\"https://en.wikipedia.org/wiki/Substitution_cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003esubstitution cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e), an example of which is 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/ROT13\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eROT13 cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (discussed 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://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Challenge Problem 78\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e). As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation \u0026amp; numbers) are unchanged. Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and may vary between messages (also, here you need to decode, not encode).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou can also assume that the original message will relate to an activity that is referred to by those involved as \\\"Operation Phoenix\\\". Therefore the phrase \\\"Operation Phoenix\\\" (with that capitalisation) would have appeared at least once in the original message.\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\u003eYour task is to crack the codes and report back in a\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://au.mathworks.com/help/matlab/ref/struct.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003estructure array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e: (1) the shifting parameter that had been used in the encoding [as\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://au.mathworks.com/help/matlab/ref/uint8.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003euint8\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e]; (2) the decoded message [as\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://au.mathworks.com/help/matlab/ref/char.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003echaracter array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e]. The name of the structure array shall be \\\"s\\\", with respective fields \\\"shift\\\" and \\\"message\\\".\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEXAMPLE\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSuppose the original message was\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\\\"Cancel Operation Phoenix immediately \u0026amp; escape.\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and a (right-shifting) ROT1 cipher had been applied. In that case A→B, B→C, ..., Y→Z, and Z→A; similarly, a→b, b→c, ..., y→z, and z→a. (Note that the shifting 'wraps' back around.) Thus the encoded message would 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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\\\"Dbodfm Pqfsbujpo Qipfojy jnnfejbufmz \u0026amp; ftdbqf.\\\"\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 correct answer would comprise:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[s.shift = uint8(1)  \\ns.message = 'Cancel Operation Phoenix immediately \u0026 escape.']]\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eNote: Many Cody solutions are hard to read and not necessarily computationally efficient. To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable and doesn't generate excessive text output). Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \\\"too slow\\\".\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----------\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\u003eNext problem: \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44356\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOperation Orthos\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\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\u003eStatistics on solutions submitted as at 15 October 2017:\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFastest wall time to decode 5000 messages = 93 milliseconds\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e , for\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1279303\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eSolution 1279303\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, with a size-based score of 40.\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eSmallest size-based score = 38\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e , for\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1278780\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eSolution 1278780\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, for which wall time to decode 5000 messages = 515 milliseconds.\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\u003eBest combined score = 49, for\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44351-code-breaker-part-i-operation-phoenix/solutions/1279303\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eSolution 1279303\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\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":42636,"title":"Big Integer Multiplication","description":"Implement big integer multiply.\r\n\r\nInput:\r\n\r\nA, B : N-by-M Matrix, each row represents a positive decimal integer.\r\n\r\nOutput:\r\n\r\nC    : N-by-P Matrix, each row represents the decimal integer A*B.  \r\n\r\nExample 1:\r\n\r\n  a = [1 2 3;0 5 6];\r\n  b = [5 6;9 0];\r\n  c = BigIntMult(a,b)\r\n  c =\r\n     6     8     8     8\r\n     5     0     4     0\r\n\r\n123*56=6888 (c(1,:)), 56*90=5040 (c(2,:))\r\n\r\nExample 2 (singleton expansion):\r\n\r\n  a = [1 2 3;0 5 6];\r\n  b = [5 7];\r\n  c = BigIntMult(a,b)\r\n  c =\r\n     7     0     1     1\r\n     3     1     9     2\r\n\r\n123*57=7011 (c(1,:)), 56*57=3192 (c(2,:))\r\n\r\nNote: \r\n\r\n1.you don't need to remove the leading zeroes.\r\n\r\n2.your score will depend on your solution performance.","description_html":"\u003cp\u003eImplement big integer multiply.\u003c/p\u003e\u003cp\u003eInput:\u003c/p\u003e\u003cp\u003eA, B : N-by-M Matrix, each row represents a positive decimal integer.\u003c/p\u003e\u003cp\u003eOutput:\u003c/p\u003e\u003cp\u003eC    : N-by-P Matrix, each row represents the decimal integer A*B.\u003c/p\u003e\u003cp\u003eExample 1:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea = [1 2 3;0 5 6];\r\nb = [5 6;9 0];\r\nc = BigIntMult(a,b)\r\nc =\r\n   6     8     8     8\r\n   5     0     4     0\r\n\u003c/pre\u003e\u003cp\u003e123*56=6888 (c(1,:)), 56*90=5040 (c(2,:))\u003c/p\u003e\u003cp\u003eExample 2 (singleton expansion):\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea = [1 2 3;0 5 6];\r\nb = [5 7];\r\nc = BigIntMult(a,b)\r\nc =\r\n   7     0     1     1\r\n   3     1     9     2\r\n\u003c/pre\u003e\u003cp\u003e123*57=7011 (c(1,:)), 56*57=3192 (c(2,:))\u003c/p\u003e\u003cp\u003eNote:\u003c/p\u003e\u003cp\u003e1.you don't need to remove the leading zeroes.\u003c/p\u003e\u003cp\u003e2.your score will depend on your solution performance.\u003c/p\u003e","function_template":"function c = BigIntMult(a,b)","test_suite":"%% Coutresy of Alfonso Nieto-Castanon\r\nurlwrite('https://sites.google.com/a/alfnie.com/alfnie/software/SetSolutionScore.p?attredirects=0\u0026amp;d=1','SetSolutionScore.p');\r\nrehash path;\r\n\r\n%%\r\na = [1 2 3;0 5 6];\r\nb = [5 6;9 0];\r\nc = BigIntMult(a,b);\r\nassert(isequal(c(:,find(any(c,1),1):end),[6 8 8 8;5 0 4 0]))\r\n\r\n%%\r\nn = 1e2;\r\nm = 20;\r\na = randi([0 9],n,m);\r\nb = randi([0 9],1,m);\r\nc = BigIntMult(a,b);\r\nfor k = 1:n\r\n    d = c(k,:); d = d(:,find(d,1):end);\r\n assert(isequal(char(multiply(java.math.BigInteger(char(48+a(k,:))),java.math.BigInteger(char(48+b))))-48,d))\r\nend\r\n\r\n%%\r\nn = 1e2;\r\nm = 1e5;\r\na = randi([0 9],n,m);\r\nb = randi([0 9],n,m);\r\nt1 = builtin('tic');\r\nc = BigIntMult(a,b);\r\nscore = builtin('toc',t1);\r\nfor k = randi(n,1,3)\r\n    d = c(k,:); d = d(:,find(d,1):end);\r\nassert(isequal(char(multiply(java.math.BigInteger(char(48+a(k,:))),java.math.BigInteger(char(48+b(k,:)))))-48,d))\r\nend\r\nSetSolutionScore(round(5*score))","published":true,"deleted":false,"likes_count":1,"comments_count":6,"created_by":1434,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":7,"test_suite_updated_at":"2015-09-28T09:34:00.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-09-28T08:47:34.000Z","updated_at":"2015-10-08T18:15:12.000Z","published_at":"2015-09-28T08:47:34.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eImplement big integer multiply.\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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA, B : N-by-M Matrix, each row represents a positive decimal integer.\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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eC : N-by-P Matrix, each row represents the decimal integer A*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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample 1:\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 = [1 2 3;0 5 6];\\nb = [5 6;9 0];\\nc = BigIntMult(a,b)\\nc =\\n   6     8     8     8\\n   5     0     4     0]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e123*56=6888 (c(1,:)), 56*90=5040 (c(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\u003eExample 2 (singleton expansion):\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 = [1 2 3;0 5 6];\\nb = [5 7];\\nc = BigIntMult(a,b)\\nc =\\n   7     0     1     1\\n   3     1     9     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\u003e123*57=7011 (c(1,:)), 56*57=3192 (c(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\u003eNote:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1.you don't need to remove the leading zeroes.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e2.your score will depend on your solution performance.\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":44508,"title":"Curve fitting (non-linear functions) \u0026 function handles","description":"In this problem you are provided some raw data. You need to find a way of summarising the data with just a few parameters, so that it can be reconstructed. You then need to provide a handle to your own (generic) custom function that will indeed reproduce the raw data when provided with the parameters that you determine.\r\nConsider a non-linear scalar function y = mˣ + c. Suppose x is the vector [3 2 1 4]. The function would operate elementwise on x; for example, if m=2 and c=3 then y = [11 7 5 19]. You are provided with both the vector x and the vector y. Every number will be provided in some form of an integer data type. The scalar parameters m and c are both whole numbers (although they're not provided directly).\r\nSo here you should output two things:\r\nthe handle to a generic function that implements the relevant non-linear function (i.e. of the form y = mˣ + c) taking two inputs, namely 1 a set of parameters and 2 the vector x, and outputting the corresponding vector y (in any data type); and\r\na set of parameter values (m and c) wrapped into a single MATLAB variable (of any data type).\r\nAs the parameters will be used in your own function, the data type will be set by you.\r\nSo, for the above example, you could return a function handle @myFunc that you have defined, along with the variable param that has two fields such that param.base = 2 and param.translation = 3.\r\nOr, if you have defined your function differently, then you could return the function handle @myFn along with a cell array variable prms that has four elements such that prms{1}='positive', prms{2}=uint8(3), prms{3} = 'positive' and prms{4} = uint8(2).\r\nAnd so on.\r\nNote 1: the parameter m can be assumed to have values between -30 and +30 (inclusive); the parameter c can be assumed to have values between -10000 and +10000 (inclusive); the elements in x are positive.\r\nNote 2: if the code runs too slowly, then it will also fail the Test Suite.\r\nNote 3: there might not be only one unique pair of the m \u0026 c parameter values that is correct — the individual values of m \u0026 c are not tested here, only the values of y that they predict are examined.\r\nSee also Problem 44507. Curve fitting (linear functions) \u0026 function handles — easier.","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: 633px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 316.5px; transform-origin: 407px 316.5px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIn this problem you are provided some raw data. You need to find a way of summarising the data with just a few parameters, so that it can be reconstructed. You then need to provide a handle to your own (generic) custom function that will indeed reproduce the raw data when provided with the parameters that you determine.\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eConsider a non-linear scalar function\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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; \"\u003ey = mˣ + c\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. Suppose\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ex\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 is the 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: 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003e[3 2 1 4]\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. The function would operate elementwise on\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ex\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; for example, if\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003em=2\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 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: 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ec=3\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 then\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ey = [11 7 5 19]\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. You are provided with both the 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: 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ex\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 and the 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: 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ey\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. Every number will be provided in some form of an\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://au.mathworks.com/help/matlab/matlab_prog/integers.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003einteger\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 data type. The scalar parameters\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003em\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 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: 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ec\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 are both whole numbers (although they're not provided directly).\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eSo here you should output two things:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003col style=\"block-size: 81px; 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 40.5px; transform-origin: 391px 40.5px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 61px; 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 30.5px; text-align: left; transform-origin: 363px 30.5px; white-space: pre-wrap; 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 handle to a\u003c/span\u003e\u003c/span\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=\"\"\u003e \u003c/span\u003e\u003c/span\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=\"font-style: italic; \"\u003egeneric\u003c/span\u003e\u003c/span\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=\"\"\u003e function that implements the relevant non-linear function (i.e. of the form\u003c/span\u003e\u003c/span\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=\"\"\u003e \u003c/span\u003e\u003c/span\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=\"font-style: italic; \"\u003ey = mˣ + c\u003c/span\u003e\u003c/span\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=\"\"\u003e) taking two inputs, namely\u003c/span\u003e\u003c/span\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=\"\"\u003e \u003c/span\u003e\u003c/span\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=\"font-weight: 700; \"\u003e1\u003c/span\u003e\u003c/span\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=\"\"\u003e a set of parameters and\u003c/span\u003e\u003c/span\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=\"\"\u003e \u003c/span\u003e\u003c/span\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=\"font-weight: 700; \"\u003e2\u003c/span\u003e\u003c/span\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=\"\"\u003e the vector\u003c/span\u003e\u003c/span\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=\"\"\u003e \u003c/span\u003e\u003c/span\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=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ex\u003c/span\u003e\u003c/span\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=\"\"\u003e, and outputting the corresponding vector\u003c/span\u003e\u003c/span\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=\"\"\u003e \u003c/span\u003e\u003c/span\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=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ey\u003c/span\u003e\u003c/span\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=\"\"\u003e (in any data type); and\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20px; 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 10px; text-align: left; transform-origin: 363px 10px; white-space: pre-wrap; 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=\"\"\u003ea set of parameter values (m and c) wrapped into a single MATLAB variable (of any data type).\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eAs the parameters will be used in your own function, the data type will be set by you.\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eSo, for the above example, you\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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; \"\u003ecould\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 return a\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://au.mathworks.com/help/matlab/function-handles.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003efunction handle\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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003e@myFunc\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 that you have defined, along with the variable\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eparam\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 that has two\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://au.mathworks.com/help/matlab/structures.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003efields\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 such that\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eparam.base\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 = 2 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: 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eparam.translation\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 = 3.\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eOr, if you have defined your function differently, then you\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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; \"\u003ecould\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 return the\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://au.mathworks.com/help/matlab/function-handles.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003efunction handle\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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003e@myFn\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 along with a\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://au.mathworks.com/help/matlab/cell-arrays.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ecell array\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 variable\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eprms\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 that has four elements such that\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eprms{1}='positive'\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eprms{2}=uint8(3)\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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eprms{3} = 'positive'\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 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: 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eprms{4} = uint8(2)\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: 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=\"\"\u003eAnd so on.\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eNote\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; \"\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; font-weight: 700; \"\u003e1\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; \"\u003e: the parameter\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; \"\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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; font-style: italic; \"\u003em\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; \"\u003e can be assumed to have values between -30 and +30 (inclusive); the parameter\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; \"\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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; font-style: italic; \"\u003ec\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; \"\u003e can be assumed to have values between -10000 and +10000 (inclusive); the elements 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; font-style: italic; \"\u003ex\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; \"\u003e are positive.\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eNote\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; \"\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; font-weight: 700; \"\u003e2\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; \"\u003e: if the code runs too slowly, then it will also fail the Test Suite.\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eNote\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; \"\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; font-weight: 700; \"\u003e3\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; \"\u003e: there might not be only one unique pair of the m \u0026amp; c parameter values that is correct — the individual values of m \u0026amp; c are not tested here, only the values of y that they predict are examined.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 20px; 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 10px; transform-origin: 391px 10px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"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 10px; text-align: left; transform-origin: 363px 10px; white-space: pre-wrap; 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=\"\"\u003eSee also\u003c/span\u003e\u003c/span\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=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/44507\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProblem 44507. Curve fitting (linear functions) \u0026amp; function handles\u003c/span\u003e\u003c/span\u003e\u003c/a\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=\"\"\u003e — easier.\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"%{\r\n    Some comments about this code....\r\n%}\r\nfunction [afunctionhandle asetofparameters] = generateFit(x, y)    % \u003c---This function is called first by the Test Suite\r\n    % Here you are going to figure out the values of the parameters\r\n    \r\n    afunctionhandle\r\n    asetofparameters\r\n    \r\nfunction nameofyouroutputvectorvariable = nameofyourgenericnonlinearfunction(nameofyourparametersetvariable, nameofyourxvectorvariable)\r\n    % Here you are providing code representing y = mˣ + c.  ","test_suite":"%% Hard-coded m and c (1).\r\nfor i = 1 : 5\r\n    x = uint64(randi(10):60-randi(40));\r\n    m = uint64(2);\r\n    c = uint64(3);\r\n    y_correct = m.^x + c;\r\n    [fh, pars] = generateFit(x, y_correct);\r\n    y = fh(pars, x);\r\n    assert( isequal(y,y_correct) )\r\nend;\r\n\r\n%% Hard-coded m and c (2).\r\nfor i = 1 : 5\r\n    x = uint64(randi(10):40-randi(10));\r\n    m = uint64(3);\r\n    c = uint64(2);\r\n    y_correct = m.^x + c;\r\n    [fh, pars] = generateFit(x, y_correct);\r\n    y = fh(pars, x);\r\n    assert( isequal(y,y_correct) )\r\nend;\r\n\r\n%% Dynamic m and c.\r\nfor i = 1 : 5\r\n    x = int64( randi(5):25-randi(5) );\r\n    m = int64( randi(10) - 5 );\r\n    c = int64( 10000 - randi(20000) );\r\n    y_correct = m.^x + c;\r\n    [fh, pars] = generateFit(x, y_correct);\r\n    y = fh(pars, x);\r\n    assert( isequal(y,y_correct) )\r\nend;\r\n\r\n%% Variable spacing in x vector, and values in reverse sequence.\r\nfor i = 1 : 100      % EDITED 2021-07-19.  Increased iterations from 5 to 100.\r\n    x = int64( +25-randi(5) : -randi(5) : randi(5) );\r\n    m = int64( randi(10) - 5 );\r\n    c = int64( 10000 - randi(20000) );\r\n    y_correct = m.^x + c;\r\n    try      % EDITED 2021-07-19.  Inserted try–catch structure to provide more feedback on failures.\r\n        [fh, pars] = generateFit(x, y_correct);\r\n        y = fh(pars, x);\r\n        assert( isequal(y,y_correct) )\r\n    catch solnErr\r\n        disp(['Error identifier:  ' solnErr.identifier])\r\n        fprintf('m:\\t%d\\r\\n', m)\r\n        fprintf('c:\\t%d\\r\\n', c)\r\n        fprintf('user parameters:\\r\\n')\r\n        pars\r\n        rethrow(solnErr)\r\n    end;\r\nend;\r\n\r\n%% Variable spacing in x vector, and values out of sequence.\r\nfor i = 1 : 100      % EDITED 2021-07-19.  Increased iterations from 5 to 100.\r\n    x = int64( randi(5) : randi(5) : 25-randi(5) );\r\n    els = randperm( length(x) );\r\n    x = x(els);\r\n    m = int64( randi(10)-5 );\r\n    c = int64( 10000 - randi(20000) );\r\n    y_correct = m.^x + c;\r\n    try      % EDITED 2021-07-19.  Inserted try–catch structure to provide more feedback on failures.\r\n        [fh, pars] = generateFit(x, y_correct);\r\n        y = fh(pars, x);\r\n        assert( isequal(y,y_correct) )\r\n    catch solnErr\r\n        disp(['Error identifier:  ' solnErr.identifier])\r\n        fprintf('m:\\t%d\\r\\n', m)\r\n        fprintf('c:\\t%d\\r\\n', c)\r\n        fprintf('user parameters:\\r\\n')\r\n        pars\r\n        rethrow(solnErr)\r\n    end;\r\nend;\r\n\r\n%% Duplicate values in x.\r\nfor i = 1 : 100      % EDITED 2021-07-19.  Increased iterations from 5 to 100.\r\n    x = int64( randi(5) : randi(5) : 25-randi(5) );\r\n    x = repmat(x, [1,50]);\r\n    els = randperm( length(x) );\r\n    x = x(els);\r\n    m = int64( randi(10)-5 );\r\n    c = int64( 10000 - randi(20000) );\r\n    y_correct = m.^x + c;\r\n    try      % EDITED 2021-07-19.  Inserted try–catch structure to provide more feedback on failures.\r\n        [fh, pars] = generateFit(x, y_correct);\r\n        y = fh(pars, x);\r\n        assert( isequal(y,y_correct) )\r\n    catch solnErr\r\n        disp(['Error identifier:  ' solnErr.identifier])\r\n        fprintf('m:\\t%d\\r\\n', m)\r\n        fprintf('c:\\t%d\\r\\n', c)\r\n        fprintf('user parameters:\\r\\n')\r\n        pars\r\n        rethrow(solnErr)\r\n    end;\r\nend;\r\n\r\n%% Different inputs.\r\nfor i = 1 : 5\r\n    x = int64( 1+randi(4) : 2*randi(2)-1 : 25-randi(4) );    % Must be odd step to ensure both odd and even values of x here.\r\n    els = randperm( length(x) );\r\n    x = x(els);\r\n    m = int64( randi(10)-5 );\r\n    c = int64( 10000 - randi(20000) );\r\n    y_correct = m.^x + c;\r\n    [fh, pars] = generateFit(x, y_correct);\r\n    y = fh(pars, x);\r\n    assert( isequal(y,y_correct) , 'Failed test 7a' )\r\n    idx = [1+randi(2) : length(x)-randi(2)];\r\n    z = x(idx);\r\n    y = fh(pars, z);\r\n    assert( isequal(y, y_correct(idx)) , 'Failed test 7b' )\r\n    z = x-1;\r\n    y = fh(pars, z);\r\n    assert( isequal(y, m.^z + c) , 'Failed test 7c' )\r\n    z = x(idx)+1;\r\n    y = fh(pars, z);\r\n    assert( isequal(y, m.^z + c) , 'Failed test 7d' )\r\nend;\r\n\r\n%% Check interchangeability of function handles.  \r\nfor i = 1 : 5\r\n    % Hard-coded m and c (1).\r\n    x1 = int64(randi(10):60-randi(40));\r\n    m = int64(2);\r\n    c = int64(3);\r\n    y1_correct = m.^x1 + c;\r\n    [fh1, pars1] = generateFit(x1, y1_correct);\r\n\r\n    % Hard-coded m and c (2).\r\n    x2 = int64(randi(10):60-randi(40));\r\n    m = int64(3);\r\n    c = int64(2);\r\n    y2_correct = m.^x2 + c;\r\n    [fh2, pars2] = generateFit(x2, y2_correct);\r\n\r\n    % According to the Problem Statament, fh1 and fh2 should be interchangeable.  \r\n    y1 = fh2(pars1, x1);\r\n    assert( isequal(y1,y1_correct) )\r\n    y2 = fh1(pars2, x2);\r\n    assert( isequal(y2,y2_correct) )\r\nend;\r\n\r\n%% Large values of m.\r\nfor i = 1 : 5\r\n    x = int64( randi(3):13-randi(3) );\r\n    m = int64( randi(60) - 30 );\r\n    c = int64( 10000 - randi(20000) );\r\n    y_correct = m.^x + c;\r\n    [fh, pars] = generateFit(x, y_correct);\r\n    y = fh(pars, x);\r\n    assert( isequal(y,y_correct) )\r\nend;\r\n\r\n\r\n%% Check timing\r\ngenerateFit( uint32([1:10]), uint32(7.^[1:10] - 7) );\r\ntic\r\nfor i = 1 : 10\r\n    x = uint64(randi(10):25-randi(10));\r\n    x = repmat(x, [1,100]);\r\n    m = uint64( randi(5) );\r\n    c = uint64( randi(1000) );\r\n    y_correct = m.^x + c;\r\n    for j = 1 : 200\r\n        [fh, pars] = generateFit(x, y_correct);\r\n        y = fh(pars, x);\r\n    end;\r\n    assert( isequal(y,y_correct) )\r\nend;\r\nt = toc\r\nassert( t \u003c 2 )    % Seconds.\r\n\r\n%% Check parameter variable\r\n% Finally, check that the user is sending a small number of parameters to their\r\n% custom function (to be called via the function handle), and not simply sending\r\n% the entire vector y.  \r\nx = uint64(randi(10):60-randi(40));\r\nm = uint64(2);\r\nc = uint64(3);\r\ny_correct = m.^x + c;\r\n[fh, pars] = generateFit(x, y_correct);\r\ny = fh(pars, x);\r\nassert( isequal(y,y_correct) )\r\npw = whos('pars')\r\nassert( pw.bytes \u003c 100 , 'Parameter variable is too big.')\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":4,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":"2021-07-19T02:37:07.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2018-01-30T04:21:49.000Z","updated_at":"2021-07-19T02:37:07.000Z","published_at":"2018-01-30T13:00: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\u003eIn this problem you are provided some raw data. You need to find a way of summarising the data with just a few parameters, so that it can be reconstructed. You then need to provide a handle to your own (generic) custom function that will indeed reproduce the raw data when provided with the parameters that you determine.\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\u003eConsider a non-linear scalar 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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey = mˣ + c\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Suppose\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\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the 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\u003e[3 2 1 4]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. The function would operate elementwise on\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e; for example, if\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003em=2\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\u003ec=3\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e then\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\u003ey = [11 7 5 19]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. You are provided with both the 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\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and the 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\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Every number will be provided in some form of an\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://au.mathworks.com/help/matlab/matlab_prog/integers.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003einteger\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e data type. The scalar parameters\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\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\u003ec\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e are both whole numbers (although they're not provided directly).\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 here you should output two things:\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\u003ethe handle to 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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003egeneric\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e function that implements the relevant non-linear function (i.e. of the form\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\u003ey = mˣ + c\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e) taking two inputs, namely\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\u003e1\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e a set of parameters 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\u003e2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e the 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\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, and outputting the corresponding 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\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (in any data type); and\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\u003ea set of parameter values (m and c) wrapped into a single MATLAB variable (of any data type).\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\u003eAs the parameters will be used in your own function, the data type will be set by 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSo, for the above example, you\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\u003ecould\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e return a\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://au.mathworks.com/help/matlab/function-handles.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003efunction handle\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e@myFunc\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e that you have defined, along with the variable\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\u003eparam\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e that has two\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://au.mathworks.com/help/matlab/structures.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003efields\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e such that\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\u003eparam.base\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = 2 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\u003eparam.translation\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = 3.\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\u003eOr, if you have defined your function differently, then you\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\u003ecould\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e return 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://au.mathworks.com/help/matlab/function-handles.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003efunction handle\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e@myFn\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e along with a\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://au.mathworks.com/help/matlab/cell-arrays.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecell array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e variable\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\u003eprms\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e that has four elements such that\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\u003eprms{1}='positive'\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eprms{2}=uint8(3)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw: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\u003eprms{3} = 'positive'\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\u003eprms{4} = uint8(2)\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\u003eAnd so on.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\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\u003eNote\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\u003e1\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e: the parameter\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:i/\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e can be assumed to have values between -30 and +30 (inclusive); the parameter\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:i/\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ec\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e can be assumed to have values between -10000 and +10000 (inclusive); the elements in\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:i/\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e are positive.\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\u003eNote\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\u003e2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e: if the code runs too slowly, then it will also fail the Test Suite.\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\u003eNote\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\u003e3\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e: there might not be only one unique pair of the m \u0026amp; c parameter values that is correct — the individual values of m \u0026amp; c are not tested here, only the values of y that they predict are examined.\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\u003eSee also\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44507\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 44507. Curve fitting (linear functions) \u0026amp; function handles\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e — easier.\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":44521,"title":"Make your own Test Suite (part 3)","description":"In this task you need to imagine that you — _yes, YOU_ — have developed a problem on Cody for _me_ to solve, and now *you need to implement a robust Test Suite* to check whether _my_ submitted solutions meet _your_ requirements or not, and to be fairly assured that I am not trying to 'game' the system.  \r\n\r\nSo the tables are turned!  You are now in the role of Tester!  I am in the role of Player!  \r\n\r\nThe problem you've set me is to:\r\n\r\n* output the *sine* of an angle, when the angle is specified in degrees as a (scalar) \u003chttps://au.mathworks.com/help/matlab/ref/double.html |double|\u003e, with no restriction in the domain,   \r\n* *without* using |regexp| or |regexpi| or |ans|, \r\n* *within* less than 0.01 seconds (10 milliseconds).\r\n\r\nYou provide me with the following example for the function defined as |s = SINE(a)|:\r\n\r\n % INPUT\r\n a = 45 % degrees\r\n % OUTPUT\r\n s = 1/sqrt(2)\r\n\r\nNow I have responded by submitting a large number of purported 'solutions', some of which are _reasonably accurate_, and others which are either too imprecise or else logically flawed.  \r\n\r\nYour Test Suite (contained within _your_ function |testSuite|) must address each of the elements of your problem specification:  \r\n\r\n# Check that my submitted code reliably returns *sufficiently accurate* values for sine of many different angles.  Use the \u003chttps://au.mathworks.com/help/matlab/ref/assert.html |assert|\u003e function.  \r\n# Ensure that the returned *data type* is suitable.  \r\n# You *cannot* use (or mention) the functions |sind|, |sin|, |cscd| or |cosd| in your Test Suite;  any other functions are allowed.  [ _MOTIVATION:  You shouldn't be exposing an efficient way of solving the problem within your Test Suite, otherwise I can just copy and paste your solution and submit it as my own!_ ]\r\n# You must check that I *haven't used* \"regexp\" or \"regexpi\" or \"ans\".  You could try using the \u003chttps://au.mathworks.com/help/coursework/ug/assessfunctionabsence.html |assessFunctionAbsence|\u003e function in the form |assessFunctionAbsence(..., 'FileName','SINE.m')|, or else you could try 'manually' opening the file |SINE.m| that corresponds to my submitted solution and then parsing it for occurrence of the prohibited function/variable.  \r\n# You must check that my code returns a result within *less than 0.01 seconds* (for a single input of an arbitrary angle).  You could use \u003chttps://au.mathworks.com/help/matlab/ref/tic.html |tic|\u003e \u0026 \u003chttps://au.mathworks.com/help/matlab/ref/toc.html |toc|\u003e or \u003chttps://au.mathworks.com/help/matlab/ref/timeit.html |timeit|\u003e, or a variety of other MATLAB functions (but not |cputime| in this case).  If your Test Suite claims that my submission runs slowly, then you must be confident that it is truly caused only by inefficiency in my submitted code, *not* just general/erratic overheads in 'queuing' or suchlike on the Cody servers.  \r\n# Your |assert| (or other) function must throw \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44357 errors/exceptions\u003e with the following *|error message| text* contents.\r\n\r\n* 'Incorrect value' if the output is too inaccurate.\r\n* 'Incorrect data type' if the output is not appropriate.\r\n* 'Too slow' if my submitted code is too slow.\r\n* 'Banned word' if my submitted code contains the |regexp| or |regexpi| functions or the \u003chttps://au.mathworks.com/help/matlab/ref/ans.html |ans|\u003e variable.  For _this_ infringement, _additional_ text can _also_ (optionally!) be present in the message — for example, 'You cannot do that!  Banned word (regexp/regexpi)' would also be acceptable.\r\n\r\nWhen creating a Test Suite for a Cody problem it is a good habit to try to anticipate the tactics that diverse Players might employ!  \r\n\r\nSee also:\r\n\r\n* \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44631 Problem 44631\u003e (part *0*)\r\n* \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44617 Problem 44617\u003e (part *1*)\r\n* \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44616 Problem 44616\u003e (part *2*)","description_html":"\u003cp\u003eIn this task you need to imagine that you — \u003ci\u003eyes, YOU\u003c/i\u003e — have developed a problem on Cody for \u003ci\u003eme\u003c/i\u003e to solve, and now \u003cb\u003eyou need to implement a robust Test Suite\u003c/b\u003e to check whether \u003ci\u003emy\u003c/i\u003e submitted solutions meet \u003ci\u003eyour\u003c/i\u003e requirements or not, and to be fairly assured that I am not trying to 'game' the system.\u003c/p\u003e\u003cp\u003eSo the tables are turned!  You are now in the role of Tester!  I am in the role of Player!\u003c/p\u003e\u003cp\u003eThe problem you've set me is to:\u003c/p\u003e\u003cul\u003e\u003cli\u003eoutput the \u003cb\u003esine\u003c/b\u003e of an angle, when the angle is specified in degrees as a (scalar) \u003ca href = \"https://au.mathworks.com/help/matlab/ref/double.html\"\u003e\u003ctt\u003edouble\u003c/tt\u003e\u003c/a\u003e, with no restriction in the domain,\u003c/li\u003e\u003cli\u003e\u003cb\u003ewithout\u003c/b\u003e using \u003ctt\u003eregexp\u003c/tt\u003e or \u003ctt\u003eregexpi\u003c/tt\u003e or \u003ctt\u003eans\u003c/tt\u003e,\u003c/li\u003e\u003cli\u003e\u003cb\u003ewithin\u003c/b\u003e less than 0.01 seconds (10 milliseconds).\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eYou provide me with the following example for the function defined as \u003ctt\u003es = SINE(a)\u003c/tt\u003e:\u003c/p\u003e\u003cpre\u003e % INPUT\r\n a = 45 % degrees\r\n % OUTPUT\r\n s = 1/sqrt(2)\u003c/pre\u003e\u003cp\u003eNow I have responded by submitting a large number of purported 'solutions', some of which are \u003ci\u003ereasonably accurate\u003c/i\u003e, and others which are either too imprecise or else logically flawed.\u003c/p\u003e\u003cp\u003eYour Test Suite (contained within \u003ci\u003eyour\u003c/i\u003e function \u003ctt\u003etestSuite\u003c/tt\u003e) must address each of the elements of your problem specification:\u003c/p\u003e\u003col\u003e\u003cli\u003eCheck that my submitted code reliably returns \u003cb\u003esufficiently accurate\u003c/b\u003e values for sine of many different angles.  Use the \u003ca href = \"https://au.mathworks.com/help/matlab/ref/assert.html\"\u003e\u003ctt\u003eassert\u003c/tt\u003e\u003c/a\u003e function.\u003c/li\u003e\u003cli\u003eEnsure that the returned \u003cb\u003edata type\u003c/b\u003e is suitable.\u003c/li\u003e\u003cli\u003eYou \u003cb\u003ecannot\u003c/b\u003e use (or mention) the functions \u003ctt\u003esind\u003c/tt\u003e, \u003ctt\u003esin\u003c/tt\u003e, \u003ctt\u003ecscd\u003c/tt\u003e or \u003ctt\u003ecosd\u003c/tt\u003e in your Test Suite;  any other functions are allowed.  [ \u003ci\u003eMOTIVATION:  You shouldn't be exposing an efficient way of solving the problem within your Test Suite, otherwise I can just copy and paste your solution and submit it as my own!\u003c/i\u003e ]\u003c/li\u003e\u003cli\u003eYou must check that I \u003cb\u003ehaven't used\u003c/b\u003e \"regexp\" or \"regexpi\" or \"ans\".  You could try using the \u003ca href = \"https://au.mathworks.com/help/coursework/ug/assessfunctionabsence.html\"\u003e\u003ctt\u003eassessFunctionAbsence\u003c/tt\u003e\u003c/a\u003e function in the form \u003ctt\u003eassessFunctionAbsence(..., 'FileName','SINE.m')\u003c/tt\u003e, or else you could try 'manually' opening the file \u003ctt\u003eSINE.m\u003c/tt\u003e that corresponds to my submitted solution and then parsing it for occurrence of the prohibited function/variable.\u003c/li\u003e\u003cli\u003eYou must check that my code returns a result within \u003cb\u003eless than 0.01 seconds\u003c/b\u003e (for a single input of an arbitrary angle).  You could use \u003ca href = \"https://au.mathworks.com/help/matlab/ref/tic.html\"\u003e\u003ctt\u003etic\u003c/tt\u003e\u003c/a\u003e \u0026 \u003ca href = \"https://au.mathworks.com/help/matlab/ref/toc.html\"\u003e\u003ctt\u003etoc\u003c/tt\u003e\u003c/a\u003e or \u003ca href = \"https://au.mathworks.com/help/matlab/ref/timeit.html\"\u003e\u003ctt\u003etimeit\u003c/tt\u003e\u003c/a\u003e, or a variety of other MATLAB functions (but not \u003ctt\u003ecputime\u003c/tt\u003e in this case).  If your Test Suite claims that my submission runs slowly, then you must be confident that it is truly caused only by inefficiency in my submitted code, \u003cb\u003enot\u003c/b\u003e just general/erratic overheads in 'queuing' or suchlike on the Cody servers.\u003c/li\u003e\u003cli\u003eYour \u003ctt\u003eassert\u003c/tt\u003e (or other) function must throw \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44357\"\u003eerrors/exceptions\u003c/a\u003e with the following \u003cb\u003e\u003ctt\u003eerror message\u003c/tt\u003e text\u003c/b\u003e contents.\u003c/li\u003e\u003c/ol\u003e\u003cul\u003e\u003cli\u003e'Incorrect value' if the output is too inaccurate.\u003c/li\u003e\u003cli\u003e'Incorrect data type' if the output is not appropriate.\u003c/li\u003e\u003cli\u003e'Too slow' if my submitted code is too slow.\u003c/li\u003e\u003cli\u003e'Banned word' if my submitted code contains the \u003ctt\u003eregexp\u003c/tt\u003e or \u003ctt\u003eregexpi\u003c/tt\u003e functions or the \u003ca href = \"https://au.mathworks.com/help/matlab/ref/ans.html\"\u003e\u003ctt\u003eans\u003c/tt\u003e\u003c/a\u003e variable.  For \u003ci\u003ethis\u003c/i\u003e infringement, \u003ci\u003eadditional\u003c/i\u003e text can \u003ci\u003ealso\u003c/i\u003e (optionally!) be present in the message — for example, 'You cannot do that!  Banned word (regexp/regexpi)' would also be acceptable.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eWhen creating a Test Suite for a Cody problem it is a good habit to try to anticipate the tactics that diverse Players might employ!\u003c/p\u003e\u003cp\u003eSee also:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44631\"\u003eProblem 44631\u003c/a\u003e (part \u003cb\u003e0\u003c/b\u003e)\u003c/li\u003e\u003cli\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44617\"\u003eProblem 44617\u003c/a\u003e (part \u003cb\u003e1\u003c/b\u003e)\u003c/li\u003e\u003cli\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44616\"\u003eProblem 44616\u003c/a\u003e (part \u003cb\u003e2\u003c/b\u003e)\u003c/li\u003e\u003c/ul\u003e","function_template":"function dummy = testSuite()\r\n    \r\n    %% Test 1 — test outputs of submitted SINE function for various input values\r\n    % RATIONALE:  Computing SINE requires relatively simple code, \r\n    %             as the focus in the present task is on implementing a robust Test Suite.  \r\n    % MOTIVATION:  I could be submitting lazy code that only works for \r\n    %              a small number of angles, if that's all you test.\r\n    assert( isequal( SINE(45), 1/sqrt(2) ) , '' )\r\n    assert( isequal( SINE(45), 1/sqrt(2) ) , '' )\r\n    assert( isequal( SINE(45), 1/sqrt(2) ) , '' )\r\n    \r\n    \r\n    %% Test 2 — test for use/presence of  \"regexp\" or \"regexpi\" or \"ans\" in the submission\r\n    % MOTIVATION:  The functions regexp and regexpi are sometimes pertinent to efficient solution of a problem, \r\n    %              but at other times are used to artificially decrease the size of a Cody submission.\r\n    %              If I'm using regexp or regexpi for *this* problem of yours (where neither is relevant), \r\n    %              then it's probably because I'm trying to 'cheat' to get a smaller Cody score.\r\n    %              Use of the ans variable is also generally employed purely to decrease\r\n    %              Cody size, at the expense of clarity in the code.  \r\n    assessFunctionAbsence( '' , 'FileName','SINE.m' )\r\n\r\n    \r\n    %% Test 3 — check the speed of execution of the submission \r\n    % MOTIVATION:  Some code that is rated as \"small\" on Cody is actually quite computationally inefficient, \r\n    %              but it is possible to 'manually' enforce a requirement for Cody submissions to be at least \r\n    %              moderately efficient.  See e.g. Cody Problems 44351, 44356 \u0026 44383.  \r\n    %              So this will balance the Cody focus on small code 'size' with \r\n    %              the desire to ensure code is also computationally efficient.\r\n    toc\r\n    timeit( SINE(45) )\r\n    duration = tic\r\n    assert( duration , '' )\r\n\r\nend\r\n\r\n%{\r\nNOTE:  \r\nThe text \"dummy = \" was added to this Function Template, \r\nbecause Cody was generating a spurious error, namely\r\n        Your problem cannot be published until you:\r\n        •Edit the function name in the test suite to match the function name in the function template\r\nHowever, in the Reference Solution it was confirmed to be unnecessary.  \r\n%}\r\n\r\n%{\r\nFOOTNOTE:  \r\nAlthough 10 milliseconds may not seem like a slow execution time, \r\ncomputing the sine of an angle is a very common task, and a general program \r\nmight need to compute it hundreds, thousands or even millions of times.  \r\nIn the latter case, if each computation of sine were to take more than 10 \r\nmilliseconds, then the hypothetical program would run for several hours.  \r\nBy way of comparison, for a 1×1000000 vector input MATLAB's built-in sin \r\nfunction is currently taking a total of about 10 to 25 milliseconds on Cody, \r\nwhile sind is taking about 20 to 50 milliseconds._  \r\n%}","test_suite":"%% Timing\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(angle);\\n');\r\nfprintf(fileID,'   pause(0.012);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Too slow') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Use of ans\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function ans = SINE(angle)\\n');\r\nfprintf(fileID,'   sind(angle);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    e.message\r\n    assert( contains(e.message, 'Banned word') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Possible false alarm for use of ans\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   % This is a simple problem:  the answer only takes one line!\\n');\r\nfprintf(fileID,'   s = sind(angle);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'pass';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Use of regexp/regexpi (I)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(angle);\\n');\r\nfprintf(fileID,'   dummy = regexp(''Test text'', ''t'');\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    e.message\r\n    assert( contains(e.message, 'Banned word') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Use of regexp/regexpi (II)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(angle);\\n');\r\nfprintf(fileID,'   dummy = regexpi(''Test text'', ''t'');\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    e.message\r\n    assert( contains(e.message, 'Banned word') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Ensure no \"sind\" or \"sin\" or \"cosd\" in _your_ Test Suite\r\n% NOTE:  You may notice that the user function has been named \"SINE\", \r\n%        in uppercase.  That is an extra precaution to avoid accidentally \r\n%        triggering an error due to a banned 'word' (sequence of characters).  \r\n%        Careful choice of code to check for banned _functions_ is better!  \r\nassessFunctionAbsence('sind', 'FileName','testSuite.m')\r\nassessFunctionAbsence('sin',  'FileName','testSuite.m')\r\nassessFunctionAbsence('cscd', 'FileName','testSuite.m')\r\nassessFunctionAbsence('cosd', 'FileName','testSuite.m')\r\n\r\n\r\n%% Exactly right\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(angle);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'pass';\r\nstatus = 'pass';\r\n                    testSuite()\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Sufficiently close (I)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(angle + eps(angle));\\n');\r\nfclose(fileID);\r\nstatus_correct = 'pass';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Sufficiently close (II)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sin(angle * pi / 180);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'pass';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Sufficiently close (III)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = 1 ./ cscd(angle);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'pass';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Insufficiently close (I)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sin(angle * 3.14 / 180);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Insufficiently close (II)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sin(angle * (22/7) / 180);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Sufficiently close (III)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(angle + 10000*eps(angle));\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Completely wrong\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = cosd(angle);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Partly wrong (I)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(angle*sign(angle));\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Partly wrong (II)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = -sind(angle*sign(angle));\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Partly wrong (III)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(angle)*sign(sind(angle));\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% 'Fixed' angles\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(fix(angle));\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% 'Unfixed' angles\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   inc=0;\\n');\r\nfprintf(fileID,'   if mod(angle,1)==0, inc=1; end;\\n');\r\nfprintf(fileID,'   s = sind(angle + inc);\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Altered data type (I)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nif rand() \u003c 0.5,\r\n    fprintf(fileID,'   s = int8(sind(angle));\\n');\r\nelse\r\n    fprintf(fileID,'   s = int16(sind(angle));\\n');\r\nend;\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') | ...\r\n            isequal(e.message, 'Incorrect data type') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Altered data type (II)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nif rand() \u003c 0.5,\r\n    fprintf(fileID,'   s = int32(sind(angle));\\n');\r\nelse\r\n    fprintf(fileID,'   s = int64(sind(angle));\\n');\r\nend;\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') | ...\r\n            isequal(e.message, 'Incorrect data type') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Altered data type (III)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = sind(double(int32(angle)));\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect value') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Total nonsense (I)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = \"ratio\";\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect data type') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Total nonsense (II)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = \"?\";\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect data type') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Total nonsense (III)\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = {1:1E4};\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect data type') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )\r\n\r\n\r\n%% Wrong data type\r\nfileID = fopen('SINE.m','w');\r\nfprintf(fileID,'function s = SINE(angle)\\n');\r\nfprintf(fileID,'   s = {sind(angle)};\\n');\r\nfclose(fileID);\r\nstatus_correct = 'fail';\r\nstatus = 'pass';\r\ntry\r\n    testSuite()\r\ncatch e\r\n    status = 'fail'\r\n    assert( isequal(e.message, 'Incorrect data type') , 'Wrong message' )\r\nend\r\nassert( isequal(status, status_correct) , 'Wrong status' )","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":3,"test_suite_updated_at":"2018-04-18T14:04:26.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-02-13T12:05:07.000Z","updated_at":"2018-05-11T13:20:58.000Z","published_at":"2018-02-20T13:11:28.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 this task you need to imagine that you —\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\u003eyes, YOU\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e — have developed a problem on Cody for\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eme\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to solve, and now\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\u003eyou need to implement a robust Test Suite\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to check whether\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\u003emy\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e submitted solutions meet\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\u003eyour\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e requirements or not, and to be fairly assured that I am not trying to 'game' the 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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSo the tables are turned! You are now in the role of Tester! I am in the role of Player!\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 problem you've set me is to:\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\u003eoutput 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\u003esine\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of an angle, when the angle is specified in degrees as a (scalar)\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://au.mathworks.com/help/matlab/ref/double.html\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003edouble\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, with no restriction in the domain,\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ewithout\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e using\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\u003eregexp\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eregexpi\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eans\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ewithin\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e less than 0.01 seconds (10 milliseconds).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou provide me with the following example for the function defined as\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003es = SINE(a)\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ % INPUT\\n a = 45 % degrees\\n % OUTPUT\\n s = 1/sqrt(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\u003eNow I have responded by submitting a large number of purported 'solutions', some of which 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\u003ereasonably accurate\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, and others which are either too imprecise or else logically flawed.\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\u003eYour Test Suite (contained within\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\u003eyour\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 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\u003etestSuite\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e) must address each of the elements of your problem specification:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCheck that my submitted code reliably returns\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\u003esufficiently accurate\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e values for sine of many different angles. Use 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://au.mathworks.com/help/matlab/ref/assert.html\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eassert\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e function.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEnsure that the returned\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\u003edata type\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is suitable.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou\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\u003ecannot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e use (or mention) the functions\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\u003esind\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esin\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ecscd\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ecosd\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e in your Test Suite; any other functions are allowed. [\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\u003eMOTIVATION: You shouldn't be exposing an efficient way of solving the problem within your Test Suite, otherwise I can just copy and paste your solution and submit it as my own!\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=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou must check that I\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\u003ehaven't used\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \\\"regexp\\\" or \\\"regexpi\\\" or \\\"ans\\\". You could try using 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://au.mathworks.com/help/coursework/ug/assessfunctionabsence.html\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eassessFunctionAbsence\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e function in the form\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\u003eassessFunctionAbsence(..., 'FileName','SINE.m')\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, or else you could try 'manually' opening the file\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\u003eSINE.m\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e that corresponds to my submitted solution and then parsing it for occurrence of the prohibited function/variable.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou must check that my code returns a result within\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\u003eless than 0.01 seconds\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (for a single input of an arbitrary angle). You could use\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://au.mathworks.com/help/matlab/ref/tic.html\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003etic\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e \u0026amp;\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://au.mathworks.com/help/matlab/ref/toc.html\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003etoc\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://au.mathworks.com/help/matlab/ref/timeit.html\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003etimeit\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, or a variety of other MATLAB functions (but not\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\u003ecputime\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e in this case). If your Test Suite claims that my submission runs slowly, then you must be confident that it is truly caused only by inefficiency in my submitted code,\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\u003enot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e just general/erratic overheads in 'queuing' or suchlike on the Cody servers.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYour\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\u003eassert\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (or other) function must throw\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44357\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eerrors/exceptions\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e with the following\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eerror message\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e text\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e contents.\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\u003e'Incorrect value' if the output is too inaccurate.\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\u003e'Incorrect data type' if the output is not appropriate.\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\u003e'Too slow' if my submitted code is too slow.\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\u003e'Banned word' if my submitted code contains the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eregexp\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eregexpi\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e functions or 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://au.mathworks.com/help/matlab/ref/ans.html\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eans\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e variable. For\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ethis\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e infringement,\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\u003eadditional\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e text can\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\u003ealso\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (optionally!) be present in the message — for example, 'You cannot do that! Banned word (regexp/regexpi)' would also be acceptable.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhen creating a Test Suite for a Cody problem it is a good habit to try to anticipate the tactics that diverse Players might employ!\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\u003eSee also:\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:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44631\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 44631\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (part\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\u003e0\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\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44617\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 44617\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (part\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\u003e1\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\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44616\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 44616\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (part\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\u003e2\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\"},{\"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":42674,"title":"Cody meets Xiangqi: foresee the unseen (Part 1)","description":"This is the first part of the Xiangqi series. The second part in this series is: \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42685-cody-meets-xiangqi-foresee-the-unseen-part-2 Cody meets Xiangqi: foresee the unseen (Part 2)\u003e\r\n\r\n\u003chttps://en.wikipedia.org/wiki/Xiangqi Xiangqi\u003e, also known as *Chinese Chess* (and 象棋 in Chinese characters), is one of the most popular board games in China. The modern Xiangqi board contains a middle section which divides two players' sides and is marked the \"Chu River–Han border\", in reference to the Chu–Han Contention between \u003chttps://en.wikipedia.org/wiki/Xiang_Yu Xiang Yu\u003e and \u003chttps://de.wikipedia.org/wiki/Han_Gaozu Liu Bang\u003e, two prominent warlords and opponents who fought thousands of battles against each other for supremacy over China in the late Qin dynasty (206–202 BC). Those interested in the story of the Chu–Han Contention and its relation to Xiangqi are referred to \u003chttps://en.wikipedia.org/wiki/Chu%E2%80%93Han_Contention here\u003e.\r\n\r\nFresh to Xiangqi, Cody becomes interested in Xiangqi by raising a question: _Who is the stronger player of Xiangqi between Xiang Yu and Liu Bang_? To answer this question, Cody designs a match for Xiang Yu and Liu Bang, in which Cody serves as the referee. The smart Cody referee also sets an intelligent rule to determine the winner: \r\n\r\n_In a succession of Xiangqi games, once Xiang Yu wins Na games *consecutively*, whereas Liu Bang has not won Nb games *consecutively*, Cody immediately announces Xiang Yu as the winner. Contrarily, once Liu Bang defeats Xiang Yu Nb times *consecutively*, whereas Xiang Yu has not won Na times *consecutively*, Liu Bang becomes the winner._ \r\n\r\nCody suggests that Na \u003e 1 and Nb \u003e 1, in order to enhance, to some extent, the confidence of the result of the match. Suppose in each individual game, the probability Xiang Yu would win is p, and the probability Liu Bang would win is 1 - p, which implicitly assumes that the probability of a tie is 0 (because they both refuse to draw and will fight to death). Unfortunately, this well-designed match has never taken place. Regretfully, Cody requests us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write a function\r\n\r\n                                sol = Xiangqi(p, Na, Nb)\r\n\r\nwith input: 0 \u003c= p \u003c= 1, Na \u003e 1, Nb \u003e 1, and output: sol --- the probability that Xiang Yu wins. Your solution will be tested against its true value Q (which is computed but hided in the P-file EvaluateSolution.p) according to a hybrid absolute and relative error tolerance criterion:\r\n\r\n                      abs(sol - Q) \u003c= max(AbsTol, RelTol*abs(sol))\r\n\r\nwhere AbsTol and RelTol are absolute and relative error tolerances, respectively, which will be specified in the test suite. You are encouraged to optimize the performance (rather than the usual Cody size) of your code as much as possible, as the score of your solution will be measured based on the *speed* of your code. \r\n\r\nHave fun!\r\n","description_html":"\u003cp\u003eThis is the first part of the Xiangqi series. The second part in this series is: \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42685-cody-meets-xiangqi-foresee-the-unseen-part-2\"\u003eCody meets Xiangqi: foresee the unseen (Part 2)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Xiangqi\"\u003eXiangqi\u003c/a\u003e, also known as \u003cb\u003eChinese Chess\u003c/b\u003e (and 象棋 in Chinese characters), is one of the most popular board games in China. The modern Xiangqi board contains a middle section which divides two players' sides and is marked the \"Chu River–Han border\", in reference to the Chu–Han Contention between \u003ca href = \"https://en.wikipedia.org/wiki/Xiang_Yu\"\u003eXiang Yu\u003c/a\u003e and \u003ca href = \"https://de.wikipedia.org/wiki/Han_Gaozu\"\u003eLiu Bang\u003c/a\u003e, two prominent warlords and opponents who fought thousands of battles against each other for supremacy over China in the late Qin dynasty (206–202 BC). Those interested in the story of the Chu–Han Contention and its relation to Xiangqi are referred to \u003ca href = \"https://en.wikipedia.org/wiki/Chu%E2%80%93Han_Contention\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eFresh to Xiangqi, Cody becomes interested in Xiangqi by raising a question: \u003ci\u003eWho is the stronger player of Xiangqi between Xiang Yu and Liu Bang\u003c/i\u003e? To answer this question, Cody designs a match for Xiang Yu and Liu Bang, in which Cody serves as the referee. The smart Cody referee also sets an intelligent rule to determine the winner:\u003c/p\u003e\u003cp\u003e\u003ci\u003eIn a succession of Xiangqi games, once Xiang Yu wins Na games \u003cb\u003econsecutively\u003c/b\u003e, whereas Liu Bang has not won Nb games \u003cb\u003econsecutively\u003c/b\u003e, Cody immediately announces Xiang Yu as the winner. Contrarily, once Liu Bang defeats Xiang Yu Nb times \u003cb\u003econsecutively\u003c/b\u003e, whereas Xiang Yu has not won Na times \u003cb\u003econsecutively\u003c/b\u003e, Liu Bang becomes the winner.\u003c/i\u003e\u003c/p\u003e\u003cp\u003eCody suggests that Na \u0026gt; 1 and Nb \u0026gt; 1, in order to enhance, to some extent, the confidence of the result of the match. Suppose in each individual game, the probability Xiang Yu would win is p, and the probability Liu Bang would win is 1 - p, which implicitly assumes that the probability of a tie is 0 (because they both refuse to draw and will fight to death). Unfortunately, this well-designed match has never taken place. Regretfully, Cody requests us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write a function\u003c/p\u003e\u003cpre\u003e                                sol = Xiangqi(p, Na, Nb)\u003c/pre\u003e\u003cp\u003ewith input: 0 \u0026lt;= p \u0026lt;= 1, Na \u0026gt; 1, Nb \u0026gt; 1, and output: sol --- the probability that Xiang Yu wins. Your solution will be tested against its true value Q (which is computed but hided in the P-file EvaluateSolution.p) according to a hybrid absolute and relative error tolerance criterion:\u003c/p\u003e\u003cpre\u003e                      abs(sol - Q) \u0026lt;= max(AbsTol, RelTol*abs(sol))\u003c/pre\u003e\u003cp\u003ewhere AbsTol and RelTol are absolute and relative error tolerances, respectively, which will be specified in the test suite. You are encouraged to optimize the performance (rather than the usual Cody size) of your code as much as possible, as the score of your solution will be measured based on the \u003cb\u003espeed\u003c/b\u003e of your code.\u003c/p\u003e\u003cp\u003eHave fun!\u003c/p\u003e","function_template":"function sol = Xiangqi(p, Na, Nb)\r\n  sol = p;\r\nend","test_suite":"%%\r\n% By courtesy of Alfonso Nieto-Castanon\r\nurlwrite('https://sites.google.com/a/alfnie.com/alfnie/software/SetSolutionScore.p?attredirects=0\u0026amp;d=1','SetSolutionScore.p');\r\nrehash path;\r\n\r\n%%\r\nfh = fopen('EvaluateSolution.p','wb');\r\nfwrite(fh, hex2dec(reshape('7630312E30307630302E3030000E601C0AF25FB100000056000000A4000000D6820EB5B30514117A9E6E5DB36898AFFFCC5086DFAF59C2910AEB07B88523DABE546868AC2BDAC3795467A7BCD91A89E2F578F2EDE92D63472A3B8FCA3F216CB3B66B010B5B924A5F514E19B90225B0978A54DA881119917D211CB055361918CAA0670F6D0E8ED17B319492619F4361BFB4C3C31D68E11F4BA084C6456783C358296B3E63E16C78EF2B0279074BCB707265EB4C044BFF7F25BA0A9678B75D36B9ACEE6853',2,[]).')); rehash path; fclose(fh); \r\n\r\n%%\r\np = 0; Na = 2; Nb = 3;\r\nAbsTol = 1e-6; RelTol = 1e-5;\r\nsol = Xiangqi(p, Na, Nb);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\n\r\n%%\r\np = 1; Na = 3; Nb = 2;\r\nAbsTol = 1e-6; RelTol = 1e-5;\r\nsol = Xiangqi(p, Na, Nb);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\n\r\n%%\r\np = 0.4; Na = 2; Nb = 3;\r\nAbsTol = 5e-4; RelTol = 5e-4;\r\nsol = Xiangqi(p, Na, Nb);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\n\r\n%%\r\np = 0.7; Na = 4; Nb = 2;\r\nAbsTol = 5e-4; RelTol = 5e-4;\r\nsol = Xiangqi(p, Na, Nb);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\n\r\n%%\r\np = 0.15; Na = 4; Nb = 2;\r\nAbsTol = 5e-5; RelTol = 1e-6;\r\nt = builtin('tic');\r\nsol = Xiangqi(p, Na, Nb);\r\nscore = builtin('toc',t);\r\nassert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));\r\nSetSolutionScore(round(500*score));","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":9,"test_suite_updated_at":"2015-10-30T08:18:09.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-10-30T05:02:43.000Z","updated_at":"2025-11-30T16:38:45.000Z","published_at":"2015-10-30T05:45:36.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is the first part of the Xiangqi series. The second part in this series is:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42685-cody-meets-xiangqi-foresee-the-unseen-part-2\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody meets Xiangqi: foresee the unseen (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Xiangqi\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eXiangqi\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, also known as\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eChinese Chess\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (and 象棋 in Chinese characters), is one of the most popular board games in China. The modern Xiangqi board contains a middle section which divides two players' sides and is marked the \\\"Chu River–Han border\\\", in reference to the Chu–Han Contention between\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Xiang_Yu\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eXiang Yu\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://de.wikipedia.org/wiki/Han_Gaozu\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eLiu Bang\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, two prominent warlords and opponents who fought thousands of battles against each other for supremacy over China in the late Qin dynasty (206–202 BC). Those interested in the story of the Chu–Han Contention and its relation to Xiangqi are referred to\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Chu%E2%80%93Han_Contention\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehere\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFresh to Xiangqi, Cody becomes interested in Xiangqi by raising a question:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eWho is the stronger player of Xiangqi between Xiang Yu and Liu Bang\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e? To answer this question, Cody designs a match for Xiang Yu and Liu Bang, in which Cody serves as the referee. The smart Cody referee also sets an intelligent rule to determine the winner:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eIn a succession of Xiangqi games, once Xiang Yu wins Na games\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econsecutively\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, whereas Liu Bang has not won Nb games\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econsecutively\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, Cody immediately announces Xiang Yu as the winner. Contrarily, once Liu Bang defeats Xiang Yu Nb times\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econsecutively\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, whereas Xiang Yu has not won Na times\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econsecutively\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e, Liu Bang becomes the winner.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCody suggests that Na \u0026gt; 1 and Nb \u0026gt; 1, in order to enhance, to some extent, the confidence of the result of the match. Suppose in each individual game, the probability Xiang Yu would win is p, and the probability Liu Bang would win is 1 - p, which implicitly assumes that the probability of a tie is 0 (because they both refuse to draw and will fight to death). Unfortunately, this well-designed match has never taken place. Regretfully, Cody requests us --- active Cody players --- to foresee the outcome of this unseen match using Monte Carlo simulations. Our task is to write a function\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[                                sol = Xiangqi(p, Na, Nb)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewith input: 0 \u0026lt;= p \u0026lt;= 1, Na \u0026gt; 1, Nb \u0026gt; 1, and output: sol --- the probability that Xiang Yu wins. Your solution will be tested against its true value Q (which is computed but hided in the P-file EvaluateSolution.p) according to a hybrid absolute and relative error tolerance criterion:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[                      abs(sol - Q) \u003c= max(AbsTol, RelTol*abs(sol))]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewhere AbsTol and RelTol are absolute and relative error tolerances, respectively, which will be specified in the test suite. You are encouraged to optimize the performance (rather than the usual Cody size) of your code as much as possible, as the score of your solution will be measured based on the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003espeed\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of your code.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHave fun!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44353,"title":"Group-wise Euclidean distance","description":"*Input*:\r\n \r\n* *x* —— An array of size *n-by-d*, where each row vector denotes a point in a d-dimensional space;\r\n* *g* —— A grouping (index) vector g of size *n-by-1*, which divides the points in x into groups. Specifically, the rows in x corresponding to the same group index in g belong to the same group. \r\n\r\n*Output*: \r\n\r\n* *y* —— The group-wise Euclidean distance matrix associated with the points in x. Suppose that m = max(g), then y will be an *m-by-m* matrix, where each element y(i,j) is the Euclidean distance between group i and group j, which is defined as the minimum of the Euclidean distances between any points in group i and any other points in group j. \r\n\r\n*Example*:\r\n\r\nExample 1: n = 6, d = 1\r\n\r\n  g = [2   1   3  2  1].';\r\n  x = [3  10  15  8  5].';\r\n  y = [0   2   5            % y(1,2) = y(2,1) = min(10-3,5-3,10-8,8-5) = 2\r\n       2   0   7            % y(1,3) = y(3,1) = min(15-10,15-5) = 5\r\n       5   7   0];          % y(2,3) = y(3,2) = min(15-3,15-8) = 7\r\n\r\nExample 2: n = 3, d = 2\r\n\r\n  g = [1 2 2].';\r\n  x = [0   0\r\n       5  12\r\n       3   4];\r\n  y = [0  5;\r\n       5  0];    % y(1,2) = y(2,1) = min(sqrt(5^2+12^2),sqrt(3^2+4^2)) = 5\r\n  \r\n*Testing*:\r\n\r\nThe test suite will focus mainly on the large-scale problem dimensions (e.g., large n and/or d). The purpose is to direct attention towards efficient runtime speed of execution. Note that your solution may run into a time-out error if it is not sufficiently efficient (which is why this problem falls into the \u003chttps://www.mathworks.com/matlabcentral/cody/groups/35 Cody5:Hard\u003e category).\r\n\r\n*Scoring*:\r\n\r\nWe have modified Cody's default size-based scoring function into a performance-based scoring system (implemented by our fellow Cody player \u003chttps://www.mathworks.com/matlabcentral/cody/players/3021298-ly-cao LY Cao\u003e), in which the score of your submission equals 5 times the execution time of your solution (which reprents a score resolution of 0.2 seconds and allows for more room for performance improvement). Please ignore the code size and focus only on improving the code performance, as our test suite will reject any submissions running longer than 20 seconds (in contrast to Cody's default 40 seconds timeout limit).  \r\n\r\nPlease be advised that an amazingly fast solution would earn a score \u003c 5, meaning that it completes execution of all test cases within a second!\r\n\r\n*Update* (11/21/2017):\r\nAdditional test cases are added to ban cheater solutions (e.g., hard-coded submissions 1351541, 1351007, 1350563, 1349442, all came from \u003chttps://www.mathworks.com/matlabcentral/cody/players/3931805-marco-tullio Marco Tullio\u003e).\r\n","description_html":"\u003cp\u003e\u003cb\u003eInput\u003c/b\u003e:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003ex\u003c/b\u003e —— An array of size \u003cb\u003en-by-d\u003c/b\u003e, where each row vector denotes a point in a d-dimensional space;\u003c/li\u003e\u003cli\u003e\u003cb\u003eg\u003c/b\u003e —— A grouping (index) vector g of size \u003cb\u003en-by-1\u003c/b\u003e, which divides the points in x into groups. Specifically, the rows in x corresponding to the same group index in g belong to the same group.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e\u003cb\u003eOutput\u003c/b\u003e:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003ey\u003c/b\u003e —— The group-wise Euclidean distance matrix associated with the points in x. Suppose that m = max(g), then y will be an \u003cb\u003em-by-m\u003c/b\u003e matrix, where each element y(i,j) is the Euclidean distance between group i and group j, which is defined as the minimum of the Euclidean distances between any points in group i and any other points in group j.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e:\u003c/p\u003e\u003cp\u003eExample 1: n = 6, d = 1\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eg = [2   1   3  2  1].';\r\nx = [3  10  15  8  5].';\r\ny = [0   2   5            % y(1,2) = y(2,1) = min(10-3,5-3,10-8,8-5) = 2\r\n     2   0   7            % y(1,3) = y(3,1) = min(15-10,15-5) = 5\r\n     5   7   0];          % y(2,3) = y(3,2) = min(15-3,15-8) = 7\r\n\u003c/pre\u003e\u003cp\u003eExample 2: n = 3, d = 2\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eg = [1 2 2].';\r\nx = [0   0\r\n     5  12\r\n     3   4];\r\ny = [0  5;\r\n     5  0];    % y(1,2) = y(2,1) = min(sqrt(5^2+12^2),sqrt(3^2+4^2)) = 5\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eTesting\u003c/b\u003e:\u003c/p\u003e\u003cp\u003eThe test suite will focus mainly on the large-scale problem dimensions (e.g., large n and/or d). The purpose is to direct attention towards efficient runtime speed of execution. Note that your solution may run into a time-out error if it is not sufficiently efficient (which is why this problem falls into the \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/groups/35\"\u003eCody5:Hard\u003c/a\u003e category).\u003c/p\u003e\u003cp\u003e\u003cb\u003eScoring\u003c/b\u003e:\u003c/p\u003e\u003cp\u003eWe have modified Cody's default size-based scoring function into a performance-based scoring system (implemented by our fellow Cody player \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/players/3021298-ly-cao\"\u003eLY Cao\u003c/a\u003e), in which the score of your submission equals 5 times the execution time of your solution (which reprents a score resolution of 0.2 seconds and allows for more room for performance improvement). Please ignore the code size and focus only on improving the code performance, as our test suite will reject any submissions running longer than 20 seconds (in contrast to Cody's default 40 seconds timeout limit).\u003c/p\u003e\u003cp\u003ePlease be advised that an amazingly fast solution would earn a score \u0026lt; 5, meaning that it completes execution of all test cases within a second!\u003c/p\u003e\u003cp\u003e\u003cb\u003eUpdate\u003c/b\u003e (11/21/2017):\r\nAdditional test cases are added to ban cheater solutions (e.g., hard-coded submissions 1351541, 1351007, 1350563, 1349442, all came from \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/players/3931805-marco-tullio\"\u003eMarco Tullio\u003c/a\u003e).\u003c/p\u003e","function_template":"function y = groupDist(x,g)\r\n  y = x;\r\nend","test_suite":"%%\r\nassessFunctionAbsence({'regexp','regexpi','regexprep','str2num','tic','toc','persistent','global','rng','assert','!','system','unix','noCheater'},'FileName','groupDist.m')\r\n\r\n%%\r\nfid = fopen('noCheater.p','Wb');\r\nfwrite(fid, hex2dec(reshape([\r\n    '7630312E30307630302E30300007701CAB777FB100000015000000740000007E3D5C20F'...'\r\n    '5319EEB8B0D3D9C9C87C18B91C13D7310D9D8E837C95E62D49A3FE08B071790DBC222B5'...\r\n    '839E9A19EA6AA7CF3785A7E7CEC1CFE46E0E9A5DB7C82D69A4FAB7BF308D0871C342A5F'...\r\n    'EF9AF61623F1D97F80207388D54ABA3CB3D551617DA33AA3F5040CD425FC9B29E2A4233'...\r\n    'AE7C5ADEF399'],2,[]).')); rehash path; \r\nfclose(fid); \r\nassert(noCheater(),'Cheater detected!')\r\n\r\n%%\r\ng = [2   1   3  2  1].';\r\nx = [3  10  15  8  5].';\r\ny_correct = [0   2   5            \r\n             2   0   7      \r\n             5   7   0]; \r\nassert(isequaln(y_correct,groupDist(x,g)))\r\n\r\n%%\r\ng = [1 2 2].';\r\nx = [0   0\r\n     5  12\r\n     3   4];\r\ny_correct = [0  5;\r\n             5  0];    \r\nassert(isequal(y_correct,groupDist(x,g)))\r\n\r\n%%\r\ng = [2 2 3 3 3 1].';\r\nx = [-5   12\r\n      3    4\r\n     -7  -24\r\n     25    4\r\n      9   40\r\n      0    0];\r\ny_correct = [0    5   25;\r\n             5    0   22\r\n             25  22    0];  \r\nassert(isequal(y_correct,groupDist(x,g)))\r\n\r\n%% Randomized case to disallow hard-coded solution\r\ng = randperm(10).';\r\nx = rand(10,1);\r\na = sortrows([g,x]);\r\ny_correct = abs(a(:,2)-a(:,2).');\r\nassert(isequal(round(y_correct,10),round(groupDist(x,g),10))) \r\n\r\n%% Additional test case to disallow hard-coded solution\r\ng = [1,2,3].';\r\nx = [2,5,10].';\r\ny_correct = [0   3   8            \r\n             3   0   5      \r\n             8   5   0]; \r\nassert(isequaln(y_correct,groupDist(x,g)))\r\n\r\n%%\r\nglobal t\r\nt = zeros(1,3); \r\nrng(923,'twister');\r\nn = 5e3; d = 3; m = 5;\r\nx = rand(n,d);\r\ng = randi(m,n,1); \r\ny_correct = [0,0.00653919638188362,0.00319052186150122,0.00858841434457234,0.00359654235965771\r\n             0.00653919638188362,0,0.00855286615862212,0.00589790293838067,0.00484910151004134\r\n             0.00319052186150122,0.00855286615862212,0,0.00591041083080696,0.00483607360689871\r\n             0.00858841434457234,0.00589790293838067,0.00591041083080696,0,0.00695738487959094\r\n             0.00359654235965771,0.00484910151004134,0.00483607360689871,0.00695738487959094,0];\r\ntic, y = groupDist(x,g); t(1) = toc;\r\nassert(isequal(round(y_correct,10),round(y,10))) \r\n\r\n%%\r\nglobal t\r\nrng(123) \r\nrng(max('cody5'),'combRecursive');\r\nn = 5e3; d = 3; m = 100;\r\nx = 10*rand(n,d);\r\ng = randi(m,n,1); \r\ntic, y = groupDist(x,g); t(2) = toc;\r\nassert(norm(y-y.') \u003c 1e-11 \u0026\u0026 all(~diag(y)) \u0026\u0026 all(size(y)==m) \u0026\u0026 abs(det(y)-0.030846735888559)\u003c1e-8 \u0026\u0026...\r\n    abs(cond(y)-1.606720826682107e+04) \u003c 1e-6 \u0026\u0026 abs(max(nonzeros(y))-1.058563379304832)\u003c1e-10 \u0026\u0026...\r\n    abs(mean(nonzeros(y))-0.419901913602729)\u003c1e-8)\r\n\r\n%%\r\nglobal t \r\nrng(sum('Cody5, Oct. 16, 2017'),'multFibonacci') \r\nn = 5e3; d = 1e2;  m = 100;\r\nx = 5*randn(n,d) + 20;\r\ng = randi(m,n,1); \r\ntic, y = groupDist(x,g); t(3) = toc;\r\nassert(norm(y-y.') \u003c 1e-11 \u0026\u0026 all(~diag(y)) \u0026\u0026 all(size(y)==m) \u0026\u0026 ...\r\n    abs(cond(y)-2.024633860688276e+02) \u003c 1e-8 \u0026\u0026 abs(max(nonzeros(y))-57.768463869822135)\u003c1e-10 \u0026\u0026...\r\n    abs(mean(nonzeros(y))-53.852605466762945)\u003c1e-8) \r\n \r\n%%\r\nglobal t\r\nfid = fopen('score.p','Wb');\r\nfwrite(fid,uint8(sscanf([...\r\n     '7630312E30307630302E3030000B901C454EFFB100000031000001330000018D483A60'...\r\n     '366BC9545F84AE26323B67424D4E8A7A2E5B7D8ACAA45A1C3C5C8B33E245C95243E3CB'...\r\n     'AF5D0D993BDA70B7AB5DA365A83E8CA87FFC45265E23EF80943784C5F48E6E53D5DA34'...\r\n     'F1F2ECD34683EABE3B7461DC9E8004CC50B2A79D73495F6F625B5365602B2E6C6093D2'...\r\n     '997D371DA457CE82327E686AF512A507B2CB62A375BFD1B283DDD2C01EDEF2771EDAA3'...\r\n     '6ABB4852BA4061E20149688E812EB41A9AF8627EF35755492D2830EB8718BCFE88027E'...\r\n     '6EA960B63A3B3E26E0451B1DCF14F3C20E70D9D93B08E7FF4AE8D82E7CC38042FD38F7'...\r\n     'A14D312EF5652823FEB7E8B52AF5C69F5E7D16B116B5F979EDA77459D6BB61B7971A51'...\r\n     '041227DD601319D667DF62E8DA5E381FDD07A2806FE835BD2569E5315CDFC19C6B6A2B'...\r\n     '4F0FF6BA803F1759ACAB133CCFAB6D5A5D002FC2C5F381F0'],'%2X')));\r\nfclose(fid);\r\nscore(round(5*sum(t)))\r\nfprintf('The execution time of test case %d is %.5f seconds \\n',[5:7;t])\r\nfprintf('The total execution time is %.5f seconds \\n',sum(t))\r\nassert(sum(t)\u003c20, 'Sorry, your solution is too slow. The execution time must not exceed 20 seconds.')\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":4,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":75,"test_suite_updated_at":"2017-11-21T22:49:00.000Z","rescore_all_solutions":false,"group_id":35,"created_at":"2017-10-01T04:33:43.000Z","updated_at":"2026-02-03T09:16:35.000Z","published_at":"2017-10-16T01:51:00.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\u003eInput\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e —— An array 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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en-by-d\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, where each row vector denotes a point in a d-dimensional space;\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eg\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e —— A grouping (index) vector g 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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en-by-1\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, which divides the points in x into groups. Specifically, the rows in x corresponding to the same group index in g belong to the same group.\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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e —— The group-wise Euclidean distance matrix associated with the points in x. Suppose that m = max(g), then y will be 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\u003em-by-m\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e matrix, where each element y(i,j) is the Euclidean distance between group i and group j, which is defined as the minimum of the Euclidean distances between any points in group i and any other points in group j.\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\u003cw:r\u003e\u003cw:t\u003e:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample 1: n = 6, d = 1\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[g = [2   1   3  2  1].';\\nx = [3  10  15  8  5].';\\ny = [0   2   5            % y(1,2) = y(2,1) = min(10-3,5-3,10-8,8-5) = 2\\n     2   0   7            % y(1,3) = y(3,1) = min(15-10,15-5) = 5\\n     5   7   0];          % y(2,3) = y(3,2) = min(15-3,15-8) = 7]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample 2: n = 3, d = 2\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[g = [1 2 2].';\\nx = [0   0\\n     5  12\\n     3   4];\\ny = [0  5;\\n     5  0];    % y(1,2) = y(2,1) = min(sqrt(5^2+12^2),sqrt(3^2+4^2)) = 5]]\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\u003eTesting\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe test suite will focus mainly on the large-scale problem dimensions (e.g., large n and/or d). The purpose is to direct attention towards efficient runtime speed of execution. Note that your solution may run into a time-out error if it is not sufficiently efficient (which is why this problem falls into 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://www.mathworks.com/matlabcentral/cody/groups/35\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody5:Hard\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e category).\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\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\u003eWe have modified Cody's default size-based scoring function into a performance-based scoring system (implemented by our fellow Cody player\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/players/3021298-ly-cao\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eLY Cao\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e), in which the score of your submission equals 5 times the execution time of your solution (which reprents a score resolution of 0.2 seconds and allows for more room for performance improvement). Please ignore the code size and focus only on improving the code performance, as our test suite will reject any submissions running longer than 20 seconds (in contrast to Cody's default 40 seconds timeout limit).\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\u003ePlease be advised that an amazingly fast solution would earn a score \u0026lt; 5, meaning that it completes execution of all test cases within a second!\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\u003eUpdate\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (11/21/2017): Additional test cases are added to ban cheater solutions (e.g., hard-coded submissions 1351541, 1351007, 1350563, 1349442, all came from\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/players/3931805-marco-tullio\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMarco Tullio\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\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":44356,"title":"Code breaker, Part II:  Operation Orthos","description":"You have been tasked with decoding several batches of coded messages that have been intercepted.  \r\n\r\nBased on previous intelligence that has been gathered, you can be confident that the messages were all encoded using a simple \u003chttps://en.wikipedia.org/wiki/Caesar_cipher Caesar cipher\u003e (a type of \u003chttps://en.wikipedia.org/wiki/Substitution_cipher substitution cipher\u003e), an example of which is the \u003chttps://en.wikipedia.org/wiki/ROT13 ROT13 cipher\u003e (discussed in \u003chttps://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher Cody Challenge Problem 78\u003e).  As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation \u0026 numbers) are unchanged.  Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and may vary between batches of messages — although it will be the same for all messages in a batch (also, here you need to decode, not encode).  \r\n\r\nYou can also assume that the original batch of messages will relate to an activity that is referred to by those involved as \"Operation Orthos\". However, in their secret internal communications they might not use this exact phrase at all, nor this exact capitalisation.  Therefore you should seek _simultaneous_ occurrence of the separate words \"Operation\" and \"Orthos\" (with any capitalisation) in messages within the given batch.  \r\n\r\nYour task is to crack the codes and report back in a \u003chttp://au.mathworks.com/help/matlab/ref/struct.html structure array\u003e:  (1) the shifting parameter that had been used in the encoding [as \u003chttp://au.mathworks.com/help/matlab/ref/uint8.html uint8\u003e];  (2)  the decoded messages [as a \u003chttp://au.mathworks.com/help/matlab/ref/cell.html?s_tid=doc_ta cell array\u003e (containing \u003chttp://au.mathworks.com/help/matlab/ref/char.html character arrays\u003e)].  \r\nThe name of the structure array shall be \"s\", with respective fields \"shift\" and \"message\".  \r\n\r\nEXAMPLE\r\n\r\nSuppose the batch contained two encoded messages — _\"qspdffe x/ pqfsbujpo\"_ and _\"Psuipt jt HP!\"_ (provided as character arrays within a cell array) — and a (right-shifting) ROT1 cipher had been applied.  In that case A→B, B→C, ..., Y→Z, and Z→A;  similarly, a→b, b→c, ..., y→z, and z→a.  (Note that the shifting 'wraps' back around.)  \r\nThus the original messages would have been:  _\"proceed w/ operation\"_ and _\"Orthos is GO!\"_ .\r\n\r\nThe correct answer would comprise:  \r\n\r\n  s.shift = uint8(1)  \r\n  s.message = {'proceed w/ operation', 'Orthos is GO!'}\r\n\r\nIf the batch of messages cannot be decoded when following the above assumptions, then simply return 'scalar' \u003chttp://au.mathworks.com/help/matlab/ref/nan.html NaN\u003e in both fields (no need for a cell array).  \r\n\r\n|Note:  Many Cody solutions are hard to read and not necessarily computationally efficient.  To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable).  Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand. (Try resubmitting on another day if your code runs slowly, in case it is caused by a server issue.)|  \r\n\r\nTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \"too slow\".  \r\n\r\n----------\r\n\r\nPrevious problem:  \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44351 Operation Phoenix\u003e.  Next problem:  \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44383 Operation Xiangliu\u003e.","description_html":"\u003cp\u003eYou have been tasked with decoding several batches of coded messages that have been intercepted.\u003c/p\u003e\u003cp\u003eBased on previous intelligence that has been gathered, you can be confident that the messages were all encoded using a simple \u003ca href = \"https://en.wikipedia.org/wiki/Caesar_cipher\"\u003eCaesar cipher\u003c/a\u003e (a type of \u003ca href = \"https://en.wikipedia.org/wiki/Substitution_cipher\"\u003esubstitution cipher\u003c/a\u003e), an example of which is the \u003ca href = \"https://en.wikipedia.org/wiki/ROT13\"\u003eROT13 cipher\u003c/a\u003e (discussed in \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher\"\u003eCody Challenge Problem 78\u003c/a\u003e).  As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation \u0026 numbers) are unchanged.  Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and may vary between batches of messages — although it will be the same for all messages in a batch (also, here you need to decode, not encode).\u003c/p\u003e\u003cp\u003eYou can also assume that the original batch of messages will relate to an activity that is referred to by those involved as \"Operation Orthos\". However, in their secret internal communications they might not use this exact phrase at all, nor this exact capitalisation.  Therefore you should seek \u003ci\u003esimultaneous\u003c/i\u003e occurrence of the separate words \"Operation\" and \"Orthos\" (with any capitalisation) in messages within the given batch.\u003c/p\u003e\u003cp\u003eYour task is to crack the codes and report back in a \u003ca href = \"http://au.mathworks.com/help/matlab/ref/struct.html\"\u003estructure array\u003c/a\u003e:  (1) the shifting parameter that had been used in the encoding [as \u003ca href = \"http://au.mathworks.com/help/matlab/ref/uint8.html\"\u003euint8\u003c/a\u003e];  (2)  the decoded messages [as a \u003ca href = \"http://au.mathworks.com/help/matlab/ref/cell.html?s_tid=doc_ta\"\u003ecell array\u003c/a\u003e (containing \u003ca href = \"http://au.mathworks.com/help/matlab/ref/char.html\"\u003echaracter arrays\u003c/a\u003e)].  \r\nThe name of the structure array shall be \"s\", with respective fields \"shift\" and \"message\".\u003c/p\u003e\u003cp\u003eEXAMPLE\u003c/p\u003e\u003cp\u003eSuppose the batch contained two encoded messages — \u003ci\u003e\"qspdffe x/ pqfsbujpo\"\u003c/i\u003e and \u003ci\u003e\"Psuipt jt HP!\"\u003c/i\u003e (provided as character arrays within a cell array) — and a (right-shifting) ROT1 cipher had been applied.  In that case A→B, B→C, ..., Y→Z, and Z→A;  similarly, a→b, b→c, ..., y→z, and z→a.  (Note that the shifting 'wraps' back around.)  \r\nThus the original messages would have been:  \u003ci\u003e\"proceed w/ operation\"\u003c/i\u003e and \u003ci\u003e\"Orthos is GO!\"\u003c/i\u003e .\u003c/p\u003e\u003cp\u003eThe correct answer would comprise:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003es.shift = uint8(1)  \r\ns.message = {'proceed w/ operation', 'Orthos is GO!'}\r\n\u003c/pre\u003e\u003cp\u003eIf the batch of messages cannot be decoded when following the above assumptions, then simply return 'scalar' \u003ca href = \"http://au.mathworks.com/help/matlab/ref/nan.html\"\u003eNaN\u003c/a\u003e in both fields (no need for a cell array).\u003c/p\u003e\u003cp\u003e\u003ctt\u003eNote:  Many Cody solutions are hard to read and not necessarily computationally efficient.  To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable).  Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand. (Try resubmitting on another day if your code runs slowly, in case it is caused by a server issue.)\u003c/tt\u003e\u003c/p\u003e\u003cp\u003eTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \"too slow\".\u003c/p\u003e\u003cp\u003e----------\u003c/p\u003e\u003cp\u003ePrevious problem:  \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44351\"\u003eOperation Phoenix\u003c/a\u003e.  Next problem:  \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44383\"\u003eOperation Xiangliu\u003c/a\u003e.\u003c/p\u003e","function_template":"function s = decode(x)\r\n  s = x;\r\nend","test_suite":"%% NOTE:  \r\n% This test suite can be updated if inappropriate 'hacks' \r\n% are discovered in any submitted solutions, \r\n% so the assessment of your submission may therefore change over time.  \r\nRE = regexp(fileread('decode.m'), '\\w+', 'match');\r\ntabooWords = {'ans', 'assert', 'freepass', 'tic'};\r\ntestResult = cellfun( @(z) ismember(z, tabooWords), RE );\r\nmsg = ['Please do not do that in your code!' char([10 13]) ...\r\n    'Found: ' strjoin(RE(testResult)) '.' char([10 13]) ...\r\n    'Banned word.' char([10 13])];\r\nassert(~any(  cellfun( @(z) ismember(z, tabooWords), RE )  ), msg)\r\n\r\n\r\n%% Test 1\r\nx =                 {'qspdffe x/ pqfsbujpo', 'Psuipt jt HP!'};\r\ns_correct.shift = uint8(1);\r\ns_correct.message = {'proceed w/ operation', 'Orthos is GO!'};\r\ns = decode(x);\r\n%disp(' *** ');  disp(s.message);  disp(' *** ')\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message{1}, s_correct.message{1}) )\r\nassert( isequal(s.message{2}, s_correct.message{2}) )\r\nassert( isequal(s.message, s_correct.message) )\r\nassert( isequal(s, s_correct) )\r\nassert( isequal(class(s.shift), 'uint8') )\r\nassert( isequal(class(s.message), 'cell') )\r\nassert( isequal(class(s.message{1}), 'char') )\r\n\r\n\r\n%% Test 2\r\nx =                 {'Hfqq Ons ts 555-7839 FXFU.', 'twymtx nx ts mtqi', 'bfnynsl ktw dtzw fianhj', 'TUJWFYNTS UTXYUTSJI'};\r\ns_correct.shift = uint8(5);\r\ns_correct.message = {'Call Jin on 555-7839 ASAP.', 'orthos is on hold', 'waiting for your advice', 'OPERATION POSTPONED'};\r\ns = decode(x);\r\n%disp(' *** ');  disp(s.message);  disp(' *** ')\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\n\r\n\r\n%% Test 3\r\nx =                 {'Ocz kvnnrjmy rvn xcvibzy: \"Knpdko\" oj \"Gjlzgk\".', 'Jkzmvodji Kcjzids rvn npxxznnapg. Izso rdgg wz Jmocjn.', 'Edi Uvkxgzout rdgg wz gzvydib Ozvh V'};\r\ns_correct.shift = uint8(21);\r\ns_correct.message = {'The password was changed: \"Psuipt\" to \"Loqelp\".', 'Operation Phoenix was successful. Next will be Orthos.', 'Jin Zapcletzy will be leading Team A'};\r\ns = decode(x);\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\n\r\n\r\n%% Test 4\r\nx =                 {'bxmzzuzs r/ adftae az fdmow', 'adftae etxp oaybxqfq uz 2 iwe', 'abqdmfuaz pmfq eturfqp nmow 2 p.', 'naawe dqoquhqp. fwe Vuz' };\r\ns_correct.shift = uint8(12);\r\ns_correct.message = {'planning f/ orthos on track', 'orthos shld complete in 2 wks', 'operation date shifted back 2 d.', 'books received. tks Jin'};\r\ns = decode(x);\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\n\r\n\r\n%% Test 5\r\nx =                 {'Hdsffafy xgj Ghwjslagf Gjlzgk zsk gxxauasddq ugeewfuwv.  Lzak oadd tw dwv tq Lwse S, kmhhgjlwv tq Lwse T sk fwwvwv.'};\r\ns_correct.shift = uint8(18);\r\ns_correct.message = {'Planning for Operation Orthos has officially commenced.  This will be led by Team A, supported by Team B as needed.'};\r\ns = decode(x);\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\n\r\n\r\n%% Test 6\r\nx = {'Mncpyrgml Nfmclgv qryprcb rfpcc bywq yem.  Yjj ncpqmllcj ypc rm pckygl ml bsrw slrgj Mncpyrgml Nfmclgv gq amknjcrcb.'};\r\ns_correct.shift = nan;\r\ns_correct.message = nan;\r\ns = decode(x);\r\nassert( isnan(s.shift) )\r\nassert( isnan(s.message) )\r\n\r\n\r\n%% Test 7\r\nx =                 {'Iutloxskj vgyycuxj oy tuc \"Ruwkrv\".', 'Vrgt lux uxznuy ruuqy UQ, haz tkkj suxk $$$', 'Ksgor Pot Fgvirkzfe ut xacqxb@sgzncuxqy.ius xk. Zakyjge', 'Zgrqkj zu Zkgs H.  Ngvve zu yavvuxz uvkxgzout....', 'Xk. latjy, vry zxgtylkx zu giiuatz \"YZOBKDSYX\" - ZDY', 'jUT''Z cUXXE'};\r\ns_correct.shift = uint8(6);\r\ns_correct.message = {'Confirmed password is now \"Loqelp\".', 'Plan for orthos looks OK, but need more $$$', 'Email Jin Zapcletzy on ruwkrv@mathworks.com re. Tuesday', 'Talked to Team B.  Happy to support operation....', 'Re. funds, pls transfer to account \"STIVEXMSR\" - TXS', 'dON''T wORRY'};\r\ns = decode(x);\r\nassert( isequal(s.shift, s_correct.shift) )\r\nassert( isequal(s.message, s_correct.message) )\r\n\r\n\r\n%% TIMING \r\n% Note:  The Time Trial section does not check accuracy; that is done above.\r\n\r\n% Acknowledgements  \r\n% Portions of this timing test code were inspired by:\r\n% (1) Problem 937. \"Rubik's Mini Cube: Solve Randomized Cube in 11 Moves or Less; Score is by Time (msec)\" by Richard Zapor.\r\n% (2) Problem 2733. \"Evil Number\" by Jan Orwat.\r\n% (3) Feedback in comments from Peng Liu.\r\n% (4) Problem Problem 1237. \"It's race time! Write a faster function than the test suite call of unique().\" by Jeremy.\r\n\r\n% INITIALISE\r\nx = {'qspdffe x/ pqfsbujpo', 'Psuipt jt HP!'};\r\nqSmall = 50;\r\nqBig = 10000;\r\n%cutoffTimeBig = 10;\r\n\r\n% EDIT (2018-06-17).  Reduced time to pose reasonable challenge.\r\n% Accounted for improving Cody server speed per Problem 44655.\r\ncutoffTimeBig = 3;    % Maximum allowable walltime (in seconds) to run function in a loop with qBig iterations.\r\ntRef = datetime('2018-06-17', 'InputFormat','yyyy-MM-dd');\r\ntNow = datetime('now');\r\nyearsElapsed = (datenum(tNow) - datenum(tRef)) / 365.24;\r\nfprintf('\\r\\n\\r\\n\\r\\nSubmission evaluated for speed on %s.\\r\\n', datestr(tNow, 'dd mmmm yyyy'))\r\nrInf = 0.2;   delta = cutoffTimeBig - rInf;  tau = 3.6;  % Data from Problem 44655, based on Problem 963.\r\nqBig = floor( qBig * (cutoffTimeBig - rInf) * exp(yearsElapsed/tau) / delta );\r\nfprintf('\\r\\n\\r\\n\\r\\nTo account for computational power increases over time, number of iterations increased to %u.\\r\\n', qBig)\r\n% END EDIT (2018-06-17)\r\n\r\nfor dummy = 1 : 10,  disp(' . ');  end;\r\n\r\n% *** PRELIMINARY TIMING WITH timeit ***\r\nfDecode = @()   decode(x);\r\ndt_timeit = timeit( fDecode );\r\nfprintf('APPROXIMATE time to decode %u message batches ~ %2.2f seconds, according to ''timeit''.\\n\\r', qBig, dt_timeit * qBig)\r\n\r\n% *** PRELIMINARY TIMING WITH SHORT LOOP ***\r\n% In case the submitted function has a lot of text output, \r\n% get an estimate based on just a few iterations\r\n% Initialise\r\nt0 = clock;\r\n\r\n% Loop\r\nfor i = 1 : qSmall\r\n    solution = decode( x );\r\nend;\r\n\r\n% Compute and display elapsed time.\r\ndt = etime(clock, t0);\r\ndisp('     -----=====-----     ')\r\n%fprintf('Your wall time to decode %u message batches = %i seconds.\\n\\r', qSmall, floor(dt))\r\nfprintf('APPROXIMATE wall time to decode %u message batches ~ %2.2f seconds, by extrapolating from %u batches.\\n\\r', qBig, dt * qBig / qSmall, qSmall)\r\ndisp('     -----=====-----     ')\r\n\r\n% *** 'OFFICIAL' TIMING ***\r\n% Re-initialise timer\r\nt0 = clock;\r\nt0_cpu = cputime;\r\n\r\n% Loop\r\nfor i = 1 : qBig\r\n    solution = decode( x );\r\nend;\r\n\r\n% Compute and display elapsed time.\r\nfor dummy = 1 : 10,  disp(' . ');  end;\r\ndisp('     -----=====|||||=====-----     ')\r\ndt = etime(clock, t0);\r\nfprintf('Your wall time to decode %u message batches = %2.2f seconds.\\n\\r', qBig, dt)\r\n\r\ndt_cpu = (cputime - t0_cpu);\r\nfprintf(' ( Your CPU time for this = %2.2f seconds. ) \\n\\r', dt_cpu)\r\n\r\n% Display (default) Cody size-based score.\r\nall_nodes = mtree('decode.m', '-file');\r\nsize_score = count(all_nodes);\r\nfprintf('Your Cody-standard size-based score = %i.\\n\\r', size_score)\r\n\r\n% Report revised performance score\r\ncombinedScore = size_score + round(dt * 10);\r\nfprintf('Your combined score = %i.\\n\\r', combinedScore)\r\ndisp('     -----=====|||||=====-----     ')\r\n\r\n% Now disallow any candidate solutions that are TOO SLOW!\r\nif dt \u003e cutoffTimeBig, \r\n    fprintf('Sorry, your submission is TOO SLOW.  It must be able to finish within %u seconds.\\n\\r', cutoffTimeBig)\r\nend;\r\n\r\nassert( dt \u003c= cutoffTimeBig )","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":29,"test_suite_updated_at":"2018-06-17T14:03:55.000Z","rescore_all_solutions":false,"group_id":40,"created_at":"2017-10-03T06:52:32.000Z","updated_at":"2026-04-02T18:15:25.000Z","published_at":"2017-10-03T11:50:21.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\u003eYou have been tasked with decoding several batches of coded messages that have been intercepted.\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\u003eBased on previous intelligence that has been gathered, you can be confident that the messages were all encoded using a simple\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/Caesar_cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCaesar cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (a type 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=\\\"https://en.wikipedia.org/wiki/Substitution_cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003esubstitution cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e), an example of which is 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/ROT13\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eROT13 cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (discussed 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://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Challenge Problem 78\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e). As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation \u0026amp; numbers) are unchanged. Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and may vary between batches of messages — although it will be the same for all messages in a batch (also, here you need to decode, not encode).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou can also assume that the original batch of messages will relate to an activity that is referred to by those involved as \\\"Operation Orthos\\\". However, in their secret internal communications they might not use this exact phrase at all, nor this exact capitalisation. Therefore you should seek\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\u003esimultaneous\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e occurrence of the separate words \\\"Operation\\\" and \\\"Orthos\\\" (with any capitalisation) in messages within the given batch.\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\u003eYour task is to crack the codes and report back in a\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://au.mathworks.com/help/matlab/ref/struct.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003estructure array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e: (1) the shifting parameter that had been used in the encoding [as\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://au.mathworks.com/help/matlab/ref/uint8.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003euint8\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e]; (2) the decoded messages [as a\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://au.mathworks.com/help/matlab/ref/cell.html?s_tid=doc_ta\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecell array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (containing\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://au.mathworks.com/help/matlab/ref/char.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003echaracter arrays\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e)]. The name of the structure array shall be \\\"s\\\", with respective fields \\\"shift\\\" and \\\"message\\\".\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEXAMPLE\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSuppose the batch contained two encoded messages —\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\\\"qspdffe x/ pqfsbujpo\\\"\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\u003e\\\"Psuipt jt HP!\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (provided as character arrays within a cell array) — and a (right-shifting) ROT1 cipher had been applied. In that case A→B, B→C, ..., Y→Z, and Z→A; similarly, a→b, b→c, ..., y→z, and z→a. (Note that the shifting 'wraps' back around.) Thus the original messages would have been: \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\\\"proceed w/ operation\\\"\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\u003e\\\"Orthos is GO!\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e .\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe correct answer would comprise:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[s.shift = uint8(1)  \\ns.message = {'proceed w/ operation', 'Orthos is GO!'}]]\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\u003eIf the batch of messages cannot be decoded when following the above assumptions, then simply return 'scalar'\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://au.mathworks.com/help/matlab/ref/nan.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eNaN\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e in both fields (no need for a cell array).\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eNote: Many Cody solutions are hard to read and not necessarily computationally efficient. To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable). Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand. (Try resubmitting on another day if your code runs slowly, in case it is caused by a server issue.)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \\\"too slow\\\".\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----------\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\u003ePrevious problem: \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44351\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOperation Phoenix\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. Next problem: \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44383\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOperation Xiangliu\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\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":52664,"title":"List the Moran numbers","description":"The quotient of a Moran number and its digit sum is prime. For example, 117 and 481 are Moran numbers because 117/(1+1+7) is 13 and 481/(4+8+1) = 37, and both 13 and 37 are prime. \r\nWrite a function to list the Moran numbers less than or equal to the input number. ","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 72px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 36px; transform-origin: 407px 36px; 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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 363px 8px; transform-origin: 363px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe quotient of a Moran number and its digit sum is prime. For example, 117 and 481 are Moran numbers because 117/(1+1+7) is 13 and 481/(4+8+1) = 37, and both 13 and 37 are prime. \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: 257px 8px; transform-origin: 257px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to list the Moran numbers less than or equal to the input number. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = Moran(n)\r\n  y = f(n);\r\nend","test_suite":"%%\r\nn = 500;\r\ny = Moran(n);\r\ny_correct = [18 21 27 42 45 63 84 111 114 117 133 152 153 156 171 190 195 198 201 207 209 222 228 247 261 266 285 333 370 372 399 402 407 423 444 465 481];\r\nassert(isequal(y,y_correct))\r\n\r\n%% \r\nn = 40332;\r\ny = Moran(n);\r\ny23_correct = [207 1679 3749 4577 8717 14099 18653 19067 22793 24449 25691 26519 26933 29417 29831 32729 33557 35627 37283];\r\nassert(isequal(y(mod(y,23)==0),y23_correct) \u0026\u0026 isequal(y(end),n))\r\n\r\n%%\r\nn = [100000 400000 700000 1e6 4e6 7e6 1e7];\r\ns = [383 1193 1870 2451 8080 12913 17271];\r\nlen_correct = [1915 5967 9352 12259 40403 64567 86356];\r\nsum_correct = [79699686 1044807776 2880495403 5339917218 73480226594 205122929098 389309242207];\r\nsd_correct  = [2.925215086021406e+04 1.171076738381341e+05 2.065163622127620e+05 2.944277010513903e+05 1.177431499460555e+06 2.057551640570258e+06 2.933705654924581e+06];\r\nys_correct  = [11354 28489 48992 71660 99972; 51489 125203 210051 300165 399477; 96325 220734 364473 524186 699739; 129627 308214 513837 741778 999219; 579189 1331117 2176042 3062214 3999644; 1046322 2330397 3782883 5322552 6999255; 1440693 3292137 5341677 7565613 9999882];\r\nfor k = 1:length(n)\r\n    disp(['Test 3.' num2str(k)])\r\n    y = Moran(n(k));\r\n    assert(isequal(length(y),len_correct(k)) \u0026\u0026 isequal(sum(y),sum_correct(k)) \u0026\u0026 abs(std(y)-sd_correct(k))\u003c1e-7 \u0026\u0026 isequal(y(s(k):s(k):end),ys_correct(k,:)));\r\nend\r\n\r\n%%\r\nfiletext = fileread('Moran.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'regexp') || contains(filetext, 'oeis') || contains(filetext, 'persistent'); \r\nassert(~illegal)","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":22,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-09-05T13:52:35.000Z","updated_at":"2025-12-15T19:21:34.000Z","published_at":"2021-09-05T14:10:51.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe quotient of a Moran number and its digit sum is prime. For example, 117 and 481 are Moran numbers because 117/(1+1+7) is 13 and 481/(4+8+1) = 37, and both 13 and 37 are prime. \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 list the Moran numbers less than or equal to the input number. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":1237,"title":"It's race time! Write a faster function than the test suite call of unique().","description":"Write a function to get unique elements of a vector faster than unique()! Input will be a vector (of integers or floating point numbers) of any size. The order of the returned vector is unimportant. \r\n\r\nExample:\r\nInput: x = [1 1 2 2 3 3];\r\nOutput: [1 2 3];\r\n\r\nInput: x = [0.1 3.1 2.1 2.0 3.1];\r\nOutput: [0.1 3.1 2.1 2.0]; % or any order","description_html":"\u003cp\u003eWrite a function to get unique elements of a vector faster than unique()! Input will be a vector (of integers or floating point numbers) of any size. The order of the returned vector is unimportant.\u003c/p\u003e\u003cp\u003eExample:\r\nInput: x = [1 1 2 2 3 3];\r\nOutput: [1 2 3];\u003c/p\u003e\u003cp\u003eInput: x = [0.1 3.1 2.1 2.0 3.1];\r\nOutput: [0.1 3.1 2.1 2.0]; % or any order\u003c/p\u003e","function_template":"function y = my_unique(x)\r\n   y = x;\r\nend","test_suite":"%%\r\nx = rand(10000, 1);\r\nz = rand(10000, 1);\r\nx = vertcat(x, z);\r\ntic\r\ny_correct = unique(x);\r\nt_unique = toc\r\n\r\ntic\r\ny_myunique = my_unique(x);\r\nt_myunique = toc\r\n\r\nassert(isequal(sort(my_unique(x)),y_correct) \u0026\u0026 t_unique \u003e t_myunique)\r\n\r\n%%\r\nx = rand(50000, 1);\r\nz = rand(50000, 1);\r\nx = vertcat(x, z);\r\n\r\ntic\r\ny_correct = unique(x);\r\nt_unique = toc\r\n\r\ntic\r\ny_my_unique = my_unique(x);\r\nt_my_unique = toc\r\n\r\nassert(isequal(sort(my_unique(x)),y_correct) \u0026\u0026 t_unique \u003e t_my_unique)\r\n\r\n%%\r\nx = [1; 2; 3; 4; 2; 3; 4; 5;];\r\n\r\ntic\r\ny_correct = unique(x);\r\nt_unique = toc\r\n\r\ntic\r\ny_my_unique = my_unique(x);\r\nt_my_unique = toc\r\n\r\nassert(isequal(sort(my_unique(x)),y_correct) \u0026\u0026 t_unique \u003e t_my_unique)\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":9,"created_by":10338,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":31,"test_suite_updated_at":"2013-02-03T20:33:40.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-02-01T03:36:13.000Z","updated_at":"2025-09-07T01:43:50.000Z","published_at":"2013-02-01T03:36:13.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function to get unique elements of a vector faster than unique()! Input will be a vector (of integers or floating point numbers) of any size. The order of the returned vector is unimportant.\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: Input: x = [1 1 2 2 3 3]; Output: [1 2 3];\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\u003eInput: x = [0.1 3.1 2.1 2.0 3.1]; Output: [0.1 3.1 2.1 2.0]; % or any order\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":44383,"title":"Code breaker, Part III:  Operation Xiangliu","description":"You have been tasked with decoding several batches of coded messages that have been intercepted.  \r\n\r\nBased on previous intelligence that has been gathered, you can be confident that the messages were all encoded using a simple \u003chttps://en.wikipedia.org/wiki/Caesar_cipher Caesar cipher\u003e (a type of \u003chttps://en.wikipedia.org/wiki/Substitution_cipher substitution cipher\u003e), an example of which is the \u003chttps://en.wikipedia.org/wiki/ROT13 ROT13 cipher\u003e (discussed in \u003chttps://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher Cody Challenge Problem 78\u003e).  As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation, numbers, accented letters) are unchanged.  Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and will vary _between_ (not within) batches — also, here you need to decode, not encode.  \r\n\r\nThese latest activities that you are investigating have been nicknamed 'Operation Xiangliu' by your own organisation.  A few decoding options are at your organisation's disposal:  \r\n\r\n# Test the candidate decodings against all words in a large dictionary — this could work, but it is very slow.\r\n# Test the candidate decodings for the appearance of a name or phrase that is certain to appear regularly (e.g. \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44351 \"Operation Phoenix\"\u003e) — unfortunately as yet there is not enough knowledge of the activities to be sure of a suitable name or phrase to use.  \r\n# Test the candidate decodings against all words in a short list comprising, say, the hundred most frequently used English words.\r\n\r\nThe *third option* will be faster than the first option, and more reliable than the second option, so this is the approach you will be taking.  \r\n\r\nYou have been careful to avoid using 'lemmatised' lists (which contain e.g. the verb \"to be\", rather than the various inflected forms such as \"am\", \"is\", \"are\") like those based on the \u003chttps://web.archive.org/web/20111226085859/http://oxforddictionaries.com/words/the-oec-facts-about-the-language OEC\u003e or \u003chttps://www.wordfrequency.info/free.asp?s=y COCA\u003e, and after setting aside \u003chttp://world-english.org/english500.htm another list\u003e you finally choose the \u003chttp://ucrel.lancs.ac.uk/bncfreq/samples/120.pdf list based on the BNC\u003e as the most reliable, and will use the first 100 words on that list.  \r\nThis list will be available for you to access as an input variable, |bncWordlist|, to your function. Note: (i) some entries on the list are morphemes (e.g. \"\u0026#x200A;n't\u0026#x200A;\" and \"\u0026#x200A;'s\u0026#x200A;\") rather than words;  (ii) some entries appear more than once (representing different grammatical word classes).  Of course, in the original messages any capitalisation might be used.  \r\n\r\nYou have been instructed that your 'certitude' (degree of confidence) in the decoding must be reported for each batch, and shall depend proportionally upon the sum of the characters for the words/morphemes in the decoded message that match words/morphemes in |bncWordlist|.  Being able to match words/morphemes accounting for three-tenths of the characters (excluding spaces) shall correspond to 100% certitude;  matching three-twentieths would be 50% certitude, and so on.  Certitude shall be reported as a percentage, rounded _up_ to the nearest integer, not greater than 100.  You need to maximise your certitude for each batch by appropriate choice of the shifting parameter.   If there are multiple shifts of equal certitude, report both options on different rows (arranged in order of ascending shift parameter).\r\n\r\nYour task is to crack the codes and report back in a \u003chttp://au.mathworks.com/help/matlab/ref/struct.html structure array\u003e: \u0026nbsp; (1) the shifting parameter that had been used in the encoding [as \u003chttp://au.mathworks.com/help/matlab/ref/uint8.html uint8\u003e] (usually scalar, but may be column vector); \u0026nbsp; (2) the decoded messages [as a \u003chttp://au.mathworks.com/help/matlab/ref/cell.html?s_tid=doc_ta cell array\u003e (containing \u003chttp://au.mathworks.com/help/matlab/ref/char.html character arrays\u003e)] (usually an array with a single row, but occasionally with multiple rows); \u0026nbsp; (3) your 'certitude' in the decoding [as \u003chttp://au.mathworks.com/help/matlab/ref/uint8.html uint8\u003e] (always scalar).  \r\nThe name of the structure array shall be |s|, with respective fields |shift|, |message|, and |certitude|.  \r\n\r\n*EXAMPLE 1*\r\n\r\nSuppose the batch contained two encoded messages — _\"Vomftt qvstvfe, pqfo op eppst.\"_ and _\"Ffmt dbo ljmm, opu pomz xpvoe.\"_ (provided as character arrays within a cell array) — and a (right-shifting) ROT1 cipher had been applied.  In that case A→B, B→C, ..., Y→Z, and Z→A;  similarly, a→b, b→c, ..., y→z, and z→a.  \r\nThus the original messages would have been:  _\"Unless pursued, open no doors.\"_ and _\"Eels can kill, not only wound.\"_ .  Twelve of the 51 characters have been matched:  \"no\", \"can\", \"not\", and \"only\".  \r\n\r\nThe correct answer would therefore comprise:  \r\n\r\n  s.shift = uint8(1)  \r\n  s.message = {'Unless pursued, open no doors.', 'Eels can kill, not only wound.'}\r\n  s.certitude = uint8(79)\r\n\r\n*EXAMPLE 2*\r\n\r\nSuppose the batch contained one encoded message — _\"Oa oqvvq'u cnycau dggp: \"Ctu itcvkc ctvku\".\"_ (provided as a character array within a cell array) — and a (right-shifting) ROT2 cipher had been applied.  In that case A→C, B→D, ..., Y→A, and Z→B;  similarly, a→c, b→d, ..., y→a, and z→b.  \r\nThus the original message would have been:  _\"My motto's always been: \"Ars gratia artis\".\"_ .  Eight of the 37 characters have been matched: \"My\", \"\u0026#x200A;'s\u0026#x200A;\", and \"been\".  Note carefully that:  \"\u0026#x200A;'s\u0026#x200A;\" should only be matched once;  \"to\" (in motto), \"be\" (in been), \"at\" (in gratia), \"is\" (in artis) and \"a\" (passim) should _not_ be matched at all;  and \"\u0026#x200A;'\u0026#x200A;\" will only ever be used as an apostrophe (never as a quotation mark).  \r\n\r\nThe correct answer would therefore comprise:  \r\n\r\n  s.shift = uint8(2)  \r\n  s.message = {'My motto''s always been: \"Ars gratia artis\".'}\r\n  s.certitude = uint8(73)\r\n\r\nIf the batch of messages cannot be decoded when following the above assumptions, then return the original encoded message(s) unchanged, with a shift of zero and a certitude of zero.  \r\n\r\n|Note:  Many Cody solutions are hard to read and not necessarily computationally efficient.  To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable).  Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand. (Try resubmitting on another day if your code runs slowly, in case it is caused by a server issue.)|  \r\n\r\nTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \"too slow\".  \r\n\r\n----------\r\n\r\nPrevious problem:  \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44356 Operation Orthos\u003e.  Next problem:  TBA.","description_html":"\u003cp\u003eYou have been tasked with decoding several batches of coded messages that have been intercepted.\u003c/p\u003e\u003cp\u003eBased on previous intelligence that has been gathered, you can be confident that the messages were all encoded using a simple \u003ca href = \"https://en.wikipedia.org/wiki/Caesar_cipher\"\u003eCaesar cipher\u003c/a\u003e (a type of \u003ca href = \"https://en.wikipedia.org/wiki/Substitution_cipher\"\u003esubstitution cipher\u003c/a\u003e), an example of which is the \u003ca href = \"https://en.wikipedia.org/wiki/ROT13\"\u003eROT13 cipher\u003c/a\u003e (discussed in \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher\"\u003eCody Challenge Problem 78\u003c/a\u003e).  As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation, numbers, accented letters) are unchanged.  Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and will vary \u003ci\u003ebetween\u003c/i\u003e (not within) batches — also, here you need to decode, not encode.\u003c/p\u003e\u003cp\u003eThese latest activities that you are investigating have been nicknamed 'Operation Xiangliu' by your own organisation.  A few decoding options are at your organisation's disposal:\u003c/p\u003e\u003col\u003e\u003cli\u003eTest the candidate decodings against all words in a large dictionary — this could work, but it is very slow.\u003c/li\u003e\u003cli\u003eTest the candidate decodings for the appearance of a name or phrase that is certain to appear regularly (e.g. \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44351\"\u003e\"Operation Phoenix\"\u003c/a\u003e) — unfortunately as yet there is not enough knowledge of the activities to be sure of a suitable name or phrase to use.\u003c/li\u003e\u003cli\u003eTest the candidate decodings against all words in a short list comprising, say, the hundred most frequently used English words.\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eThe \u003cb\u003ethird option\u003c/b\u003e will be faster than the first option, and more reliable than the second option, so this is the approach you will be taking.\u003c/p\u003e\u003cp\u003eYou have been careful to avoid using 'lemmatised' lists (which contain e.g. the verb \"to be\", rather than the various inflected forms such as \"am\", \"is\", \"are\") like those based on the \u003ca href = \"https://web.archive.org/web/20111226085859/http://oxforddictionaries.com/words/the-oec-facts-about-the-language\"\u003eOEC\u003c/a\u003e or \u003ca href = \"https://www.wordfrequency.info/free.asp?s=y\"\u003eCOCA\u003c/a\u003e, and after setting aside \u003ca href = \"http://world-english.org/english500.htm\"\u003eanother list\u003c/a\u003e you finally choose the \u003ca href = \"http://ucrel.lancs.ac.uk/bncfreq/samples/120.pdf\"\u003elist based on the BNC\u003c/a\u003e as the most reliable, and will use the first 100 words on that list.  \r\nThis list will be available for you to access as an input variable, \u003ctt\u003ebncWordlist\u003c/tt\u003e, to your function. Note: (i) some entries on the list are morphemes (e.g. \"\u0026#x200A;n't\u0026#x200A;\" and \"\u0026#x200A;'s\u0026#x200A;\") rather than words;  (ii) some entries appear more than once (representing different grammatical word classes).  Of course, in the original messages any capitalisation might be used.\u003c/p\u003e\u003cp\u003eYou have been instructed that your 'certitude' (degree of confidence) in the decoding must be reported for each batch, and shall depend proportionally upon the sum of the characters for the words/morphemes in the decoded message that match words/morphemes in \u003ctt\u003ebncWordlist\u003c/tt\u003e.  Being able to match words/morphemes accounting for three-tenths of the characters (excluding spaces) shall correspond to 100% certitude;  matching three-twentieths would be 50% certitude, and so on.  Certitude shall be reported as a percentage, rounded \u003ci\u003eup\u003c/i\u003e to the nearest integer, not greater than 100.  You need to maximise your certitude for each batch by appropriate choice of the shifting parameter.   If there are multiple shifts of equal certitude, report both options on different rows (arranged in order of ascending shift parameter).\u003c/p\u003e\u003cp\u003eYour task is to crack the codes and report back in a \u003ca href = \"http://au.mathworks.com/help/matlab/ref/struct.html\"\u003estructure array\u003c/a\u003e: \u0026nbsp; (1) the shifting parameter that had been used in the encoding [as \u003ca href = \"http://au.mathworks.com/help/matlab/ref/uint8.html\"\u003euint8\u003c/a\u003e] (usually scalar, but may be column vector); \u0026nbsp; (2) the decoded messages [as a \u003ca href = \"http://au.mathworks.com/help/matlab/ref/cell.html?s_tid=doc_ta\"\u003ecell array\u003c/a\u003e (containing \u003ca href = \"http://au.mathworks.com/help/matlab/ref/char.html\"\u003echaracter arrays\u003c/a\u003e)] (usually an array with a single row, but occasionally with multiple rows); \u0026nbsp; (3) your 'certitude' in the decoding [as \u003ca href = \"http://au.mathworks.com/help/matlab/ref/uint8.html\"\u003euint8\u003c/a\u003e] (always scalar).  \r\nThe name of the structure array shall be \u003ctt\u003es\u003c/tt\u003e, with respective fields \u003ctt\u003eshift\u003c/tt\u003e, \u003ctt\u003emessage\u003c/tt\u003e, and \u003ctt\u003ecertitude\u003c/tt\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eEXAMPLE 1\u003c/b\u003e\u003c/p\u003e\u003cp\u003eSuppose the batch contained two encoded messages — \u003ci\u003e\"Vomftt qvstvfe, pqfo op eppst.\"\u003c/i\u003e and \u003ci\u003e\"Ffmt dbo ljmm, opu pomz xpvoe.\"\u003c/i\u003e (provided as character arrays within a cell array) — and a (right-shifting) ROT1 cipher had been applied.  In that case A→B, B→C, ..., Y→Z, and Z→A;  similarly, a→b, b→c, ..., y→z, and z→a.  \r\nThus the original messages would have been:  \u003ci\u003e\"Unless pursued, open no doors.\"\u003c/i\u003e and \u003ci\u003e\"Eels can kill, not only wound.\"\u003c/i\u003e .  Twelve of the 51 characters have been matched:  \"no\", \"can\", \"not\", and \"only\".\u003c/p\u003e\u003cp\u003eThe correct answer would therefore comprise:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003es.shift = uint8(1)  \r\ns.message = {'Unless pursued, open no doors.', 'Eels can kill, not only wound.'}\r\ns.certitude = uint8(79)\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eEXAMPLE 2\u003c/b\u003e\u003c/p\u003e\u003cp\u003eSuppose the batch contained one encoded message — \u003ci\u003e\"Oa oqvvq'u cnycau dggp: \"Ctu itcvkc ctvku\".\"\u003c/i\u003e (provided as a character array within a cell array) — and a (right-shifting) ROT2 cipher had been applied.  In that case A→C, B→D, ..., Y→A, and Z→B;  similarly, a→c, b→d, ..., y→a, and z→b.  \r\nThus the original message would have been:  \u003ci\u003e\"My motto's always been: \"Ars gratia artis\".\"\u003c/i\u003e .  Eight of the 37 characters have been matched: \"My\", \"\u0026#x200A;'s\u0026#x200A;\", and \"been\".  Note carefully that:  \"\u0026#x200A;'s\u0026#x200A;\" should only be matched once;  \"to\" (in motto), \"be\" (in been), \"at\" (in gratia), \"is\" (in artis) and \"a\" (passim) should \u003ci\u003enot\u003c/i\u003e be matched at all;  and \"\u0026#x200A;'\u0026#x200A;\" will only ever be used as an apostrophe (never as a quotation mark).\u003c/p\u003e\u003cp\u003eThe correct answer would therefore comprise:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003es.shift = uint8(2)  \r\ns.message = {'My motto''s always been: \"Ars gratia artis\".'}\r\ns.certitude = uint8(73)\r\n\u003c/pre\u003e\u003cp\u003eIf the batch of messages cannot be decoded when following the above assumptions, then return the original encoded message(s) unchanged, with a shift of zero and a certitude of zero.\u003c/p\u003e\u003cp\u003e\u003ctt\u003eNote:  Many Cody solutions are hard to read and not necessarily computationally efficient.  To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable).  Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand. (Try resubmitting on another day if your code runs slowly, in case it is caused by a server issue.)\u003c/tt\u003e\u003c/p\u003e\u003cp\u003eTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \"too slow\".\u003c/p\u003e\u003cp\u003e----------\u003c/p\u003e\u003cp\u003ePrevious problem:  \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44356\"\u003eOperation Orthos\u003c/a\u003e.  Next problem:  TBA.\u003c/p\u003e","function_template":"% Comments are nice, aren't they....\r\nfunction s = decode(x, bncWordlist)\r\nend","test_suite":"%% NOTE:  \r\n% This test suite can be updated if inappropriate 'hacks' \r\n% are discovered in any submitted solutions.\r\n% The assessment of your submission may therefore change over time.  \r\n\r\nglobal bncWordlist\r\nbncWordlist = {'the', 'of', 'and', 'a', 'in', 'to', 'it', 'is', 'to', 'was', ...\r\n    'I', 'for', 'that', 'you', 'he', 'be', 'with', 'on', 'by', 'at', ...\r\n    'have', 'are', 'not', 'this', '''s', 'but', 'had', 'they', 'his', ...\r\n    'from', 'she', 'that', 'which', 'or', 'we', '''s', 'an', 'n''t', 'were', ...\r\n    'as', 'do', 'been', 'their', 'has', 'would', 'there', 'what', 'will', 'all', ...\r\n    'if', 'can', 'her', 'said', 'who', 'one', 'so', 'up', 'as', 'them', 'some', ...\r\n    'when', 'could', 'him', 'into', 'its', 'then', 'two', 'out', 'time', ...\r\n    'my', 'about', 'did', 'your', 'now', 'me', 'no', 'other', 'only', 'just', ...\r\n    'more', 'these', 'also', 'people', 'know', 'any', 'first', 'see', 'very', 'new', ...\r\n    'may', 'well', 'should', 'her', 'like', 'than', 'how', 'get', 'way', 'one', 'our'};\r\n\r\n\r\n%% Anti-hacking\r\n% EDIT (2019-07-02). Anti-hacking provision\r\n% Ensure only builtin functions will be called.\r\n! rm -v fileread.m\r\n! rm -v assert.m\r\n% END EDIT (2019-07-02)\r\n% EDIT (2018-06-18).  Anti-hacking provision\r\nRE = regexp(fileread('decode.m'), '\\w+', 'match');\r\ntabooWords = {'ans', 'assert', 'freepass', 'tic'};\r\ntestResult = cellfun( @(z) ismember(z, tabooWords), RE );\r\nmsg = ['Please do not do that in your code!' char([10 13]) ...\r\n    'Found: ' strjoin(RE(testResult)) '.' char([10 13]) ...\r\n    'Banned word.' char([10 13])];\r\nassert(~any(  cellfun( @(z) ismember(z, tabooWords), RE )  ), msg)\r\n\r\nfor j = 1 : randi(10)\r\n    decode({'Pizza for dinner.'}, {'mozzarella', 'mushrooms'});\r\nend;\r\n% END EDIT (2018-06-18)\r\n\r\n\r\n%% Test 1\r\nglobal bncWordlist\r\nx =                 {'Vomftt qvstvfe, pqfo op eppst.', 'Ffmt dbo ljmm, opu pomz xpvoe.'};\r\ns_correct.shift = uint8(1);\r\ns_correct.message = {'Unless pursued, open no doors.', 'Eels can kill, not only wound.'};\r\ns_correct.certitude = uint8(79);\r\ns = decode(x, bncWordlist);\r\n%disp(' *** ');  disp(s.message);  disp(' *** ')\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.' )\r\nassert( isequal(s.message{1}, s_correct.message{1}), 'Wrong message{1}.' )\r\nassert( isequal(s.message{2}, s_correct.message{2}), 'Wrong message{2}.' )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.' )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.' )\r\nassert( isequal(s, s_correct), 'Wrong s.' )\r\nassert( isequal(class(s.shift), 'uint8'), 'Wrong class.' )\r\nassert( isequal(class(s.message), 'cell'), 'Wrong class.'  )\r\nassert( isequal(class(s.message{1}), 'char'), 'Wrong class.'  )\r\nassert( isequal(class(s.certitude), 'uint8'), 'Wrong class.'  )\r\n\r\n\r\n%% Test 2\r\nglobal bncWordlist\r\nx =                 {'Doo zduiduh lv edvhg rq ghfhswlrq.', ...\r\n    'Khqfh, zkhq deoh wr dwwdfn, zh pxvw vhhp xqdeoh;  zkhq xvlqj rxu irufhv, zh pxvw vhhp lqdfwlyh;  zkhq zh duh qhdu, zh pxvw pdnh wkh hqhpb eholhyh zh duh idu dzdb; zkhq idu dzdb, zh pxvw pdnh klp eholhyh zh duh qhdu.'};\r\ns_correct.shift = uint8(3);\r\ns_correct.message = {'All warfare is based on deception.', ...\r\n    'Hence, when able to attack, we must seem unable;  when using our forces, we must seem inactive;  when we are near, we must make the enemy believe we are far away; when far away, we must make him believe we are near.'};\r\ns_correct.certitude = uint8(95);\r\ns = decode(x, bncWordlist);\r\n%disp(' *** ');  disp(s.message);  disp(' *** ')\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.'  )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.'  )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.'  )\r\n\r\n\r\n%% Test 3\r\nglobal bncWordlist\r\nx =                 {'Elia lrq yxfqp ql bkqfzb qeb bkbjv.  Cbfdk afploabo, xka zorpe efj.', ...\r\n    'Fc eb fp pbzrob xq xii mlfkqp, yb mobmxoba clo efj.  Fc eb fp fk prmboflo pqobkdqe, bsxab efj.'};\r\ns_correct.shift = uint8(23);\r\ns_correct.message = {'Hold out baits to entice the enemy.  Feign disorder, and crush him.', ...\r\n    'If he is secure at all points, be prepared for him.  If he is in superior strength, evade him.'};\r\ns_correct.certitude = uint8(100);\r\ns = decode(x, bncWordlist);\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.'  )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.'  )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.'  )\r\n\r\n\r\n%% Test 4\r\nglobal bncWordlist\r\nx =                 {'Ax qgmj ghhgfwfl ak gx uzgdwjau lwehwj, kwwc lg ajjalslw zae.  Hjwlwfv lg tw owsc, lzsl zw esq yjgo sjjgysfl.', ...\r\n    'Ax zw ak lscafy zak wskw, yanw zae fg jwkl.', ...\r\n    'Ax zak xgjuwk sjw mfalwv, kwhsjslw lzwe.', ...\r\n    'Sllsuc zae ozwjw zw ak mfhjwhsjwv, shhwsj ozwjw qgm sjw fgl wphwulwv.'};\r\ns_correct.shift = uint8(18);\r\ns_correct.message = {'If your opponent is of choleric temper, seek to irritate him.  Pretend to be weak, that he may grow arrogant.', ...\r\n    'If he is taking his ease, give him no rest.', ...\r\n    'If his forces are united, separate them.', ...\r\n    'Attack him where he is unprepared, appear where you are not expected.'};\r\ns_correct.certitude = uint8(100);\r\ns = decode(x, bncWordlist);\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.'  )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.'  )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.'  )\r\n\r\n\r\n%% Test 5\r\nglobal bncWordlist\r\nx =                 {'Aes cèwo vo foxd bémyvdo vo dowzy', ...\r\n    'Yx wo dbksdo no dbkîdbo aekxn to dbksdo no vk népksdo ne csvoxmo / Vo csvoxmo ocd n''yb, wksc t''ks mryscs vk mknoxmo', ... \r\n    'Mrkaeo wyd, mrkaeo zrbkco nsdc kfom owzrkco / Pksd no Mvkeno WM, vo mywwkxny no vk zrbkco', ...\r\n    'Mkb t''cesc ex WM n''kddkaeo, ckxc dsmc, kedroxdsaeo zkc ox dym / Zbêd à pbkzzob ceb vo lokd zyeb vo wyefowoxd rsz-ryz', ...\r\n    'Ne bkz n''kddkaeo aes pbkzzo, ézkdo, wkdbkaeo od zkdkdbkaeo / Zvec no ckxq de mvkaeoc, t''cesc WM noc Mkbzkdoc', ...\r\n    'Vo zénkqyqeo ox fyqeo ke xyw no myno Cyvkkb ye Mvkeno WM / Do zbyzyco n''émyedob moms / Ae''yx ézovvo voc fyiovvoc, nèc ae''yx cyxxo voc myxcyxxoc'};\r\ns_correct.shift = uint8([0 21]');\r\n% TIP:  The original message was not English!\r\ns_correct.message(1, :) = {'Aes cèwo vo foxd bémyvdo vo dowzy', ... \r\n    'Yx wo dbksdo no dbkîdbo aekxn to dbksdo no vk népksdo ne csvoxmo / Vo csvoxmo ocd n''yb, wksc t''ks mryscs vk mknoxmo', ... \r\n    'Mrkaeo wyd, mrkaeo zrbkco nsdc kfom owzrkco / Pksd no Mvkeno WM, vo mywwkxny no vk zrbkco', ... \r\n    'Mkb t''cesc ex WM n''kddkaeo, ckxc dsmc, kedroxdsaeo zkc ox dym / Zbêd à pbkzzob ceb vo lokd zyeb vo wyefowoxd rsz-ryz', ... \r\n    'Ne bkz n''kddkaeo aes pbkzzo, ézkdo, wkdbkaeo od zkdkdbkaeo / Zvec no ckxq de mvkaeoc, t''cesc WM noc Mkbzkdoc', ... \r\n    'Vo zénkqyqeo ox fyqeo ke xyw no myno Cyvkkb ye Mvkeno WM / Do zbyzyco n''émyedob moms / Ae''yx ézovvo voc fyiovvoc, nèc ae''yx cyxxo voc myxcyxxoc'}\r\ns_correct.message(2, :) = {'Fjx hèbt at ktci gérdait at itbed', ... \r\n    'Dc bt igpxit st igpîigt fjpcs yt igpxit st ap séupxit sj hxatcrt / At hxatcrt thi s''dg, bpxh y''px rwdxhx ap rpstcrt', ... \r\n    'Rwpfjt bdi, rwpfjt ewgpht sxih pktr tbewpht / Upxi st Rapjst BR, at rdbbpcsd st ap ewgpht', ... \r\n    'Rpg y''hjxh jc BR s''piipfjt, hpch ixrh, pjiwtcixfjt eph tc idr / Egêi à ugpeetg hjg at qtpi edjg at bdjktbtci wxe-wde', ... \r\n    'Sj gpe s''piipfjt fjx ugpeet, éepit, bpigpfjt ti epipigpfjt / Eajh st hpcv ij rapfjth, y''hjxh BR sth Rpgepith', ... \r\n    'At eéspvdvjt tc kdvjt pj cdb st rdst Hdappg dj Rapjst BR / It egdedht s''érdjitg rtrx / Fj''dc éetaat ath kdntaath, sèh fj''dc hdcct ath rdchdccth'}\r\ns_correct.certitude = uint8(11);\r\ns = decode(x, bncWordlist);\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.'  )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.'  )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.'  )\r\n\r\n\r\n%% Test 6\r\nglobal bncWordlist\r\nx =                 {'Brvdujcnm mrbxamna yxbcdujcnb ynaonlc mrblryurwn;  brvdujcnm onja yxbcdujcnb lxdajpn;  brvdujcnm fnjtwnbb yxbcdujcnb bcanwpcq.' ...\r\n    'X mrerwn jac xo bdkcunch jwm bnlanlh!'};\r\ns_correct.shift = uint8(9);\r\ns_correct.message = {'Simulated disorder postulates perfect discipline;  simulated fear postulates courage;  simulated weakness postulates strength.' ...\r\n    'O divine art of subtlety and secrecy!'};\r\ns_correct.certitude = uint8(12);\r\ns = decode(x, bncWordlist);\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.'  )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.'  )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.'  )\r\n\r\n\r\n%% Test 7\r\nglobal bncWordlist\r\nx =                 {'Nv treefk vekvi zekf rcczretv nzky evzxysfizex gizetvj lekzc nv riv rthlrzekvu nzky kyvzi uvjzxej.', ... \r\n    'Nv riv efk wzk kf cvru re ridp fe kyv drity lecvjj nv riv wrdzczri nzky kyv wrtv fw kyv tflekip — zkj dflekrzej reu wfivjkj, zkj gzkwrccj reu givtzgztvj, zkj drijyvj reu jnrdgj.', ... \r\n    'Nv jyrcc sv lerscv kf klie erklirc rumrekrxvj kf rttflek lecvjj nv drbv ljv fw cftrc xlzuvj.'};\r\ns_correct.shift = uint8(17);\r\ns_correct.message = {'We cannot enter into alliance with neighboring princes until we are acquainted with their designs.', ...  \r\n    'We are not fit to lead an army on the march unless we are familiar with the face of the country — its mountains and forests, its pitfalls and precipices, its marshes and swamps.', ...  \r\n    'We shall be unable to turn natural advantages to account unless we make use of local guides.'};\r\ns_correct.certitude = uint8(97);\r\ns = decode(x, bncWordlist);\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.'  )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.'  )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.'  )\r\n\r\n\r\n%% Test 8\r\nglobal bncWordlist\r\nx =                 {'Oa oqvvq''u cnycau dggp: \"Ctu itcvkc ctvku\".'};\r\ns_correct.shift = uint8(2);\r\ns_correct.message = {'My motto''s always been: \"Ars gratia artis\".'};\r\ns_correct.certitude = uint8(73);\r\ns = decode(x, bncWordlist);\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.'  )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.'  )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.'  )\r\n\r\n\r\n%% Test 9\r\nglobal bncWordlist\r\nx =                 {'Bestow rewards without regard 2 rule;  issue orders without regard 2 previous arrangements', ...\r\n    '\"Let advance bee richly rewarded \u0026 retreat bee heavily punished.\"', ...\r\n    ' Qwertyuiop''asdfghjkl.   Zxcvbnm-0123456789 = pass. ', ...\r\n    'αβγδ — persimon–apricot hybrid.', ...\r\n    'aIanasatbebydoheifinisitmemynoofonor''ssotoupweallandanyarebutcandidforgethadhasherhimhishowitsmaynewnotnown''toneouroutseeshethetwowaswaywhoyoualsobeenfromhaveintojustknowlikemoreonlysaidsomethanthatthemthentheythistimeverywellwerewhatwhenwillwithyouraboutcouldfirstothertheirtherethesewhichwouldpeopleshould'};\r\ns_correct.shift = uint8(0);\r\ns_correct.message = x;\r\ns_correct.certitude = uint8(0);\r\ns = decode(x, bncWordlist);\r\nassert( isequal(s.shift, s_correct.shift), 'Wrong shift.'  )\r\nassert( isequal(s.message, s_correct.message), 'Wrong message.'  )\r\nassert( isequal(s.certitude, s_correct.certitude), 'Wrong certitude.'  )\r\n\r\n\r\n%% TIMING \r\n% Note:  The Time Trial section does not check accuracy; that is done above.\r\n\r\n% Acknowledgements  \r\n% Portions of this timing test code were inspired by:\r\n% (1) Problem 937. \"Rubik's Mini Cube: Solve Randomized Cube in 11 Moves or Less; Score is by Time (msec)\" by Richard Zapor.\r\n% (2) Problem 2733. \"Evil Number\" by Jan Orwat.\r\n% (3) Feedback in comments from Peng Liu.\r\n% (4) Problem Problem 1237. \"It's race time! Write a faster function than the test suite call of unique().\" by Jeremy.\r\n\r\n% INITIALISE\r\nglobal bncWordlist\r\nx =                 {'Vomftt qvstvfe, pqfo op eppst.', 'Ffmt dbo ljmm, opu pomz xpvoe.'};\r\nqSmall = 50;\r\nqBig = 1000;\r\n%cutoffTimeBig = 10;    % Maximum allowable walltime (in seconds) to run function in a loop with qBig iterations.\r\n\r\n% EDIT (2018-06-17).  Reduced time [slightly] to pose reasonable challenge.\r\n% Accounted for improving Cody server speed per Problem 44655.\r\ncutoffTimeBig = 8;    % Maximum allowable walltime (in seconds) to run function in a loop with qBig iterations.\r\ntRef = datetime('2018-06-17', 'InputFormat','yyyy-MM-dd');\r\ntNow = datetime('now');\r\nyearsElapsed = (datenum(tNow) - datenum(tRef)) / 365.24;\r\ndisp(' . ');\r\nfprintf('\\r\\n\\r\\n\\r\\nSubmission evaluated for speed on %s.\\r\\n', datestr(tNow, 'dd mmmm yyyy'))\r\nrInf = 0.2;   delta = cutoffTimeBig - rInf;  tau = 3.6;  % Data from Problem 44655, based on Problem 963.\r\nqBig = ceil( qBig * (cutoffTimeBig - rInf) * exp(yearsElapsed/tau) / delta );\r\nfprintf('\\r\\n\\r\\n\\r\\nTo account for computational power increases over time, number of iterations increased to %u.\\r\\n', qBig)\r\n% END EDIT (2018-06-17)\r\n\r\n\r\n% *** PRELIMINARY TIMING WITH timeit ***\r\nfDecode = @()   decode(x, bncWordlist);\r\ndt_timeit = timeit( fDecode );\r\nfor dummy = 1 : 10,  disp(' . ');  end;\r\nfprintf('APPROXIMATE time to decode %u message batches ~ %2.2f seconds, according to ''timeit''.\\n\\r', qBig, dt_timeit * qBig)\r\n\r\n% *** PRELIMINARY TIMING WITH SHORT LOOP ***\r\n% In case the submitted function has a lot of text output, \r\n% get an estimate based on just a few iterations\r\n% Initialise\r\nt0 = clock;\r\n\r\n% Loop\r\nfor i = 1 : qSmall\r\n    solution = decode(x, bncWordlist);\r\nend;\r\n\r\n% Compute and display elapsed time.\r\ndt = etime(clock, t0);\r\nfor dummy = 1 : 10,  disp(' . ');  end;\r\n%fprintf('Your wall time to decode %u message batches = %i seconds.\\n\\r', qSmall, floor(dt))\r\nfprintf('APPROXIMATE wall time to decode %u message batches ~ %2.2f seconds, by extrapolating from %u batches.\\n\\r', qBig, dt * qBig / qSmall, qSmall)\r\n\r\n% *** 'OFFICIAL' TIMING ***\r\n% Re-initialise timer\r\nt0 = clock;\r\nt0_cpu = cputime;\r\n\r\n% Loop\r\nfor i = 1 : qBig\r\n    % EDIT (2018-06-17).   Ensure each case is unique.\r\n    characters = ['  ,   .' char(randi([97,122], [1,23]))];\r\n    x{2} = characters( randperm(30) );\r\n    % END EDIT (2018-06-17)\r\n    solution = decode(x, bncWordlist);\r\nend;\r\n\r\n% Compute and display elapsed time.\r\ndt = etime(clock, t0);\r\nfor dummy = 1 : 10,  disp(' . ');  end;\r\nfprintf('Your wall time to decode %u message batches = %2.2f seconds.\\n\\r', qBig, dt)\r\n\r\ndt_cpu = (cputime - t0_cpu);\r\nfprintf(' ( Your CPU time for this = %2.2f seconds. ) \\n\\r', dt_cpu)\r\n\r\n% Display (default) Cody size-based score.\r\nall_nodes = mtree('decode.m', '-file');\r\nsize_score = count(all_nodes);\r\nfprintf('Your Cody-standard size-based score = %i.\\n\\r', size_score)\r\n\r\n% Report revised performance score\r\ncombinedScore = size_score + round(dt * 10);\r\nfprintf('Your combined score = %i.\\n\\r', combinedScore)\r\ndisp('     -----=====|||||=====-----     ')\r\n\r\n% Now disallow any candidate solutions that are TOO SLOW!\r\nif dt \u003e cutoffTimeBig, \r\n    fprintf('Sorry, your submission is TOO SLOW.  It must be able to finish within %u seconds.\\n\\r', cutoffTimeBig)\r\nend;\r\n\r\nassert( dt \u003c= cutoffTimeBig, 'Exceeded time limit specified in Test Suite.' )","published":true,"deleted":false,"likes_count":2,"comments_count":16,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":13,"test_suite_updated_at":"2019-07-02T13:23:18.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2017-10-12T23:17:24.000Z","updated_at":"2026-04-02T20:05:58.000Z","published_at":"2017-10-15T06:52:40.000Z","restored_at":"2017-10-25T07:03:11.000Z","restored_by":null,"spam":false,"simulink":false,"admin_reviewed":true,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou have been tasked with decoding several batches of coded messages that have been intercepted.\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\u003eBased on previous intelligence that has been gathered, you can be confident that the messages were all encoded using a simple\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/Caesar_cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCaesar cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (a type 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=\\\"https://en.wikipedia.org/wiki/Substitution_cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003esubstitution cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e), an example of which is 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/ROT13\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eROT13 cipher\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (discussed 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://www.mathworks.com/matlabcentral/cody/problems/78-implement-a-rot13-cipher\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Challenge Problem 78\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e). As in the Cody Challenge Problem, uppercase and lowercase letters are handled independently of one another, and all other characters (e.g. punctuation, numbers, accented letters) are unchanged. Unlike the Cody Challenge Problem, here the number of letters to shift is not known in advance, and will vary\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\u003ebetween\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (not within) batches — also, here you need to decode, not encode.\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\u003eThese latest activities that you are investigating have been nicknamed 'Operation Xiangliu' by your own organisation. A few decoding options are at your organisation's disposal:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTest the candidate decodings against all words in a large dictionary — this could work, but it is very slow.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTest the candidate decodings for the appearance of a name or phrase that is certain to appear regularly (e.g.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44351\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\\\"Operation Phoenix\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e) — unfortunately as yet there is not enough knowledge of the activities to be sure of a suitable name or phrase to use.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTest the candidate decodings against all words in a short list comprising, say, the hundred most frequently used English 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\u003eThe\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\u003ethird option\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e will be faster than the first option, and more reliable than the second option, so this is the approach you will be taking.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou have been careful to avoid using 'lemmatised' lists (which contain e.g. the verb \\\"to be\\\", rather than the various inflected forms such as \\\"am\\\", \\\"is\\\", \\\"are\\\") like those based on the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://web.archive.org/web/20111226085859/http://oxforddictionaries.com/words/the-oec-facts-about-the-language\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOEC\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.wordfrequency.info/free.asp?s=y\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCOCA\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, and after setting aside\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://world-english.org/english500.htm\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eanother list\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e you finally choose 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://ucrel.lancs.ac.uk/bncfreq/samples/120.pdf\\\"\u003e\u003cw:r\u003e\u003cw:t\u003elist based on the BNC\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e as the most reliable, and will use the first 100 words on that list. This list will be available for you to access as an input variable,\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\u003ebncWordlist\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, to your function. Note: (i) some entries on the list are morphemes (e.g. \\\" n't \\\" and \\\" 's \\\") rather than words; (ii) some entries appear more than once (representing different grammatical word classes). Of course, in the original messages any capitalisation might be used.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou have been instructed that your 'certitude' (degree of confidence) in the decoding must be reported for each batch, and shall depend proportionally upon the sum of the characters for the words/morphemes in the decoded message that match words/morphemes 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\u003ebncWordlist\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Being able to match words/morphemes accounting for three-tenths of the characters (excluding spaces) shall correspond to 100% certitude; matching three-twentieths would be 50% certitude, and so on. Certitude shall be reported as a percentage, rounded\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\u003eup\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to the nearest integer, not greater than 100. You need to maximise your certitude for each batch by appropriate choice of the shifting parameter. If there are multiple shifts of equal certitude, report both options on different rows (arranged in order of ascending shift parameter).\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\u003eYour task is to crack the codes and report back in a\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://au.mathworks.com/help/matlab/ref/struct.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003estructure array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e: (1) the shifting parameter that had been used in the encoding [as\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://au.mathworks.com/help/matlab/ref/uint8.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003euint8\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e] (usually scalar, but may be column vector); (2) the decoded messages [as a\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://au.mathworks.com/help/matlab/ref/cell.html?s_tid=doc_ta\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecell array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (containing\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://au.mathworks.com/help/matlab/ref/char.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003echaracter arrays\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e)] (usually an array with a single row, but occasionally with multiple rows); (3) your 'certitude' in the decoding [as\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://au.mathworks.com/help/matlab/ref/uint8.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003euint8\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e] (always scalar). The name of the structure array shall be\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003es\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, with respective fields\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\u003eshift\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003emessage\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\u003ecertitude\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 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSuppose the batch contained two encoded messages —\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\\\"Vomftt qvstvfe, pqfo op eppst.\\\"\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\u003e\\\"Ffmt dbo ljmm, opu pomz xpvoe.\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (provided as character arrays within a cell array) — and a (right-shifting) ROT1 cipher had been applied. In that case A→B, B→C, ..., Y→Z, and Z→A; similarly, a→b, b→c, ..., y→z, and z→a. Thus the original messages would have been: \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\\\"Unless pursued, open no doors.\\\"\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\u003e\\\"Eels can kill, not only wound.\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e . Twelve of the 51 characters have been matched: \\\"no\\\", \\\"can\\\", \\\"not\\\", and \\\"only\\\".\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 correct answer would therefore comprise:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[s.shift = uint8(1)  \\ns.message = {'Unless pursued, open no doors.', 'Eels can kill, not only wound.'}\\ns.certitude = uint8(79)]]\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 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\u003eSuppose the batch contained one encoded message —\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\\\"Oa oqvvq'u cnycau dggp: \\\"Ctu itcvkc ctvku\\\".\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (provided as a character array within a cell array) — and a (right-shifting) ROT2 cipher had been applied. In that case A→C, B→D, ..., Y→A, and Z→B; similarly, a→c, b→d, ..., y→a, and z→b. Thus the original message would have been: \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\\\"My motto's always been: \\\"Ars gratia artis\\\".\\\"\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e . Eight of the 37 characters have been matched: \\\"My\\\", \\\" 's \\\", and \\\"been\\\". Note carefully that: \\\" 's \\\" should only be matched once; \\\"to\\\" (in motto), \\\"be\\\" (in been), \\\"at\\\" (in gratia), \\\"is\\\" (in artis) and \\\"a\\\" (passim) should\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\u003enot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e be matched at all; and \\\" ' \\\" will only ever be used as an apostrophe (never as a quotation mark).\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 correct answer would therefore comprise:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[s.shift = uint8(2)  \\ns.message = {'My motto''s always been: \\\"Ars gratia artis\\\".'}\\ns.certitude = uint8(73)]]\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\u003eIf the batch of messages cannot be decoded when following the above assumptions, then return the original encoded message(s) unchanged, with a shift of zero and a certitude of zero.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eNote: Many Cody solutions are hard to read and not necessarily computationally efficient. To direct attention toward efficient runtime speed of execution, timings are measured in the Test Suite, and reported back (if the submission is runnable). Although the timings are not perfectly reproducible, they do provide an indication of computational resource demand. (Try resubmitting on another day if your code runs slowly, in case it is caused by a server issue.)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTo provide some extra motivation for you to get your code to run efficiently, it will fail the Test Suite if it is deemed \\\"too slow\\\".\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----------\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\u003ePrevious problem: \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44356\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOperation Orthos\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. Next problem: TBA.\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":1139,"title":"Rubik's Cube: 30 Moves or Less : Contest Scoring (Time/Size/Moves)","description":"This Challenge is to solve a thoroughly scrambled Rubik's cube with the best score (30 moves max). Score is Moves + Size/2000 + e^(avg time sec / 3).\r\n\r\nRubik's Cube can be solved in 20 moves or less from any position.  The \u003chttp://kociemba.org/cube.htm Kociemba Two Phase algorithm\u003e can solve the Cube in 30 moves or less.  The basic theory is that any cube can transition to an H-cube by 12 moves using all possible 18 move types.  An H-cube is defined as having no rotations or flips of corners or edges, respectively, and has all middle edges in the middle row. The cube can be solved from any H-cube state in 18 moves or less using only the moves U U' U2 D D' D2 F2 L2 R2 B2. \u003chttp://kociemba.org/math/CubeDefs.htm#faceturns Definitions of Moves / Rotates / Flips for Corners and Edges\u003e. The Two-Phase algorithm typically solves in 24 moves or less.\r\n\r\n\u003c\u003chttps://sites.google.com/site/razapor/matlab_cody/cube_small.gif\u003e\u003e\r\n\r\n\u003c\u003chttps://sites.google.com/site/razapor/matlab_cody/Cube_Map48_200.png\u003e\u003e\r\n\r\nRubik's Cube has 48 faces that are assigned to a vector as in the above figure.\r\nU refers to the White face, F-Blue, L-Red, R-Orange, D-Yellow, and B-Green. Moves (1-6 UFDLBR 7-12 U'F'D'L'B'R' 13-18 U2F2D2L2B2R2) are clockwise looking towards the center, primes are CCW (eq U'), and twos are a half turn of a face.\r\n\r\n  The color to numeric coding is [RWBYGO] [012345]. \r\n  A solved cube is [0000 0000 1111 1111 2222 2222 3333 3333 4444 4444 5555 5555]\r\n\r\n*Input:* Cube\r\n\r\nCube is a 48 long row vector of values 0 thru 5.\r\n  \r\n*Output:* Move_Vector\r\n\r\nMove_Vector is an empty to 30 element vector of values 1:18\r\n\r\n*Constraint:* Solution must be 30 moves or less\r\n\r\n*Scoring:* Moves + Size / 2000 + e^(avg time sec / 3 )\r\n\r\n\u003chttp://cube20.org/src/ Two Phase Source code\u003e is fairly complex and may require a 500MB database file. Its goal is to find solutions of 20 or less starting with Two Phase.\r\n\r\n\u003chttps://sites.google.com/site/razapor/matlab_cody/Cube30rev001.ppt?attredirects=0\u0026d=1 30 move Cube Solution in Matlab (rought draft)\u003e","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: 957.7px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 478.85px; transform-origin: 407px 478.85px; 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\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 368.333px 7.91667px; transform-origin: 368.333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis Challenge is to solve a thoroughly scrambled Rubik's cube with the best score (30 moves max). Score is Moves + Size/2000 + e^(avg time sec / 3).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 126px; 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 63px; text-align: left; transform-origin: 384px 63px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 219.95px 7.91667px; transform-origin: 219.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eRubik's Cube can be solved in 20 moves or less from any position. 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.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://kociemba.org/cube.htm\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eKociemba Two Phase algorithm\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: 63.7px 7.91667px; transform-origin: 63.7px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e can solve the Cube in 30 moves or less. The basic theory is that any cube can transition to an H-cube by 12 moves using all possible 18 move types. An H-cube is defined as having no rotations or flips of corners or edges, respectively, and has all middle edges in the middle row. The cube can be solved from any H-cube state in 18 moves or less using only the moves U U' U2 D D' D2 F2 L2 R2 B2.\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.91667px; transform-origin: 1.95px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://kociemba.org/math/CubeDefs.htm#faceturns\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eDefinitions of Moves / Rotates / Flips for Corners and Edges\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: 151.317px 7.91667px; transform-origin: 151.317px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. The Two-Phase algorithm typically solves in 24 moves or less.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 134.917px; 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 67.4667px; text-align: center; transform-origin: 384px 67.4667px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"data:image/gif;base64,R0lGODlhhACBAPcAAFIBBYKCggAAjsfHvZZOTubm2KOioo4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oHVHKBIDdwBRoHYm+IQh8QNcMANBZIVc2IVe+IVgGIZiOIZkWIZmeIZomIZquIZs2IYJERAAOw==\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 242.917px; 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 121.467px; text-align: center; transform-origin: 384px 121.467px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADtCAIAAAB1W61MAAA8KklEQVR42u2dB1gUx/vHX6QevSkW7CZ2Y2KLiS3RGKPGHkKiMWpU7F1EmiDSpbdDQIpi12iM2LuCAmIDVFCKoPR29Hbvf3fvgAPu4FhCwv3+u888PndzO9/bdT7MvDvznTkICQnx8/Pzl+TD29s7JiYG23cQIikpKe1RIIoTIu28jCtXrvj4+Eh0dRA4EVABr2Ik+nBxcYmKimpnjRIiSUlJ7VEgihMi7byMv//+283NTdJrhICKAYsBiwGLAYsBq1OBVVtelpudlZ2bV17LbSNY3PLiotLyKsGsytLS7Kys3PyCai5XDLCEKPA/qCovLMgrLqtgwJJIsDLfXFsyeYRO1x5aXbWm6e9JK+SKC1Zl6WnPPd1kWasPnK9H9Poxtxlffq7bq6eqqsr8tY5ZlS2CVVt12suom6yCgELDEWSsBwDfr7etZcCSPLDyX03upzReb19GcUVh4sOvBqh+9YezOGBVZj7VmzKi74BhvTU0fjE5wc8tTjCY953LifBybmX4aWdVgMXmgS2AFXxgfa+BQ3qrCyjUHWmPjo7rN2jYoG5jfzFmwJI8sOL/smIp9riaUsZ7+/iYiZLWqOjMmlbByom/4+B7tKa6eMP0wfN3hvI7r9rqqsryulNK1nylqjV1fakosGrL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UrBW1rTX1LbXkLblt1g9bUhM1z66WVN8f5iVFAG99IHhD4srw+6vrJdiwOqsYInyvO+BQSHrn3+MZD92PPjQ4WJKzN1YX+19IjzvovZ5JweiFFzj39QU3By0v/GgubDlX9SPJBJq8rYJGRkJtvJUKyjtNP5+Pic945bdvYPh2XkZGedH2gGzmEIyukIhnndq6/ZpJwy8on08H3s73jfsadWwNkbcfd7JjSG01920+j14TKPfXG15SsdcesbZ7dvPzqgfeWfZDtl57yA72tf62h8aVrKCAx8MWJ06eBfpeTfm/84bmfbR3efdiIrALNsyCW3ceK7QXGC+kpkrlCSwGHfDfw5WSEiIn5+fvyQfxw8f13PXU7NRU7Olm5zV1Barqe1RU7Onq2BPFV9MSdnST7t9dh8JOCLR1UHgRED1f5BylCjEvsbMAAAAAElFTkSuQmCC\" data-image-state=\"image-loaded\"\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.667px 7.91667px; transform-origin: 376.667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eRubik's Cube has 48 faces that are assigned to a vector as in the above figure. U refers to the White face, F-Blue, L-Red, R-Orange, D-Yellow, and B-Green. Moves (1-6 UFDLBR 7-12 U'F'D'L'B'R' 13-18 U2F2D2L2B2R2) are clockwise looking towards the center, primes are CCW (eq U'), and twos are a half turn of a face.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 40.8667px; 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 20.4333px; transform-origin: 404px 20.4333px; 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.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; 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: 192.5px 7.91667px; transform-origin: 192.5px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 15.4px 7.91667px; transform-origin: 15.4px 7.91667px; \"\u003eThe \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: 177.1px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 177.1px 7.91667px; \"\u003ecolor to numeric coding is [RWBYGO] [012345]. \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.833333px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.833333px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.833333px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.833333px; 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: 300.3px 7.91667px; transform-origin: 300.3px 7.91667px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 7.7px 7.91667px; transform-origin: 7.7px 7.91667px; \"\u003eA \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: 292.6px 7.91667px; text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 292.6px 7.91667px; \"\u003esolved cube is [0000 0000 1111 1111 2222 2222 3333 3333 4444 4444 5555 5555]\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: 19.4333px 7.91667px; transform-origin: 19.4333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eInput:\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: 18.6833px 7.91667px; transform-origin: 18.6833px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e Cube\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: 146.25px 7.91667px; transform-origin: 146.25px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCube is a 48 long row vector of values 0 thru 5.\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: 25.2667px 7.91667px; transform-origin: 25.2667px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eOutput:\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: 42.8px 7.91667px; transform-origin: 42.8px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e Move_Vector\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: 189.433px 7.91667px; transform-origin: 189.433px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eMove_Vector is an empty to 30 element vector of values 1:18\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: 37.3333px 7.91667px; transform-origin: 37.3333px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eConstraint:\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: 108.917px 7.91667px; transform-origin: 108.917px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e Solution must be 30 moves or less\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: 28.3833px 7.91667px; transform-origin: 28.3833px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eScoring:\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: 136.3px 7.91667px; transform-origin: 136.3px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e Moves + Size / 2000 + e^(avg time sec / 3 )\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\u003ca target='_blank' href = \"http://cube20.org/src/\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eTwo Phase Source code\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: 301.833px 7.91667px; transform-origin: 301.833px 7.91667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is fairly complex and may require a 500MB database file. Its goal is to find solutions of 20 or less starting with Two Phase.\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\u003ca target='_blank' href = \"https://sites.google.com/site/razapor/matlab_cody/Cube30rev001.ppt?attredirects=0\u0026amp;d=1\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003e30 move Cube Solution in Matlab (rought draft)\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [v]=Rubik_Solver(cube)\r\n% moves 1-6 UFDLBR 7-12 U'F;D'L'B'R' 13-18 U2F2D2L2B2R2\r\n% Return v as a numeric row vector of k values in range 1:18\r\n  v=[];\r\nend","test_suite":"%%\r\nfeval(@assignin,'caller','score',100);\r\n%%\r\nvf=[ 17 2 3 20 5 22 7 8 11 13 16 10 15 9 12 14 41 18 19 44 21 46 23 24 25 26 27 28 29 30 31 32 33 34 6 36 4 38 39 1 40 42 43 37 45 35 47 48; \r\n  1 2 3 4 5 25 28 30 9 10 8 12 7 14 15 6 19 21 24 18 23 17 20 22 43 26 27 42 29 41 31 32 33 34 35 36 37 38 39 40 11 13 16 44 45 46 47 48 ;\r\n  1 2 38 4 36 6 7 33 9 10 11 12 13 14 15 16 17 18 3 20 5 22 23 8 27 29 32 26 31 25 28 30 48 34 35 45 37 43 39 40 41 42 19 44 21 46 47 24 ;\r\n  3 5 8 2 7 1 4 6 33 34 35 12 13 14 15 16 9 10 11 20 21 22 23 24 17 18 19 28 29 30 31 32 25 26 27 36 37 38 39 40 41 42 43 44 45 46 47 48 ;\r\n  14 12 9 4 5 6 7 8 46 10 11 47 13 48 15 16 17 18 19 20 21 22 23 24 25 26 1 28 2 30 31 3 35 37 40 34 39 33 36 38 41 42 43 44 45 32 29 27 ;\r\n  1 2 3 4 5 6 7 8 9 10 11 12 13 22 23 24 17 18 19 20 21 30 31 32 25 26 27 28 29 38 39 40 33 34 35 36 37 14 15 16 43 45 48 42 47 41 44 46 ;\r\n  40 2 3 37 5 35 7 8 14 12 9 15 10 16 13 11 1 18 19 4 21 6 23 24 25 26 27 28 29 30 31 32 33 34 46 36 44 38 39 41 17 42 43 20 45 22 47 48 ;\r\n  1 2 3 4 5 16 13 11 9 10 41 12 42 14 15 43 22 20 17 23 18 24 21 19 6 26 27 7 29 8 31 32 33 34 35 36 37 38 39 40 30 28 25 44 45 46 47 48 ;\r\n  1 2 19 4 21 6 7 24 9 10 11 12 13 14 15 16 17 18 43 20 45 22 23 48 30 28 25 31 26 32 29 27 8 34 35 5 37 3 39 40 41 42 38 44 36 46 47 33 ;\r\n  6 4 1 7 2 8 5 3 17 18 19 12 13 14 15 16 25 26 27 20 21 22 23 24 33 34 35 28 29 30 31 32 9 10 11 36 37 38 39 40 41 42 43 44 45 46 47 48 ;\r\n  27 29 32 4 5 6 7 8 3 10 11 2 13 1 15 16 17 18 19 20 21 22 23 24 25 26 48 28 47 30 31 46 38 36 33 39 34 40 37 35 41 42 43 44 45 9 12 14 ;\r\n  1 2 3 4 5 6 7 8 9 10 11 12 13 38 39 40 17 18 19 20 21 14 15 16 25 26 27 28 29 22 23 24 33 34 35 36 37 30 31 32 46 44 41 47 42 48 45 43 ;\r\n  41 2 3 44 5 46 7 8 16 15 14 13 12 11 10 9 40 18 19 37 21 35 23 24 25 26 27 28 29 30 31 32 33 34 22 36 20 38 39 17 1 42 43 4 45 6 47 48 ;\r\n  1 2 3 4 5 43 42 41 9 10 30 12 28 14 15 25 24 23 22 21 20 19 18 17 16 26 27 13 29 11 31 32 33 34 35 36 37 38 39 40 8 7 6 44 45 46 47 48 ;\r\n  1 2 43 4 45 6 7 48 9 10 11 12 13 14 15 16 17 18 38 20 36 22 23 33 32 31 30 29 28 27 26 25 24 34 35 21 37 19 39 40 41 42 3 44 5 46 47 8 ;\r\n  8 7 6 5 4 3 2 1 25 26 27 12 13 14 15 16 33 34 35 20 21 22 23 24 9 10 11 28 29 30 31 32 17 18 19 36 37 38 39 40 41 42 43 44 45 46 47 48 ;\r\n  48 47 46 4 5 6 7 8 32 10 11 29 13 27 15 16 17 18 19 20 21 22 23 24 25 26 14 28 12 30 31 9 40 39 38 37 36 35 34 33 41 42 43 44 45 3 2 1 ; \r\n  1 2 3 4 5 6 7 8 9 10 11 12 13 30 31 32 17 18 19 20 21 38 39 40 25 26 27 28 29 14 15 16 33 34 35 36 37 22 23 24 48 47 46 45 44 43 42 41 ];\r\n\r\n cube_orig=[zeros(1,8) ones(1,8) ones(1,8)*2 ones(1,8)*3 ones(1,8)*4 ones(1,8)*5]; \r\n tsum=0;\r\n msum=0;\r\n Lbest=30;\r\n for cube_sets=1:4\r\n  if cube_sets==2\r\n   tsum=0;\r\n   msum=0;\r\n  end\r\n encode=randi(18,1,80);\r\n fprintf('Encode: ');fprintf('%i ',encode);fprintf('\\n')\r\n r=cube_orig;\r\n for i= encode\r\n  r=r(vf(i,:));\r\n end\r\n encode=[]; % anti-shortcut\r\n encode_str='';\r\n cube=r;\r\n fprintf('%i',r);fprintf('\\n')\r\n\r\n% Time function\r\n ta=clock;\r\n [v]=Rubik_Solver(cube);\r\n t1=etime(clock,ta)*1000; % time in msec\r\n tsum=tsum+t1;\r\n Lv=length(v);\r\n msum=msum+Lv;\r\n assert(Lv\u003c=30)\r\n \r\n fprintf('Time: %.0f msec  Total Time %.0f\\n',t1,tsum)\r\n \r\n fprintf('Solution length %i\\n',length(v))\r\n fprintf('%i ',v);fprintf('\\n')\r\n \r\n r=cube;\r\n for i=v\r\n  r=r(vf(i,:));\r\n end\r\n \r\n fprintf('Solved Cube\\n');fprintf('%i',r);fprintf('\\n')\r\n\r\n tf=isequal(r,cube_orig);\r\n fprintf('Solved %i Moves %i \\n\\n\\n\\n',tf, Lv)\r\n assert(tf)\r\n assert(~isequal(1,2))\r\n if Lv\u003cLbest,Lbest=Lv;end\r\n \r\n end % cubesets\r\n\r\n msiz=mtree('Rubik_Solver.m','-file').count\r\n tsum=tsum/3000; % avg in seconds\r\n msum=msum/3;\r\n\r\nscore=msum+msiz/2000+exp(tsum/3);\r\n\r\nfprintf('Size %.0f  Avg Time %5.2f  Moves Avg %5.1f\\n',msiz,tsum,msum)\r\n\r\nfeval(  @assignin,'caller','score',floor(min( 100,score ))  );\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-12-25T04:50:18.000Z","updated_at":"2025-12-16T02:49:54.000Z","published_at":"2012-12-25T05:21:15.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is to solve a thoroughly scrambled Rubik's cube with the best score (30 moves max). Score is Moves + Size/2000 + e^(avg time sec / 3).\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\u003eRubik's Cube can be solved in 20 moves or less from any position. 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://kociemba.org/cube.htm\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eKociemba Two Phase algorithm\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e can solve the Cube in 30 moves or less. The basic theory is that any cube can transition to an H-cube by 12 moves using all possible 18 move types. An H-cube is defined as having no rotations or flips of corners or edges, respectively, and has all middle edges in the middle row. The cube can be solved from any H-cube state in 18 moves or less using only the moves U U' U2 D D' D2 F2 L2 R2 B2.\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://kociemba.org/math/CubeDefs.htm#faceturns\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eDefinitions of Moves / Rotates / Flips for Corners and Edges\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The Two-Phase algorithm typically solves in 24 moves or less.\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=\\\"center\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"center\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId2\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRubik's Cube has 48 faces that are assigned to a vector as in the above figure. U refers to the White face, F-Blue, L-Red, R-Orange, D-Yellow, and B-Green. Moves (1-6 UFDLBR 7-12 U'F'D'L'B'R' 13-18 U2F2D2L2B2R2) are clockwise looking towards the center, primes are CCW (eq U'), and twos are a half turn of a face.\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[The color to numeric coding is [RWBYGO] [012345]. \\nA solved cube is [0000 0000 1111 1111 2222 2222 3333 3333 4444 4444 5555 5555]]]\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\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Cube\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\u003eCube is a 48 long row vector of values 0 thru 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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Move_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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMove_Vector is an empty to 30 element vector of values 1:18\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\u003eConstraint:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Solution must be 30 moves or less\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\u003eScoring:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Moves + Size / 2000 + e^(avg time sec / 3 )\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:hyperlink w:docLocation=\\\"http://cube20.org/src/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eTwo Phase Source code\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is fairly complex and may require a 500MB database file. Its goal is to find solutions of 20 or less starting with Two Phase.\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:hyperlink w:docLocation=\\\"https://sites.google.com/site/razapor/matlab_cody/Cube30rev001.ppt?attredirects=0\u0026amp;d=1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e30 move Cube Solution in Matlab (rought draft)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.gif\",\"relationshipId\":\"rId1\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.png\",\"relationshipId\":\"rId2\"}]},{\"partUri\":\"/media/image1.gif\",\"contentType\":\"image/gif\",\"content\":\"data:image/gif;base64,R0lGODlhhACBAPcAAFIBBYKCggAAjsfHvZZOTubm2KOioo4AAD09lgAAyqccHJ+xsfPz5cYAACMjldfXygEBrJKSkuLx8QQEU6yuu4UUFLmxsa2tpxAQnOQAAN/f0c3NxGVlaOnp6aoAAZqamv7+8gAAnAAA7AAAvImJibSlpbW4uJaWoCkp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KzAVcrn14iETIICC/i/JHykBj9Wruj2GNnvyjCSGrRxZ5NKR/wxzOMNub4rfjzyBAIU1W1Wv+uS/cVbNpXtvfI8KUDzQlKMxBDNI3pDn4YrQBo08875i64GmjoCdGHRzDEUQggn4OLMsWUKaZXtKG+x0sTZbYhwSgNr2mvZ/76XDqxNdZ5EswcmOfuIBFOtQ4O0AAGxILW5nXboRuKCQHW4tTEowBT3/LQN6uCGq9dzSYf+PDmSAQBeNSEdFj2QLCiB1/BpQQOziFsaQ47KXS5fsGscEDDnI9d88UIZeC/i4ppVzCFTLbu/mrRC1LkkXcpCBIARBksG7Lkg/LT3kKtemzKUjHaAgvpZIAM/lxZ4blODfCx/3hVZmODqbmwA1nEAHQf9ZwxuEW0ypUpfK2TUwd7XMWhy0wQcqqAojJtzyepIXhCKHnLFdQOT08QEDMShAXFrA0BwTc8dAP2Jfz4DuI0JTBIbYwwMaAwQiOH1fg50yzNNHdS9n2eq3jMINBjAbMYQ7h/bOnthV52PlIlrTaM/bCMwAr8aAwQk5hPJmnazi0vFhqQM+ewzhnAAoNAEE/klCDkwpaUDEFtB5AyUZfIz3GLrA5ChvUCS6QICdtlLwNxNepecwB2kOWqzEbngbYpBz0Q9kDQQYc+WtOkY6yBrB9I19cjGwB6Xb3iBvkOe0J+mCapc2hoa4wdaPj5AWSDvuf7PBzM/9vyiYge3UV4jRAQiRAdQ3MehYnvXexQD58C8EERXAPggh3l50l9wA7Xc/Q7ZwB3O7+rsO4AMMoH8QAQPxdm90NFN8MHvGR4AQQXojVni4NQF7oAEOSBF31miYd0QQIH0XeBFvMHfBE3TeB34feBGidn6UBQUrkH8neBEt4HUjSHY3N4AvuBGI0Gx0tztn4ABJd4MeAW47mDdH94NA+BHwZnm6IwJGoHVHKBIDdwBRoHYm+IQh8QNcMANBZIVc2IVe+IVgGIZiOIZkWIZmeIZomIZquIZs2IYJERAAOw==\",\"relationship\":null},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/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V9MSdnST7t9dh8JOCLR1UHgRED1f5BylCjEvsbMAAAAAElFTkSuQmCC\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42765,"title":"Maximize Non-Co-Planar Points in an N-Cube","description":"This Challenge is to find a set with the maximum number of integer points that create planar surfaces with a maximum of three points from the set. No four points may be co-planar.\r\nGiven the size N and the number of expected points Q find a set of Q points. Only N=2/Q=5 and N=3/Q=8 will be tested. N=4/Q=10 or N=5/Q=13 are too large to process.\r\n\r\n  N=2 contains 8 points [0,0,0;0,1,0;1,0,0;1,1,0;0,0,1;0,1,1;1,0,1;1,1,1]\r\n  N=3 contains 27 points [0,0,0;0,0,1;0,0,2;...2,2,2]\r\n\r\nOutput is a Qx3 matrix of the non-co-planar points.\r\n\r\nReference: The \u003chttp://68.173.157.131/Contest/Tetrahedra March 2016 Al Zimmermann Non-Coplanar contest\u003e is N=primes less than 100. Maximize the number of points in an NxNxN cube with no 4 points in a common plane.\r\n\r\nTheory: The N=2 and N=3 cases can be processed by brute force if care is taken. Assumption of [0,0,0] greatly reduces number of cases. Solving \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42762-is-3d-point-set-co-planar Cody Co-Planar Check\u003e may improve speed. ","description_html":"\u003cp\u003eThis Challenge is to find a set with the maximum number of integer points that create planar surfaces with a maximum of three points from the set. No four points may be co-planar.\r\nGiven the size N and the number of expected points Q find a set of Q points. Only N=2/Q=5 and N=3/Q=8 will be tested. N=4/Q=10 or N=5/Q=13 are too large to process.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eN=2 contains 8 points [0,0,0;0,1,0;1,0,0;1,1,0;0,0,1;0,1,1;1,0,1;1,1,1]\r\nN=3 contains 27 points [0,0,0;0,0,1;0,0,2;...2,2,2]\r\n\u003c/pre\u003e\u003cp\u003eOutput is a Qx3 matrix of the non-co-planar points.\u003c/p\u003e\u003cp\u003eReference: The \u003ca href = \"http://68.173.157.131/Contest/Tetrahedra\"\u003eMarch 2016 Al Zimmermann Non-Coplanar contest\u003c/a\u003e is N=primes less than 100. Maximize the number of points in an NxNxN cube with no 4 points in a common plane.\u003c/p\u003e\u003cp\u003eTheory: The N=2 and N=3 cases can be processed by brute force if care is taken. Assumption of [0,0,0] greatly reduces number of cases. Solving \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42762-is-3d-point-set-co-planar\"\u003eCody Co-Planar Check\u003c/a\u003e may improve speed.\u003c/p\u003e","function_template":"function m=MaxNonCoplanarPts(N,Q);\r\n% Place Q or more points in an 0:N-1 #D grid such that each plane created uses only 3 points from the set provided\r\n% N is Cube size\r\n% Q is expected number of points in solution\r\n% Hint: Point [0,0,0] can be assumed to be in the solution for N=2 and N=3\r\n% N=3 is the 27 points [0,0,0;0,0,1;0,0,2;...2,2,2]\r\n  m=[];\r\nend","test_suite":"%%\r\nN=2;\r\nQ=5;\r\nm=MaxNonCoplanarPts(N,Q);\r\nm=floor(abs(m))\r\n% Perform m check\r\nvalid=1;\r\nif size(m,1)\u003cQ,valid=0;end % Must be Q pts or more\r\nif max(m(:))\u003eN-1,valid=0;end\r\npset=nchoosek(1:size(m,1),4);\r\nfor i=1:length(pset)\r\n m4=m(pset(i,:),:);\r\n% Coplanar check method courtesy of Tim\r\n if ~det([m4 ones(4,1)]) % coplanar det=0\r\n  valid=0;\r\n  break\r\n end\r\nend\r\nassert(isequal(1,valid))\r\n%%\r\nN=3;\r\nQ=8;\r\nm=MaxNonCoplanarPts(N,Q);\r\nm=floor(abs(m))\r\n% Perform m check\r\nvalid=1;\r\nif size(m,1)\u003cQ,valid=0;end % Must be Q pts or more\r\nif max(m(:))\u003eN-1,valid=0;end\r\npset=nchoosek(1:size(m,1),4);\r\nfor i=1:length(pset)\r\n m4=m(pset(i,:),:);\r\n% Coplanar check method courtesy of Tim\r\n if ~det([m4 ones(4,1)]) % coplanar det=0\r\n  valid=0;\r\n  break\r\n end\r\nend\r\nassert(isequal(1,valid))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":6,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-03-07T00:22:02.000Z","updated_at":"2016-03-07T01:01:33.000Z","published_at":"2016-03-07T01:01: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\u003eThis Challenge is to find a set with the maximum number of integer points that create planar surfaces with a maximum of three points from the set. No four points may be co-planar. Given the size N and the number of expected points Q find a set of Q points. Only N=2/Q=5 and N=3/Q=8 will be tested. N=4/Q=10 or N=5/Q=13 are too large to process.\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=2 contains 8 points [0,0,0;0,1,0;1,0,0;1,1,0;0,0,1;0,1,1;1,0,1;1,1,1]\\nN=3 contains 27 points [0,0,0;0,0,1;0,0,2;...2,2,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\u003eOutput is a Qx3 matrix of the non-co-planar points.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eReference: 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://68.173.157.131/Contest/Tetrahedra\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMarch 2016 Al Zimmermann Non-Coplanar contest\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is N=primes less than 100. Maximize the number of points in an NxNxN cube with no 4 points in a common plane.\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\u003eTheory: The N=2 and N=3 cases can be processed by brute force if care is taken. Assumption of [0,0,0] greatly reduces number of cases. Solving\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/42762-is-3d-point-set-co-planar\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody Co-Planar Check\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e may improve speed.\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":1122,"title":"USC Fall 2012 ACM: Rover Maze","description":"This Challenge is to solve Question F, Martian Pits, of the \u003chttp://contest.usc.edu/index.php/Fall12/Home USC ACM Fall 2012 Contest\u003e.\r\n\r\nThe task is to determine the minimum time for the Rover to drive from its current position to a Goal location. The Rover must STOP on the Goal location. Commands are processed at 1 Cmd per sec. Rover must stay on array.\r\n\r\nThis is an intriguing Maze problem that incorporates turn penalties, variable speed forward, and a fixed reverse speed.\r\n\r\n  Initial conditions are Rover Stopped and Facing +Y.\r\n  Commands are processed at 1 second intervals\r\n  \r\n  Commands and their attributes:\r\n  FORWARD: Starts rolling forward at 1 cm/s\r\n  BACKWARDS: Roll backwards at 1 cm/s\r\n  FASTER: Increase forward speed by 1 cm/s up to 5 cm/s\r\n  SLOWER: Decrease forward speed by 1 cm/s down to 0 cm/s. At 0 cm/s Rover is \"Stopped\"\r\n  STOP: Halts rover movement\r\n  RIGHT: Turn rover 90 degrees to the right\r\n  LEFT: Turn the rover 90 degrees to the left\r\n  NOOP: No change in anything \r\n\r\n\r\n  Commands FORWARD, BACKWARDS, RIGHT, LEFT only take effect if the rover is stopped. A moving rover ignores these commands.\r\n\r\n  Commands FASTER and SLOWER only take effect if the rover is moving forward.\r\n\r\n\r\n*Input: [Char array]* \".\" is Flat ground, \"P\" Pit, \"R\" Rover start location, \"D\" is Destination.  Matrix max dim 50, min 1. \r\n\r\n*Output: [T]*; Drive Time to destination; -1 if not possible\r\n\r\n*Scoring: Time (msec)*\r\n\r\n\r\nThe full \u003chttp://contest.usc.edu/index.php/Fall12/Home?action=download\u0026upname=pits.in.txt USC data file\u003e\r\n\r\n*Example:*\r\n\r\n*Input: [A]*\r\n\r\n  ...................D\r\n  .P......P.P.........\r\n  .P...PPPP.P.........\r\n  .P...P....P.........\r\n  .P...P.PPPP.........\r\n  .P.PPP.P............\r\n  .P.P...P............\r\n  .PPP.PPPPPPPPPPPPPPP\r\n  ....R...............\r\n  PPPPPPPPPPPPPPPPPPPP\r\n\r\n*Output: [19]* as the best path is L, Fwd, Faster, Slower, Stop to (9,1). The cmds to reach (1,1) are R, Fwd, Faster, Faster, Slower, Stop. Cmds to optimally reach (1,20) are R, Fwd, Faster, Faster, Faster, Faster, Slower, Stop. \r\n\r\nOnce again my code is large thus the contest will be scored based on Processing Time.\r\n\r\n*Hints:* One Speed-Up method is to do an initial Start/Finish connectivity check.\r\n \r\n\r\n\u003chttp://contest.usc.edu/index.php/Fall12/Home?action=download\u0026upname=pits.yucheng.cpp.txt Martian Pits C solution\u003e.  Time to Solve: 40 minutes. Only three solved this puzzle during the contest. Start.","description_html":"\u003cp\u003eThis Challenge is to solve Question F, Martian Pits, of the \u003ca href=\"http://contest.usc.edu/index.php/Fall12/Home\"\u003eUSC ACM Fall 2012 Contest\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eThe task is to determine the minimum time for the Rover to drive from its current position to a Goal location. The Rover must STOP on the Goal location. Commands are processed at 1 Cmd per sec. Rover must stay on array.\u003c/p\u003e\u003cp\u003eThis is an intriguing Maze problem that incorporates turn penalties, variable speed forward, and a fixed reverse speed.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInitial conditions are Rover Stopped and Facing +Y.\r\nCommands are processed at 1 second intervals\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eCommands and their attributes:\r\nFORWARD: Starts rolling forward at 1 cm/s\r\nBACKWARDS: Roll backwards at 1 cm/s\r\nFASTER: Increase forward speed by 1 cm/s up to 5 cm/s\r\nSLOWER: Decrease forward speed by 1 cm/s down to 0 cm/s. At 0 cm/s Rover is \"Stopped\"\r\nSTOP: Halts rover movement\r\nRIGHT: Turn rover 90 degrees to the right\r\nLEFT: Turn the rover 90 degrees to the left\r\nNOOP: No change in anything \r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eCommands FORWARD, BACKWARDS, RIGHT, LEFT only take effect if the rover is stopped. A moving rover ignores these commands.\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eCommands FASTER and SLOWER only take effect if the rover is moving forward.\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eInput: [Char array]\u003c/b\u003e \".\" is Flat ground, \"P\" Pit, \"R\" Rover start location, \"D\" is Destination.  Matrix max dim 50, min 1.\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput: [T]\u003c/b\u003e; Drive Time to destination; -1 if not possible\u003c/p\u003e\u003cp\u003e\u003cb\u003eScoring: 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=pits.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: [A]\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e...................D\r\n.P......P.P.........\r\n.P...PPPP.P.........\r\n.P...P....P.........\r\n.P...P.PPPP.........\r\n.P.PPP.P............\r\n.P.P...P............\r\n.PPP.PPPPPPPPPPPPPPP\r\n....R...............\r\nPPPPPPPPPPPPPPPPPPPP\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eOutput: [19]\u003c/b\u003e as the best path is L, Fwd, Faster, Slower, Stop to (9,1). The cmds to reach (1,1) are R, Fwd, Faster, Faster, Slower, Stop. Cmds to optimally reach (1,20) are R, Fwd, Faster, Faster, Faster, Faster, Slower, Stop.\u003c/p\u003e\u003cp\u003eOnce again my code is large thus the contest will be scored based on Processing Time.\u003c/p\u003e\u003cp\u003e\u003cb\u003eHints:\u003c/b\u003e One Speed-Up method is to do an initial Start/Finish connectivity check.\u003c/p\u003e\u003cp\u003e\u003ca href=\"http://contest.usc.edu/index.php/Fall12/Home?action=download\u0026amp;upname=pits.yucheng.cpp.txt\"\u003eMartian Pits C solution\u003c/a\u003e.  Time to Solve: 40 minutes. Only three solved this puzzle during the contest. Start.\u003c/p\u003e","function_template":"function t=Pits(A)\r\n  t=-1;\r\n\r\nend","test_suite":"feval(@assignin,'caller','score',1000);\r\n%%\r\nurlwrite('http://contest.usc.edu/index.php/Fall12/Home?action=download\u0026upname=pits.in.txt','pits.in.txt');\r\n%%\r\n fid=fopen('pits.in.txt','r');\r\n t_expect=[19 2 2 3 -1 7 14 23 401 200 42 -1 27 -1];\r\n \r\n t1=0;\r\n qty=fscanf(fid,'%i',1);\r\nfor q=1:qty %qty\r\n  n = fscanf(fid,'%f %f\\n',2)'; % array size\r\n  A=zeros(n);\r\n  for i=1:n(1)\r\n   strv=fgetl(fid);\r\n   %A(i,:)=strv-'.';\r\n   A(i,:)=strv;\r\n  end\r\n\r\n  ta=clock;\r\n   [t]=Pits(char(A)) ;\r\n  t1=t1+etime(clock,ta)*1000; % Time in msec\r\n   \r\n  fprintf('%2i  Cmds %3.0f  Sum Time %.0f \\n',q,t,t1)\r\n\r\n  %isequal(t,t_expect(q))\r\n\r\n  assert(isequal(t,t_expect(q)));\r\n\r\nend % q\r\n\r\nt2=min(1000,t1);\r\nfprintf('Actual Time = %.1f msec\\n',t1)\r\nfeval(@assignin,'caller','score',floor(t2));","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":3,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-12-14T01:14:38.000Z","updated_at":"2012-12-14T02:24:14.000Z","published_at":"2012-12-14T02:24: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 F, Martian Pits, 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\u003eThe task is to determine the minimum time for the Rover to drive from its current position to a Goal location. The Rover must STOP on the Goal location. Commands are processed at 1 Cmd per sec. Rover must stay on array.\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 an intriguing Maze problem that incorporates turn penalties, variable speed forward, and a fixed reverse speed.\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[Initial conditions are Rover Stopped and Facing +Y.\\nCommands are processed at 1 second intervals\\n\\nCommands and their attributes:\\nFORWARD: Starts rolling forward at 1 cm/s\\nBACKWARDS: Roll backwards at 1 cm/s\\nFASTER: Increase forward speed by 1 cm/s up to 5 cm/s\\nSLOWER: Decrease forward speed by 1 cm/s down to 0 cm/s. At 0 cm/s Rover is \\\"Stopped\\\"\\nSTOP: Halts rover movement\\nRIGHT: Turn rover 90 degrees to the right\\nLEFT: Turn the rover 90 degrees to the left\\nNOOP: No change in anything \\n\\nCommands FORWARD, BACKWARDS, RIGHT, LEFT only take effect if the rover is stopped. A moving rover ignores these commands.\\n\\nCommands FASTER and SLOWER only take effect if the rover is moving forward.]]\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\u003eInput: [Char array]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \\\".\\\" is Flat ground, \\\"P\\\" Pit, \\\"R\\\" Rover start location, \\\"D\\\" is Destination. Matrix max dim 50, min 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\u003eOutput: [T]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e; Drive Time to destination; -1 if not possible\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: 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=pits.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: [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[...................D\\n.P......P.P.........\\n.P...PPPP.P.........\\n.P...P....P.........\\n.P...P.PPPP.........\\n.P.PPP.P............\\n.P.P...P............\\n.PPP.PPPPPPPPPPPPPPP\\n....R...............\\nPPPPPPPPPPPPPPPPPPPP]]\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\u003eOutput: [19]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e as the best path is L, Fwd, Faster, Slower, Stop to (9,1). The cmds to reach (1,1) are R, Fwd, Faster, Faster, Slower, Stop. Cmds to optimally reach (1,20) are R, Fwd, Faster, Faster, Faster, Faster, Slower, Stop.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOnce again my code is large thus the contest will be scored based on Processing 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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHints:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e One Speed-Up method is to do an initial Start/Finish connectivity check.\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=pits.yucheng.cpp.txt\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMartian Pits C solution\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. Time to Solve: 40 minutes. Only three solved this puzzle during the contest. Start.\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":1138,"title":"Rubik's Cube: 30 Moves or Less: Minimum Avg Time","description":"This Challenge is to solve a thoroughly scrambled Rubik's cube in the minimum time (30 moves max).\r\n\r\nRubik's Cube can be solved in 20 moves or less from any position.  The \u003chttp://kociemba.org/cube.htm Kociemba Two Phase algorithm\u003e can solve the Cube in 30 moves or less.  The basic theory is that any cube can transition to an H-cube by 12 moves using all possible 18 move types.  An H-cube is defined as having no rotations or flips of corners or edges, respectively, and has all middle edges in the middle row. The cube can be solved from any H-cube state in 18 moves or less using only the moves U U' U2 D D' D2 F2 L2 R2 B2. \u003chttp://kociemba.org/math/CubeDefs.htm#faceturns Definitions of Moves / Rotates / Flips for Corners and Edges\u003e. The Two-Phase algorithm typically solves in 24 moves or less.\r\n\r\n\u003c\u003chttps://sites.google.com/site/razapor/matlab_cody/cube_small.gif\u003e\u003e\r\n\r\n\u003c\u003chttps://sites.google.com/site/razapor/matlab_cody/Cube_Map48_200.png\u003e\u003e\r\n\r\nRubik's Cube has 48 faces that are assigned to a vector as in the above figure.\r\nU refers to the White face, F-Blue, L-Red, R-Orange, D-Yellow, and B-Green. Moves (1-6 UFDLBR 7-12 U'F'D'L'B'R' 13-18 U2F2D2L2B2R2) are clockwise looking towards the center, primes are CCW (eq U'), and twos are a half turn of a face.\r\n\r\n  The color to numeric coding is [RWBYGO] [012345]. \r\n  A solved cube is [0000 0000 1111 1111 2222 2222 3333 3333 4444 4444 5555 5555]\r\n\r\n*Input:* Cube\r\n\r\nCube is a 48 long row vector of values 0 thru 5.\r\n  \r\n*Output:* Move_Vector\r\n\r\nMove_Vector is an empty to 30 element vector of values 1:18\r\n\r\n*Constraint:* Solution must be 30 moves or less\r\n\r\n*Scoring:* Average Time of Cubes 2 thru 4 (msec)\r\n\r\n\u003chttp://cube20.org/src/ Two Phase Source code\u003e is fairly complex and may require a 500MB database file. Its goal is to find solutions of 20 or less starting with Two Phase.\r\n\r\n\u003chttps://sites.google.com/site/razapor/matlab_cody/Cube30rev001.ppt?attredirects=0\u0026d=1 30 move Cube Solution in Matlab (rought draft)\u003e","description_html":"\u003cp\u003eThis Challenge is to solve a thoroughly scrambled Rubik's cube in the minimum time (30 moves max).\u003c/p\u003e\u003cp\u003eRubik's Cube can be solved in 20 moves or less from any position.  The \u003ca href=\"http://kociemba.org/cube.htm\"\u003eKociemba Two Phase algorithm\u003c/a\u003e can solve the Cube in 30 moves or less.  The basic theory is that any cube can transition to an H-cube by 12 moves using all possible 18 move types.  An H-cube is defined as having no rotations or flips of corners or edges, respectively, and has all middle edges in the middle row. The cube can be solved from any H-cube state in 18 moves or less using only the moves U U' U2 D D' D2 F2 L2 R2 B2. \u003ca href=\"http://kociemba.org/math/CubeDefs.htm#faceturns\"\u003eDefinitions of Moves / Rotates / Flips for Corners and Edges\u003c/a\u003e. The Two-Phase algorithm typically solves in 24 moves or less.\u003c/p\u003e\u003cimg src=\"https://sites.google.com/site/razapor/matlab_cody/cube_small.gif\"\u003e\u003cimg src=\"https://sites.google.com/site/razapor/matlab_cody/Cube_Map48_200.png\"\u003e\u003cp\u003eRubik's Cube has 48 faces that are assigned to a vector as in the above figure.\r\nU refers to the White face, F-Blue, L-Red, R-Orange, D-Yellow, and B-Green. Moves (1-6 UFDLBR 7-12 U'F'D'L'B'R' 13-18 U2F2D2L2B2R2) are clockwise looking towards the center, primes are CCW (eq U'), and twos are a half turn of a face.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eThe color to numeric coding is [RWBYGO] [012345]. \r\nA solved cube is [0000 0000 1111 1111 2222 2222 3333 3333 4444 4444 5555 5555]\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e Cube\u003c/p\u003e\u003cp\u003eCube is a 48 long row vector of values 0 thru 5.\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e Move_Vector\u003c/p\u003e\u003cp\u003eMove_Vector is an empty to 30 element vector of values 1:18\u003c/p\u003e\u003cp\u003e\u003cb\u003eConstraint:\u003c/b\u003e Solution must be 30 moves or less\u003c/p\u003e\u003cp\u003e\u003cb\u003eScoring:\u003c/b\u003e Average Time of Cubes 2 thru 4 (msec)\u003c/p\u003e\u003cp\u003e\u003ca href=\"http://cube20.org/src/\"\u003eTwo Phase Source code\u003c/a\u003e is fairly complex and may require a 500MB database file. Its goal is to find solutions of 20 or less starting with Two Phase.\u003c/p\u003e\u003cp\u003e\u003ca href=\"https://sites.google.com/site/razapor/matlab_cody/Cube30rev001.ppt?attredirects=0\u0026amp;d=1\"\u003e30 move Cube Solution in Matlab (rought draft)\u003c/a\u003e\u003c/p\u003e","function_template":"function [v]=Rubik_Solver(cube)\r\n% moves 1-6 UFDLBR 7-12 U'F;D'L'B'R' 13-18 U2F2D2L2B2R2\r\n% Return v as a numeric row vector of k values in range 1:18\r\n  v=[];\r\nend","test_suite":"%%\r\n% Thanks to Alfonso Nieto-Castanon\r\nurlwrite('https://sites.google.com/a/alfnie.com/alfnie/software/SetSolutionScore.p?attredirects=0\u0026amp;d=1','SetSolutionScore.p');\r\nrehash path;\r\n%%\r\n%feval(@assignin,'caller','score',20000); % msec\r\n%%\r\nvf=[ 17 2 3 20 5 22 7 8 11 13 16 10 15 9 12 14 41 18 19 44 21 46 23 24 25 26 27 28 29 30 31 32 33 34 6 36 4 38 39 1 40 42 43 37 45 35 47 48; \r\n  1 2 3 4 5 25 28 30 9 10 8 12 7 14 15 6 19 21 24 18 23 17 20 22 43 26 27 42 29 41 31 32 33 34 35 36 37 38 39 40 11 13 16 44 45 46 47 48 ;\r\n  1 2 38 4 36 6 7 33 9 10 11 12 13 14 15 16 17 18 3 20 5 22 23 8 27 29 32 26 31 25 28 30 48 34 35 45 37 43 39 40 41 42 19 44 21 46 47 24 ;\r\n  3 5 8 2 7 1 4 6 33 34 35 12 13 14 15 16 9 10 11 20 21 22 23 24 17 18 19 28 29 30 31 32 25 26 27 36 37 38 39 40 41 42 43 44 45 46 47 48 ;\r\n  14 12 9 4 5 6 7 8 46 10 11 47 13 48 15 16 17 18 19 20 21 22 23 24 25 26 1 28 2 30 31 3 35 37 40 34 39 33 36 38 41 42 43 44 45 32 29 27 ;\r\n  1 2 3 4 5 6 7 8 9 10 11 12 13 22 23 24 17 18 19 20 21 30 31 32 25 26 27 28 29 38 39 40 33 34 35 36 37 14 15 16 43 45 48 42 47 41 44 46 ;\r\n  40 2 3 37 5 35 7 8 14 12 9 15 10 16 13 11 1 18 19 4 21 6 23 24 25 26 27 28 29 30 31 32 33 34 46 36 44 38 39 41 17 42 43 20 45 22 47 48 ;\r\n  1 2 3 4 5 16 13 11 9 10 41 12 42 14 15 43 22 20 17 23 18 24 21 19 6 26 27 7 29 8 31 32 33 34 35 36 37 38 39 40 30 28 25 44 45 46 47 48 ;\r\n  1 2 19 4 21 6 7 24 9 10 11 12 13 14 15 16 17 18 43 20 45 22 23 48 30 28 25 31 26 32 29 27 8 34 35 5 37 3 39 40 41 42 38 44 36 46 47 33 ;\r\n  6 4 1 7 2 8 5 3 17 18 19 12 13 14 15 16 25 26 27 20 21 22 23 24 33 34 35 28 29 30 31 32 9 10 11 36 37 38 39 40 41 42 43 44 45 46 47 48 ;\r\n  27 29 32 4 5 6 7 8 3 10 11 2 13 1 15 16 17 18 19 20 21 22 23 24 25 26 48 28 47 30 31 46 38 36 33 39 34 40 37 35 41 42 43 44 45 9 12 14 ;\r\n  1 2 3 4 5 6 7 8 9 10 11 12 13 38 39 40 17 18 19 20 21 14 15 16 25 26 27 28 29 22 23 24 33 34 35 36 37 30 31 32 46 44 41 47 42 48 45 43 ;\r\n  41 2 3 44 5 46 7 8 16 15 14 13 12 11 10 9 40 18 19 37 21 35 23 24 25 26 27 28 29 30 31 32 33 34 22 36 20 38 39 17 1 42 43 4 45 6 47 48 ;\r\n  1 2 3 4 5 43 42 41 9 10 30 12 28 14 15 25 24 23 22 21 20 19 18 17 16 26 27 13 29 11 31 32 33 34 35 36 37 38 39 40 8 7 6 44 45 46 47 48 ;\r\n  1 2 43 4 45 6 7 48 9 10 11 12 13 14 15 16 17 18 38 20 36 22 23 33 32 31 30 29 28 27 26 25 24 34 35 21 37 19 39 40 41 42 3 44 5 46 47 8 ;\r\n  8 7 6 5 4 3 2 1 25 26 27 12 13 14 15 16 33 34 35 20 21 22 23 24 9 10 11 28 29 30 31 32 17 18 19 36 37 38 39 40 41 42 43 44 45 46 47 48 ;\r\n  48 47 46 4 5 6 7 8 32 10 11 29 13 27 15 16 17 18 19 20 21 22 23 24 25 26 14 28 12 30 31 9 40 39 38 37 36 35 34 33 41 42 43 44 45 3 2 1 ; \r\n  1 2 3 4 5 6 7 8 9 10 11 12 13 30 31 32 17 18 19 20 21 38 39 40 25 26 27 28 29 14 15 16 33 34 35 36 37 22 23 24 48 47 46 45 44 43 42 41 ];\r\n\r\n cube_orig=[zeros(1,8) ones(1,8) ones(1,8)*2 ones(1,8)*3 ones(1,8)*4 ones(1,8)*5]; \r\n tsum=0;\r\n Lbest=30;\r\n for cube_sets=1:4\r\n  if cube_sets==2,tsum=0;end\r\n encode=randi(18,1,80);\r\n fprintf('Encode: ');fprintf('%i ',encode);fprintf('\\n')\r\n r=cube_orig;\r\n for i= encode\r\n  r=r(vf(i,:));\r\n end\r\n encode=[]; % anti-shortcut\r\n encode_str='';\r\n cube=r;\r\n fprintf('%i',r);fprintf('\\n')\r\n\r\n% Time function\r\n ta=clock;\r\n [v]=Rubik_Solver(cube);\r\n t1=etime(clock,ta)*1000; % time in msec\r\n tsum=tsum+t1;\r\n Lv=length(v);\r\n assert(Lv\u003c=30)\r\n \r\n fprintf('Time: %.0f msec  Total Time %.0f\\n',t1,tsum)\r\n \r\n fprintf('Solution length %i\\n',length(v))\r\n fprintf('%i ',v);fprintf('\\n')\r\n \r\n r=cube;\r\n for i=v\r\n  r=r(vf(i,:));\r\n end\r\n \r\n fprintf('Solved Cube\\n');fprintf('%i',r);fprintf('\\n')\r\n\r\n tf=isequal(r,cube_orig);\r\n fprintf('Solved %i Moves %i \\n\\n\\n\\n',tf, Lv)\r\n assert(tf)\r\n assert(~isequal(1,2))\r\n if Lv\u003cLbest,Lbest=Lv;end\r\n \r\n end % cubesets\r\n\r\n %msiz=mtree('Rubik_Solver.m','-file').count\r\n\r\nfeval(  @assignin,'caller','score',floor(min( 20000,tsum/3 ))  );\r\nfprintf('\\n\\nScore %i\\n',floor(min( 20000,tsum/3 )));\r\nSetSolutionScore(floor(min( 20000,tsum/3 )));","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1,"test_suite_updated_at":"2016-12-23T22:06:57.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-12-25T03:53:42.000Z","updated_at":"2026-02-03T07:18:48.000Z","published_at":"2012-12-25T05:17:49.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.gif\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/media/image1.png\"}],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is to solve a thoroughly scrambled Rubik's cube in the minimum time (30 moves max).\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\u003eRubik's Cube can be solved in 20 moves or less from any position. 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://kociemba.org/cube.htm\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eKociemba Two Phase algorithm\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e can solve the Cube in 30 moves or less. The basic theory is that any cube can transition to an H-cube by 12 moves using all possible 18 move types. An H-cube is defined as having no rotations or flips of corners or edges, respectively, and has all middle edges in the middle row. The cube can be solved from any H-cube state in 18 moves or less using only the moves U U' U2 D D' D2 F2 L2 R2 B2.\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://kociemba.org/math/CubeDefs.htm#faceturns\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eDefinitions of Moves / Rotates / Flips for Corners and Edges\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The Two-Phase algorithm typically solves in 24 moves or less.\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:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId2\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRubik's Cube has 48 faces that are assigned to a vector as in the above figure. U refers to the White face, F-Blue, L-Red, R-Orange, D-Yellow, and B-Green. Moves (1-6 UFDLBR 7-12 U'F'D'L'B'R' 13-18 U2F2D2L2B2R2) are clockwise looking towards the center, primes are CCW (eq U'), and twos are a half turn of a face.\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[The color to numeric coding is [RWBYGO] [012345]. \\nA solved cube is [0000 0000 1111 1111 2222 2222 3333 3333 4444 4444 5555 5555]]]\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\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Cube\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\u003eCube is a 48 long row vector of values 0 thru 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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Move_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\u003eMove_Vector is an empty to 30 element vector of values 1:18\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\u003eConstraint:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Solution must be 30 moves or less\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:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Average Time of Cubes 2 thru 4 (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:hyperlink w:docLocation=\\\"http://cube20.org/src/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eTwo Phase Source code\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is fairly complex and may require a 500MB database file. Its goal is to find solutions of 20 or less starting with Two Phase.\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=\\\"https://sites.google.com/site/razapor/matlab_cody/Cube30rev001.ppt?attredirects=0\u0026amp;d=1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e30 move Cube Solution in Matlab (rought draft)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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,R0lGODlhhACBAPcAAFIBBYKCggAAjsfHvZZOTubm2KOioo4AAD09lgAAyqccHJ+xsfPz5cYAACMjldfXygEBrJKSkuLx8QQEU6yuu4UUFLmxsa2tpxAQnOQAAN/f0c3NxGVlaOnp6aoAAZqamv7+8gAAnAAA7AAAvImJibSlpbW4uJaWoCkpQ1EdHe7u4La2qsEKCqeTkwAAcrm5s9HZ2YGBlMLCwktLc+Li4qWlqpsAAFpaigAA3Zs1NPn569IAAMjQ0A8PtJCQnPLy8qqqqvMAAMrKynJycrMJCfr6+gwMpauwsMm6utTf32kAAJ2Dgw8PjKampp0lJenw7zc3igAAspWVla0MDO/v8LsAAAAAowAA/w8Puw4Oe7q6urzFxXBbYNnk5NXV1a6ursbNzfT//7a2tYeHhwAAlJQAAEhIiQAA1ZwgIM0AACkpjOn29gICZBkZleoAAJptbe7u7rUAAJ2dnQAA8wAAw46Ojriko3gfHwAAfdnZ2aQAAm1tkAAA49wAANHR0fX19f8AAHd5eXdjY30EBLgMDAcHtAYGpr6+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mODqbmwA1nEAHQf9ZwxuEW0ypUpfK2TUwd7XMWhy0wQcqqAojJtzyepIXhCKHnLFdQOT08QEDMShAXFrA0BwTc8dAP2Jfz4DuI0JTBIbYwwMaAwQiOH1fg50yzNNHdS9n2eq3jMINBjAbMYQ7h/bOnthV52PlIlrTaM/bCMwAr8aAwQk5hPJmnazi0vFhqQM+ewzhnAAoNAEE/klCDkwpaUDEFtB5AyUZfIz3GLrA5ChvUCS6QICdtlLwNxNepecwB2kOWqzEbngbYpBz0Q9kDQQYc+WtOkY6yBrB9I19cjGwB6Xb3iBvkOe0J+mCapc2hoa4wdaPj5AWSDvuf7PBzM/9vyiYge3UV4jRAQiRAdQ3MehYnvXexQD58C8EERXAPggh3l50l9wA7Xc/Q7ZwB3O7+rsO4AMMoH8QAQPxdm90NFN8MHvGR4AQQXojVni4NQF7oAEOSBF31miYd0QQIH0XeBFvMHfBE3TeB34feBGidn6UBQUrkH8neBEt4HUjSHY3N4AvuBGI0Gx0tztn4ABJd4MeAW47mDdH94NA+BHwZnm6IwJGoHVHKBIDdwBRoHYm+IQh8QNcMANBZIVc2IVe+IVgGIZiOIZkWIZmeIZomIZquIZs2IYJERAAOw==\"},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADtCAIAAAB1W61MAAA8KklEQVR42u2dB1gUx/vHX6QevSkW7CZ2Y2KLiS3RGKPGHkKiMWpU7F1EmiDSpbdDQIpi12iM2LuCAmIDVFCKoPR29Hbvf3fvgAPu4FhCwv3+u888PndzO9/bdT7MvDvznTkICQnx8/Pzl+TD29s7JiYG23cQIikpKe1RIIoTIu28jCtXrvj4+Eh0dRA4EVABr2Ik+nBxcYmKimpnjRIiSUlJ7VEgihMi7byMv//+283NTdJrhICKAYsBiwGLAYsBq1OBVVtelpudlZ2bV17LbSNY3PLiotLyKsGsytLS7Kys3PyCai5XDLCEKPA/qCovLMgrLqtgwJJIsDLfXFs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Yhdk/ktlrZDg2N9ddBA/tOlMYw9aYVY8bt/L5E/eWIC+rdOhCce17CR7WLTw+1tevpbdx1rkLEZFl1Wc4ZosYzqWqxbp2vKngyxlmLAkoThhqae98yZB1kg2JcZg2/c/djn+7sYi97n3bTBsf6qFo8+oJ4AyMZPKeh97sd3viwzEXuQkg2enPnzyOqqvKSCd0mFqUVV1bU1Ze+zb0126xGcUR733Ey6PsZ6HF6axcRYnR8sEZ73oTZE3curWCnyWyxzjRsf43zD5oi1z7vv8hJE9ysLeOu3BgUaVCFanvhc0FLcLMaSUrBW1rTX1LbXkLblt1g9bUhM1z66WVN8f5iVFAG99IHhD4srw+6vrJdiwOqsYInyvO+BQSHrn3+MZD92PPjQ4WJKzN1YX+19IjzvovZ5JweiFFzj39QU3By0v/GgubDlX9SPJBJq8rYJGRkJtvJUKyjtNP5+Pic945bdvYPh2XkZGedH2gGzmEIyukIhnndq6/ZpJwy8on08H3s73jfsadWwNkbcfd7JjSG01920+j14TKPfXG15SsdcesbZ7dvPzqgfeWfZDtl57yA72tf62h8aVrKCAx8MWJ06eBfpeTfm/84bmfbR3efdiIrALNsyCW3ceK7QXGC+kpkrlCSwGHfDfw5WSEiIn5+fvyQfxw8f13PXU7NRU7Olm5zV1Barqe1RU7Onq2BPFV9MSdnST7t9dh8JOCLR1UHgRED1f5BylCjEvsbMAAAAAElFTkSuQmCC\"}]}"}],"term":"tag:\"speed\"","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:\"speed\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"speed\"","","\"","speed","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f30366f6220\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f30366f60e0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f30366f5780\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f30366f65e0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f30366f6540\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f30366f64a0\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f30366f6400\u003e":"tag:\"speed\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f30366f6400\u003e":"tag:\"speed\""},"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:\"speed\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"speed\"","","\"","speed","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f30366f6220\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f30366f60e0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f30366f5780\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f30366f65e0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f30366f6540\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f30366f64a0\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f30366f6400\u003e":"tag:\"speed\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f30366f6400\u003e":"tag:\"speed\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":1693,"difficulty_rating":"easy"},{"id":956,"difficulty_rating":"easy"},{"id":955,"difficulty_rating":"easy"},{"id":952,"difficulty_rating":"easy-medium"},{"id":963,"difficulty_rating":"easy-medium"},{"id":477,"difficulty_rating":"easy-medium"},{"id":850,"difficulty_rating":"easy-medium"},{"id":539,"difficulty_rating":"easy-medium"},{"id":1259,"difficulty_rating":"medium"},{"id":1889,"difficulty_rating":"medium"},{"id":44351,"difficulty_rating":"medium"},{"id":42636,"difficulty_rating":"medium"},{"id":44508,"difficulty_rating":"medium"},{"id":44521,"difficulty_rating":"medium"},{"id":42674,"difficulty_rating":"medium"},{"id":44353,"difficulty_rating":"medium"},{"id":44356,"difficulty_rating":"medium"},{"id":52664,"difficulty_rating":"medium"},{"id":1237,"difficulty_rating":"medium-hard"},{"id":44383,"difficulty_rating":"hard"},{"id":1139,"difficulty_rating":"hard"},{"id":42765,"difficulty_rating":"unrated"},{"id":1122,"difficulty_rating":"unrated"},{"id":1138,"difficulty_rating":"unrated"}]}}