# Counting distinguishable ways of painting a cube with 4 different colors (each used at least once)

You have many identical cube-shaped wooden blocks. You have four colors of paint to use, and you paint each face of each block a solid color so that each block has at least one face painted with each of the four colors. Find the number of distinguishable ways you could paint the blocks. (Two blocks are distinguishable if you cannot rotate one block so that it looks identical to the other block.)

Having trouble solving this problem with the added constraint of "at least one face painted with each of four colors" - Thanks in advance

Call the four colors $a$, $b$, $c$, $d$.

There are two partitions of $6$ into four parts, namely (1): $(3,1,1,1)$, and (2): $(2,2,1,1)$.

In case (1) we can choose the color appearing three times in $4$ ways. This color can either (1.1) appear on three faces sharing a vertex of the cube, or (1.2) on three faces forming a $\sqcup$-shape. In case (1.1) we can place the three other colors in $2$ ways ("clockwise" or "counterclockwise"); in case (1.2) we can choose which of the three other colors is opposite the floor of the $\sqcup$. This amounts to $4\cdot(2+3)=20$ different colorings.

In case (2) the two colors appearing only once can be chosen in ${4\choose2}=6$ ways. Assume that colors $a$ and $b$ are chosen. The $a$-face $F_a$ and the $b$-face $F_b$ can be either (2.1) opposite or (2.2) adjacent to each other. In case (2.1) we can chose the two $c$-faces either adjacent or opposite to each other. In case (2.2) the two $c$-faces can be (2.2.1) opposite to each other, (2.2.2) opposite to $F_a$ and to $F_b$, or (2.2.3) opposite to one of $F_a$ or $F_b$ and on one of the faces adjacent to both $F_a$ and $F_b$. In all this amounts to $6\cdot(2+1+1+2\cdot2_*)=48$ different colorings. (The factor $2_*$ distinguishes mirror-equivalent colorings.)

Altogether we have found $68$ different admissible colorings of the cube.

• great solution ! - I still need to work out the second scenario in detail but appears to be a valid solution. Thanks – randomwalker Apr 18 '17 at 21:15

There is an algorithmic approach to this which I include for future reference and which consists in using Burnside and Stirling numbers of the second kind. For Burnside we need the cycle index of the face permutation group of the cube. We enumerate the constituent permutations in turn. First there is the identity for a contribution of $$a_1^6.$$

Rotating about one of the four diagonals by $120$ degrees and $240$ degrees we get

$$4\times 2a_3^2.$$

Rotating about an axis passing through opposite faces by $90$ degrees and by $270$ degrees we get

$$3\times 2 a_1^2 a_4$$

and by $180$ degrees

$$3\times a_1^2 a_2^2.$$

Finally rotating about an exis passing through opposite edges yields

$$6\times a_2^3.$$

We thus get the cycle index

$$Z(G) = \frac{1}{24} (a_1^6 + 8 a_3^2 + 6 a_1^2 a_4 + 3 a_1^2 a_2^2 + 6 a_2^3).$$

As a sanity check we use this to compute the number of colorings with at most $N$ colors and obtain

$$\frac{1}{24}(N^6 + 8 N^2 + 12 N^3 + 3 N^4).$$

This gives the sequence

$$1, 10, 57, 240, 800, 2226, 5390, 11712, 23355, 43450, \ldots$$

which is OEIS A047780 which looks to be correct. Now if we are coloring with $M$ colors where all $M$ colors have to be present we must partition the cycles of the entries of the cycle index into a set partition of $M$ non-empty sets. We thus obtain

$$\frac{M!}{24} \left({6\brace M} + 8 {2\brace M} + 12 {3\brace M} + 3{4\brace M}\right).$$

This yields the finite sequence (finite because the cube can be painted with at most six different colors):

$$1, 8, 30, 68, 75, 30, 0, \ldots$$

In particular the value for four colors is $68.$ We also get $6!/24 = 30$ for six colors because all orbits have the same size.

Here's my crack at it: Starting with a stationary cube, there are $\frac{4 \cdot 3 \cdot 6!}{2 \cdot 2}$ ways of painting the cube where there are 2 colors with 2 faces, and $\frac{4 \cdot 6!}{3}$ ways of painting the cube when there is 1 color with 3 faces which gives a total of 3120 ways of painting the cube, but this over counts all the orientations of a cube, so the final answer is $\frac{3120}{4 \cdot 6} = 130$

• awright96 - Thank you for taking the time to answer the question. I understand your approach which is a good, clean approach. However the correct answer is 68. This problem appeared on a middle-school purple comet test in 2015 ( unfortunately only answers are published, no solutions) – randomwalker Apr 18 '17 at 19:31


Prove that every set and subset with the cofinite topology is compact

Prove that every set with the cofinite topology is compact as well as every subset

Solution. Let $$X$$ be a nonempty set with the cofinite topology and let $$\mathscr{U}$$ be an open cover of $$X$$. Let $$U \in \mathscr{U}$$. Then $$X\setminus U$$ is finite. For every $$a \in X\setminus U$$ let $$U_a$$ be an element of $$\mathscr{U}$$ that contains $$a$$. Then $$\{U\}\cup\{U_a : a ∈ X\setminus U\}$$ is a finite subcover of $$\mathscr{U}$$.

Now I missing the part for the subsets $$E\subseteq X$$. I don't think this refers to the relative topology, but just to any subset of $$X$$ How do I go about it?

• It of course refers to the rel topology and the proof is the same. – JCAA Jul 7 '20 at 22:10
• I thought the statement meant that any subset of X was compact with the original topology, not with the relative one – J.C.VegaO Jul 7 '20 at 22:13
• Well what does it mean to be compact with the original topology? – Severin Schraven Jul 7 '20 at 22:21
• @Severin Schraven That you can extract a finite subcover from a open cover made of open sets of the original topology, ( not made of the intersection of them with the set, like in the relative topology.) The reason I make a difference is because set that is not open in the original topology may be open in the relative. like for example in [-1,1] with the usual topology $\tau$ as a subset of $\mathbb{R}$ . $E=[-1,1 ]$ is not open in $(\mathbb{R},\tau)$ but it is in $(\mathbb{R},\tau_E)$ – J.C.VegaO Jul 7 '20 at 22:27

In the case of compactness it makes no difference whether you use the topology of $$X$$ or the relative topology on the subset.

Proposition. Let $$\langle X,\tau\rangle$$ be any space, let $$K\subseteq X$$, and let $$\tau_K$$ be the relative topology on $$K$$; then $$K$$ is compact with respect to $$\tau$$ iff it is compact with respect to $$\tau_K$$.

Proof. Suppose first that $$K$$ is compact with respect to $$\tau$$, and let $$\mathscr{U}\subseteq\tau'$$ be a $$\tau'$$-open cover of $$K$$. For each $$U\in\mathscr{U}$$ there is a $$V_U\in\tau$$ such that $$U=K\cap V_U$$. Let $$\mathscr{V}=\{V_U:U\in\mathscr{U}\}$$; clearly $$\mathscr{V}$$ is a $$\tau$$-open cover of $$K$$, so it has a finite subcover $$\{V_{U_1},\ldots,V_{U_n}\}$$. Let $$\mathscr{F}=\{U_1,\ldots,U_n\}$$; $$\mathscr{F}$$ is a finite subset of $$\mathscr{U}$$, and

