{"group":{"group":{"id":8504,"name":"The Movies","lockable":false,"created_at":"2020-10-30T18:26:07.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"","is_default":false,"created_by":633508,"badge_id":62,"featured":false,"trending":false,"solution_count_in_trending_period":22,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":5630,"published":true,"community_created":true,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"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\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 20.8px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 289.5px 10.4px; transform-origin: 289.5px 10.4px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 266.5px 10.4px; text-align: left; transform-origin: 266.5px 10.4px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","published_at":"2021-11-11T18:02:36.000Z"},"current_player":null},"problems":[{"id":157,"title":"The Hitchhiker's Guide to MATLAB","description":"Output logical \"true\" if the input is the answer to life, the universe and everything. Otherwise, output logical \"false\".","description_html":"\u003cp\u003eOutput logical \"true\" if the input is the answer to life, the universe and everything. Otherwise, output logical \"false\".\u003c/p\u003e","function_template":"function y = zaphod(x)\r\n  y = false\r\nend","test_suite":"%%\r\nx = 41;\r\ny_correct = false;\r\nassert(isequal(zaphod(x),y_correct))\r\n%%\r\nx = 42;\r\ny_correct = true;\r\nassert(isequal(zaphod(x),y_correct))\r\n%%\r\nx = 43;\r\ny_correct = false;\r\nassert(isequal(zaphod(x),y_correct))%%\r\nx = 44;\r\ny_correct = false;\r\nassert(isequal(zaphod(x),y_correct))%%\r\nx = 45;\r\ny_correct = false;\r\nassert(isequal(zaphod(x),y_correct))%%\r\nx = 46;\r\ny_correct = false;\r\nassert(isequal(zaphod(x),y_correct))%%\r\nx = 47;\r\ny_correct = false;\r\nassert(isequal(zaphod(x),y_correct))\r\n%%\r\nx = 48;\r\ny_correct = false;\r\nassert(isequal(zaphod(x),y_correct))\r\n%%\r\nx = 49;\r\ny_correct = false;\r\nassert(isequal(zaphod(x),y_correct))\r\n%%\r\nx = 50;\r\ny_correct = false;\r\nassert(isequal(zaphod(x),y_correct))","published":true,"deleted":false,"likes_count":54,"comments_count":18,"created_by":39,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":3408,"test_suite_updated_at":"2012-01-29T03:52:07.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-01-29T03:52:07.000Z","updated_at":"2026-03-26T05:13:23.000Z","published_at":"2012-01-29T03:53:05.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOutput logical \\\"true\\\" if the input is the answer to life, the universe and everything. Otherwise, output logical \\\"false\\\".\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":44350,"title":"Breaking Out of the Matrix","description":"Do you want to take the Red Pill, or the Blue Pill?\r\n\r\nIf you take the Blue Pill, you will simply pass along to the next problem, not knowing what Cody has in store for you.\r\n\r\nIf you take the Red Pill, you will be asked to write a MATLAB function that will Break a Matrix. The inputs to the function will be a matrix M, along with a number of rows (R) and columns (C). You goal is to break the larger 2-D matrix up into a 3-D matrix comprised of enough RxC matrices so that you can recreate the 2-D matrix. When creating your 3-D matrix, go down the columns first, and then across the rows.  Increment only one column (or one row) at a time.  Do not go C columns down at each step.\r\n\r\nFor example, R=2 and C=3, and M is as follows:\r\n\r\n M=[1 4 7 10\r\n    2 5 8 11\r\n    3 6 9 12]\r\n\r\nThis means that your output should be a 2x3x4 matrix:\r\n\r\n X(:,:,1) =\r\n     1     4     7\r\n     2     5     8\r\n X(:,:,2) =\r\n     2     5     8\r\n     3     6     9\r\n X(:,:,3) =\r\n     4     7    10\r\n     5     8    11\r\n X(:,:,4) =\r\n     5     8    11\r\n     6     9    12\r\n\r\nYou can assume that R and C will always be less than or equal to the appropriate dimension of the original matrix. Good luck!\r\n","description_html":"\u003cp\u003eDo you want to take the Red Pill, or the Blue Pill?\u003c/p\u003e\u003cp\u003eIf you take the Blue Pill, you will simply pass along to the next problem, not knowing what Cody has in store for you.\u003c/p\u003e\u003cp\u003eIf you take the Red Pill, you will be asked to write a MATLAB function that will Break a Matrix. The inputs to the function will be a matrix M, along with a number of rows (R) and columns (C). You goal is to break the larger 2-D matrix up into a 3-D matrix comprised of enough RxC matrices so that you can recreate the 2-D matrix. When creating your 3-D matrix, go down the columns first, and then across the rows.  Increment only one column (or one row) at a time.  Do not go C columns down at each step.\u003c/p\u003e\u003cp\u003eFor example, R=2 and C=3, and M is as follows:\u003c/p\u003e\u003cpre\u003e M=[1 4 7 10\r\n    2 5 8 11\r\n    3 6 9 12]\u003c/pre\u003e\u003cp\u003eThis means that your output should be a 2x3x4 matrix:\u003c/p\u003e\u003cpre\u003e X(:,:,1) =\r\n     1     4     7\r\n     2     5     8\r\n X(:,:,2) =\r\n     2     5     8\r\n     3     6     9\r\n X(:,:,3) =\r\n     4     7    10\r\n     5     8    11\r\n X(:,:,4) =\r\n     5     8    11\r\n     6     9    12\u003c/pre\u003e\u003cp\u003eYou can assume that R and C will always be less than or equal to the appropriate dimension of the original matrix. Good luck!\u003c/p\u003e","function_template":"function y = BreakTheMatrix(M,R,C)\r\n  y = x;\r\nend","test_suite":"%%\r\nM=[1 4 7 10;\r\n2 5 8 11;\r\n3 6 9 12];\r\nR=2;C=3;\r\nX(:,:,1) =[1 4 7 ; 2 5 8];\r\nX(:,:,2) =[2 5 8 ; 3 6 9];\r\nX(:,:,3) =[4 7 10 ; 5 8 11];\r\nX(:,:,4) =[5 8 11 ; 6 9 12];\r\nassert(isequal(BreakTheMatrix(M,R,C),X))\r\n%%\r\nx=1:ceil(35+25*rand());r=1;c=1;\r\nM=BreakTheMatrix(x,r,c);\r\nassert(all(arrayfun(@(y) (M(:,:,y)==y),1:numel(x))))\r\n%%\r\nx=eye(7);r=2;c=2;\r\nM=BreakTheMatrix(x,r,c);\r\nids=[1 8 15 22 29 36];\r\nurs=ids(1:5)+1;\r\nlls=urs+5;\r\nz=setxor(1:size(M,3),[ids urs lls]);\r\na1=arrayfun(@(a) isequal(M(:,:,a),eye(2)),ids);\r\na2=arrayfun(@(a) isequal(M(:,:,a),[0 1 ; 0 0]),urs);\r\na3=arrayfun(@(a) isequal(M(:,:,a),[0 0 ; 1 0]),lls);\r\na4=arrayfun(@(a) isequal(M(:,:,a),zeros(2)),z);\r\nassert(all([a1 a2 a3 a4]))\r\n%%\r\nu=ceil(10*rand())+4;\r\nx=magic(u);r=u;c=u;\r\nM=BreakTheMatrix(x,r,c);\r\nassert(isequal(M,x))\r\n%%\r\ntemp=ceil(8*rand)+3;\r\nx=ones(temp);r=2;c=2;\r\nM=BreakTheMatrix(x,r,c);\r\nassert(size(M,3)==(temp-1)^2);\r\nassert(all(arrayfun(@(a) isequal(M(:,:,a),ones(2)),1:size(M,3))))\r\n%%\r\nx=eye(7);r=7;c=7;\r\nassert(isequal(x,BreakTheMatrix(x,r,c)))","published":true,"deleted":false,"likes_count":9,"comments_count":14,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":379,"test_suite_updated_at":"2017-10-31T19:02:59.000Z","rescore_all_solutions":false,"group_id":34,"created_at":"2017-09-28T14:36:19.000Z","updated_at":"2026-03-31T15:14:35.000Z","published_at":"2017-10-16T01:45:08.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\u003eDo you want to take the Red Pill, or the Blue Pill?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf you take the Blue Pill, you will simply pass along to the next problem, not knowing what Cody has in store for you.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf you take the Red Pill, you will be asked to write a MATLAB function that will Break a Matrix. The inputs to the function will be a matrix M, along with a number of rows (R) and columns (C). You goal is to break the larger 2-D matrix up into a 3-D matrix comprised of enough RxC matrices so that you can recreate the 2-D matrix. When creating your 3-D matrix, go down the columns first, and then across the rows. Increment only one column (or one row) at a time. Do not go C columns down at each step.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example, R=2 and C=3, and M is as follows:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ M=[1 4 7 10\\n    2 5 8 11\\n    3 6 9 12]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis means that your output should be a 2x3x4 matrix:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ X(:,:,1) =\\n     1     4     7\\n     2     5     8\\n X(:,:,2) =\\n     2     5     8\\n     3     6     9\\n X(:,:,3) =\\n     4     7    10\\n     5     8    11\\n X(:,:,4) =\\n     5     8    11\\n     6     9    12]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou can assume that R and C will always be less than or equal to the appropriate dimension of the original matrix. Good luck!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1437,"title":"Who has power to do everything in this world?","description":"There is only one person who is older than this universe. \r\nHe is Indian version of Chuck Norris.","description_html":"\u003cp\u003eThere is only one person who is older than this universe. \r\nHe is Indian version of Chuck Norris.\u003c/p\u003e","function_template":"function y = your_fcn_name\r\n  y;\r\nend","test_suite":"%%\r\nassert(isequal(your_fcn_name,'Rajnikanth'))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":3,"created_by":10792,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":486,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-04-19T19:24:35.000Z","updated_at":"2026-03-29T03:50:18.000Z","published_at":"2013-04-19T19:24:35.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eThere is only one person who is older than this universe. He is Indian version of Chuck Norris.\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":1674,"title":"How many jokers?","description":"* Given DNA codes of a group of suspects, \r\n* and a code for certain types of jokers,\r\n* Count how many jokers of that type.\r\n* Try general solution\r\n* If test suite is expanded then solutions should still pass.","description_html":"\u003cul\u003e\u003cli\u003eGiven DNA codes of a group of suspects,\u003c/li\u003e\u003cli\u003eand a code for certain types of jokers,\u003c/li\u003e\u003cli\u003eCount how many jokers of that type.\u003c/li\u003e\u003cli\u003eTry general solution\u003c/li\u003e\u003cli\u003eIf test suite is expanded then solutions should still pass.\u003c/li\u003e\u003c/ul\u003e","function_template":"function jokers = mytest(suspects, code)\r\n  jokers = 23;\r\nend","test_suite":"%%\r\nsuspects = [431 543 211 911 436]; \r\ncode = 211; \r\njokers = 1;\r\nassert(isequal(mytest(suspects,code),jokers))\r\n\r\n%%\r\nsuspects = [431 543 211 911 436]; \r\ncode = 217; \r\njokers = 0;\r\nassert(isequal(mytest(suspects,code),jokers))\r\n\r\n%%\r\nsuspects = 100:200; \r\ncode = 160; \r\njokers = 1;\r\nassert(isequal(mytest(suspects,code),jokers))\r\n\r\n%%\r\nsuspects = [100 200 300 350 200]; \r\ncode = 200; \r\njokers = 2;\r\nassert(isequal(mytest(suspects,code),jokers))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":292,"test_suite_updated_at":"2013-06-26T13:56:01.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-06-22T16:14:37.000Z","updated_at":"2026-03-11T15:16:49.000Z","published_at":"2013-06-22T16:14:37.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"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 DNA codes of a group of suspects,\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\u003eand a code for certain types of jokers,\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\u003eCount how many jokers of that type.\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\u003eTry general solution\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\u003eIf test suite is expanded then solutions should still pass.\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":1188,"title":"The Answer to Life, the Universe, and Everything","description":"A variation of a previous Hitchhiker's Guide to the Galaxy problem.\r\n\r\n*Inputs:* Life, the Universe, and Everything\r\n\r\n*Output:* The Answer","description_html":"\u003cp\u003eA variation of a previous Hitchhiker's Guide to the Galaxy problem.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInputs:\u003c/b\u003e Life, the Universe, and Everything\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e The Answer\u003c/p\u003e","function_template":"function answer = answer_to(life,universe,everything)\r\n  answer = [];\r\nend","test_suite":"%%\r\nanswer = 42;\r\nassert(isequal(answer_to('life'),answer))\r\n\r\n%%\r\nanswer = 42;\r\nassert(isequal(answer_to('universe'),answer))\r\n\r\n%%\r\nanswer = 42;\r\nassert(isequal(answer_to('everything'),answer))\r\n\r\n%%\r\nanswer = 42;\r\nassert(isequal(answer_to('life','universe','everything'),answer))","published":true,"deleted":false,"likes_count":5,"comments_count":4,"created_by":1057,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":578,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-01-08T12:59:24.000Z","updated_at":"2026-03-13T22:22:07.000Z","published_at":"2013-01-08T12:59:46.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA variation of a previous Hitchhiker's Guide to the Galaxy problem.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInputs:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Life, the Universe, and Everything\u003c/w:t\u003e\u003c/w:r\u003e\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 The Answer\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":776,"title":"TRON strategy toggle","description":"Detect whether your lightcycle is on same side of existing walls as opponents lightcycle. This function is useful in toggling a tron algorithm from agressive/strategic mode (chasing and hassling opponent) to passive/efficiency mode (wherein you'd presumably focus on using up remaining space, and wouldn't have to bother tracking opponent, etc.). Inspired by Alfonso Nieto-Castanon's Problem 327, as well as Richard Zapor's followups.\r\ninput: 50 by 50 matrix of lightcycle and wall positions, empty space = 0, lightcycles = 1 \u0026 2, outer walls = -3, lightcycle trails/walls = -1 and -2.\r\noutput: true if on same side, or false if no path exists between the two light cycles.","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: 165px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.5px 82.5px; transform-origin: 406.5px 82.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 84px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 383.5px 42px; text-align: left; transform-origin: 383.5px 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: 365.8px 7.75px; transform-origin: 365.8px 7.75px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eDetect whether your lightcycle is on same side of existing walls as opponents lightcycle. This function is useful in toggling a tron algorithm from agressive/strategic mode (chasing and hassling opponent) to passive/efficiency mode (wherein you'd presumably focus on using up remaining space, and wouldn't have to bother tracking opponent, etc.). Inspired by Alfonso Nieto-Castanon's\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 2.06667px 7.75px; transform-origin: 2.06667px 7.75px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProblem 327\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: 123.483px 7.75px; transform-origin: 123.483px 7.75px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, as well as Richard Zapor's followups.\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: 383.5px 21px; text-align: left; transform-origin: 383.5px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 380.267px 7.75px; transform-origin: 380.267px 7.75px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003einput: 50 by 50 matrix of lightcycle and wall positions, empty space = 0, lightcycles = 1 \u0026amp; 2, outer walls = -3, lightcycle trails/walls = -1 and -2.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 383.5px 10.5px; text-align: left; transform-origin: 383.5px 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: 264.533px 7.75px; transform-origin: 264.533px 7.75px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eoutput: true if on same side, or false if no path exists between the two light cycles.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = onSameSide(board)\r\n  y = true;\r\nend","test_suite":"%%\r\nboard=zeros(50);\r\nboard([1,end],:)=-3;\r\nboard(:,[1,end])=-3;\r\nboard(2,2) = 1;\r\nboard(49,49)=2;\r\ny_correct = true;\r\nassert(isequal(onSameSide(board),y_correct))\r\n%%\r\nboard=zeros(50);\r\nboard([1,end],:)=-3;\r\nboard(:,[1,end])=-3;\r\nboard(5,25) = 1;\r\nboard(46,25)=2;\r\nboard(25,2:49)=-2;\r\ny_correct = false;\r\nassert(isequal(onSameSide(board),y_correct))\r\n%%\r\nboard=zeros(50);\r\nboard([1,end],:)=-3;\r\nboard(:,[1,end])=-3;\r\nboard(5,25) = 1;\r\nboard(46,25)=2;\r\nboard(28,2:48)=-2;\r\nboard(23,3:49)=-1;\r\ny_correct = true;\r\nassert(isequal(onSameSide(board),y_correct))\r\n\r\n%%\r\n%diagonal walls\r\nboard=-eye(50);\r\nboard([1,end],:)=-3;\r\nboard(:,[1,end])=-3;\r\nboard(5,25) = 1;\r\nboard(46,25)=2;\r\ny_correct = false;\r\nassert(isequal(onSameSide(board),y_correct))\r\n\r\n%%\r\n%diagonal walls\r\nboard=-eye(50);\r\nboard([1,end],:)=-3;\r\nboard(:,[1,end])=-3;\r\nidx=randi([2 20])\r\nboard(idx,idx+1)=1;\r\nboard(idx,idx-1)=2;\r\ny_correct = false;\r\nassert(isequal(onSameSide(board),y_correct))\r\n\r\n\r\n%%\r\n%diagonal walls\r\nboard=-rot90(eye(50));\r\nboard([1,end],:)=-3;\r\nboard(:,[1,end])=-3;\r\nboard(5,25)=1;\r\nboard(46,25)=2;\r\ny_correct = false;\r\nassert(isequal(onSameSide(board),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":4,"created_by":2846,"edited_by":223089,"edited_at":"2023-03-03T11:47:35.000Z","deleted_by":null,"deleted_at":null,"solvers_count":26,"test_suite_updated_at":"2023-03-03T11:47:35.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-06-19T20:11:09.000Z","updated_at":"2026-03-31T15:12:08.000Z","published_at":"2012-06-19T20:11:09.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDetect whether your lightcycle is on same side of existing walls as opponents lightcycle. This function is useful in toggling a tron algorithm from agressive/strategic mode (chasing and hassling opponent) to passive/efficiency mode (wherein you'd presumably focus on using up remaining space, and wouldn't have to bother tracking opponent, etc.). Inspired by Alfonso Nieto-Castanon's\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=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 327\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, as well as Richard Zapor's followups.\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: 50 by 50 matrix of lightcycle and wall positions, empty space = 0, lightcycles = 1 \u0026amp; 2, outer walls = -3, lightcycle trails/walls = -1 and -2.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eoutput: true if on same side, or false if no path exists between the two light cycles.\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":47053,"title":"Deduce Equations for Simplified Interstellar Doppler Effect ✨","description":"R2-D2 and C-3PO are friends. R2-D2 boards a spacecraft bound to a galaxy far, far away, but is always in contact with C-3PO, also, each one replies, as and when a message is received. R2-D2 started a conversation just after travelling a light-year. If there are total n messages in the conversation, what is the distance between the friends, just after R2-D2 said goodbye, in light-years? \r\nFYI:\r\n\r\n0                   Relativity is eliminated                                     \r\n2               Messages travel at speed of light                             \r\n4           Speed of spaceship is  1 times that of light                                                              \r\n6        X is more than 1; function must return 0, if otherwise...         ","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: 271px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 135.5px; transform-origin: 407px 135.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 83.6px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 41.8px; text-align: left; transform-origin: 384px 41.8px; 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=\"\"\u003eR2-D2 and C-3PO are friends. R2-D2 boards a spacecraft bound to a galaxy far, far away, but is always in contact with C-3PO, also, each one replies, as and when a message is received. R2-D2 started a conversation just after travelling a light-year. If there are total \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; 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; \"\u003en\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; 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 messages in the conversation, what is the distance between the friends, just after R2-D2 said \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; 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; \"\u003egoodbye\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; 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, in light-years? \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.4px; border-block-end-color: rgb(60, 60, 60); border-block-start-color: rgb(60, 60, 60); border-bottom-color: rgb(60, 60, 60); border-inline-end-color: rgb(60, 60, 60); border-inline-start-color: rgb(60, 60, 60); border-left-color: rgb(60, 60, 60); border-right-color: rgb(60, 60, 60); border-top-color: rgb(60, 60, 60); caret-color: rgb(60, 60, 60); color: rgb(60, 60, 60); column-rule-color: rgb(60, 60, 60); font-family: Helvetica, Arial, sans-serif; font-size: 20px; font-weight: 700; line-height: 20px; margin-block-end: 5px; margin-block-start: 20px; margin-bottom: 5px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 20px; outline-color: rgb(60, 60, 60); perspective-origin: 384px 10.2px; text-align: left; text-decoration: none; text-decoration-color: rgb(60, 60, 60); transform-origin: 384px 10.2px; white-space: pre-wrap; margin-left: 4px; margin-top: 20px; margin-bottom: 5px; 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eFYI:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21.2px; 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.6px; text-align: left; transform-origin: 384px 10.6px; 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; font-weight: 700; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21.2px; 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.6px; text-align: left; transform-origin: 384px 10.6px; 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; font-weight: 700; \"\u003e0                   \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; 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; \"\u003eR\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; 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; \"\u003eelativity is eliminated\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; 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: 21.2px; 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.6px; text-align: left; transform-origin: 384px 10.6px; 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; 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; font-weight: 700; \"\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; \"\u003eessages travel at speed of light\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; 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: 21.2px; 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.6px; text-align: left; transform-origin: 384px 10.6px; 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; font-weight: 700; \"\u003e4           \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; 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; \"\u003eS\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; 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; \"\u003epeed of spaceship is  \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; 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; font-weight: 700; \"\u003e1\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAAp9JREFUWEft11vIj1kUx/HPG8XQEDWJlCYXlNLUMETKDa4ocuMwEiGMnA8p5ySEFOGWHC4mkRslya1yo6ZmuCDGKSJFcp6W9l9v+r/vs5/neU3vhX31r732f333Wnut33padLLV0sl4fAcqykidCMXZoXiAF0WOcvfrAA3CUazBX7kOi+zqAE3DRKzE6yJHuftVgbphD67ibK6zHLuqQEOwD8twO8dRrk1VoPkYjE34kOssx64K0I84hOO4nOOkjE0VoF+xDQvwsIyzHNuyQGEfVdUDO/Epx0kZm7JAfXAE+3GtjKNc27JAY7E8pavDunNr2DJAXbAF93Gs4MY9MRJTMQk/YS4upHNRGGuxFJdS+3gSe2WABqR0bcyQioHJ8Tvsxe84kQA+Yhd+wCg8wxzcLQs0Jd34D7zKfRNYlDTvegKbjH9xullR5EaojlREm4hU9U+pfoqteN/sUrlAP6fKWlVBKiLVJzEeV1KU4h02XblAIRXDsAFvS6QrTLsn3VuCA0X/kQMUFRNScSpVREmez4UTFbUbF1OEIm2VIzQ8SUXcsIpUjMCfiIHuFqbjRh2gkIqIUhWp6IeDKbLzMAaz05uqFKE6UtEV63AH59M7ihYQPSjGluhH4/APHjfoit5QSMUKLMTzgscT/9UrzUfRp2ZgNNanEbfRjxrvKIokRuDteJMD1JCKAInqKFq/4Bz64mbqvItb3f63tB/9KCL2EqtbR6eoU8fBwym8OV8V8V5irI2Ofgab8ajVLUIqQgtDJiJK8fve17dsL2UTMBNlpaIoku3utwXUkIqYeaLL/m+rLaA6UlELvi2gWYhHGGX7pQJqeco83AyorlRkus6XjugPO9IwVUUqOhyoN2Jk+PtbfFUU0RZ16qLzHb7/H7TefyUkcHtGAAAAAElFTkSuQmCC\" width=\"18\" height=\"18\" style=\"width: 18px; height: 18px;\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 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; \"\u003etimes that of light\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; 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: 21.2px; 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.6px; text-align: left; transform-origin: 384px 10.6px; 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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; font-weight: 700; \"\u003e6        \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; 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; font-weight: 700; \"\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 is more than \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; 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; 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; function must return \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; 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; font-weight: 700; \"\u003e0\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; 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; \"\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; \"\u003eif otherwise...\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e         \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function d = distance_now(x,n)\r\n         d = 1+n*x;\r\nend","test_suite":"%%\r\nx=3;\r\nn=30;\r\ny_correct = 32768;\r\nassert(isequal(distance_now(x,n),y_correct))\r\n%%\r\nx=1;\r\nn=1;\r\ny_correct = 0;\r\nassert(isequal(distance_now(x,n),y_correct))\r\n%%\r\nx=.5;\r\nn=1;\r\ny_correct = 0;\r\nassert(isequal(distance_now(x,n),y_correct))\r\n%%\r\nx=1.1;\r\nn=1;\r\ny_correct = 1;\r\nassert(isequal(distance_now(x,n),y_correct))\r\n%%\r\nx=5;\r\nn=1;\r\ny_correct = 1;\r\nassert(isequal(distance_now(x,n),y_correct))\r\n%%\r\nx=2;\r\nn=3;\r\ny_correct = 3;\r\nassert(isequal(distance_now(x,n),y_correct))\r\n%%\r\nx=2;\r\nn=4;\r\ny_correct = 9;\r\nassert(isequal(distance_now(x,n),y_correct))\r\n%%\r\nx=2;\r\nn=5;\r\ny_correct = 9;\r\nassert(isequal(distance_now(x,n),y_correct))\r\n\r\n%%\r\nx=5;\r\nn=5;\r\ny_correct = 2.2500;\r\nassert(isequal(distance_now(x,n),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":633508,"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":"2020-10-24T07:48:35.000Z","updated_at":"2026-03-31T15:18:38.000Z","published_at":"2020-10-24T07:48:35.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\u003eR2-D2 and C-3PO are friends. R2-D2 boards a spacecraft bound to a galaxy far, far away, but is always in contact with C-3PO, also, each one replies, as and when a message is received. R2-D2 started a conversation just after travelling a light-year. If there are total \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e messages in the conversation, what is the distance between the friends, just after R2-D2 said \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\u003egoodbye\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, in light-years? \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"heading\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFYI:\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\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e0                   \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\u003eR\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eelativity is eliminated\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:rPr\u003e\u003cw:b/\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e2               \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\u003eM\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eessages travel at speed of light\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:rPr\u003e\u003cw:b/\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e4           \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\u003eS\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003epeed of spaceship is  \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e1\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e/x\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003etimes that of light\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:rPr\u003e\u003cw:b/\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e6        \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\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 is more than \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\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; function must return \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e0\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\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eif otherwise...\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e         \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":1330,"title":"James Bond film count","description":"Twenty-three James Bond films have been produced, in the years\r\n\r\n   1962, 1963, 1964, 1965, 1967, 1969, 1971, 1973, ...\r\n   1974, 1977, 1979, 1981, 1983, 1985, 1987, 1989, ...\r\n   1995, 1997, 1999, 2002, 2006, 2008, 2012\r\n\r\nThe total number of films N produced as a function of year Y can be approximated fairly well by a curve of the form \r\n\r\n   N = A*(Y-1961)^p   or   log(N) = log(A) + p*log(Y-1961)\r\n\r\nUse this to predict the total number of Bond films that will have been produced as of any given year in the future.","description_html":"\u003cp\u003eTwenty-three James Bond films have been produced, in the years\u003c/p\u003e\u003cpre\u003e   1962, 1963, 1964, 1965, 1967, 1969, 1971, 1973, ...\r\n   1974, 1977, 1979, 1981, 1983, 1985, 1987, 1989, ...\r\n   1995, 1997, 1999, 2002, 2006, 2008, 2012\u003c/pre\u003e\u003cp\u003eThe total number of films N produced as a function of year Y can be approximated fairly well by a curve of the form\u003c/p\u003e\u003cpre\u003e   N = A*(Y-1961)^p   or   log(N) = log(A) + p*log(Y-1961)\u003c/pre\u003e\u003cp\u003eUse this to predict the total number of Bond films that will have been produced as of any given year in the future.\u003c/p\u003e","function_template":"function n=bondcount(y)\r\nn=0;\r\n","test_suite":"%%\r\ny=2020;\r\nn=bondcount(y);\r\nassert(isequal(round(n),27))\r\n%%\r\ny=2100;\r\nn=bondcount(y);\r\nassert(isequal(round(n),52))\r\n%%\r\ny=2289;\r\nn=bondcount(y);\r\nassert(isequal(round(n),100))\r\n%%\r\ny=4661;\r\nn=bondcount(y);\r\nassert(isequal(round(n),500))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":245,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":54,"test_suite_updated_at":"2013-03-09T21:08:40.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-03-09T20:40:39.000Z","updated_at":"2026-02-27T10:03:31.000Z","published_at":"2013-03-09T21:08:40.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\u003eTwenty-three James Bond films have been produced, in the years\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[   1962, 1963, 1964, 1965, 1967, 1969, 1971, 1973, ...\\n   1974, 1977, 1979, 1981, 1983, 1985, 1987, 1989, ...\\n   1995, 1997, 1999, 2002, 2006, 2008, 2012]]\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 total number of films N produced as a function of year Y can be approximated fairly well by a curve of the form\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 = A*(Y-1961)^p   or   log(N) = log(A) + p*log(Y-1961)]]\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\u003eUse this to predict the total number of Bond films that will have been produced as of any given year in the future.\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":3061,"title":"Mirror, mirror on the wall, who is fairest of them all?","description":"The Elo rating system was featured in the movie *The Social Network* during the \u003chttps://www.youtube.com/watch?v=BzZRr4KV59I/ algorithm scene\u003e where Mark Zuckerberg released Facemash. \r\n\r\nIn the scene Eduardo Saverin writes mathematical formulas for the Elo rating system on Zuckerberg's dorm room window. \r\nThe Elo system is employed to rank coeds by their attractiveness. \r\nThe equations driving the algorithm are shown briefly (Ea and Eb). \r\n\r\nYou should know these equations now (See problem \u003chttp://www.mathworks.com/matlabcentral/cody/problems/3056-chess-probability/ 3056\u003e) :\r\n\r\n\r\n\u003c\u003chttp://upload.wikimedia.org/math/b/0/3/b0366725c224ee55eab6e2371dc6a0ef.png\u003e\u003e\r\n \r\n* \r\n\r\n\r\nEa is the expected probability that Girl A will win the match against Girl B.\r\n\r\nRa is the rating of Girl A, which changes after tournament, according to the formula (Ra )n = (Ra )n-1 + 32 (W - Ea ) where W = {1,0.5,0}.\r\n\r\nNow imagine a single round-robin tournament where each girl plays (is compared with)  every other girl once.\r\nA judge (me for the problem) gives a note :\r\n\r\n* 1   if girl A is more attractive than girl B\r\n* 0   if girl B is more attractive than girl A\r\n* 0.5 if same attractiveness\r\n\r\nI give you the tournament results (2 on the main diagonal).\r\n\r\nFind the final rating of Snow White (she is unique).\r\n\r\nConsider that all girl begin the tournament with a rating of 1000.\r\n\r\nYou can observe that the total number of attractiveness (ELO) points remains constant.\r\n","description_html":"\u003cp\u003eThe Elo rating system was featured in the movie \u003cb\u003eThe Social Network\u003c/b\u003e during the \u003ca href = \"https://www.youtube.com/watch?v=BzZRr4KV59I/\"\u003ealgorithm scene\u003c/a\u003e where Mark Zuckerberg released Facemash.\u003c/p\u003e\u003cp\u003eIn the scene Eduardo Saverin writes mathematical formulas for the Elo rating system on Zuckerberg's dorm room window. \r\nThe Elo system is employed to rank coeds by their attractiveness. \r\nThe equations driving the algorithm are shown briefly (Ea and Eb).\u003c/p\u003e\u003cp\u003eYou should know these equations now (See problem \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/3056-chess-probability/\"\u003e3056\u003c/a\u003e) :\u003c/p\u003e\u003cimg src = \"http://upload.wikimedia.org/math/b/0/3/b0366725c224ee55eab6e2371dc6a0ef.png\"\u003e\u003cul\u003e\u003cli\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eEa is the expected probability that Girl A will win the match against Girl B.\u003c/p\u003e\u003cp\u003eRa is the rating of Girl A, which changes after tournament, according to the formula (Ra )n = (Ra )n-1 + 32 (W - Ea ) where W = {1,0.5,0}.\u003c/p\u003e\u003cp\u003eNow imagine a single round-robin tournament where each girl plays (is compared with)  every other girl once.\r\nA judge (me for the problem) gives a note :\u003c/p\u003e\u003cul\u003e\u003cli\u003e1   if girl A is more attractive than girl B\u003c/li\u003e\u003cli\u003e0   if girl B is more attractive than girl A\u003c/li\u003e\u003cli\u003e0.5 if same attractiveness\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eI give you the tournament results (2 on the main diagonal).\u003c/p\u003e\u003cp\u003eFind the final rating of Snow White (she is unique).\u003c/p\u003e\u003cp\u003eConsider that all girl begin the tournament with a rating of 1000.\u003c/p\u003e\u003cp\u003eYou can observe that the total number of attractiveness (ELO) points remains constant.\u003c/p\u003e","function_template":"function y = fairest_girl(X)\r\n  y = X;\r\nend","test_suite":"%%\r\nA=[2 1 1 1 1;0 2 1 1 1;0 0 2 1 1;0 0 0 2 1;0 0 0 0 2];\r\nassert(isequal(fairest_girl(A),1064));\r\n%%\r\nA=[2 1;0 2];\r\nassert(isequal(fairest_girl(A),1016));\r\n%%\r\nassert(isequal(fairest_girl([2 1 0.5;0 2 0.5;0.5 0.5 2]),1016));\r\n%%\r\nA=[2 1 1 1 1 1;0 2 1 1 1 1;0 0 2 1 1 1;0 0 0 2 0.5 0.5;0 0 0 0.5 2 0.5;0 0 0 0.5 0.5 2];\r\nassert(isequal(fairest_girl(A),1080));\r\n%%\r\nA=[2 0.5 1;0.5 2 0.5;0 0.5 2];\r\nassert(isequal(fairest_girl(A),1016));\r\n%%\r\nA=[2 1 1 1 1 1 1;0 2 1 1 1 1 1;0 0 2 1 1 1 1;0 0 0 2 0.5 0.5 1;0 0 0 0.5 2 0.5 1;0 0 0 0.5 0.5 2 1;0 0 0 0 0 0 2];\r\nassert(isequal(fairest_girl(A),1096));\r\n%%\r\nA=[2 1 1 1 1 1 0.5;0 2 1 1 1 1 0.5;0 0 2 1 1 1 0.5;0 0 0 2 0.5 0.5 0.5;0 0 0 0.5 2 0.5 0.5;0 0 0 0.5 0.5 2 0.5;0.5 0.5 0.5 0.5 0.5 0.5 2];\r\nassert(isequal(fairest_girl(A),1080));\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":5390,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":18,"test_suite_updated_at":"2015-03-03T18:22:50.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-03-03T18:06:46.000Z","updated_at":"2026-04-01T09:44:49.000Z","published_at":"2015-03-03T18:13:07.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.png\"}],\"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 Elo rating system was featured in the movie\u003c/w:t\u003e\u003c/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\u003eThe Social Network\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e during 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.youtube.com/watch?v=BzZRr4KV59I/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ealgorithm scene\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e where Mark Zuckerberg released Facemash.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn the scene Eduardo Saverin writes mathematical formulas for the Elo rating system on Zuckerberg's dorm room window. The Elo system is employed to rank coeds by their attractiveness. The equations driving the algorithm are shown briefly (Ea and Eb).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/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 should know these equations now (See 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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/3056-chess-probability/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e3056\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e) :\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEa is the expected probability that Girl A will win the match against Girl 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\u003eRa is the rating of Girl A, which changes after tournament, according to the formula (Ra )n = (Ra )n-1 + 32 (W - Ea ) where W = {1,0.5,0}.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNow imagine a single round-robin tournament where each girl plays (is compared with) every other girl once. A judge (me for the problem) gives a note :\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\u003e1 if girl A is more attractive than girl B\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\u003e0 if girl B is more attractive than girl A\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\u003e0.5 if same attractiveness\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eI give you the tournament results (2 on the main diagonal).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the final rating of Snow White (she is unique).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eConsider that all girl begin the tournament with a rating of 1000.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/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 observe that the total number of attractiveness (ELO) points remains constant.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAM4AAAArBAMAAADCuKrGAAAAMFBMVEX///90dHQEBAQwMDCenp5QUFAWFhbm5ubMzMyKioq2trZAQEAMDAwiIiJiYmIAAADHPVvyAAAAAXRSTlMAQObYZgAAAuJJREFUeNrtV0toE2EQ/pJs91+TZpuKKZ7aHDxZhKBo8WCNQj14qNHiAxFZRNIHVAPFi0UbFC8qEqh40cOePBUfUAoS0BQPvhByqXqoEK1CaauNXswWu3H+JF03TbV5dHPqwGYzM//u98/881qgOhoscZ29OhjnkRIXOqqCYdvmXqMmtKc2fiuZ1nHWcdZxikmrDU7Xq53hkhbagG8Nz7Cl0WO565xkuxS3/nwEHUinrMfJ9NLdbz2OPYUkVOtD+2GA+S0HEYDAzQ82nyEYe8R/+yxAfoc6671G+dM6If+U0oC4sEyXWSuQHzw5JQ0MdfRnPmxpvGk6Fam9lK5q9kzGQpwSqz4Y+beK71cq2rSDxwC9V6iPlrE/+T/GH6fLVWRPhpx3ia57v4Jl4NyIYv5pV8HODH4kx9ep0uETuOYly9m43dV/N7brShRS50xw9amWCwabaWEboO4f7THrDF4PABv4aKe3PMDn2SSJFFMi2ZSiCvt2JcFLDMNJWdYEHqV/yeB52vvBmtQRiAfjOFvQfybhWF6zWau6gkDuwXlVoD214MK0WWvwGnnHB5ZCH9gLFf1mnKvTGJpY3ivfLIWd2yRI+yAEFsnpKe+sD/fbpwL5RVkeUraeLPpxPRtdH42HS5me3SZBgwcOxRWAlEI7aSJCwhaLxR7nebjI0m76PGBRUW2C+EnBucr6djgCSaHSoSWxSDUjkolnOjo6DuV57KaYe4IDWDg9uekOxF4FxyrD4TVEEVTYPRiWcLHxfT6TcjzqGUUeWZTZuHVOCWOM4XfFc0gaepCdOglvEpvnt+djJMfLvgEIUcYFU7f1fZ344k1Wdj5DUbjjPH+yNAqxICgHvo/DFbGV2QCyOK5Q6Ewo1G+KA7diZHD3UvbnKYijuFX2V+JK9ohBiEk4cyVG1r+2FZiTkCZVDy6vAY6cQINaQV8oa6olgZaGrKwtTtFUywXa8+YdVnVDN2pDjqrf8Af8bczR/4tLjAAAAABJRU5ErkJggg==\"}]}"}],"no_progress_badge":{"id":53,"name":"Unknown","symbol":"unknown","description":"Partially completed groups","description_html":null,"image_location":"/images/responsive/supporting/matlabcentral/cody/badges/problem_groups_unknown_2.png","bonus":null,"players_count":0,"active":false,"created_by":null,"updated_by":null,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"created_at":"2018-01-10T23:20:29.000Z","updated_at":"2018-01-10T23:20:29.000Z","community_badge_id":null,"award_multiples":false}}