{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-04-26T00:14:02.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-26T00: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":44451,"title":"Rate of event occurence:  find percentiles of the distribution  (for smallish rates)","description":"*In this problem you need to find the 5th and 95th percentiles of a Poisson distribution defined by parameter _μ_ (the mean rate parameter).*\r\n\r\n_What follows is just a longer introduction to the concepts, including two examples._  \r\n\r\nSay that you manage the inventory of a business for which orders *on average* come in at a known rate (daily, say), but for any given period the number of orders can be somewhat above or somewhat below the expected value.  If it helps your motivation, you can imagine you're running a stall selling vegan sausages, or in booth handing out free beer, or at a barbecue serving pancakes, ....  \r\n\r\nThe variable of interest, N, is the number of customers/orders within a given period — one day, let's say.  The average rate multiplied by the period of interest yields the mean of the distribution (in this problem), which is the 'expected value', or average.  \r\n\r\nIn this problem, N follows a *\u003chttps://www.britannica.com/topic/Poisson-distribution Poisson distribution\u003e* :\r\nN ~ Poisson(μ).  \r\nSo there is no influence of any external factors (weather, trends, etc.).  The only parameter having a deterministic effect is μ.  \r\n\r\nThen the probability of having k customers in a period, given the expected number of customers in that period being equal to μ, is given by:  \r\nPr(N=k) = μ^k × exp(−μ) / k!\r\n\r\nThe caret (^) represents the power operator, and the exclamation mark (!) represents the factorial operation.  \r\n\r\nIf μ and k are given, it is therefore straightforward to compute the probability, Pr(N=k), using the above formula.  \r\n\r\nHowever, in this problem you will be given μ, representing the mean ('expected') daily rate, and you thereby need to determine _two_ values of k:\r\n\r\n* A _lower_ limit on the number of customers, k, for which a lower demand will not be faced more than 5% of the time\r\n* An _upper_ limit on the number of customers, k, that will not be exceeded more than 5% of the time\r\n\r\nHence, you will be sure that, in the long run, the number of customers you see each day will not often (no more than 10% of the time) be outside the range specified by the above two limits.  \r\n\r\nEXAMPLE 1:\r\n\r\n  % Input\r\n  mu = 10\r\n  % Output\r\n  lowerLimit = 4\r\n  upperLimit = 15\r\n  safeLimits = [lowerLimit upperLimit]\r\n\r\nNote that the outputs shall be integers, because there is no physical meaning to 'half a customer'.  \r\n\r\nEXAMPLE 2:\r\n\r\n  % Input\r\n  mu = 100\r\n  % Output\r\n  lowerLimit = 83\r\n  upperLimit = 117\r\n  safeLimits = [lowerLimit upperLimit]\r\n\r\nNOTE:  the two limits are returned as the vector safeLimits, as shown.\r\n\r\n|NOTE:  Toolbox functions are generally not available from within Cody.|","description_html":"\u003cp\u003e\u003cb\u003eIn this problem you need to find the 5th and 95th percentiles of a Poisson distribution defined by parameter \u003ci\u003eμ\u003c/i\u003e (the mean rate parameter).\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ci\u003eWhat follows is just a longer introduction to the concepts, including two examples.\u003c/i\u003e\u003c/p\u003e\u003cp\u003eSay that you manage the inventory of a business for which orders \u003cb\u003eon average\u003c/b\u003e come in at a known rate (daily, say), but for any given period the number of orders can be somewhat above or somewhat below the expected value.  If it helps your motivation, you can imagine you're running a stall selling vegan sausages, or in booth handing out free beer, or at a barbecue serving pancakes, ....\u003c/p\u003e\u003cp\u003eThe variable of interest, N, is the number of customers/orders within a given period — one day, let's say.  The average rate multiplied by the period of interest yields the mean of the distribution (in this problem), which is the 'expected value', or average.\u003c/p\u003e\u003cp\u003eIn this problem, N follows a \u003cb\u003e\u003ca href = \"https://www.britannica.com/topic/Poisson-distribution\"\u003ePoisson distribution\u003c/a\u003e\u003c/b\u003e :\r\nN ~ Poisson(μ).  \r\nSo there is no influence of any external factors (weather, trends, etc.).  The only parameter having a deterministic effect is μ.\u003c/p\u003e\u003cp\u003eThen the probability of having k customers in a period, given the expected number of customers in that period being equal to μ, is given by:  \r\nPr(N=k) = μ^k × exp(−μ) / k!\u003c/p\u003e\u003cp\u003eThe caret (^) represents the power operator, and the exclamation mark (!) represents the factorial operation.\u003c/p\u003e\u003cp\u003eIf μ and k are given, it is therefore straightforward to compute the probability, Pr(N=k), using the above formula.\u003c/p\u003e\u003cp\u003eHowever, in this problem you will be given μ, representing the mean ('expected') daily rate, and you thereby need to determine \u003ci\u003etwo\u003c/i\u003e values of k:\u003c/p\u003e\u003cul\u003e\u003cli\u003eA \u003ci\u003elower\u003c/i\u003e limit on the number of customers, k, for which a lower demand will not be faced more than 5% of the time\u003c/li\u003e\u003cli\u003eAn \u003ci\u003eupper\u003c/i\u003e limit on the number of customers, k, that will not be exceeded more than 5% of the time\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eHence, you will be sure that, in the long run, the number of customers you see each day will not often (no more than 10% of the time) be outside the range specified by the above two limits.\u003c/p\u003e\u003cp\u003eEXAMPLE 1:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e% Input\r\nmu = 10\r\n% Output\r\nlowerLimit = 4\r\nupperLimit = 15\r\nsafeLimits = [lowerLimit upperLimit]\r\n\u003c/pre\u003e\u003cp\u003eNote that the outputs shall be integers, because there is no physical meaning to 'half a customer'.\u003c/p\u003e\u003cp\u003eEXAMPLE 2:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e% Input\r\nmu = 100\r\n% Output\r\nlowerLimit = 83\r\nupperLimit = 117\r\nsafeLimits = [lowerLimit upperLimit]\r\n\u003c/pre\u003e\u003cp\u003eNOTE:  the two limits are returned as the vector safeLimits, as shown.\u003c/p\u003e\u003cp\u003e\u003ctt\u003eNOTE:  Toolbox functions are generally not available from within Cody.\u003c/tt\u003e\u003c/p\u003e","function_template":"% Here you can describe your strategy.\r\nfunction safeLimits = getLimits(mu)\r\n    % Here you can write your code.\r\nend","test_suite":"%% From EXAMPLE 1\r\nmu = 10;\r\nsafeLimits = [4 15];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%% From EXAMPLE 2:\r\nmu = 100;\r\nsafeLimits = [83 117];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%% Handle lower limit of zero:\r\nmu = 3;\r\nsafeLimits = [0 6];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 30;\r\nsafeLimits = [20 39];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 4;\r\nsafeLimits = [0 8];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 40;\r\nsafeLimits = [29 51];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 11;\r\nsafeLimits = [5 17];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 12;\r\nsafeLimits = [6 18];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 13;\r\nsafeLimits = [6 19];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 14;\r\nsafeLimits = [7 20];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 15;\r\nsafeLimits = [8 22];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 20;\r\nsafeLimits = [12 28];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 110;\r\nsafeLimits = [92 128];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 120;\r\nsafeLimits = [101 138];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n\r\n%% High rates\r\n% Not asserted in this problem\r\n\r\nmu = 150;\r\nsafeLimits = [129 170];\r\n%assert(isequal(getLimits(mu), safeLimits))\r\n\r\nmu = 200;\r\nsafeLimits = [176 224];\r\n%assert(isequal(getLimits(mu), safeLimits))\r\n\r\nmu = 300;\r\nsafeLimits = [271 329];\r\n%assert(isequal(getLimits(mu), safeLimits))\r\n\r\nmu = 1000;\r\nsafeLimits = [947 1052];\r\n%assert(isequal(getLimits(mu), safeLimits))","published":true,"deleted":false,"likes_count":2,"comments_count":5,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":13,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-12-13T04:58:52.000Z","updated_at":"2026-04-28T00:56:11.000Z","published_at":"2017-12-13T07:41:31.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\u003eIn this problem you need to find the 5th and 95th percentiles of a Poisson distribution defined by parameter\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\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 (the mean rate 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:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eWhat follows is just a longer introduction to the concepts, including two examples.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSay that you manage the inventory of a business for which orders\u003c/w:t\u003e\u003c/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\u003eon average\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e come in at a known rate (daily, say), but for any given period the number of orders can be somewhat above or somewhat below the expected value. If it helps your motivation, you can imagine you're running a stall selling vegan sausages, or in booth handing out free beer, or at a barbecue serving pancakes, ....\u003c/w:t\u003e\u003c/w:r\u003e\u003c/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 variable of interest, N, is the number of customers/orders within a given period — one day, let's say. The average rate multiplied by the period of interest yields the mean of the distribution (in this problem), which is the 'expected value', or average.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/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 this problem, N follows a\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.britannica.com/topic/Poisson-distribution\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePoisson distribution\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e : N ~ Poisson(μ). So there is no influence of any external factors (weather, trends, etc.). The only parameter having a deterministic effect is μ.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThen the probability of having k customers in a period, given the expected number of customers in that period being equal to μ, is given by: Pr(N=k) = μ^k × exp(−μ) / k!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/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 caret (^) represents the power operator, and the exclamation mark (!) represents the factorial operation.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/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 μ and k are given, it is therefore straightforward to compute the probability, Pr(N=k), using the above formula.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHowever, in this problem you will be given μ, representing the mean ('expected') daily rate, and you thereby need to determine\u003c/w:t\u003e\u003c/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\u003etwo\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e values of k:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/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\u003elower\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e limit on the number of customers, k, for which a lower demand will not be faced more than 5% of the time\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\u003eAn\u003c/w:t\u003e\u003c/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\u003eupper\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e limit on the number of customers, k, that will not be exceeded more than 5% of the time\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHence, you will be sure that, in the long run, the number of customers you see each day will not often (no more than 10% of the time) be outside the range specified by the above two limits.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/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[% Input\\nmu = 10\\n% Output\\nlowerLimit = 4\\nupperLimit = 15\\nsafeLimits = [lowerLimit upperLimit]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNote that the outputs shall be integers, because there is no physical meaning to 'half a customer'.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/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:\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\\nmu = 100\\n% Output\\nlowerLimit = 83\\nupperLimit = 117\\nsafeLimits = [lowerLimit upperLimit]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNOTE: the two limits are returned as the vector safeLimits, as shown.\u003c/w:t\u003e\u003c/w:r\u003e\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: Toolbox functions are generally not available from within Cody.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":44451,"title":"Rate of event occurence:  find percentiles of the distribution  (for smallish rates)","description":"*In this problem you need to find the 5th and 95th percentiles of a Poisson distribution defined by parameter _μ_ (the mean rate parameter).*\r\n\r\n_What follows is just a longer introduction to the concepts, including two examples._  \r\n\r\nSay that you manage the inventory of a business for which orders *on average* come in at a known rate (daily, say), but for any given period the number of orders can be somewhat above or somewhat below the expected value.  If it helps your motivation, you can imagine you're running a stall selling vegan sausages, or in booth handing out free beer, or at a barbecue serving pancakes, ....  \r\n\r\nThe variable of interest, N, is the number of customers/orders within a given period — one day, let's say.  The average rate multiplied by the period of interest yields the mean of the distribution (in this problem), which is the 'expected value', or average.  \r\n\r\nIn this problem, N follows a *\u003chttps://www.britannica.com/topic/Poisson-distribution Poisson distribution\u003e* :\r\nN ~ Poisson(μ).  \r\nSo there is no influence of any external factors (weather, trends, etc.).  The only parameter having a deterministic effect is μ.  \r\n\r\nThen the probability of having k customers in a period, given the expected number of customers in that period being equal to μ, is given by:  \r\nPr(N=k) = μ^k × exp(−μ) / k!\r\n\r\nThe caret (^) represents the power operator, and the exclamation mark (!) represents the factorial operation.  \r\n\r\nIf μ and k are given, it is therefore straightforward to compute the probability, Pr(N=k), using the above formula.  \r\n\r\nHowever, in this problem you will be given μ, representing the mean ('expected') daily rate, and you thereby need to determine _two_ values of k:\r\n\r\n* A _lower_ limit on the number of customers, k, for which a lower demand will not be faced more than 5% of the time\r\n* An _upper_ limit on the number of customers, k, that will not be exceeded more than 5% of the time\r\n\r\nHence, you will be sure that, in the long run, the number of customers you see each day will not often (no more than 10% of the time) be outside the range specified by the above two limits.  \r\n\r\nEXAMPLE 1:\r\n\r\n  % Input\r\n  mu = 10\r\n  % Output\r\n  lowerLimit = 4\r\n  upperLimit = 15\r\n  safeLimits = [lowerLimit upperLimit]\r\n\r\nNote that the outputs shall be integers, because there is no physical meaning to 'half a customer'.  \r\n\r\nEXAMPLE 2:\r\n\r\n  % Input\r\n  mu = 100\r\n  % Output\r\n  lowerLimit = 83\r\n  upperLimit = 117\r\n  safeLimits = [lowerLimit upperLimit]\r\n\r\nNOTE:  the two limits are returned as the vector safeLimits, as shown.\r\n\r\n|NOTE:  Toolbox functions are generally not available from within Cody.|","description_html":"\u003cp\u003e\u003cb\u003eIn this problem you need to find the 5th and 95th percentiles of a Poisson distribution defined by parameter \u003ci\u003eμ\u003c/i\u003e (the mean rate parameter).\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ci\u003eWhat follows is just a longer introduction to the concepts, including two examples.\u003c/i\u003e\u003c/p\u003e\u003cp\u003eSay that you manage the inventory of a business for which orders \u003cb\u003eon average\u003c/b\u003e come in at a known rate (daily, say), but for any given period the number of orders can be somewhat above or somewhat below the expected value.  If it helps your motivation, you can imagine you're running a stall selling vegan sausages, or in booth handing out free beer, or at a barbecue serving pancakes, ....\u003c/p\u003e\u003cp\u003eThe variable of interest, N, is the number of customers/orders within a given period — one day, let's say.  The average rate multiplied by the period of interest yields the mean of the distribution (in this problem), which is the 'expected value', or average.\u003c/p\u003e\u003cp\u003eIn this problem, N follows a \u003cb\u003e\u003ca href = \"https://www.britannica.com/topic/Poisson-distribution\"\u003ePoisson distribution\u003c/a\u003e\u003c/b\u003e :\r\nN ~ Poisson(μ).  \r\nSo there is no influence of any external factors (weather, trends, etc.).  The only parameter having a deterministic effect is μ.\u003c/p\u003e\u003cp\u003eThen the probability of having k customers in a period, given the expected number of customers in that period being equal to μ, is given by:  \r\nPr(N=k) = μ^k × exp(−μ) / k!\u003c/p\u003e\u003cp\u003eThe caret (^) represents the power operator, and the exclamation mark (!) represents the factorial operation.\u003c/p\u003e\u003cp\u003eIf μ and k are given, it is therefore straightforward to compute the probability, Pr(N=k), using the above formula.\u003c/p\u003e\u003cp\u003eHowever, in this problem you will be given μ, representing the mean ('expected') daily rate, and you thereby need to determine \u003ci\u003etwo\u003c/i\u003e values of k:\u003c/p\u003e\u003cul\u003e\u003cli\u003eA \u003ci\u003elower\u003c/i\u003e limit on the number of customers, k, for which a lower demand will not be faced more than 5% of the time\u003c/li\u003e\u003cli\u003eAn \u003ci\u003eupper\u003c/i\u003e limit on the number of customers, k, that will not be exceeded more than 5% of the time\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eHence, you will be sure that, in the long run, the number of customers you see each day will not often (no more than 10% of the time) be outside the range specified by the above two limits.\u003c/p\u003e\u003cp\u003eEXAMPLE 1:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e% Input\r\nmu = 10\r\n% Output\r\nlowerLimit = 4\r\nupperLimit = 15\r\nsafeLimits = [lowerLimit upperLimit]\r\n\u003c/pre\u003e\u003cp\u003eNote that the outputs shall be integers, because there is no physical meaning to 'half a customer'.\u003c/p\u003e\u003cp\u003eEXAMPLE 2:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e% Input\r\nmu = 100\r\n% Output\r\nlowerLimit = 83\r\nupperLimit = 117\r\nsafeLimits = [lowerLimit upperLimit]\r\n\u003c/pre\u003e\u003cp\u003eNOTE:  the two limits are returned as the vector safeLimits, as shown.\u003c/p\u003e\u003cp\u003e\u003ctt\u003eNOTE:  Toolbox functions are generally not available from within Cody.\u003c/tt\u003e\u003c/p\u003e","function_template":"% Here you can describe your strategy.\r\nfunction safeLimits = getLimits(mu)\r\n    % Here you can write your code.\r\nend","test_suite":"%% From EXAMPLE 1\r\nmu = 10;\r\nsafeLimits = [4 15];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%% From EXAMPLE 2:\r\nmu = 100;\r\nsafeLimits = [83 117];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%% Handle lower limit of zero:\r\nmu = 3;\r\nsafeLimits = [0 6];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 30;\r\nsafeLimits = [20 39];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 4;\r\nsafeLimits = [0 8];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 40;\r\nsafeLimits = [29 51];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 11;\r\nsafeLimits = [5 17];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 12;\r\nsafeLimits = [6 18];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 13;\r\nsafeLimits = [6 19];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 14;\r\nsafeLimits = [7 20];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 15;\r\nsafeLimits = [8 22];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 20;\r\nsafeLimits = [12 28];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 110;\r\nsafeLimits = [92 128];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n%%\r\nmu = 120;\r\nsafeLimits = [101 138];\r\nassert(isequal(getLimits(mu), safeLimits))\r\n\r\n\r\n%% High rates\r\n% Not asserted in this problem\r\n\r\nmu = 150;\r\nsafeLimits = [129 170];\r\n%assert(isequal(getLimits(mu), safeLimits))\r\n\r\nmu = 200;\r\nsafeLimits = [176 224];\r\n%assert(isequal(getLimits(mu), safeLimits))\r\n\r\nmu = 300;\r\nsafeLimits = [271 329];\r\n%assert(isequal(getLimits(mu), safeLimits))\r\n\r\nmu = 1000;\r\nsafeLimits = [947 1052];\r\n%assert(isequal(getLimits(mu), safeLimits))","published":true,"deleted":false,"likes_count":2,"comments_count":5,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":13,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-12-13T04:58:52.000Z","updated_at":"2026-04-28T00:56:11.000Z","published_at":"2017-12-13T07:41:31.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\u003eIn this problem you need to find the 5th and 95th percentiles of a Poisson distribution defined by parameter\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\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 (the mean rate 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:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eWhat follows is just a longer introduction to the concepts, including two examples.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSay that you manage the inventory of a business for which orders\u003c/w:t\u003e\u003c/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\u003eon average\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e come in at a known rate (daily, say), but for any given period the number of orders can be somewhat above or somewhat below the expected value. If it helps your motivation, you can imagine you're running a stall selling vegan sausages, or in booth handing out free beer, or at a barbecue serving pancakes, ....\u003c/w:t\u003e\u003c/w:r\u003e\u003c/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 variable of interest, N, is the number of customers/orders within a given period — one day, let's say. The average rate multiplied by the period of interest yields the mean of the distribution (in this problem), which is the 'expected value', or average.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/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 this problem, N follows a\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.britannica.com/topic/Poisson-distribution\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePoisson distribution\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e : N ~ Poisson(μ). So there is no influence of any external factors (weather, trends, etc.). The only parameter having a deterministic effect is μ.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThen the probability of having k customers in a period, given the expected number of customers in that period being equal to μ, is given by: Pr(N=k) = μ^k × exp(−μ) / k!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/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 caret (^) represents the power operator, and the exclamation mark (!) represents the factorial operation.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/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 μ and k are given, it is therefore straightforward to compute the probability, Pr(N=k), using the above formula.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHowever, in this problem you will be given μ, representing the mean ('expected') daily rate, and you thereby need to determine\u003c/w:t\u003e\u003c/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\u003etwo\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e values of k:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/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\u003elower\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e limit on the number of customers, k, for which a lower demand will not be faced more than 5% of the time\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\u003eAn\u003c/w:t\u003e\u003c/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\u003eupper\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e limit on the number of customers, k, that will not be exceeded more than 5% of the time\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHence, you will be sure that, in the long run, the number of customers you see each day will not often (no more than 10% of the time) be outside the range specified by the above two limits.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/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[% Input\\nmu = 10\\n% Output\\nlowerLimit = 4\\nupperLimit = 15\\nsafeLimits = [lowerLimit upperLimit]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNote that the outputs shall be integers, because there is no physical meaning to 'half a customer'.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/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:\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\\nmu = 100\\n% Output\\nlowerLimit = 83\\nupperLimit = 117\\nsafeLimits = [lowerLimit upperLimit]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNOTE: the two limits are returned as the vector safeLimits, as shown.\u003c/w:t\u003e\u003c/w:r\u003e\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: Toolbox functions are generally not available from within Cody.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"term":"tag:\"poisson distribution\"","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:\"poisson distribution\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"poisson distribution\"","","\"","poisson distribution","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f41e778ff20\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f41e778fe80\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f41e778f5c0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f41e7730200\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f41e7730160\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f41e77300c0\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f41e7730020\u003e":"tag:\"poisson distribution\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f41e7730020\u003e":"tag:\"poisson distribution\""},"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:\"poisson distribution\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"poisson distribution\"","","\"","poisson distribution","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f41e778ff20\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f41e778fe80\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f41e778f5c0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f41e7730200\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f41e7730160\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f41e77300c0\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f41e7730020\u003e":"tag:\"poisson distribution\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f41e7730020\u003e":"tag:\"poisson distribution\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":44451,"difficulty_rating":"medium"}]}}