$$\bigcup\mathscr{F}=\bigcup_{k=1}^nU_k=\bigcup_{k=1}^n(K\cap V_{U_k})=K\cap\bigcup_{k=1}^nU_k=K\;,$$

so $$\mathscr{F}$$ covers $$K$$. Thus, $$K$$ is compact with respect to $$\tau'$$.

Now suppose that $$K$$ is compact with respect to $$\tau'$$, and let $$\mathscr{U}\subseteq\tau$$ be a $$\tau$$-open cover of $$K$$. For each $$U\in\mathscr{U}$$ let $$V_U=K\cap U$$, and let $$\mathscr{V}=\{V_U:U\in\mathscr{U}\}$$. $$\mathscr{V}$$ is a $$\tau'$$-open cover of $$K$$, so it has a finite subcover $$\{V_{U_1},\ldots,V_{U_n}\}$$. Let $$\mathscr{F}=\{U_1,\ldots,U_n\}$$; $$\mathscr{F}$$ is a finite subset of $$\mathscr{U}$$, and

$$\bigcup\mathscr{F}=\bigcup_{k=1}^nU_k\supseteq\bigcup_{k=1}^n(K\cap U_k)=\bigcup_{k=1}^nV_{U_k}=K\;,$$

so $$\mathscr{F}$$ covers $$K$$. Thus, $$K$$ is compact with respect to $$\tau$$. $$\dashv$$

• Initially I thought that they were saying that any subset of $X$ was compact, like for example if $X=\mathbb{R}$ with the cofinite topology, then any subset like $\{1\}$ $[1,2] ,(1,2),(1,2], (1,+\infty)$ should be compact, that is not true, is it? – J.C.VegaO Jul 7 '20 at 23:43
• @J.C.VegaO: It is true. You essentially proved it in your question. – Brian M. Scott Jul 7 '20 at 23:46


# SAT Maths Question About Fractions

Whilst revising, a problem caught my eye and I cannot seem to find an answer. I am usually bad at these types of questions.

On a certain Russian-American committee, $\frac23$ of members are men, and $\frac38$ of the men are Americans. If $\frac35$ of the committee members are Russians, what fraction of the members are American women?

A. $\frac{3}{20}$ B. $\frac{11}{60}$ C. $\frac{1}{4}$ D. $\frac{2}{5}$ E. $\frac{5}{12}$

Could you please explain how to approach and analyse the problem, maybe give some hints or the complete procedure of solving?

I get a bit confused with all those fractions. What I tried was to convert them to percentages but that seemed a bad idea.

Sorry if this question is annoying.

Thank you.

Update: I solved the problem both intuitively and mathematically. Thanks.

• You've got two categories, each with two options. You can find the probabilities of being in the intersection of each of these options (e.g. Russian Women) using the proportions and conditional proportions (like how its not that 3/8 are american, but 3/8 of men are american), and your answer will be there. – Bob Krueger May 24 '15 at 13:38

Here's a more algebraic approach. We know that $\frac{2}{5}$ of the committee is American (the other $\frac{3}{5}$ is Russian), and that $\frac{2}{3}\cdot\frac{3}{8} = \frac{1}{4}$ of the committee is American men. Thus, if the proportion of American women is $x$, then, $$\frac{1}{4} + x = \frac{2}{5}$$ that is, if you add up the proportion of American men and the proportion of American women (assuming men and women are the only two categories), then you get the proportion of Americans. From here, we can solve for $x$ to get $$x = \frac{2}{5} - \frac{1}{4} = \frac{3}{20},$$ which is in agreement with abel's answer.

Let me try. We will pick a nice number for the total number of members so that every category of members come out whole numbers. We can pick the least common multiple of all the denominators of the fractions. That gives us $120.$ Of course as long as we are only interested in the ratio, it don't matter what that number is. It makes computation easier to do.

Suppose there were $120$ members. There are $80$ men and $40$ women. Of the $80$ men $30$ are American and $50$ russian. There are $72$ Russians on the committee that leave $22$ Russian women and $18$ American women on the committee. The fraction of American women on the committee is $$\frac{18}{120} = \frac3{20}.$$

Hopefully I did not make any silly arithmetic errors.

• I'd only suggest you edit to make clear why you chose 120. It may not be obvious to OP. – JoeTaxpayer May 24 '15 at 14:36

I can't improve on @abel 's excellent answer but do want to point out that it's an example of an important strategy. When you're "confused with all those fractions" and converting to percentages doesn't help (because they are just fractions) try natural frequencies - pick a number (in this case 120) that lets you count the cases.

See

http://opinionator.blogs.nytimes.com/2010/04/25/chances-are/

http://www.medicine.ox.ac.uk/bandolier/booth/glossary/freq.html

An alternative approach, very similar to @Strants's, with similar logic, but a slightly different way of looking at things:

We know that $\frac{2}{3}$ of the committee members are men and that $\frac{3}{8}$ of them are Americans.

This means that the proportion of all committee members who are American men is:

$\frac{2}{3} \times \frac{3}{8} = \frac{6}{24} = \frac{1}{4}$

We know also that $\frac{3}{5}$ of the members are Russian.

We know that there are only four types of people at the committee:

American men, Russian men, Russian women and American women.

We have found that $\frac{1}{4}$ of the members are American men and $\frac{3}{5}$ of them are Russian - i.e. Russian men and Russian women account for $\frac{3}{5}$ of the members.

Therefore, the proportion of members who are American men, Russian men, or Russian women is:

$\frac{3}{5} + \frac{1}{4} = \frac{12}{20} + \frac{5}{20} = \frac{17}{20}$

Therefore, the proportion of members who are American women is:

$1 - \frac{17}{20} = \frac{3}{20} = \text{A}$.


# We roll a six-sided die ten times. What is the probability that the total of all ten rolls is divisible by 6?

So the question is really hard I think. I tried using a simple way by calculating the probability of each combination that makes a sum divisible by six, but it would take forever. Does anyone have any ideas?

Suppose that we roll a six-sided die ten times. What is the probability that the total of all ten rolls is divisible by six?

• Almost a duplicate of this question. Using the same logic, the answer is easily seen to be $1/6$. – TonyK Nov 11 '15 at 15:33

Hint.

Roll $9$ times and let $x$ be the total.

For exactly one number $n\in\{1,2,3,4,5,6\}$ we will have $6 \mid (x+n)$ (i.e. $x+n$ is divisible by $6$).

• I didn't get it, why would I roll 9 times instead of 10? and what is 6|x? – Xlyon Nov 11 '15 at 9:38
• @Xlyon When you've rolled nine times there's always exactly one outcome for the tenth that will make the sum divisible by $6$. – skyking Nov 11 '15 at 9:43
• Thanks! that is logical. Can you please help me complete it? – Xlyon Nov 11 '15 at 10:50
• Exactly one of the faces of the die thrown at the $10$th time will result in a total sum ($x+n$) that is divisible by $6$. The probability that this face shows up is $\frac16$ (if the die is fair, of course). – drhab Nov 11 '15 at 10:54
• The value of $x$ is indeed irrelevant. Whatever value $x$ takes, it's chance to change into a number divisible by $6$ (when the last result is added by $x$) is in all cases $\frac16$. So that's indeed the answer to this question. They could have asked: take some arbitrary number $y\in\mathbb Z$ and trhrow a fair die. If $D$ denotes the outcome then what is the probability that $y+D$ is divisible by $6$? Same answer: $\frac16$, – drhab Nov 11 '15 at 11:34

