# Math Question, not for HW

**URL:** <https://boards.straightdope.com/t/math-question-not-for-hw/628411>\
**Category:** Factual Questions\
**Created:** [July 16, 2012, 2:24pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411 "2012-07-16T14:24:18Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![pancakes3](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@pancakes3](https://boards.straightdope.com/u/pancakes3)\
**Post date:** [July 17, 2012, 1:25am UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/21 "2012-07-17T01:25:38Z")

</div>

thanks guys (factorial)

---

<div class="post-metadata">

**Author:** ![pancakes3](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@pancakes3](https://boards.straightdope.com/u/pancakes3)\
**Post date:** [July 18, 2012, 2:39pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/22 "2012-07-18T14:39:51Z")

</div>

Got another one. These are practice mathcounts question that a friend’s daughter of mine is trying and when he doesn’t get it, he forwards it to me, and I am now forwarding to this forum.

The digits 1-9 are each used once to form a positive 9-digit integer. There are 362880 possible integers like this. How many of them have the digits 1, 2, and 3 in order from least to greatest throughout the integer? One such example is 451,728,936

(so the 1-2-3 doesn’t have to go in order.)

---

<div class="post-metadata">

**Author:** ![Frylock](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@Frylock](https://boards.straightdope.com/u/Frylock)\
**Post date:** [July 18, 2012, 3:04pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/23 "2012-07-18T15:04:00Z")

</div>

> [@pancakes3](#):
>
> Got another one. These are practice mathcounts question that a friend’s daughter of mine is trying and when he doesn’t get it, he forwards it to me, and I am now forwarding to this forum.
> 
> The digits 1-9 are each used once to form a positive 9-digit integer. There are 362880 possible integers like this. How many of them have the digits 1, 2, and 3 in order from least to greatest throughout the integer? One such example is 451,728,936
> 
> (so the 1-2-3 doesn’t have to go in order.)

You just need to figure out how many items are in the following list:

123…  
12.3…  
12..3…  
.  
.  
.  
1..2…3.  
1..2…3  
1…23…  
.  
.  
.  
.  
…1..23  
…123.  
…12.3  
…1.23  
…123

No time now to count it up but I imagine conceptualizing the problem that way should make the math more obvious.

---

<div class="post-metadata">

**Author:** ![Frylock](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@Frylock](https://boards.straightdope.com/u/Frylock)\
**Post date:** [July 18, 2012, 3:06pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/24 "2012-07-18T15:06:56Z")

</div>

nvm

---

<div class="post-metadata">

**Author:** ![TriPolar](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tripolar/32/3008_2.png) [@TriPolar](https://boards.straightdope.com/u/TriPolar)\
**Post date:** [July 18, 2012, 3:07pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/25 "2012-07-18T15:07:34Z")

</div>

Ok, I wrote all the numbers down on a piece of paper, then used 3 different colored highlighters for the digits 1, 2, and 3, with the colors red, green, and blue. Then I counted up the ones that an RGB pattern in them and got 60480. I may not have done this carefully, so I’ll try it again to check.

---

<div class="post-metadata">

**Author:** ![Frylock](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@Frylock](https://boards.straightdope.com/u/Frylock)\
**Post date:** [July 18, 2012, 3:10pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/26 "2012-07-18T15:10:00Z")

</div>

> [@TriPolar](#):
>
> Ok, I wrote all the numbers down on a piece of paper, then used 3 different colored highlighters for the digits 1, 2, and 3, with the colors red, green, and blue. Then I counted up the ones that an RGB pattern in them and got 60480. I may not have done this carefully, so I’ll try it again to check.

😃

---

<div class="post-metadata">

**Author:** ![Frylock](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@Frylock](https://boards.straightdope.com/u/Frylock)\
**Post date:** [July 18, 2012, 3:11pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/27 "2012-07-18T15:11:03Z")

</div>

Never mind what I posted above: I completely misread the problem.

---

<div class="post-metadata">

**Author:** ![TriPolar](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tripolar/32/3008_2.png) [@TriPolar](https://boards.straightdope.com/u/TriPolar)\
**Post date:** [July 18, 2012, 3:11pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/28 "2012-07-18T15:11:17Z")

</div>

Yep, recounted, 60480 is it.

---

<div class="post-metadata">

**Author:** ![Great\_Antibob](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Great\_Antibob](https://boards.straightdope.com/u/Great_Antibob)\
**Post date:** [July 18, 2012, 3:12pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/29 "2012-07-18T15:12:22Z")

</div>

Here’s how to work that problem in a more formal way.

There are 9 “positions”. There are C(9,3) = 84 ways to choose which positions the 1, 2, 3 go in.

This is the simple way to compute what **Frylock** was trying to do by hand.

\*Note: equivalently, you can choose which positions the other 6 numbers go in, or C(9,6) = 84, which works out to the same.

For the other 6 numbers, there are 6! = 720 permutations. For example, if the first three numbers are 123, there are 720 ways to arrange the remaining 6 numbers:

```
123456789
123456798
123987654
etc 

```

So, there are a total of C(9,3)_6! = 84_720 = 60,480 such integers, which matches what **TriPolar** got by hand.

---

<div class="post-metadata">

**Author:** ![Frylock](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@Frylock](https://boards.straightdope.com/u/Frylock)\
**Post date:** [July 18, 2012, 3:12pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/30 "2012-07-18T15:12:48Z")

</div>

> [@Frylock](#):
>
> You just need to figure out how many items are in the following list:
> 
> 123…  
> 12.3…  
> 12..3…  
> .  
> .  
> .  
> 1..2…3.  
> 1..2…3  
> 1…23…  
> .  
> .  
> .  
> .  
> …1..23  
> …123.  
> …12.3  
> …1.23  
> …123
> 
> No time now to count it up but I imagine conceptualizing the problem that way should make the math more obvious.

To correct the above, you take the number of items on the implied list I gave, and multiply it by the number of possible combinations of six digits in six spaces.

---

<div class="post-metadata">

**Author:** ![pancakes3](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@pancakes3](https://boards.straightdope.com/u/pancakes3)\
**Post date:** [July 18, 2012, 3:29pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/31 "2012-07-18T15:29:38Z")

</div>

> [@Great\_Antibob](#):
>
> Here’s how to work that problem in a more formal way.
> 
> There are 9 “positions”. There are C(9,3) = 84 ways to choose which positions the 1, 2, 3 go in.
> 
> This is the simple way to compute what **Frylock** was trying to do by hand.
> 
> \*Note: equivalently, you can choose which positions the other 6 numbers go in, or C(9,6) = 84, which works out to the same.
> 
> For the other 6 numbers, there are 6! = 720 permutations. For example, if the first three numbers are 123, there are 720 ways to arrange the remaining 6 numbers:
> 
> ```
> 123456789
> 123456798
> 123987654
> etc 
> 
> ```
> 
> So, there are a total of C(9,3)_6! = 84_720 = 60,480 such integers, which matches what **TriPolar** got by hand.

doesn’t 9C3 method just give the exact combinations where 1-2-3 are in a row?

---

<div class="post-metadata">

**Author:** ![TriPolar](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tripolar/32/3008_2.png) [@TriPolar](https://boards.straightdope.com/u/TriPolar)\
**Post date:** [July 18, 2012, 3:33pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/32 "2012-07-18T15:33:53Z")

</div>

> [@pancakes3](#):
>
> doesn’t 9C3 method just give the exact combinations where 1-2-3 are in a row?

I don’t know, but he got the same total I did, which included all that had the sequence 1-2-3 going left to right, including numbers like 516283794.

ETA: I assumed you weren’t counting rotations like 345678912.

---

<div class="post-metadata">

**Author:** ![jpei](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@jpei](https://boards.straightdope.com/u/jpei)\
**Post date:** [July 18, 2012, 3:34pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/33 "2012-07-18T15:34:05Z")

</div>

Here’s another way to get the same answer:

Let us call this set of 9-digit integers with the digits 1-9 used once, the set X.

Ignoring all other digits, there’s nothing special about the digits 1, 2, and 3 being in ascending order. They could just as easily be in the order 1, 3, and 2, or 2, 1, and 3.

We can imagine dividing this set X into:  
{The subset with 1,2,3 being in the order 123}  
{The subset with 1,2,3 being in the order 132}  
{The subset with 1,2,3 being in the order 213}  
{The subset with 1,2,3 being in the order 231}  
{The subset with 1,2,3 being in the order 312}  
{The subset with 1,2,3 being in the order 321}

One may check that each number in X belongs to exactly one of these subsets.

Given no further restrictions, one may conclude that by symmetry, these sets are of equal size. The problem statement gives the size of X as 362880, so there are 362880/3! = 60480 such numbers having the digits 1, 2, and 3 in order.

---

<div class="post-metadata">

**Author:** ![Great\_Antibob](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Great\_Antibob](https://boards.straightdope.com/u/Great_Antibob)\
**Post date:** [July 18, 2012, 3:34pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/34 "2012-07-18T15:34:29Z")

</div>

> [@pancakes3](#):
>
> doesn’t 9C3 method just give the exact combinations where 1-2-3 are in a row?

No, it’s the number of different positions you can choose for the numbers.

Let’s say you have 9 “positions”

* * *

How many ways can you choose 3 of these positions for 1-2-3? The answer is 9C3.

You can always verify it by counting them by hand:

1 2 3 \_ \_ \_ \_ \_ \_  
1 \_ 2 3 \_ \_ \_ \_ \_  
1 \_ \_ 2 3 \_ \_ \_ \_  
etc

There are 9C3 = 84 of these.

As I noted, you can equivalently use 9C6, which is the number of ways of choosing which positions 1-2-3 are NOT in.

After you have that, 6! is the number of combinations for the rest, i.e. after the positions of 1-2-3 are decided.

For example, if you have \_ \_ 1 \_ 2 \_ \_ 3 \_, then there are 6! = 720 ways to arrange the other 6 digits in the blanks.

---

<div class="post-metadata">

**Author:** ![Great\_Antibob](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Great\_Antibob](https://boards.straightdope.com/u/Great_Antibob)\
**Post date:** [July 18, 2012, 3:47pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/35 "2012-07-18T15:47:43Z")

</div>

By the way, another way to check the 9C3 is ok is by allowing permutations of 1-2-3.

So, if you allowed 3-2-1, 1-2-3, 1-3-2, etc, we’d have 9P3, instead.

Including the other 6 digits, the total number of integers would be:

```
9P3 * 6!, which works out to (9!/6!)*6! = 9!

```

So, the calculation using 9C3 is consistent with allowing permutations of all 9 digits without constraint.

This is the same thing that **jpei** noted but from the other direction.

---

<div class="post-metadata">

**Author:** ![TriPolar](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tripolar/32/3008_2.png) [@TriPolar](https://boards.straightdope.com/u/TriPolar)\
**Post date:** [July 18, 2012, 3:51pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/36 "2012-07-18T15:51:14Z")

</div>

Ok, so if you want to count rotations, I just looked for all combinations of RGB, BRG, and GBR. There are 181440 of those.

I just realized I didn’t have write down ALL the numbers, just the integers between 123456789 and 987654321. It was really hard writing down those irrational numbers, and you don’t even use them.

---

<div class="post-metadata">

**Author:** ![Jas09](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@Jas09](https://boards.straightdope.com/u/Jas09)\
**Post date:** [July 18, 2012, 5:02pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/37 "2012-07-18T17:02:19Z")

</div>

Props to **jpei** (I did it the longer way) - that’s very elegant and exactly the sort of thing MathCounts would applaud.

---

<div class="post-metadata">

**Author:** ![TriPolar](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tripolar/32/3008_2.png) [@TriPolar](https://boards.straightdope.com/u/TriPolar)\
**Post date:** [July 18, 2012, 5:17pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/38 "2012-07-18T17:17:34Z")

</div>

> [@TriPolar](#):
>
> Ok, so if you want to count rotations, I just looked for all combinations of RGB, BRG, and GBR. There are 181440 of those.

> [@Jas09](#):
>
> Props to **jpei** (I did it the longer way) - that’s very elegant and exactly the sort of thing MathCounts would applaud.

Yes, look at that! 3\*60480=181440. That would have been way easier.

---

<div class="post-metadata">

**Author:** ![pancakes3](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@pancakes3](https://boards.straightdope.com/u/pancakes3)\
**Post date:** [July 19, 2012, 3:01pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/39 "2012-07-19T15:01:18Z")

</div>

Twofer:

1. What is the largest value of n for which 213! is divisible by (7!)^n

2. Let N be any 3-digit integer which has none of its digits equal to zero. Let M be the 3-digit integer formed by reversing the order of N’s digits. What is the greatest integer that is always a factor of the positive difference of N and M. (is it 0?)

---

<div class="post-metadata">

**Author:** ![truthSeeker2](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@truthSeeker2](https://boards.straightdope.com/u/truthSeeker2)\
**Post date:** [July 19, 2012, 3:07pm UTC](https://boards.straightdope.com/t/math-question-not-for-hw/628411/40 "2012-07-19T15:07:58Z")

</div>

> [@pancakes3](#):
>
> Twofer:
> 
> 1. What is the largest value of n for which 213! is divisible by (7!)^n
> 
> 2. Let N be any 3-digit integer which has none of its digits equal to zero. Let M be the 3-digit integer formed by reversing the order of N’s digits. What is the greatest integer that is always a factor of the positive difference of N and M. (is it 0?)

1. 

Since 7 is the largest prime number from 1 to 7. Count all the factors of 7 from 1 to 213 for the answer:  
Answer = 213/7 + 213/49 = 34

[Previous page](https://boards.straightdope.com/t/math-question-not-for-hw/628411.md?page=1)

[Next page](https://boards.straightdope.com/t/math-question-not-for-hw/628411.md?page=3)
