+0  
 
0
140
4
avatar

1. A number is called swappy if it is not a palindrome, but swapping two of its digits produces a six-digit palindrome. For example, the number 813381 is swappy, because we can swap the last two digits to get 813318, which is a palindrome.

How many swappy six-digit numbers are there?

 

2. A bag contains 4 red marbles, 5 yellow marbles, and 6 blue marbles. Three marbles are to be picked out randomly (without replacement). What is the probability that exactly two of them have the same color?

 

3. How many subsets of the set {1, 2, ..., 11} have median 6?

 

4. There are 5 computers. For each pair of computers, a coin is flipped. If it is heads, then a link is built between the computers; if it is tails, there's no link between the two. Every message that a computer receives is automatically sent to every computer to which it is linked. Find the probability that every computer is able to receive messages from every other computer.

 Feb 9, 2020
 #1
avatar
0

1 -      a=1;b=0;c=0;d=0;e=0;f=1;p=0; cycle:n= a*100000+b*10000+c*1000+d*100+e*10+f;if(n<1000000 and a==e and b==f and e!=f and c==d, goto loop, goto next); loop:printn," ",;p=p+1; next:f++;if(f<10, goto cycle, 0);f=1;e++;if(e<10, goto cycle, 0);f=1;e=0;d++;if(d<10, goto cycle,0);f=1;e=0;d=0;c++;if(c<10, goto cycle,0);f=1;e=0;d=0;c=0;b++;if(b<10, goto cycle,0);f=1;e=0;d=0;c=0;b=0;a++;if(a<10, goto cycle,0);print"Total = ",p

 

OUTPUT = 720 "swappy" numbers, such as: 325532,  359935,  412241, 537753.....If you swap the last 2 digits, you get a palindrome. 

 Feb 9, 2020
 #4
avatar
0

Geno3141: In the above code, I deliberately eliminated the numbers that were already palindromes. If I include them I get EXACTLY the same number as yours, or 810.

Guest Feb 9, 2020
 #2
avatar+18875 
0

Question #1:  According to the other answer, there are 720 swappy six-digit numbers; however, I got 810. Where did I go wrong?

 

My way:  If you start with this list:

     10 xx 10     11 xx 11     12 xx 12     13 xx 13     14 xx 14      ...     97 xx 97     98 xx 98     99 xx 99

There will be 90 in this list and each will be a palindrome if you switch the last two digits.

However, 9 of them are already palindromes:  11 xx 11     22 xx 22     ...     88 xx 88     99 xx 99.

So, removing them, there will be only 81 in the list.

 

Now, for each of the 81 in the list, there are 10 ways to replace the "xx"; for example:

     47 00 47     47 11 47     47 22 47     ...     47 88 47     47 99 47.

 

Multiplying 81 x 10, I get 810.

 

What mistake did I make?

 Feb 9, 2020
 #3
avatar+18875 
0

Question #2:  There are 4 red, 5 yellow and 6 blue, for a total of 15.

                      There are  15C to choose 3 marbles from 15.

 

To get 2 red, 1 yellow, 0 blue:  4C2 x 5C1 x 6C0

To get 2 red, 0 yellow, 1 blue:  4C2 x 5C0 x 6C1 

To get 1 red, 2 yellow, 0 blue:  4C1 x 5C2 x 6C

To get 0 red, 2 yellow, 1 blue:  4C0 x 5C2 x 6C1​ ​ 

To get 1 red, 0 yellow, 2 blue:  4C1 x 5C0 x 6C2

To get 0 red, 1 yellow, 2 blue:  4C0 x 5C1 x 6C2

 

Add all the individual possibilities for red, yellow, and blue, and divide by the total number possible.(​ ​ 15C).

 Feb 9, 2020

16 Online Users