After rolling the die once, there is equal probability for each result modulo 6. Adding any unrelated integer to it will preserve the equidistribution. So you can even roll a 20-sided die afterwards and add its outcome: the total sum will still have a probability of 1/6 to be divisible by 6.

• @Kevin The d20 by itself does have that unequal distribution, but the sum d20+d6 does not. It literally does not matter what _**x**_ is in determining the distribution of (_**x**_ + d6) mod 6. In fact, d20 + d6 also has exactly a 1/20 chance of being divisible by 20 by the same logic – Monty Harder Nov 11 '15 at 19:28

If you want something a little more formal and solid than drhab's clever and brilliant answer:

Let $P(k,n)$ be the probability of rolling a total with remainder $k$ when divided by $6, (k = 0...5)$ with $n$ die.

$P(k, 1)$ = Probability of rolling a $k$ if $k \ne 0$ or a $6$ if $k = 6$; $P(k, 1) = \frac 1 6$.

For $n > 1$. $P(k,n) = \sum_{k= 0}^5 P(k, n-1)\cdot \text{Probability of Rolling(6-k)} = \sum_{k= 0}^5 P(k, n-1)\cdot\frac 1 6= \frac 1 6\sum_{k= 0}^5 P(k, n-1)= \frac 1 6 \cdot 1 = \frac 1 6$

This is drhab's answer but in formal terms without appeals to common sense

• That's a way to do it. What I actually had in mind was: $P\left(6\text{ divides }S_{10}\right)=\sum_{m\in\mathbb{N}}P\left(6\text{ divides }S_{10}\mid S_{9}=m\right)P\left(S_{9}=m\right)=\sum_{m\in\mathbb{N}}\frac{1}{6}P\left(S_{9}=m\right)=\frac{1}{6}$ – drhab Nov 12 '15 at 9:40
• Yes, that is more direct. – fleablood Nov 12 '15 at 16:45

In spite of all great answers, given here, I say, why not give another proof, from another point of view. The problem is we have 10 random variables $X_i$ for $i=1,\dots,10$, defined over $[6]=\{1,\dots,6\}$, and we are interested in distribution of $Z$ defined as $$Z=X_1\oplus X_2\oplus \dots \oplus X_{10}$$ where $\oplus$ is addition modulo $6$. We can go on by two different, yet similar proofs.

First proof: If $X_1$ and $X_2$ are two random variables over $[6]$, and $X_1$ is uniformly distributed, sheer calculation can show that $X_1\oplus X_2$ is also uniformly distributed. Same logic yields that $Z$ is uniformly distributed over $[6]$.

Remark: This proves a more general problem. It says that even if only one of the dices is fair dice, i.e. each side appearing with probability $\frac 16$, the distribution of $Z$ will be uniform and hence $\mathbb P(Z=0)=\frac 16$.

Second proof: This proof draws on (simple) information theoretic tools and assumes its background. The random variable $Z$ is output of an additive noisy channel and it is known that the worst case is uniformly distributed noise. In other word if $X_i$ is uniform for only one $i$, $Z$ will be uniform. To see this, suppose that $X_1$ is uniformly distributed. Then consider the following mutual information $I(X_2,X_3,\dots,X_6;Z)$ which can be written as $H(Z)-H(Z|X_2,\dots,X_6)$. But we have: $$H(Z|X_2,\dots,X_6)=H(X_1|X_2,\dots,X_6)=H(X_1)$$
where the first equality is resulted from the fact that knowing $X_2,\dots,X_6$ the only uncertainty in $Z$ is due to $X_1$. The second equality is because $X_1$ is independent of others. Know see that:

• Mutual information is positive: $H(Z)\geq H(X_1)$
• Entropy of $Z$ is always less that or equal to the entropy of uniformly distributed random variable over $[6]$: $H(Z)\leq H(X_1)$
• From the last two $H(Z)=H(X_1)$ and $Z$ is uniformly distributed and the proof is complete.

Similarly here, only one fair dice is enough. Moreover the same proof can be used for an arbitrary set $[n]$. As long as one of the $X_i$'s is uniform, then their finite sum modulo $n$ will be uniformly distributed.

There are 3 variables in this case:

• the number of sides of the dice: s (e.g. 6)
• the number of throws: t (e.g. 10)
• the requesed multiple: x (e.g. 6)

In this case, the conditions are simple:

• s>=x
• x >0
• t > 0

And also the answer is simple: Throwing a sum that is a multiple of 6 has a 1/6 probability.

$P(s,t,x) = 1/x$

For situations where s<x this is not entirely correct. It approaches the same result though, at a high amount of throws. Example: If you throw a 6-sided dice 30 times the chance that the sum is a multiple of 20 will be about 5%. Proving this is a bit of a challenge.

$\lim \limits_{t \to \infty} P(s,t,x) = 1/x$,

Nevertheless, if programming is an acceptable proof:

public static void main(String[] args) {
int t_throws = 10;
int s_sides = 6;
int x_multiple = 6;
int[] diceCurrentValues = new int[t_throws];
for (int i = 0; i < diceCurrentValues.length; i++) diceCurrentValues[i] = 1;

int combinations = 0;
int matches = 0;
for (; ; ) {
// calculate the sum of the current combination
int sum = 0;
for (int diceValue : diceCurrentValues) sum += diceValue;

combinations++;
if (sum % x_multiple == 0) matches++;
System.out.println("status: " + matches + "/" + combinations + "=" + (matches * 100 / (double) combinations) + "%");

// create the next dice combination
int dicePointer = 0;
boolean incremented = false;
while (!incremented) {
if (dicePointer == diceCurrentValues.length) return;
if (diceCurrentValues[dicePointer] == s_sides) {
diceCurrentValues[dicePointer] = 1;
dicePointer++;
} else {
diceCurrentValues[dicePointer]++;
incremented = true;
}
}
}
}

# EDIT:

Here's another example. If you throw a 6-sided dice 10 times, there is 1/4 probability that the sum is a multiple of 4. The program above should run with the following parameters:

    int t_throws = 10;
int s_sides = 6;
int x_multiple = 4;

The program will show the final output: status: 15116544/60466176=25.0% That means that there are 60466176 combinations (i.e. 6^10) and that there are 15116544 of them where the sum is a multiple of 4. So, that's 25% (=1/4).

This just follows the formula as mentioned above (i.e. P(s,t,x) = 1/x). x is 4 in this case.

• "Assuming that t converges to infinity. This is also the case when s<x." This sounds nonsensical. – djechlin Nov 11 '15 at 17:43
• Excuse me for my poor English :) The thing is, if you apply this for values greater than the number of sides of your dice. (e.g. multiples of 10 with a 6 sided dice.) then P = 1/x is no longer correct. But it does converge 1/x ; meaning that if you would throw an infinit amount of times, the result would be 1/x again. – bvdb Nov 12 '15 at 0:10
• I made some slight adjustments. Let me know what you think. – bvdb Nov 12 '15 at 0:22
• It's not the case that the limiting factor is if s>=x. Consider the probability that 10 rolls of a six-sided dice divides 4. (Of course the limit still converges when the number of dices increases) – Taemyr Nov 12 '15 at 8:40
• @Taemyr for 10 roles with a 6-sided dice, there are 60466176 combinations, of which 15116544 have a sum which is a multiple of 4. That's exactly 25% which is exactly 1/4. So, it's correct, right ? – bvdb Nov 14 '15 at 15:51

