+0

# Counting Question

0
84
15

1. How many integers from 1 to 2018 inclusive have a base three representation that contains at least one digit 2?

2. Consider a cube on a table with each of the faces painted a different color. Suppose you were to pick up the cube, turn it around, then return it to its original position with the same colors permuted. Of the ways to reposition the cube, in how many cases does no color occupy its original position?

Feb 2, 2020
edited by Guest  Feb 2, 2020

#1
0

1 -  I counted 448 such numbers.

Feb 2, 2020
#2
0

1- I count 1891 numbers which have at least 1 two.

Feb 2, 2020
#3
0

excuse me why does this just happen to be a question in the aops homework? In high school math contest? Problems 3 and 4?

Feb 2, 2020
#4
0

1. I count 1165 numbers.

Feb 2, 2020
#5
+2

;i=0;x=0;c=0;m=b;a=b[0];

cycle: s=(b[i]%10);if(s==2, c=c+1, 0);b[i]=int(b[i]/10);if(b[i]!=0, goto cycle,0);

if(c>=1,goto end, goto next);end:printm[i],", ",;x=x+1;

next:c=0;i++;if(i< count b, goto cycle, discard=0;print"Total =", x

OUTPUT: 1891

Feb 3, 2020
#6
+107414
+2

I found 127 dont have a 2 which means that 1891 do have a 2.

Prob =  1891/ 2018

Feb 3, 2020
#7
0

2. There are 12 ways to reposition the cube.

Feb 3, 2020
#8
-1

Just so you know thats incorrect.

Guest Feb 4, 2020
#11
+107414
0

How do you know?  You should justify such a claim.

Melody  Feb 5, 2020
#9
+1840
+1

Solution for #2:

$${}$$

Solve this using the derangement formula:

$$!n = \left [\dfrac{n!}{e} \right] \qquad | \qquad \text { where [ ] is the nearest integer, and (e) is Euler’s Number ~(2.71828...).} \\$$

In combinatorial mathematics, a derangement is a permutation of the elements of a set, such that no element appears in its original position. In other words, a derangement is a permutation that has no fixed points. Source: https://en.wikipedia.org/wiki/Derangement

$$!6 = \left [\dfrac{6!}{e} \right] = 265 \; \text {sets where no color occupies its original position.}\\$$

GA

Feb 5, 2020
#10
+107414
0

Maybe Ginger but I am not convinced.

Melody  Feb 5, 2020
#12
+1840
0

You may be right. I may reconsider my answer.  This question seems to lack clarity and precision.

Suppose you were to pick up the cube, turn it around, then return it to its original position with the same colors permuted. Of the ways to reposition the cube, in how many cases does no color occupy its original position?

I interpret: “return it to its original position with the same colors permuted” to mean any color may be swapped with any other color. If so, then the derangement formula is correct.

However, if it means the colors may only be swapped by rotating the cube then the full set of permutations are not attainable, only the permutations relative to it orientation in space.  The portion of derangements will be reduced but they probably will not be a(n) (integer) factor of (e).

GA

GingerAle  Feb 5, 2020
#13
+107414
0

Sorry Ginger, I did not even realise there WAS a question 2.