{"id":125,"date":"2020-01-30T05:49:55","date_gmt":"2020-01-30T05:49:55","guid":{"rendered":"http:\/\/mathfun4kids.com\/mlog\/?p=125"},"modified":"2020-10-16T15:20:24","modified_gmt":"2020-10-16T15:20:24","slug":"mathcounts-exercises-18","status":"publish","type":"post","link":"https:\/\/mathfun4kids.com\/mlog\/?p=125","title":{"rendered":"MATHCOUNTS Exercises &#8211; 18"},"content":{"rendered":"\n<p>How many 4-digit integers between 1000 and 9999 have their digits in non-decreasing order, such as 3447?\n<a onclick=\"toggle_visibility(&quot;mathcounts-exercises-18-sol&quot;);\"\/>Click here for solutions.<\/a><\/p>\n<div id=\"mathcounts-exercises-18-sol\" style=\"display:none\">\n<p><strong>Solution 1 &#8211; Brute Force<\/strong> Denote $f(m, n)$ as the number of $m$-digit\nintegers with their digits in non-decreasing order and the first digit value as $n$, where $0\\le n\\le 9$.\nWe have the following relation: $$ \\begin{array}{rcl}\nf(1,\\ n)&amp;=&amp;1 \\\\\nf(m,9)&amp;=&amp;1 \\\\\nf(m, n)&amp;=&amp;f(m-1, 9) + &#8230; + f(m-1, n+1) + f(m-1, n)\\\\\n&amp;=&amp;f(m, n+1) + f(m-1, n)\n\\end{array} $$\nThen we have the following table $$ \\begin{array}{c|rrrrrrrrrr}<br>\nf(m,n)&amp; &amp; &amp; &amp; &amp; n &amp; &amp; &amp; &amp; &amp; \\\\ \\hline<br>\nm &amp; 9 &amp; 8 &amp; 7 &amp; 6 &amp; 5 &amp; 4 &amp; 3 &amp; 2 &amp; 1 &amp; 0 \\\\ \\hline<br>\n1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 \\\\<br>\n2 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &amp; 7 &amp; 8 &amp; 9 &amp; 10 \\\\<br>\n3 &amp; 1 &amp; 3 &amp; 6 &amp; 10 &amp; 15 &amp; 21 &amp; 28 &amp; 36 &amp; 45 &amp; 55 \\\\<br>\n4 &amp; 1 &amp; 4 &amp; 10 &amp; 20 &amp; 35 &amp; 56 &amp; 84 &amp; 120 &amp; 165 &amp; 220 \\\\<br>\n5 &amp; 1 &amp; 5 &amp; 15 &amp; 35 &amp; 70 &amp; 126 &amp; 210 &amp; 330 &amp; 495 &amp; 715 \\\\<br>\n\\hline\n\\end{array} $$\n<\/p><p>\nThe answer to the question is equivalent to $f(5, 1)=495$, i.e. number of 5-digit integers with their digits in non-decreasing order and the first digit as $1$.\n<br>\n<strong>Note<\/strong> Do you notice the Pascal&#8217;s triangle in the above table?<\/p>\n<p><strong>Solution 2 &#8211; Use <a href=\"https:\/\/en.wikipedia.org\/wiki\/Stars_and_bars_(combinatorics)\" target=\"_blank\" rel=\"noopener noreferrer\">Stars and Bars Theorem<\/a><\/strong>\nThis problem can be translated into inserting 4 identical balls in the boxes after 9 ordered digits as the following,\nwhere the number of balls in a box indicates the number of consecutive occurrences of the proceeding digit in forming a 4-digit number:\n$$\\fbox{1}\\Box{ }\\fbox{2}\\Box\\fbox{3}\\Box{ }\\fbox{4}\\Box{ }\\fbox{5}\\Box{ }\\fbox{6}\\Box{ }\\fbox{7}\\Box{ }\\fbox{8}\\Box{ }\\fbox{9}\\Box{ }$$\nFor example, 3447 will have 1 ball in the box after 3, 2 balls in the box after 4, and 1 ball in the box after 7 in the above figure.\nTherefore, using the <a href=\"https:\/\/artofproblemsolving.com\/wiki\/index.php\/Ball-and-urn\" target=\"_blank\" rel=\"noopener noreferrer\">formula<\/a>, the answer to the\nquestion is\n$$ {n+k-1\\choose n} = {4+9-1 \\choose 4} = {12 \\choose 4} = \\dfrac{12\\times 11\\times 10\\times 9}{4\\times 3\\times 2\\times 1} = 495$$\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>How many 4-digit integers between 1000 and 9999 have their digits in non-decreasing order, such as 3447? Click here for solutions. Solution 1 &#8211; Brute Force Denote $f(m, n)$ as the number of $m$-digit integers with their digits in non-decreasing &hellip; <a href=\"https:\/\/mathfun4kids.com\/mlog\/?p=125\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false},"categories":[10,11],"tags":[],"_links":{"self":[{"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=\/wp\/v2\/posts\/125"}],"collection":[{"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=125"}],"version-history":[{"count":5,"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=\/wp\/v2\/posts\/125\/revisions"}],"predecessor-version":[{"id":1748,"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=\/wp\/v2\/posts\/125\/revisions\/1748"}],"wp:attachment":[{"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}