Roll the die 9 times and add up the dots. The answer is x. Roll the die one more time. add the number thrown to x to get one and only one of the following answers; x+1, x+2, x+3, x+4, x+5 or x+6. since these answers are six sequential numbers one and only one of them will be divisible by six. Therefore the probability of the sum of ten rolls of a die being divisible by six is exactly 1/6.

Couldn't you also think of it as the maximum possible value you could get for rolling the die 10 times would be 60, how many numbers between 1 and 60 are divisible by 6? 10 numbers are divisible by 6(6*1, 2, 3, etc.) So, 10 out of 60 possible values gives... 1/6. I love math.

• True, but some numbers appear multiple times. So, even though your answer is correct, your logic is flawed. – bvdb Nov 11 '15 at 11:58
• The minimum possible value is 10. So only 9 of 51 values are divisible by 6. But not all numbers are equally probable. – Cephalopod Nov 11 '15 at 11:58
• The numbers are not distributed evenly. – fleablood Nov 11 '15 at 20:31


# Yet Another Question On Using Basics Limit Arithmetics

Is this claim true?

Given $\lim \limits_{n\to \infty}\ a_n=\frac{1}{2}$ Then $\lim \limits_{n\to \infty}\ (a_n - [a_n])=\frac{1}{2}$

I think it's true, but probably I just didn't find the right example to disprove it.

Thanks a lot.

-
What do you mean by $[a_{n}]$? –  Isaac Solomon Apr 1 '12 at 18:14
it's the round integer –  Anonymous Apr 1 '12 at 18:17
Round up or down? –  Isaac Solomon Apr 1 '12 at 18:17
If you mean nearest integer, then the claim is correct, so you will not find an example to disprove it. Are you looking for a formal argument? –  André Nicolas Apr 1 '12 at 18:20
It's round donwn or truncate. And yes, @André Nicolas, I'm looking for a formal argument, thanks a lot. –  Anonymous Apr 1 '12 at 18:21

Since

$$\lim_{n \to \infty} a_{n} = \frac{1}{2}$$

there exists $N$ such that for all $n \geq N$,

$$|a_{n} - \frac{1}{2}| < \frac{1}{4}$$

Then, for $n \geq N$, we have

$$0 \leq a_{n} \leq 1 \Longrightarrow [a_{n}] = 0$$

so that for $n \geq N$,

$$a_{n} - [a_{n}] = a_{n}$$

Now pick $\epsilon > 0$. Suppose that for all $n > M_{\epsilon}$

$$|a_{n} - \frac{1}{2}| < \epsilon$$

Replacing $M_{\epsilon}$ with $\mbox{max}(M_{\epsilon},N)$, we have

$$|(a_{n} - [a_{n}]) - \frac{1}{2} | = |a_{n} - \frac{1}{2}| < \epsilon$$

which proves that

$$\lim_{n \to \infty} (a_{n} - [a_{n}]) = \frac{1}{2}$$

-
I'm reading the proof and I'm at the line: "Now pick $\epsilon > 0$. Suppose that for all $n > M_{\epsilon}$ - what is $M_{\epsilon}$? –  Anonymous Apr 1 '12 at 18:43
$M_{\epsilon}$ is just some sufficiently large natural number. I write $\epsilon$ in the subscript to indicate that this $M$ is a function of $\epsilon$. –  Isaac Solomon Apr 1 '12 at 19:29

It depends on what you mean by the symbol $[x]$. If $[x]$ is the floor of $x$ (i.e., the greatest integer less than or equal to $x$), then the limit will be $\frac{1}{2}$. This follows from $\lim \limits_{n\to \infty}\ a_n=\frac{1}{2}$: there exists an $N$ such that for every $n \geq N$, $|a_n - \frac{1}{2}| < \frac{1}{2}$. For these $a_n$, it follows that $[a_n] = 0$, and so $$\lim \limits_{n\to \infty}\ a_n - [a_n] =\frac{1}{2} - 0 = \frac{1}{2}$$

On the other hand, if $[x]$ is the nearest integer to $x$, then the limit does not exist: consider the sequence $a = (0.4,0.6,0.49,0.51,0.499,0.501,\ldots)$. Clearly $a_n \rightarrow \frac{1}{2}$, but $[a_n]$ alternates between $0$ and $1$.

-
Thanks, I'm talking about the first case where $[x]$ is the floor of $x$. Could you please explain why it follows that $[a_n] = 0$? –  Anonymous Apr 1 '12 at 18:32
Essentially, the $a_n$ are getting closer and closer to $\frac{1}{2}$; after a while (for $n \geq N$), all the $a_n$ will be between $0$ and $1$. The floor of a number in this interval is $0$. –  Théophile Apr 1 '12 at 18:39
@Théophile: Yes, I was careless in my comment, which has been deleted. I meant the distance to the nearest integer. –  André Nicolas Apr 1 '12 at 18:56

We want to show that for any $\epsilon>0$, there is an $N$ such that if $n>N$, then $|(a_n-\lfloor a_n\rfloor)-\frac{1}{2}|<\epsilon$. Here by $\lfloor w\rfloor$ we mean the greatest integer which is $\le w$.

Let $\epsilon'=\min(\epsilon,1/4)$. By the fact that $\lim_{n\to\infty} a_n=\frac{1}{2}$, there is an $N$ such that if $n>N$ then $|a_n-\frac{1}{2}|<\epsilon'$. In particular, $|a_n-\frac{1}{2}|<\frac{1}{4}$, and therefore $\lfloor a_n\rfloor=0$. It follows that if $n>N$ then $$\left|(a_n-\lfloor a_n\rfloor)-\frac{1}{2}\right|=\left|a_n-\frac{1}{2}\right|<\epsilon.$$

-
you wrote: $\left|(x_n-\lfloor x_n\rfloor)-\frac{1}{2}\right|=\left|x_n-\frac{1}{2}\right|<\epsilon$. But actually I know that $\left|(x_n-\lfloor x_n\rfloor)-\frac{1}{2}\right|=\left|x_n-\frac{1}{2}\right|<\epsilon'$, no? why can I make the switch from $\epsilon'$ to $\epsilon$? at least not for that n, maybe we need to add $n_1$? –  Anonymous Apr 1 '12 at 19:04
The number we are "challenged with" is $\epsilon$. If $\epsilon$ is ridiculous, like $5$, then we can't say that $\lfloor x_n\rfloor=0$. Specifying that $\epsilon'=\min(1/4,\epsilon)$ makes sure $\lfloor x_n\rfloor=0$. It also makes sure (since $\epsilon' \le \epsilon$) that from $|x_n-\frac{1}{2}|<\epsilon'$, we can conclude that $|x_n-\frac{1}{2}|<\epsilon$. More informally, we could forget about $\epsilon'$, and say that the argument will only work if $\epsilon$ is reasonably small, but that's good enough. –  André Nicolas Apr 1 '12 at 19:16
Thanks, I used the max between the n you gave me and the $n_1$ I have from the definition of limit, therefore safe to any $\epsilon$. –  Anonymous Apr 1 '12 at 19:23
@Anonymous: It is just a technical trick. It can be replaced by taking $N$ simultaneously large enough to make $|a_n-1/2|<1/4$ (anything under $1/2$ is OK) and large enough to make $|a_n-1/2|<\epsilon$. –  André Nicolas Apr 1 '12 at 19:27


.

.

.

.

.

HealthyNumerics

HealthPoliticsEconomics | Quant Analytics | Numerics

Basic Stats 02: A mechanical approach to the Bayesian rule

Intro

The Bayesian rule

$$P(A \mid B) = \frac{P(B \mid A) \cdot P(A)}{P(B)}$$

seems to be a rather abstract formula. But this impression can be corrected easely when considering a simple practical application. We call this approach mechanical because for this type of application there is no philosphical dispute between frequentist's and bayesian's mind set. We will just use in a mechanical/algorithmical manner the cells of a matrix. In this section we

• formulate a prototype of a probability problem (with red and green balls that have letters A and B printed on)
• summarize the problem in a basically 2x2 matrix (called contingency table)
• use the frequencies first
• replace them by probalities afterwards and recognize what conditional probablities are
• recognize that applying the Bayesian formula is nothing else than walking from one side of the matrix to the other side

A prototype of a probability problem

Given:

• 19 balls
• 14 balls are red, 5 balls are green
• among the 14 red balls, 4 have a A printed on, 10 have a B printed on
• among the 5 green balls, 1 has a A printed on, 4 have a B printed on

Typical questions: - we take 1 ball. - What is the probabilitiy that it is green ? - What is the probabilitiy that it is B under the precondition it's green ?

We will use Pandas to represent the problem and the solutions

import matplotlib.pyplot as plt
from IPython.core.pylabtools import figsize
import numpy as np
import pandas as pd
pd.set_option('precision', 3)

Contingency table with the frequencies

The core of the representation is a 2x2 matrix that summarizes the situation of the balls with the colors and the letters on. This matrix is expanded with the margins that contain the sums. - sum L stands for the sum of the letters - sum C stands for the sum of the colors

columns = np.array(['A', 'B'])
index   = np.array(['red', 'green'])
data    = np.array([[4,10],[1,4]])

df = pd.DataFrame(data=data, index=index, columns=columns)
df['sumC'] = df.sum(axis=1)  # append the sums of the rows
df.loc['sumL']= df.sum()     # append the sums of the columns
df

A B sumC
red 4 10 14
green 1 4 5
sumL 5 14 19

Append the relative contributions of B and of green

We expand the matrix by a further column and a further row and use them to compute relative frequencies (see below).

def highlight_cells(x):
df = x.copy()
df.loc[:,:] = ''
df.iloc[1,1] = 'background-color: #53ff1a'
df.iloc[1,3] = 'background-color: lightgreen'
df.iloc[3,1] = 'background-color: lightblue'
return df

df[r'B/sumC']         = df.values[:,1]/df.values[:,2]
df.loc[r'green/sumL'] = df.values[1,:]/df.values[2,:]

t = df.style.apply(highlight_cells, axis=None)
t

A B sumC B/sumC
red 4 10 14 0.714
green 1 4 5 0.8
sumL 5 14 19 0.737
green/sumL 0.2 0.286 0.263 1.09

Let's focus on the row with the green balls

From all green balls (= 5) is the portion of those with a letter B (=4) 0.8

$$\frac{green\: balls\: with \:B}{all\: green\: balls} = \frac{4}{5} = 0.8$$

Note that this value already corresponds to the conditional probality $$P(B \mid green)$$

Let's focus on the column with the balls with letter B

From all balls with letter B (= 14) is the portion of those that are green (=4) 0.286

$$\frac{green\; balls\; with\; B}{all\; balls\; with\; letter\; B} = \frac{4}{14} = 0.286$$

Note that also this value already corresponds to the conditional probality $$P(green \mid B)$$

Contingency table with the probabilities

We find the probabilities by dividing the frequencies by the sum of balls.

columns = np.array(['A', 'B'])
index   = np.array(['red', 'green'])
data    = np.array([[4,10],[1,4]])
data    = data/np.sum(data)

df = pd.DataFrame(data=data, index=index, columns=columns)
df['sumC'] = df.sum(axis=1)  # append the sums of the rows
df.loc['sumL']= df.sum()     # append the sums of the columns
df

A B sumC
red 0.211 0.526 0.737
green 0.053 0.211 0.263
sumL 0.263 0.737 1.000

Append the relative contributions of B and of green

df[r'B/sumC']         = df.values[:,1]/df.values[:,2]
df.loc[r'green/sumL'] = df.values[1,:]/df.values[2,:]
t = df.style.apply(highlight_cells, axis=None)
t

A B sumC B/sumC
red 0.211 0.526 0.737 0.714
green 0.0526 0.211 0.263 0.8
sumL 0.263 0.737 1 0.737
green/sumL 0.2 0.286 0.263 1.09

Note the formula in the cells

columns = np.array(['-----------A----------', '---------B----------', '----------sumC--------',  '--------B/sumC--------'])
index   = np.array(['red', 'green', 'sumL',  'green/sumL'])
data    = np.array([['...','...','...','...'],
['...', '$P(B \cap green)$', '$P(green)$', '$P(B \mid green)$'],
['...','$P(B)$','...','...'],
['...','$P(green \mid B)$','...','...'] ])
df = pd.DataFrame(data=data, index=index, columns=columns)
t = df.style.apply(highlight_cells, axis=None)
t

-----------A---------- ---------B---------- ----------sumC-------- --------B/sumC--------
red ... ... ... ...
green ... $$P(B \cap green)$$ $$P(green)$$ $$P(B \mid green)$$
sumL ... $$P(B)$$ ... ...
green/sumL ... $$P(green \mid B)$$ ... ...

Conditional probability: Let's focus on the row with the green balls

The probability to get a ball with B out of all green balls is 0.8

$$P(B \mid green) = \frac{P(green\: balls\: with \:B)}{P(all\: green\: balls)} = \frac{P(green \cap B)}{P(green)} = \frac{0.211}{0.263} = 0.8$$

Conditional probability: Let's focus on the column with the balls with letter B

The probability to get a green ball out of all balls with a B is 0.286

$$P(green \mid B) = \frac{P(green\; balls\; with\; B)}{P(all\; balls\; with\; letter\; B)} = \frac{P(green \cap B)}{P(B)} = \frac{0.211}{0.737} = 0.286$$

Bayes rule

Given $$P(green \mid B$$) find $$P(B \mid green)$$ :

$$P(B \mid green) = \frac{P(green \mid B) \cdot P(B)}{P(green)} = \frac{0.286 \cdot 0.737}{0.263} = \frac{0.211}{0.263}= 0.8$$

and given $$P(B \mid green)$$ find $$P(green \mid B$$):

$$P(green \mid B) = \frac{P(B \mid green) \cdot P(green)}{P(B)} = \frac{0.8 \cdot 0.263}{0.737} = \frac{0.211}{0.737} = 0.286$$

Applying the Bayes rule means that we walk from the element most right in the matrix to the element at the bottom of the matrix and vice versa:

show_frequencies()

def show_frequencies():
px = 4; py = 4

figsize(10, 10)
fontSize1 = 15
fontSize2 = 12
fontSize3 = 20

A1 = 4;     A2 = 10;       A3 = A1+A2
B1 = 1;     B2 =  4;       B3 = B1+B2
C1 = A1+B1; C2 = A2+B2;   C3 = A3+B3

data = np.array([[A1, A2, A3],
[B1, B2, B3],
[C1, C2, C3] ])

clr     = np.array([ ['#ffc2b3', '#ff704d', '#ff0000'],
['#b3ff99', '#53ff1a', '#208000'],
['#00bfff', '#0000ff', '#bf00ff']   ])

title  = np.array([['A and red', 'B and red', 'sum of reds',
'$P(B|red) = \\frac {P(A\\cap red)}{P(red)}$'           ],
['A and green', 'B and green', 'sum greens',   '% (B of greens)'     ],
['sum of A', 'sum of B', 'sum of all balls',' '        ],
[' ', '% (greens of B)', '',  ' '     ],
]  )

xlabel = np.array([ ['A', 'B', 'A+B', 'B/(A+B)'],
['A', 'B', 'A+B', 'B/(A+B)'],
['A red + A green', 'B red + B green', 'A+B', 'B/(A+B)'],
['A', 'B green/(B red + B green)', 'A+B', 'B/(A+B)']       ]  )

ylabel = np.array([ ['red',   'red',   'red',  'B of reds'],
['green', 'green', 'green','B of greens'],
['sum A', 'sum B', 'Total', '' ],
['green', 'greens of B', 'green', ' '],    ])

f, ax = plt.subplots(px, py, sharex=True, sharey=True, edgecolor='none')  #, facecolor='lightgrey'

for i in range(px-1):
for j in range(py-1):

patches, texts =ax[i,j].pie([data[i,j]], labels=[str(data[i,j])], #autopct='%1.1f%%',
colors = [clr[i,j]])
texts[0].set_fontsize(fontSize3)
ax[i,j].set_title(title[i,j], position=(0.5,1.2), bbox=dict(facecolor='#f2f2f2', edgecolor='none'), fontsize= fontSize1)
if i*j==1 :
ax[i,j].set_title(title[i,j], position=(0.5,1.2), bbox=dict(facecolor='#bfbfbf', edgecolor='none'), fontsize=fontSize1)

ax[i,j].set_xlabel(xlabel[i,j], fontsize=fontSize2, color='c')
ax[i,j].xaxis.set_label_position('top')

ax[i,j].set_ylabel(ylabel[i,j], fontsize=fontSize2, color='c')

ax[i,j].axis('equal')

j += 1
if (i == 1):
p = data[i,-2]/data[i,-1]; o = p/(1-p)
patches, texts =ax[i,j].pie([o,1], #autopct='%1.1f%%',
colors = [clr[i,1], clr[i,2] ] )
texts[0].set_fontsize(fontSize3)
ax[i,j].set_title(title[i,j], position=(0.5,1.2), bbox=dict(facecolor='#bfbfbf', edgecolor='none'), fontsize=fontSize1)
ax[i,j].set_xlabel(xlabel[i,j], color='c', fontsize=fontSize2)
ax[i,j].xaxis.set_label_position('top')
ax[i,j].set_ylabel(ylabel[i,j], fontsize=fontSize2, color='c')
ax[i,j].axis('equal')
else:
ax[i,j].plot(0,0)
ax[i,j].set_frame_on(False)

i = px-1;
for j in range(py):
if j==1:
p = data[1,1]/data[2,1]; o = p/(1-p)
patches, texts =ax[i,j].pie([o,1], #autopct='%1.1f%%',
colors = [clr[1,1], clr[2,1] ])
texts[0].set_fontsize(fontSize3)
ax[i,j].set_title(title[i,j], position=(0.5,1.2), bbox=dict(facecolor='#bfbfbf', edgecolor='none'), fontsize=fontSize1)

ax[i,j].set_xlabel(xlabel[i,j], color='c', fontsize=fontSize2)
ax[i,j].xaxis.set_label_position('top')
ax[i,j].set_ylabel(ylabel[i,j], fontsize=fontSize2, color='c')
ax[i,j].axis('equal')
ax[i,j].set_facecolor('y')
else:
ax[i,j].plot(0,0)
ax[i,j].set_frame_on(False)

plt.tight_layout()
plt.show()

from IPython.display import HTML

# HTML('''<script> $('div .input').hide()''') #lässt die input-zellen verschwinden HTML('''<script> code_show=true; function code_toggle() { if (code_show){$('div.input').hide();
} else {
$('div.input').show(); } code_show = !code_show }$( document ).ready(code_toggle);
</script>


# Permutations : hard question !

1. Feb 6, 2013

### hms.tech

1. The problem statement, all variables and given/known data

In how many ways can the three letters from the word " GREEN " be arranged in a row if atleast one of the letters is "E"

2. Relevant equations

Permutations Formula

3. The attempt at a solution

The total arrangements without restriction: 5P3/2! = $\frac{5!}{2! * 2!}$

The number of arrangements in which there is no "E" = 3!

Ans : 5P3/2! - 3! = 24 (wrong)

Here is another approach :

The arrangements with just one "E" = $\frac{2!*4!}{2!}$
The arrangements with two "E" = $\frac{3*2}{1}$

I think I making a mistake due to the repetition of "E" ... Can any one of you tell me a better way which avoids the problem I am being having .

2. Feb 6, 2013

### HallsofIvy

If "at least one letter must be E", that means that the other two letters must be chosen from "GREN". That is, the first letter must be one of those 4 letters, the second one of the three remaining letters. How many is that?

But then we can put the "E" that we took out into any of three places: before the two, between them, or after the two letters so we need 3 times that previous number.

3. Feb 6, 2013

### hms.tech

4P2 = 4*3

According to your method the answer should be 12 * 3 = 36 (The correct answer in the solutions is "27")

Clearly your method (as did mine) repeats some of the permutations :

You didn't take onto account that the two "E" are not distinct. Thus in those permutations where we chose two "E" were repeated. see :
GEE , EEG, EGE
ENE, EEN, NEE
REE, ERE , EER

4. Feb 6, 2013

### CAF123

Alternatively, split the problem into two: Count those combinations with only 1 E and then count separately those with two E's.

For one E combination: (1C1)*(3C2)*3! = 18
For two E combination: (2C2)*(3C1)*(3!/2!) = 9. Then add.


# Toronto Math Forum

## MAT334-2018F => MAT334--Lectures & Home Assignments => Topic started by: Ende Jin on September 08, 2018, 03:39:53 PM

Title: About the definition of Argument (in book)
Post by: Ende Jin on September 08, 2018, 03:39:53 PM
I found that the definition of "arg" and "Arg" in the book is different from that introduced in the lecture (exactly opposite) (on page 7).
I remember in the lecture, the "arg" is the one always lies in $(-\pi, \pi]$
Which one should I use?
Title: Re: About the definition of Argument (in book)
Post by: Victor Ivrii on September 08, 2018, 04:58:09 PM
Quote
Which one should I use?
This is a good and tricky question because the answer is nuanced:
Solving problems, use definition as in the Textbook, unless the problem under consideration requires modification: for example, if we are restricted to the right half-plane  $\{z\colon \Re z >0\}$ then it is reasonable to consider $\arg z\in (-\pi/2,\pi/2)$, but if we are restricted to the upper half-plane  $\{z\colon \Im z >0\}$ then it is reasonable to consider $\arg z\in (0,\pi)$ and so on.
Title: Re: About the definition of Argument (in book)
Post by: Ende Jin on September 09, 2018, 12:48:34 PM
I am still confused. Let me rephrase the question again.
In the textbook, the definition of "arg" and "Arg" are:
$arg(z) = \theta \Leftrightarrow \frac{z}{|z|} = cos\theta + isin\theta$
which means $arg(z) \in \mathbb{R}$
while
$Arg(z) = \theta \Leftrightarrow \frac{z}{|z|} = cos\theta + isin\theta \land \theta \in [-\pi, \pi)$
which means $Arg(z) \in [-\pi, \pi)$

While in the lecture, as you have introduced, it is the opposite and the range changes to $(-\pi, \pi]$ instead of $[-\pi, \pi)$ (unless I remember incorrectly):
Arg is defined to be
$Arg(z) = \theta \Leftrightarrow \frac{z}{|z|} = (cos\theta + isin\theta)$
which means $arg(z) \in \mathbb{R}$
while arg is
$arg(z) = \theta \Leftrightarrow \frac{z}{|z|} = cos\theta + isin\theta \land \theta \in (-\pi, \pi]$

I am confused because if I am using the definition by the book,
when $z \in \{z : Re (z) > 0\}$
then $arg(z) \in (-\frac{\pi}{2} + 2\pi n,\frac{\pi}{2} + 2\pi n), n \in \mathbb{Z}$
Title: Re: About the definition of Argument (in book)
Post by: Victor Ivrii on September 09, 2018, 04:40:38 PM

BTW, you need to write \sin t and \cos t and so on to have them displayed properly (upright and with a space after): $\sin t$, $\cos t$ and so on
Title: Re: About the definition of Argument (in book)
Post by: Ende Jin on September 10, 2018, 10:03:33 AM
Thus in a test/quiz/exam, I should follow the convention of the textbook, right?
Title: Re: About the definition of Argument (in book)
Post by: Victor Ivrii on September 10, 2018, 01:34:22 PM
Thus in a test/quiz/exam, I should follow the convention of the textbook, right?
Indeed
Title: Re: About the definition of Argument (in book)
Post by: oighea on September 12, 2018, 04:24:46 PM
The $\arg$ of a complex number $z$ is an angle $\theta$. All angles $\theta$ have an infinite number of "equivalent" angles, namely $\theta =2k\pi$ for any integer $k$.

Equivalent angles can be characterized by that they exactly overlap when graphed on a graph paper, relative to the $0^\circ$ mark (usually the positive $x$-axis). Or more mathematically, they have the same sine and cosine. It also makes sine and cosine a non-reversible function, as given a sine or cosine, there are an infinite number of angles that satisfy this property.

$\Arg$, on the other hand, reduces the range of the possible angles such that it always lie between $0$ (inclusive) to $2\pi$ (exclusive). That is because one revolution is $2\pi$, or $360$ degrees. That is called the principal argument of a complex number.

We will later discover that complex logarithm also have a similar phenomenon.
Title: Re: About the definition of Argument (in book)
Post by: Victor Ivrii on September 12, 2018, 04:34:21 PM
oighea

Please fix your screen name and use LaTeX command (rendered by MathJax) to display math, not paltry html commands.
I fixed it in this post


# Math Help - Equation problem and others...

1. ## Equation problem and others...

Could any1 help me a bit with this equation ?
1) X1+X2+X3=11 , So how many are the solutions?

2) We 've got these letters -> A,B,C,D,E,F,G,H , how many permutations
of these letters can we make that include ABC ?

3) How many ways are possible in order 3 girls and 8 boys sit in a row so that Mary and John NOT to sit next to each other ?

4) I can understand at all what this question wants, but anyway ill ask here maybe you can understand ...

How many bytes exist with 1) Exactly 2 aces
2) Exactly 4 aces
3) Exactly 6 aces
4) At least 6 aces

i dont get it , a byte consists of 8 bits, whats that ace? any ideas?

Thanks in advance for your help =)

2. Hi primeimplicant,
where are you getting stuck with these?

For 1)

$X_1,\ X_2, X_3$ probably need to be positive integers >0.

Are any of the numbers allowed to be zero?

If they are allowed to be negative or non-integers, that leaves infinitely
many solutions.
-14+1+2, -15+1+3 etc

Hence, start with 1, add 2 and find out what $X_3$ is.
Then start again at 1, add 3 and find out what $X_3$ is.

When finished with 1, go on to 2 and make sure you leave out all numbers
less than 2.
Then go on to 3, leaving out all numbers less than 3.
Continue until done, there are only a few.

3. Originally Posted by primeimplicant
[snip]
4) I can understand at all what this question wants, but anyway ill ask here maybe you can understand ...

How many bytes exist with 1) Exactly 2 aces
2) Exactly 4 aces
3) Exactly 6 aces
4) At least 6 aces

i dont get it , a byte consists of 8 bits, whats that ace? any ideas?

Thanks in advance for your help =)
My guess is that an "ace" is a 1 bit, although this is unusual terminology I have not seen before. If my guess is correct then 1) is asking you how many 8-bit sequences there are which consist of two 1's and six 0's.

4. Hello, primeimplicant!

$1)\;x_1+x_2+x_3\:=\:11$
So how many are the solutions?
The problem is NOT clearly stated.
I must assume that the $x$'s are positive integers.

Consider an 11-inch board marked in 1-inch intervals.

. . $\square\square\square\square\square\square
\square\square\square\square\square$

We will cut the board at two of the ten marks.

Then: . $\square\square\square\square\square |
\square\square | \square\square\square\square$
.represents: . $5+2+4$

And:- - $\square \square \square | \square \square \square \square \square \square \square | \square$ .represents: . $3 + 7 + 1$

Therefore, there are: . $_{10}C_2 \:=\:45$ solutions.

2) We 've got these letters: . $A,B,C,D,E,F,G,H$
How many permutations of these letters can we make that include $ABC$ ?
I assume you mean in that exact order: $ABC$

Duct-tape $ABC$ together.

Then we have 6 "letters" to arrange: . $\boxed{ABC}\;D\;E\;F\;G\;H$

There are: . $6! \,=\,720$ permutations.

3) How many ways are possible in order 3 girls and 8 boys sit in a row
so that Mary and John do NOT sit next to each other?
With no restrictions, the children can be seated in: $11!$ ways.

Suppose Mary and John DO sit together.
Duct-tape them together.

Then we have 10 "people" to arrange: . $\boxed{MJ}\;A\;B\;C\;D\;E\;F\;G\;H\;I$
. . They can be seated in: $10!$ ways.

But Mary and John could be taped like this: . $\boxed{JM}$
. . This makes for another $10!$ ways.

So there are: $2(10!)$ ways that Mary and John DO sit together.

Therefore, there are: . $11! - 2(10!) \:=\:39,916,800 - 2(3,628,800) \:=\:32,659,200$ ways
. . that Mary and John do NOT sit together.

5. Thanks a lot Soroban , awesome, i totally understood!!

6. Hi Primeimplicant,

For Q1...

that was fabulous work by Soroban!!
He's an artist at breaking long calculations into neat compact solutions.
Here's just a bit i wanted to add.

For your Q1, i interpreted it as....

how many different additions of 3 unequal positive non-zero integers sum to 11.

Hence, i recommended you try

1+2+(11-3)=11, which is 1+2+8=11

then 1+3+(11-4)=1+3+7,
1+4+6=11,
1+5+5...but this contains 2 fives.

Starting with 2,
2+3+6,
2+4+5,
2+5+4 is the same as 2+4+5 so move on to 3,
3+4+4 has two fours, so that's out.

3+5+3 out
3+6+2 is ok
3+7+1 counted

start with 4
4+5+2 has been found already as has 4+6+1

The list then is

1+2+8
1+3+7
1+4+6
2+3+6
2+4+5
3+6+2

If you meant that

$X_1,\ X_2, X_3$ could be variables that can have any value
from 1 to 9, since 1+1+9=11, so 9 is the largest positive integer useable,

then we have, starting with 1
1+1+9
1+2+8
1+3+7
1+4+6
1+5+5

Since any variable can be any of these values, these can be arranged in 3! ways, therefore there are 5(3!) = 30 combinations with the digit 1,
with 119 and 191 and 911 all double-counted, along with 155, 515, 551 double-counted, so we subtract 6.
30-6 =24.

starting with 2, not containing 1
2+2+7
2+3+6
2+4+5

these can also be arranged in (2)3!+3!/2! ways to give 12+3=15 additional combinations.

starting with 3, not containing 1 or 2

3+3+5
3+4+4
3+5+3 has been counted
3+6+2 has 2 in it

so there are 2 new ones which can be arranged in (2)3!/2! ways to account for
each of the 3 variables having those values.
this is another 3! combinations =6.

starting with 4, not containing 1, 2 or 3.

4+4+3 is out so we have found them all as there are no further combinations due to the fact that we will need smaller digits for the sum.

Hence the total is 24+15+6=45

This is the total for this interpretation of the question.

If the variables must have different values, then we must subtract the three with the repeated digit 1, the three with the repeated digit 2, the three with the repeated digit 3, the three with the repeated digit 4, and the three with the repeated digit 5,
getting 45-15=30 with all 3 digits different,
in other words.... combinations of the digits, where the digits are selections of 3 from the 8 available in that case, in such a way that they sum to 11.

Looking at Soroban's analysis in another way

*****|*|*****

The red lines can move 4 places left and 4 places right, giving an additional 8 solutions to the 1 shown....8+1=9 solutions containing the digit 1.

****|**|*****

The red lines can move 3 places left and 4 places right,
giving 7+1=8 solutions containing the digit 2.

****|***|****

The red lines can move 3 places left and 3 places right giving 6+1=7 solutions with the digit 3.

Continuing that we get 9+8+7+6+5+4+3+2+1=45 solutions containing repeated digits.


# RD Sharma Solutions Class 7 Data Handling Iv Probability Exercise 25.1

## RD Sharma Solutions Class 7 Chapter 25 Exercise 25.1

### RD Sharma Class 7 Solutions Chapter 25 Ex 25.1 PDF Free Download

#### Exercise 25.1

Q 1.A coin is tossed 1000 times with the following frequencies:

Head : 445, Tail : 555

When a coin is tossed at random, what is the probability of getting

(ii).a tail?

SOLUTION:

Total number of times a coin is tossed = 1000

Number of times a head comes up = 445

Number of times a tail comes up = 555

(i) Probability of getting a head = $\frac{No.\;of\;heads}{Total\;No.\;of\;trails}$ = $\frac{445}{1000}$=0.445

(ii) Probability of getting a tail = $\frac{No.\;of\;tails}{Total\;No.\;of\;trails}$ = $\frac{555}{1000}$ = 0.555

Q 2.A die is thrown 100 times and outcomes are noted as given below:

If a die is thrown at random, find the probability of getting a/an:

(i) 3 (ii) 5 (iii) 4 (iv) Even number (v) Odd number (vi) Number less than 3.

SOLUTION:

Total number of trials = 100

Number of times “1” comes up = 21

Number of times “2” comes up = 9

Number of times “3” comes up = 14

Number of times “4” comes up = 23

Number of times “5” comes up = 18

Number of times “6” comes up = 15

(i) Probability of getting 3 = $\frac{Frequency\;of\;3}{Total\;No.\;of\;trails}$ = $\frac{14}{100}$ = 0.14

(ii) Probability of getting 5 = $\frac{Frequency\;of\;5}{Total\;No.\;of\;trails}$ = $\frac{18}{100}$ = 0.18

(iii) Probability of getting 4 = $\frac{Frequency\;of\;4}{Total\;No.\;of\;trails}$ = $\frac{23}{100}$ = 0.23

(iv) Frequency of getting an even no. = Frequency of 2 + Frequency of 4 + Frequency of 6 = 9 + 23 + 15 = 47

Probability of getting an even no. = $\frac{Frequency\;of\;even\;number}{Total\;No.\;of\;trails}$ = $\frac{47}{100}$ = 0.47

(v) Frequency of getting an odd no. = Frequency of 1 + Frequency of 3 + Frequency of 5 = 21 + 14 + 18 = 53

Probability of getting an odd no. = $\frac{Frequency\;of\;odd\;number}{Total\;No.\;of\;trails}$ = $\frac{53}{100}$ = 0.53

(vi) Frequency of getting a no. less than 3 = Frequency of 1 + Frequency of 2 = 21 + 9 = 30

Probability of getting a no. less than 3 = $\frac{Frequency\;of\;number\;less\;than\;3}{Total\;No.\;of\;trails}$ = $\frac{30}{100}$ = 0.30

Q 3.A box contains two pair of socks of two colours (black and white). I have picked out a white sock. I pick out one more with my eyes closed. What is the probability that I will make a pair?

SOLUTION:

No. of socks in the box = 4

Let B and W denote black and white socks respectively. Then we have:

S = {B,B,W,W}

If a white sock is picked out, then the total no. of socks left in the box = 3

No. of white socks left = 2 – 1 = 1

Probability of getting a white sock = $\frac{no.\;of\;white\;socks\;left\;in\;the\;box}{total\;no.\;of\;socks\;left\;in\;the\;box}$ = $\frac{1}{3}$

Q 4.Two coins are tossed simultaneously 500 times and the outcomes are noted as given below:

If same pair of coins is tossed at random, find the probability of getting:

SOLUTION:

Number of trials = 500

Number of outcomes of two heads (HH) = 105

Number of outcomes of one head (HT or TH) = 275

Number of outcomes of no head (TT) = 120

(i) Probability of getting two heads = $\frac{Frequency\;of\;getting\;2\;heads}{Total\;No.\;of\;trails}$ = $\frac{105}{500}$ = $\frac{21}{100}$

(ii) Probability of getting one head = $\frac{Frequency\;of\;getting\;1\;heads}{Total\;No.\;of\;trails}$ = $\frac{275}{500}$ = $\frac{11}{20}$

(iii) Probability of getting no head = $\frac{Frequency\;of\;getting\;no\;heads}{Total\;No.\;of\;trails}$ = $\frac{120}{500}$ = $\frac{6}{25}$

#### Practise This Question

The lines shown below never meet at any point. So, these lines are not parallel. Say true or false.