# There are 4 cups of liquid. Three are water and one is poison. If you were to drink 3 of the 4 cups, what is the probability of being poisoned?

In Season 5 Episode 16 of Agents of Shield, one of the characters decides to prove she can't die by pouring three glasses of water and one of poison; she then randomly drinks three of the four cups. I was wondering how to compute the probability of her drinking the one with poison.

I thought to label the four cups $\alpha, \beta, \gamma, \delta$ with events

• $A = \{\alpha \text{ is water}\}, \ a = \{\alpha \text{ is poison}\}$
• $B = \{\beta \text{ is water}\},\ b = \{\beta \text{ is poison}\}$
• $C = \{\gamma \text{ is water}\},\ c = \{\gamma \text{ is poison}\}$
• $D = \{\delta \text{ is water}\},\ d = \{\delta \text{ is poison}\}$

If she were to drink in order, then I would calculate $P(a) = {1}/{4}$. Next $$P(b|A) = \frac{P(A|b)P(b)}{P(A)}$$ Next $P(c|A \cap B)$, which I'm not completely sure how to calculate.

My doubt is that I shouldn't order the cups because that assumes $\delta$ is the poisoned cup. I am also unsure how I would calculate the conditional probabilities (I know about Bayes theorem, I mean more what numbers to put in the particular case). Thank you for you help.

• Comments are not for extended discussion; this conversation has been moved to chat. – Jyrki Lahtonen May 16 '18 at 5:01
• You need to provide a little more information to actually answer this question correctly. Is the poison fast acting? If the poison is fast-acting, then being available to drink the third cup is added information that the first two cups were not poison. – jerrylagrou May 17 '18 at 16:27
• Possible duplicate of Probability of being poisoned – Xander Henderson May 17 '18 at 19:12
• @EricTowers not to mention the inference from Murphy's Law, which tells you that the probability is 1. – Michael Kay May 18 '18 at 7:13
• As someone really bad at math, gonna ask a dumb question here: Why is the probability not just 75%? – john doe May 19 '18 at 13:41

NicNic8 has provided a nice intuitive answer to the question.

Here are three alternative methods. In the first, we solve the problem directly by considering which cups are selected if she is poisoned. In the second, we solve the problem indirectly by considering the order in which the cups are selected if she is not poisoned. In the third, we add the probabilities that she was poisoned with the first cup, second cup, or third cup.

Method 1: We use the hypergeometric distribution.

There are $\binom{4}{3}$ ways to select three of the four cups. Of these, the person selecting the cups is poisoned if she selects the poisoned cup and two of the three cups of water, which can be done in $\binom{1}{1}\binom{3}{2}$ ways. Hence, the probability that she is poisoned is $$\Pr(\text{poisoned}) = \frac{\binom{1}{1}\binom{3}{2}}{\binom{4}{3}} = \frac{1 \cdot 3}{4} = \frac{3}{4}$$

Method 2: We subtract the probability that she is not poisoned from $1$.

The probability that the first cup she selects is not poisoned is $3/4$ since three of the four cups do not contain poison. If the first cup she selects is not poisoned, the probability that the second cup she selects is not poisoned is $2/3$ since two of the three remaining cups do not contain poison. If both of the first two cups she selects are not poisoned, the probability that the third cup she selects is also not poisoned is $1/2$ since one of the two remaining cups is not poisoned. Hence, the probability that she is not poisoned if she drinks three of the four cups is $$\Pr(\text{not poisoned}) = \frac{3}{4} \cdot \frac{2}{3} \cdot \frac{1}{2} = \frac{1}{4}$$ Hence, the probability that she is poisoned is $$\Pr(\text{poisoned}) = 1 - \Pr(\text{not poisoned}) = 1 - \frac{1}{4} = \frac{3}{4}$$

Addendum: We can relate this method to the first method by using the hypergeometric distribution.

She is not poisoned if she selects all three cups which do not contain poison when selecting three of the four cups. Hence, the probability that she is not poisoned is $$\Pr(\text{not poisoned}) = \frac{\dbinom{3}{3}}{\dbinom{4}{3}} = \frac{1}{4}$$ so the probability she is poisoned is $$\Pr(\text{poisoned}) = 1 - \frac{\dbinom{3}{3}}{\dbinom{4}{3}} = 1 - \frac{1}{4} = \frac{3}{4}$$

Method 3: We calculate the probability that the person is poisoned by adding the probabilities that she is poisoned with the first cup, the second cup, and the third cup.

Let $P_k$ denote the event that she is poisoned with the $k$th cup.

Since there are four cups, of which just one contains poison, the probability that she is poisoned with her first cup is $$\Pr(P_1) = \frac{1}{4}$$

To be poisoned with the second cup, she must not have been poisoned with the first cup and then be poisoned with the second cup. The probability that she is not poisoned with the first cup is $\Pr(P_1^C) = 1 - 1/4 = 3/4$. If she is not poisoned with the first cup, there are three cups remaining of which one is poisoned, so the probability that she is poisoned with the second cup if she is not poisoned with the first is $\Pr(P_2 \mid P_1^C) = 1/3$. Hence, the probability that she is poisoned with the second cup is $$\Pr(P_2) = \Pr(P_2 \mid P_1^C)\Pr(P_1) = \frac{3}{4} \cdot \frac{1}{3} = \frac{1}{4}$$

To be poisoned with the third cup, she must not have been poisoned with the first two cups and then be poisoned with the third cup. The probability that she is not poisoned with the first cup is $\Pr(P_1^C) = 3/4$. The probability that she is not poisoned with the second cup given that she was not poisoned with the first is $\Pr(P_2^C \mid P_1^C) = 1 - \Pr(P_2 \mid P_1^C) = 1 - 1/3 = 2/3$. If neither of the first two cups she drank was poisoned, two cups are left, one of which is poisoned, so the probability that the third cup she drinks is poisoned given that the first two were not is $\Pr(P_3 \mid P_1^C \cap P_2^C) = 1/2$. Hence, the probability that she is poisoned with the third cup is $$\Pr(P_3) = \Pr(P_3 \mid P_1^C \cap P_2^C)\Pr(P_2^C \mid P_1^C)\Pr(P_1^C) = \frac{1}{2} \cdot \frac{2}{3} \cdot \frac{3}{4} = \frac{1}{4}$$ Hence, the probability that she is poisoned is $$\Pr(\text{poisoned}) = \Pr(P_1) + \Pr(P_2) + \Pr(P_3) = \frac{1}{4} + \frac{1}{4} + \frac{1}{4} = \frac{3}{4}$$

• I was attempting to use Method 3 (which you've shown is the most tedious). Thank you for your very detailed answer, it helped me view the problem in different ways and understand it more clearly. Thank you. – Eli May 14 '18 at 13:37
• To be honest, Methods 1 and 3 seem like a distraction from Method 2, the only really reasonable way of calculating this. – jwg May 16 '18 at 8:51
• Both of the other methods are eminently reasonable. – Matthew Read May 17 '18 at 3:37
• Why is it that in method 3 it is necessary to include the probability that the preceding cups were not poisoned, but in method 2 the preceding cups are not necessary? Subtleties like that are what make probability both difficult and fascinating IMHO. – Jim W says reinstate Monica May 17 '18 at 20:43
• @JimW In method 2, the probability that the preceding cups were not poisoned is taken into account. The probability that the first cup is not poisoned is $3/4$. Observe that the probability that the second cup is not poisoned given that the first cup was not poisoned is $2/3$ since if the first cup was not poisoned only two of the three cups that remain are not poisoned. The probability that the third cup is not poisoned given that the first two cups were not poisoned is $1/2$ since if the first two cups were not poisoned then only one of the two cups that remain is not poisoned. – N. F. Taussig May 17 '18 at 20:52

The probability of not being poisoned is exactly the same as the following problem:

You choose one cup and drink from the other three. What is the probability of choosing the poisoned cup (and not being poisoned)? That probability is 1/4.

Therefore, the probability of being poisoned is 3/4.

• @NicNic8 This version is clearer. – N. F. Taussig May 14 '18 at 2:30
• No idea why this isn't the accepted answer - it's the way I'd do it but it's also much clearer than the other. – arboviral May 16 '18 at 8:07
• @arboviral The other answer has better math, and can be applied generally. Consider instead that there was a fifth glass containing poison; which approach would you use? – Drunk Cynic May 16 '18 at 16:16
• Think of it this way: What is the prob that the poison cup is still full after drinking three cups? – DWin May 17 '18 at 2:23
• If there are three glasses of water and two of poison, the method analogous to this answer is you pick two glasses not to drink, and you survive if you happen to pick the two poisoned glasses, which occurs just one way out of the ten possible pairs of glasses you could pick. – David K May 20 '18 at 23:09

Not sure why everybody uses such a complicated approach:
after drinking three cups, one remains. The chance that she is alive is equal to the chance that the remaining cup is the poison, which is one in four = 25%.

The sequence of drinking water and or poison is completely irrelevant.

• Agreed. Part of the SE ethos is to provided detailed additional information that could be used for other, less direct problems. (And to show off) – MarsJarsGuitars-n-Chars May 14 '18 at 22:08
• This is essentially the same as NicNic8’s solution. – wgrenard May 15 '18 at 0:56
• From a baysean perspective there is something fishy about the answer. After drinking three cups, she is either dead or alive. Talking about chance is futile! – Albert van der Horst May 20 '18 at 18:40
• Yes I agree. These top voted answers are a bit extreme it seems, even with my zero experience with any advanced level math and using only my high school school math logic. Yet sometimes you'll see some crazy "sounding" problem given by the questioner yet a few simple lines for a response that seems to solve everyone's issues, confusions. Good ol' SE – Hunter Frazier May 21 '18 at 10:38

There are $4!$ permutations of $W_1W_2W_3P$.

The only way to live is if $P$ is last, and there are $3!$ ways for this to occur.

So there are $4!-3!$ ways to die with probability $1-\frac{3!}{4!} = \frac34$.

• Just read Taussig's answer. This solution is more or less the same approach. – suneater May 14 '18 at 8:35
• This solution is more or less the same approach well I would not say so. This one has a different approach / methodology (and ultimately relies on similar concepts). – WoJ May 14 '18 at 10:34

A good way to think about such problems is to ask yourself the opposite question: what is the probability that I will not get poisoned?

\begin{align*} \Pr(\text{not poisoned}) &= \Pr(\text{not poisoned on first glass}) \cdot \Pr(\text{not poisoned on second glass}) \cdot \Pr(\text{not poisoned on third glass}) \\ &= \frac{3}{4} \cdot \frac{2}{3} \cdot \frac{1}{2} \\ &= \frac{1}{4} \\ \end{align*}

It follows that

\begin{align*} \Pr(\text{poisoned}) &= 1 - \Pr(\text{not poisoned}) \\ &= 1 - \frac{1}{4} \\ &= \frac{3}{4} \\ \end{align*}

• "Ask yourself the opposite question" is the important lesson here. +1 – joeytwiddle May 16 '18 at 5:34
• Now if one of them is the antidote... – John P May 18 '18 at 16:50

You have 50%. If you drink the third cup means first and second are not poison. So when drink third you have just two cups, and one is poison.... 50%. I think this problem is about logic more than math... Thanks a Lot

• This is a valid approach, under a different set of assumptions (namely that the poison is debilitating and acts faster than you can drink another cup) – Ben Voigt May 14 '18 at 23:55
• This is saying it is more a language issue than a math issue. 'If you were to drink' could mean the action is done or to be done. Interesting. – David May 15 '18 at 16:22
• There is a revolver handgun with 4 chambers, three are empty and one has a live round. If you put it to your head and squeezed the trigger three times, what is the probability of having a bullet in your head? Your answer addresses the gun question better than the poison question. – user1717828 May 15 '18 at 16:36
• hahaha! So funny! If I press three times the trigger means first and second was without bullet. Pressing third time maybe I got the bullet in my head, maybe not (I'm not lucky man! so for sure I have!). So 50% probability... – German Rodriguez May 15 '18 at 18:41
• Just make sure it is a revolver and not an automatic! – Eric Lippert May 15 '18 at 19:02

Label the cups A, B, C, D. Now we can assume WLOG that the cups she drank are A, B and C.

There are only 4 scenarios according to which cup is the poisoned one. In 3 of the scenarios (poisoned cup = cup A, B, C respectively), she is poisoned. In 1 of the scenarios (poisoned cup = cup D), she is not poisoned. Therefore the probability is 3/4 = 75%.

Not sure why it is any more complicated than that.

• It isn't any more complicated, as NicNic8 and Aganju already answered. – Dronz May 15 '18 at 3:26
• It is more complicated if you want to solve very similar problems generally. Laying out all the scenarios and counting them quickly becomes unreasonable for larger numbers of cups with more than 1 left untouched. – Matthew Read May 17 '18 at 3:47

The solution to this problem depends on how fast the poison works. If the poison is slow acting, the previous solutions are OK. But if the poison works instantly, there may be no opportunity to drink three cups.

The problem states that three cups are taken, so the first two cups can NOT be poison. The third cup is chosen from a set of two with one poison and the other safe. So the probability of survival = probability of poison = 1/2.

• I think you are wrong. You are not calculating the probability of the first two cups not be poisoned. – sawa May 17 '18 at 3:25
• @sawa If we know that both (a) the poison acts instantly and (b) you drink 3 cups, the poison cannot have been in either the first 2 (they would have killed you before you drank the third). That means the probability of either of the first two cups being poison is 0. Obviously, this is intentionally misinterpreting the problem for the sake of humor; it's a joke. – Matthew Read May 17 '18 at 3:42
• I am not saying that your interpretation is wrong. That is not my point. My point is that you are only calculating the conditional probability (that the third one is poison) under the assumption that the first two were not poison. I am saying that you have to calculate the conditional part to get to that situation, which Floris does correctly in my opinion. – sawa May 17 '18 at 3:48
• @sawa: The probability of surviving until the third cup does not have to be calculated, it is postulated by the problem formulation, therefore 100% (P(x | x) = 1). – Ben Voigt May 18 '18 at 3:31
• Okay, I understand. – sawa May 18 '18 at 4:31

I thought it would be instructive to try a different approach.

If you drink three cups, that tells me for sure that two of the cups you drank (the first two) were not poisoned - otherwise you would not have gotten to the third cup.

So the poison must be in either cup 3 or cup 4, and since it is equally likely to be in any of the cups, there is a 50% chance of that happening.

Having survived the first two cups, you now have a 50-50 chance that cup 3 is poisoned (because it's either cup 3 or cup 4). To survive drinking cup 3, you need to beat those odds as well.

Multiplying these probabilities, you once again get 0.25 for the chance of surviving.

Of course it's the same answer - but I thought this would give additional insight.

• The OP stated that the person drinking the water was proving that they can't die, so I don't think it's fair to make your conclusion that drinking three cups itself is amount to showing that the first two cups are not poisoned. – Green May 16 '18 at 23:45
• Your interpretation of the question is the same as richard1941 and German Rodriguez, but I think they gave the wrong answer under that assumption, and you are the only one to give the correct answer under the assumption. – sawa May 17 '18 at 3:29
• This is not correct; it's almost like the reverse of the Monty Hall misunderstanding. In this version of the problem, the first two cups don't matter. They might as well not exist. The problem is reduced purely to two cups, one of which is poisoned. You drink only one of them -- what are your odds? 50%, not 25%. – Matthew Read May 17 '18 at 3:59
• Or to fully dive into the scenarios you wanted to lay out here -- there are four situations: (1) cup 3 is poisoned and you drink it (2) cup 4 is poisoned and you drink it (3) cup 3 is poisoned but you drink cup 4 (4) cup 4 is poisoned but you drink cup 3. 2/4 of those are deadly; 50%. – Matthew Read May 17 '18 at 4:02
• A potentially more intuitive reason it can't be 25%: In this version of the problem, you've gained definitive knowledge of absolute safety about the first two choices made. That MUST affect the odds. It is obviously not true that drinking two safe cups leaves you with the same odds as drinking two cups that could have included the poisoned cup. – Matthew Read May 17 '18 at 4:05

Wow, people are making this complicated.

There are 4 cups. One is poisoned. She picks 3. There are 3 chances that she will pick the poisoned cup out of 4. Therefore, the probability is 3/4.

This assumes that she does not pick a cup, drink it, then put it back and someone refills it before she picks another.

I'm also assuming that she either picks 3 cups before drinking any of them, or that if she dies before picking 3 cups, that we treat that as if she picked enough to fill out the 3 at random. Otherwise the probability is impossible to calculate, because if the first or second cup is poisoned, she doesn't "pick 3 cups".

You can do all the permutations and bayesian sequences, but as others have shown, they all come to the same answer.

If she picked, say, 3 out of 6 cups and 2 are poisoned, I don't see how to do it other than with combinatorics. But maybe I'm missing an easy way.

• NicNic8's answer is even more simple, check that top answer. – user061703 May 19 '18 at 6:02
• For your drinking 3 out of 6 with 2 poisoned, just think of six spots for glasses in a row. The first three are to be drunk. The first poisoned glass has 3 safe locations (the last three) out of 6, so we're safe with probability 0.5. The second poisoned glass has 2 safe locations to land on out of 5, so we'll stay safe with probability 0.4. Combined: 0.2 probability of a safe three drink binge... – DJohnM May 19 '18 at 8:12
• Ooh, interesting. Yes, simpler than what I had in mind, which was: number of safe combinations divided by total number of combinations = 4C3 / 6C3 = 4 / 20 = 0.2. Same answer. – Jay May 19 '18 at 23:17
• @TrầnThúcMinhTrí I though NicNic8's answer was a shade more complicated than mine as it requires reversing the probability, but whatever. Not something that I would challenge someone to a duel to the death over. – Jay May 19 '18 at 23:19
• So the problem grows as more people think about it. Now we have sampling with replacement as a possibility. The probability of surviving on a single draw is 3/4. Because the non-poisoned cup is replaced, the overall probability of survival, at the beginning of the trial, is 3/4 x 3/4 x 3/4 = 27/64. It does not matter if the poison if fast or slow because the conditional probabilities are the same as the initial probability. – richard1941 May 21 '18 at 17:27


# Math Help - How do I solve this with a direct proof?

1. ## How do I solve this with a direct proof?

Prove that for all sets X and Y, (X ∩ Y) ∪(Y-X)=Y

I'm stuck and I'm not fully sure how to solve this.

2. ## Re: How do I solve this with a direct proof?

suppose that a is an element of (X∩Y) U (Y-X).

this means one of two things:

a is in X∩Y, or
a is in Y-X

suppose a is in X∩Y. this means that a is in BOTH X and Y, so is certainly in Y.

alternatively, if a is in Y-X, this means a is in Y, but not in X. who cares if its not in X, at least it's in Y!

so in all possible cases, we see that a is in Y.

this means that (X∩Y) U (Y-X) is a subset of Y.

now suppose b is in Y.

well we have two possibilities:

b is in X
b is NOT in X (in or out, that's the way it is with sets. you cannot be "sort of" in a set).

if b is in X, then b is in X AND Y, so b is in X∩Y.
if b is not in X, then b is in Y, but not in X, so b is in Y-X.

if we put these two sets together, b is certain to be in one of them. hence b is in (X∩Y) U (Y-X).

thus Y is a subset of (X∩Y) U (Y-X).

but, if for 2 sets A,B: if A⊆B and B⊆A, then A and B have exactly the same elements, that is: A = B.

so (X∩Y) U (Y-X) = Y.

(intuitively what we are doing is splitting Y into 2 parts: the part that overlaps with X, and the part that doesn't).

3. ## Re: How do I solve this with a direct proof?

Hello, blueaura94!

$\text{Prove: }\:(X \cap Y) \cup (Y - X) \:=\:Y$

$\begin{array}{ccccc}1. & (X \cap Y) \cup (Y - X) && 1. & \text{Given} \\ 2. & (X \cap Y) \cup (Y \cap \overline{X}) && 2. & \text{Def. Subtr'n} \\ 3. & (X\cap Y) \cup (\overline{X} \cap Y) && 3. & \text{Commutative} \\ 4. & (X \cup \overline{X}) \cap Y && 4. & \text{Distributive} \\ 5. & U \cap Y && 5. & A \cup \overline{A} \,=\,\mathbb{U} \\ 6. & Y && 6. & \mathbb{U} \cap A \,=\,A \end{array}$

4. ## Re: How do I solve this with a direct proof?

Originally Posted by blueaura94
Prove that for all sets X and Y, (X ∩ Y) ∪(Y-X)=Y
Here is another way.
$X\cap Y\subseteq Y~\&~Y\setminus X\subseteq Y$ so there is just need to prove one way.

If $t\in Y$ then either $t\in X$ or $t\notin X$.

And we are done.


## Exercise 1

Just before their last year at Anytown High School, the seniors hold the Senior Year Kick-Off party. Sixty percent of the students attending the party are seniors, and the rest (friends, significant others, siblings, etc.) are juniors (25%), sophomores (10%), and freshmen (5%) Unfortunately, drinking is quite common at this party; 90% of the seniors consume alcohol, so do 80% of the juniors, 50% of the sophomores, and 20% of the freshmen.

(a) If a student at this party is drinking, what is the probability that this student is a senior?

Solution:

First, we note the given information

\begin{aligned} P(Fr) &= 0.05, \ P(D \mid Fr) = 0.20 \\ P(So) &= 0.10, \ P(D \mid So) = 0.50 \\ P(Jr) &= 0.25, \ P(D \mid Jr) = 0.80 \\ P(Sr) &= 0.60, \ P(D \mid Sr) = 0.90 \\ \end{aligned}

Next, we calculate proportion of the students attending the party consume alcohol.

\begin{aligned} P(D) &= P(Fr \cap D) + P(So \cap D) + P(Jr \cap D) + P(Sr \cap D) \\ &= P(Fr) \cdot P(D \mid Fr) + P(So) \cdot P(D \mid So) + P(Jr) \cdot P(D \mid Jr) + P(Sr) \cdot P(D \mid Sr) \\ &= 0.05 \cdot 0.20 + 0.10 \cdot 0.50 + 0.25 \cdot 0.80 + 0.60 \cdot 0.90 \\ &= 0.01 + 0.05 + 0.20 + 0.54 \\ &= 0.80 \end{aligned}

Note that, along the way we obtained the probability of drinking and the intersection with each class.

Then, we finally calculate

$P(Sr \mid D) = \frac{P(Sr \cap D) }{P(D)} = \frac{0.54}{0.80} = \boxed{0.675}$

(b) If a student at this party is not drinking, what is the probability that this student is not a senior?

Solution:

Based on the work we did in the previous problem, we can easily “complete the table.” (We could have also used a tree to get the information needed for the table.)

Fr So Jr Sr
Drinking 0.01 0.05 0.20 0.54 0.80
Not Drinking 0.04 0.05 0.05 0.06 0.20
0.05 0.10 0.25 0.60 1

$P(Sr^\prime \mid D^\prime) = \frac{P(Sr^\prime \cap D^\prime)}{P(D^\prime)} = \frac{0.04 + 0.05 + 0.05}{0.20} = \boxed{0.70}$

(c) If a student at this party is not a senior, what is the probability that this student is not drinking?

Solution:

$P(D^\prime \mid Sr^\prime) = \frac{P(D^\prime \cap Sr^\prime)}{P(Sr^\prime)} = \frac{0.04 + 0.05 + 0.05}{0.05 + 0.10 + 0.25} = \boxed{0.35}$

(d) What proportion of the underclassmen (freshmen and sophomores) attending the party consume alcohol?

Solution:

$P(D \mid (Fr \cup So)) = \frac{0.01 + 0.05}{0.05 + 0.10} = \boxed{0.40}$

(e) The school administration discourages the Senior Year Kick-Off party; the principal of AHS announced that any senior attending the party will receive a week of detention. Of course, drinking is also discouraged. Find the proportion of the students at the party who either are seniors, or consume alcohol, or both.

Solution:

$P(S \cup D) = P(S) + P(D) - P(S \cap D) = 0.60 + 0.80 - 0.54 = \boxed{0.86}$

(f) Are events {a student at the party is a senior} and {a student at the party is drinking} independent? Justify your answer. No credit will be given without proper justification.

Solution:

$$\boxed{\text{No.}}$$

$0.54 = P(Sr \cap D) \neq P(Sr) \cdot P(D) = 0.60 \cdot 0.80 = 0.48$

We could have also showed that $$P(Sr \mid D) \neq P(Sr)$$ or $$P(D \mid Sr) \neq P(D)$$.

(g) Are events {a student at the party is a junior} and {a student at the party is drinking} independent? Justify your answer. No credit will be given without proper justification.

Solution:

$$\boxed{\text{Yes.}}$$

$0.20 = P(Jr \cap D) \neq P(Jr) \cdot P(D) = 0.25 \cdot 0.80 = 0.20$

## Exercise 2

A bishop is placed at random (with equal chance) on a chess board (8 x 8). A king of the opposing color is placed at random (with equal chance) on one of the remaining squares. What is the probability that the king is under attack from the bishop?

Hint: Placed anywhere on a chess board, a rook attacks 14 squares out of the remaining 63.

$P(\text{ K is under attack }) = \frac{14}{63}$

Solution:

We first need to determine how many squares are being attacked for each possible position of the bishop. For example, in the top left corner, the bishop can attack 7 positions. We also keep track of how many positions on the board have the bishop attacking 7 positions. (And do so for all possibilities.)

Then we use the law of total probability.

\begin{aligned} P(\text{K is under attack}) &= P(\text{B attacks 7}) \cdot P(\text{K is under attack} \mid \text{B attacks 7}) \\ &+ P(\text{B attacks 9}) \cdot P(\text{K is under attack} \mid \text{B attacks 9}) \\ &+ P(\text{B attacks 11}) \cdot P(\text{K is under attack} \mid \text{B attacks 11}) \\ &+ P(\text{B attacks 13}) \cdot P(\text{K is under attack} \mid \text{B attacks 13}) \\ &= \frac{28}{64} \cdot \frac{7}{63} + \frac{20}{64} \cdot \frac{9}{63} + \frac{12}{64} \cdot \frac{11}{63} + \frac{4}{64} \cdot \frac{13}{63} \\ &= \boxed{\frac{5}{36}} \end{aligned}

# Exercise 3

You are given that $$P(A) = 0.5$$ and $$P(A \cup B) = 0.7$$. Student 1 assumes that $$A$$ and $$B$$ are independent and calculates $$P(B)$$ based on that assumption. Student 2 assumes that $$A$$ and $$B$$ are mutually exclusive and calculates $$P(B)$$ based on that assumption. Find the absolute difference between the two calculations.

Solution:

We first consider Student 1. Since Student 1 believes that $$A$$ and $$B$$ are independent, we have

$P_1(A \cap B) = P_1(A) \cdot P_1(B)$

It is also always true that

$P_1(A \cup B) = P_1(A) + P_1(B) - P_1(A \cap B)$

With the given probabilities, we have

\begin{aligned} P_1(A \cap B) &= 0.5 \cdot P_1(B) \\ 0.7 &= 0.5 + P_1(B) - P_1(A \cap B) \end{aligned}

This is a system of two equation, with two unknowns, so we solve and obtain

$P_1(B) = 0.40$

Now we consider Student 2. Since they assumes that $$A$$ and $$B$$ are mutually exclusive we have

$P_2(A \cap B) = 0.$

Because of this, we have

$P_2(A \cup B) = P_2(A) + P_2(B)$

With the given probabilities, we have

$0.7 = 0.5 + P_2(B)$

So we obtain

$P_2(B) = 0.2.$

So, finally, their absolute difference is

$\left| P_1(B) - P_2(B)\right | = 0.4 - 0.2 = \boxed{0.2}$

# Exercise 4

Alex and David agreed to play a series of tennis games (as many as needed) until one of them wins two games in a row. Alex will serve in the first game, then the serve would alternate game by game between Alex and David. David is a better tennis player; Alex has a 50% chance of winning a game on his serve and only a 20% chance of winning a game if David serves. Assume that all games are independent. Find the probability that Alex is the first one to win two games in a row.

Solution:

First we define some notation. We say

$O_S$

$$O$$ is the outcome for Alex, $$W$$ or $$L$$. $$S$$ is the player serving. $$D$$ for David, $$A$$ for Alex.

Now we enumerate the possible outcomes that result in Alex being the first to win two games in a row. Recall that Alex serves first. We can group these into two groups of possibilities.

Alex wins the first game:

\begin{aligned} & W_{A}W_{D} \\ & W_{A}L_{D} W_{A}W_{D} \\ & W_{A}L_{D} W_{A}L_{D} W_{A}W_{D} \\ & \ldots \end{aligned}

David wins the first game:

\begin{aligned} & L_{A}W_{D}W_{A} \\ & L_{A}W_{D} L_{A}W_{D}W_{A} \\ & L_{A}W_{D} L_{A}W_{D} L_{A}W_{D}W_{A} \\ & \ldots \end{aligned}

Or, more succinctly:

Alex wins first game: $$(W_{A}L_{D})^k W_{A}W_{D}, \quad k = 0, 1, 2, 3, \ldots$$

David wins first game: $$L_{A} (W_{D}L_{A})^k W_{D}W_{A}, \quad k = 0, 1, 2, 3, \ldots$$

Then, we calculate the required probability by adding the probabilities of each of the outcomes we listed above, since they are all disjoint.

\begin{aligned} P(\text{ Alex wins two in a row }) &= P(\text{ Alex wins two in a row after winning the first }) \\[0.5em] &+ P(\text{ Alex wins two in a row after losing the first }) \\[0.5em] &= \sum_{k = 0}^{\infty}(0.50 \cdot 0.80)^k (0.50 \cdot 0.20) \\[0.5em] &+ \sum_{k = 0}^{\infty} 0.50 \cdot (0.20 \cdot 0.50)^k (0.20 \cdot 0.50) \\[0.5em] &= \frac{0.50 \cdot 0.20}{1 - 0.50 \cdot 0.80} = \frac{0.50 \cdot 0.20 \cdot 0.50}{1 - 0.20 \cdot 0.50} \\[0.5em] &= \frac{1}{6} + \frac{1}{18}\\[0.5em] &= \boxed{\frac{2}{9}} \end{aligned}


# Finding frequency of the filter circuit from the transfer function

#### Wompalamba

Joined Dec 28, 2020
19
Hi i am trying to extract the cutoff frequency from the transfer function that i derived similar to this derivation of the RC filter. I am currently stuck at the step where the equation is modulus on both side as i am not sure how do i continue from there. I have attached the work i have done so far in the image. Thank you for your time!

Edit: i realized that i posted the title wrongly it should be Finding frequency of the filter circuit from the transfer function and i am not sure how to edit the title

Last edited:

#### ZCochran98

Joined Jul 24, 2018
105
Before I answer your question, I do need to point out a small mistake. You have:
$Z = \left(\frac{1}{\frac{1}{sC_1}+\frac{1}{R_3}}\right)^{-1}$
Which is incorrect. You already incorporated the ^-1 with the fraction, so you don't need the ^-1 outside the brackets, and, the sC_1 shouldn't be inverted (1/sC_1 is impedance, so 1/(1/sC_1) = sC_1). So that line should just be:
$Z = \frac{1}{sC_1+\frac{1}{R_3}}$

Now, to answer your question: After you correct that, you have the correct process (Z/Z_total, basically), just the wrong value for Z. Ultimately, after you do all the math, you should get an equation of the form:
$\left|\frac{V_{out}}{V_{in}}\right| = \frac{|a|}{\left|bs+c\right|}$
For some constants a, b, and c which depend on your circuit variables (similar to what you have, but with the corrected value of Z, I can tell you there will be no s in the numerator).

The frequency for which your filter is designed, in this case, is the pole of this equation: what value of s makes the denominator of the fraction = 0? The frequency corresponding to that s (you correctly wrote $$s = \omega j = 2\pi f j$$) is the frequency for which this filter was designed.

Hope this helps!

#### Wompalamba

Joined Dec 28, 2020
19
Thank you for correcting my careless mistake and i appreciate you spending some time to share your knowledge. I have since corrected the issue but still have some doubts as to how to solve the modulus function .I am trying to extract out the frequency to find the cut off frequency at $\frac{Vout}{Vin}=\frac{1}{\sqrt{2}}$ when i put in the fixed component values. Am i right to do the following steps as shown in the image attached?

#### ZCochran98

Joined Jul 24, 2018
105
You are on the right track. One thing to keep in mind: if you have something = 0, then |something| is also = 0. Thus, at the third line down, where you have written "$$= \frac{1}{1 + sC_1R_1 + \frac{R_1}{R_3} + sC_1R_2 + \frac{R_2}{R_3}}$$," you can actually just go ahead and solve that line, as you set the denominator there = 0, then the magnitude of it will also be zero. Doing that, you can solve for s and then for f, subsequently. The next 3 lines after it are just extra work that, for this case, aren't necessary.

#### Wompalamba

Joined Dec 28, 2020
19
Thank you for the guidance. However, I suspect i might have made a mistake somewhere because when i tried to find the frequency cut off it was not the answer i expected which is 810~kHz i have attached the two images below.

#### The Electrician

Joined Oct 9, 2007
2,814
At the very end you made an algebra mistake. The expression (C1 R1 - C1 R2) should be (C1 R1 + C1 R2).

#### Wompalamba

Joined Dec 28, 2020
19
Thank you! I corrected the mistake but i am still not getting the desired cut off frequency of 810kHz. Did i accidentally made more mistake in the last step?

#### The Electrician

Joined Oct 9, 2007
2,814
Where did you get the value of 810 kHz? I solved it and got the 895.98 kHz value. This is correct for the component values you have given and for the circuit as shown.

#### ericgibbs

Joined Jan 29, 2010
11,630
hi W,
This is what LTSpice shows for those component values.
Slight difference to calculated numeric value, due to accuracy of cursor placement.
E

#### Attachments

• 58.4 KB Views: 8

#### Wompalamba

Joined Dec 28, 2020
19
You are right. I tried the spice simulation and it shows the correct value. I am assuming this is a weird software issue . I have attached the schematic i was using for the Elsie simulation just in case i did something wrongly.

#### ericgibbs

Joined Jan 29, 2010
11,630
hi W,
Did you also try to calculate the Freq, by summing R1 and R2 and say re-naming as R4, in order to simplify the maths.?

Try it.
E


# Symbol for very small variable

Is there any representation to state that a variable is close to (not equal) zero? Let me give you an example. Consider the function

$$u(x)=\alpha (e^{i\omega \delta t}-1) f(x)$$

I am interested in the function $$u(x)$$ when $$\delta t$$ is very small. For this case, it should be easy to see that

$$u(x)|_{\text{small }\delta t} \approx i \alpha \omega \delta t f(x)$$

Is there any "nice" notation to represent such an equation (without having to write small)? I thought that I could use the limit notation for that [for example, $$\lim_{\delta t \to 0} u(t)$$], but then I realized that if $$\delta t$$ goes to zero, then $$u(x)=0$$. Therefore, it is not what I need.

I found this link in the same forum, but it did not help.

• Really, what's wrong with $\delta t<<1$? Mar 23 at 15:44
• $\delta t\ll 1$ is good Mar 23 at 15:55
• I think it is okay. Nevertheless, I would need to use something like $|\delta t| << 1$ to make it clear that $\delta t$ is positive?
– jeb
Mar 23 at 16:31

I think you are asking about the first order (linear) approximation using the derivative.

You might say $$u(x)= i \alpha \omega \delta t f(x) + o(\delta t ).$$

The fact that this is an approximation for small $$\delta t$$ should be clear to your reader. If not you can say so.

• I like to "o" notation, I have to say. What would you recommend me to include in my text or even in front of the $u(x)$ term to make it clear that $\delta t$ is small? My question is based on the fact that I will need to manage this equation further, and if I include the "o" notation, they will become too overloaded. The best that I could think of was something like $u(x)|_{\delta t = \epsilon}$, such that $o(\epsilon)$ is insignificant (or can be disregarded). Thank you.
– jeb
Mar 23 at 18:41
• The insignifance to first order is implicit in the use of the $o$ notation. You can just carry the $o(\delta t)$ term along in future calculations and throw it away at the end (r sooner) as appropriate. You could add "as $\delta t \to 0$" when you first state the equation. I would not want to read an invented notation like the one you propose. Mar 23 at 19:01

The issue with taking limits is that as $$\delta t\to 0$$ both sides go to zero, but what you want to say is stronger than that.
I imagine what you actually mean by $$u(x)\approx i\alpha\omega\delta tf(x)$$ can be formalised as $$\lim_{\delta t\to 0}\frac{u(x)}{\delta t}=i\alpha\omega f(x).$$

This is simply a matter of rearranging so that the limit captures the relative error of the approximation, not just the absolute error.


# Proving that $x-\left\lfloor \frac{x}{2} \right\rfloor\; =\; \left\lfloor \frac{x+1}{2} \right\rfloor$

How would you prove that if $x$ is an integer, then

$$x-\left\lfloor \frac{x}{2} \right\rfloor\; =\; \left\lfloor \frac{x+1}{2} \right\rfloor$$

I tried to start by saying that if $x$ is an even integer, then:

$$\left\lfloor \frac{x}{2} \right\rfloor = \frac{x}{2}.$$

However, I am stuck on showing that $$\left\lfloor \frac{x+1}{2} \right\rfloor$$ is also $\frac{x}{2}$. Intuitively It makes intuitive sense just by playing around with some sample numbers, but I don't know how to make it mathematically rigorous. Further, what do you do in the odd case? Is this even the right way to go about it?

• Start with $\lfloor y+n \rfloor = \lfloor y\rfloor +n$. – lhf Sep 25 '14 at 1:53
• @lhf Is there a proof for that? – 1110101001 Sep 25 '14 at 1:56
• By definition, $\lfloor y \rfloor \le y < \lfloor y \rfloor +1$ and so $\lfloor y \rfloor + n \le y + n < \lfloor y \rfloor +n+1$, which says that $\lfloor y+n \rfloor = \lfloor y\rfloor +n$. – lhf Sep 25 '14 at 1:58

If $x$ is even, then $x=2k$ where $k \in \mathbb{Z}$.

We then have: $$x-\left\lfloor \frac{x}{2} \right\rfloor=2k-\lfloor k \rfloor=k=\left\lfloor k+\frac{1}{2} \right\rfloor=\left\lfloor \frac{2k+1}{2} \right\rfloor=\left\lfloor \frac{x+1}{2} \right\rfloor$$

If $x$ is odd, then $x=2k+1$ where $k \in \mathbb{Z}$.

We then have $$x-\left\lfloor \frac{x}{2} \right\rfloor=2k+1-\left\lfloor k+{1\over 2} \right\rfloor=k+1=\left\lfloor k+1 \right\rfloor=\left\lfloor \frac{2k+2}{2} \right\rfloor=\left\lfloor \frac{x+1}{2} \right\rfloor$$

Case-1 (Even) write $x=2k$. Now$\left\lfloor \frac{x}{2} \right\rfloor =k$ so L.H.S is $2k-k=k$. now work with R.H.S, $\left\lfloor \frac{x+1}{2} \right\rfloor=\left\lfloor \frac{2k+1}{2} \right\rfloor=\left\lfloor k.5 \right\rfloor=k$.

Case 2) (Odd) Let $x=2k+1$ Similarly. I am in hurry, so i leave it on you. very easy.

Prove LHS=RHS= $k+1$


Probability question on drawing cards

micky123

New member
From a standard pack of 52 cards, I draw 3 cards at random without replacement. What is the probability that all cards drawn are both hearts and picture cards?

is the answer: (3/52)*(2/51)*(1/50)?

Subhotosh Khan

Super Moderator
Staff member
From a standard pack of 52 cards, I draw 3 cards at random without replacement. What is the probability that all cards drawn are both hearts and picture cards?

is the answer: (3/52)*(2/51)*(1/50)?
There are 4 cards (ACE included) with pictures AND heart.

How many ways can you draw 3 cards from that group ?

How many ways can you draw 3 cards from 52 cards ?

micky123

New member
Why would ace be included? I thought there are only 3 cards that are both heart and picture? (jack, queen and king)

Please kindly explain if I have gotten it wrong! Thank you.

Subhotosh Khan

Super Moderator
Staff member
Why would ace be included? I thought there are only 3 cards that are both heart and picture? (jack, queen and king)

Please kindly explain if I have gotten it wrong! Thank you.
If ACE is not included then - how many ways can you choose 3 cards from that group (Hearts and pictures) ? ------ 1 way

How many ways can you choose 3 cards (no restriction) from the deck? _____ $$\displaystyle C^{52}_{3}$$

Now calculate probability.

reference: https://math.stackexchange.com/ques...-getting-3-cards-in-the-same-suit-from-a-deck

micky123

New member
If ace is not included, then the probability is 1/22100. However, i am confused as to why there are 4 cards with pictures and heart?

Am I understanding the event incorrectly? I understood the event that “all three cards are both heart and picture” to be drawing “a jack, a queen and a king of hearts”, which is 1 out of 22100 ways.

pka

Elite Member
If ace is not included, then the probability is 1/22100. However, i am confused as to why there are 4 cards with pictures and heart?

Am I understanding the event incorrectly? I understood the event that “all three cards are both heart and picture” to be drawing “a jack, a queen and a king of hearts”, which is 1 out of 22100 ways.
I would agree with your first answer [imath]\left(\dfrac{3}{52}\right)\cdot\left(\dfrac{2}{51}\right)\cdot\left(\dfrac{1}{50}\right)[/imath].
BUT if I were reading this question as an editor I would object to its wording as being unclear. It is extremely unusual to use picture card what standard English uses face cards.

mmm4444bot

Super Moderator
Staff member
It is extremely unusual to use picture card what standard English uses face cards.
Your wikipedia link states that names 'picture card' and 'face card' mean the same thing.

Otis

Elite Member
confused as to why there are 4 cards with pictures and heart?
Because a lot of card manufacturers draw a picture on each ace. However, the design on the aces do not show a person.

The name 'picture card' refers only to cards containing a picture of a person.

micky123

New member
I see. So this means that it depends on the way “picture card” is defined in the question?

if ace is not considered a picture card, the ans would be (3/52)*(2/51)*(1/50).

if ace is considered a picture card, the and would be (4/51)*(3/51)*(2/50).

am i right?


# latex equation multiple lines

If you wanted to just split in two parts, then multlined (notice the extra d) from the mathtools package would be a simpler solution: All the above works with elsarticle class in your updated question. Latex equation in multiple lines. â Charlie Jan 16 '14 at 3:38 You need to specify an alignment point on each line with & and separate lines with \\. 3 Multiple Lines of Displayed Maths . The breqn package is designed to split long equations automatically. the first version becomes: Not sure what you tried doing with multine but this seems OK: Btw, you seem to be missing a bracket on the RHS -- and I deleted an extraneous comma after the . To subscribe to this RSS feed, copy and paste this URL into your RSS reader. Latex allows two writing modes for mathematical expressions. The command \overline and \underline places a line above or below the expression. The % sign tells LATEX L A T E X to ignore the rest of the current line. To learn more, see our tips on writing great answers. Here also, the amsmath package is required. The amsmath package provides the align and align* environments for aligned equations. As previously mentioned, Originâs LaTeX App wraps user-entered equation markup in a single equation environment by automatically adding and commands before and after user-entered markup. Grouping and centering equations. LaTeX Error: \begin{document} ended by \end{multline}.See the LaTeX manual or LaTeX Companion for explanation.Type H for immediate help.... \end{multline}, Though i get the equation broken it is not numbered, or has a one line distance from my text as the The starred version doesn't number the equations. I am attaching a screenshot of the result: How would one justify public funding for non-STEM (or unprofitable) college majors to a non college educated taxpayer? Use instead the equation - just the multline environment, you can work as usual with line breaks. TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Yes you can load several different packages. You need to use this Feature, the amsmath-package. As a test, when the 2nd backslash was deleted at the end of the 3rd line of code (\dot{x} & = \sigma(y-x) \), it produced the single line equation you provided as an example. Philosophically what is the difference between stimulus checks and tax breaks? Again, use * to toggle the equation numbering. I suggest you use a split environment, which in contrast to multline may be used a subenvironment of equation. LATEX doesnât break long equations to make them ï¬t within the margins as it does with normal text. In that version I was able to open an Equation Editor and enter multiple lines of math equations in a the editor, pressing return at the end of each line to move to the next line. I copied and pasted their example exactly as is, but i still get errors, does it have to do with the package i am using? Try the example on the right which sets the same multiple equations in several ways. My code compiles and, looking at it, it doesn't contain, i will try it as well, i was fortunate to get many helpful answers. Is my Connection is really encrypted through vpn? I am a new Latex user,I have loaded these two math equation in my Latex documents and i want to split an equation i have into multiple line, I am reading this topic for breaking the lines over multiple, although what ever i do it does not allow me to compile. What location in Europe is known for its pipe organs? I want to place them/break the equation in two lines and retain the format of numbering and equal placing beneath. How to answer a reviewer asking for the methodology code of the paper? If you want to create a document with more than two columns, use the package multicol, which has a set of commands for the same. It works very well in the majority of situations, but it's not as mature as the amsmath package. @PaulGessler I had a look in the document, thank you for the link. Mathematical modes LaTeX allows two writing modes for mathematical expressions: the inline mode and the display mode. \begin{eqnarray*} Therefore, special environments have been declared for this purpose. In another practical tip we show you how to in your, LaTeX: equation in multiple rows - how to, d^2 = a^2 + b^2 + c^2 \geq a^2 + b^2 = a^2 + b^2 + 2ab - 2ab = (a+b)^2 - 2ab \\\ \geq 2ab. Latex Support In Pages Macs Chemistry. Referencing subordinate equations can be done using either of two methods: adding a label after the \begin {subequations} command, viz. What might happen to a laser printer if you print fewer pages than is recommended? 2). The { and } characters are used to surround multiple characters that LATEX L A T E X should treat as a single character. Asking for help, clarification, or responding to other answers. E.g. By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. As shown, it is possible to add both labels in case â¦ Add Mathematical Equations In Keynote On Mac Apple Support. LUXCO NEWS. You need to specify an alignment point on each line with & and separate lines with \\. Robotics & Space Missions; Why is the physical presence of people in spacecraft still necessary? A line end with [\\\\]. LaTeX equation editing supports most of the common LaTeX mathematical keywords. The first part of the equation is here separated from the rest of the formula. You have to put up with [\\\\] a line break at the desired location in your equation. It only takes a minute to sign up. Line breaks are straightforward, a double backslash does the trick This is not the only command to insert line breaks, in the next sectiontwo more will be presented. View PDF âºâº Find news, promotions, and other information pertaining to our diverse lineup of innovative brands as well as newsworthy headlines about our company and culture. Figure 1: Typical equation problems in ordinary LATEX: (a) di erent spacing around the equals signs in (14) and (15) because one uses equationand the other uses eqnarray; (b) equation (15) is a single equation but because it covers two lines \nonumbermust be used on the rst line; (c) and then the If a coworker is mean to me, and I do not want to talk to them, is it harrasment for me not to talk to them? They can be distinguished into two categories depending on how they are presented: 1. text â text formulas are displayed inline, that is, within the body of text where it is declared, for example, I can say that a + a = 2 a {\displaystyle a+a=2a} within this sentence. site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. Equations. How is HTTPS protected against MITM attacks by other countries? Description below mirrored brace. LaTeX needs to know when text is mathematical. It is therefore up to you to format the equation appropriately (if they overrun the margin.) 3 Special Characterulti Line Equations. This is because LaTeX typesets maths notation differently from normal text. Usually, the eqnarray environment is only used if authors cannot use the amsmath package because the environments included in this package are easier to use (refer to Section . thank you very much, although if i may ask can i ask if multiple packages can be used. Equations on Multiple Lines. The description of your first image says "On Windows, rstudio renders the equations correctly", but the first image shows a broken equation. That is why I was confused. By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy. With the split environment, you can display long equations clearly. Schematically, this is what its supposed to look like: As with the tabular environment, use & to separate columns and \\ to separate rows. The Moodle XML file can then be used to bu Auto Latex Equations Google Workspace Marketplace. In this case the first line should be move left relative to the others and the package mathtools provides a convenient command for this: I have split across three lines for clarity. This is best used at the start of a line to mark that line as a âcommentâ. When numbering is allowed, you can label each row individually. To put a pay attention, when you Create a new line in front of the comparison operator [ & ]. If an equation is longer than one line or several formulas must be grouped together, the eqnarray environment could be used. Contents 1 Introduction 2 Including the amsmath package 3 Writing a single equation 4 Displaying long equations We will show you how you can format the equation-environment is still suitable. That can be achieve in plain LaTeX without any specific package. two âcolumnsâ, one with the equation, one with the annotations. How to start equation environment inside a custom environment? You can choose the layout that better suits your document, even if the equations are really long, or if you have to include several equations in the same line. The first one is used to write formulas that are part of a text. formulas, graphs). 9. I suggest you use a split environment, which in contrast to multline may be used a subenvironment of equation. In fact, your example is probably best with the cases environment. There are several ways to format multiple equations and the amsmath package adds several more. In this case the first line should be move left relative to the others and the package mathtools provides a convenient command for this: Andrew,@Andrew,i used \begin{multline} after the , i pasted your solution and i get an error which i have given in the question as a new edit. The amsmath package provides a handful of options for displaying equations. To make use of the inline math feature, simply write your text and if you need to typeset a single math symbol or formula, surround it with dollar signs:Output equation: This formula f(x)=x2 is an example.This formula f(x)=x2 is an example. Find all positive integer solutions for the following equation: Allow bash script to be run as root, but not sudo. Also tried this example as kindly suggested. Now I realize your second screenshot shows what you saw in the RStudio IDE (in the source R Markdown document). You have to put up with [\\\\] a line break at the desired location in your equation. Subscribe to our newsletter to get notification about new updates, information, etc.. LaTeX forum â Math & Science â amsmath | Correct Alignment for multi-line Equations Topic is solved Information and discussion about LaTeX's math and science related features (e.g. Art Of Problem Solving. \label {eq:Maxwell}, which will reference the main equation (1.1 above), or adding a label at the end of each line, before the \\ command, which will reference the sub-equation (1.1a or 1.1b above). Math equation in LaTeX provides three stretchable lines/arrows that appear above or below the equation: braces, bars and arrows. Missing $inserted.$ ...l N(\sigma;\lambda;\theta;t)}{\partial t} over multiple lines, @PaulGessler although as far as I can see the give s me a better visual result, that is why i am keen of using that one. Open an example of the amsmath package in Overleaf First of all, you probably don't want the align environment if you have only one column of equations. I am using the package math of \usepackage{amssymb} \usepackage{amsthm}, @George I posted the self-contained code example above so that you could see one of doing this that works. With a normal line break, you can't write in LaTeX equations multiple lines. The next lines contain only the equations and annotations, I would like them aligned with the equation and annotation of the second line. These environments provide pairs of left- and right-aligned columns. I am trying to align a set of long equations, that are themselves align environments as most of them are spreading on multiple lines.. If we have two lines, then _{xxx} should be at the end of the first line (or at the start of the second line). Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. LaTeX assumes that each equation consists of two parts separated by a &; also that each equation is separated from the one before by an &. Understanding the zero current in a simple circuit. rev 2020.12.18.38240, The best answers are voted up and rise to the top, TeX - LaTeX Stack Exchange works best with JavaScript enabled, Start here for a quick overview of the site, Detailed answers to any questions you might have, Discuss the workings and policies of this site, Learn more about Stack Overflow the company, Learn more about hiring developers or posting ads with us, @PaulGessler I used it alone but it gave more errors in the compilers most of them saying ! In general, the command \\ signifies a line break and within the correct math mode environment, it can start a new equation line. Here also, the amsmath package is required. thank you for your time, Podcast 300: Welcome to 2021 with Joel Spolsky, Split numbered equation over multiple pages, Defining new split environment with reduced spacing, Can't generate png with Error: Erroneous nesting of equation structures, Formula too long and \split fails | contains “sqrt” (square root). Making statements based on opinion; back them up with references or personal experience. The \overbrace command places a brace above the expression (or variables) and the command \underbrace places a brace below the expression. Socially oriented website which will help to solve your little (or not little) technical problems. I am trying to learn Latex at the same time , thank you for your patience. I think the use of multiple lines structured environment can work. Check out what we are up to! Currently I just have a sequence of align environments, with each equation inside in order to align the pieces of each equations. Then there is an equation and some conditions for the equation, i.e. \end{math} \end{document} This code produces something which looks what you seems to need. Latex equation in multiple lines. The placement of _{xxx} depends on the number of lines that underbrace symbol should occupy, and in general it should be somewhere in the middle. 9 3 Multiple Lines Of Displayed Maths. LaTeX Long equation in several lines Use instead the equation - just the multline environment, you can work as usual with line breaks. Anyway, I'm glad to know that removing the extra empty lines worked. Unlike the tabular environment, there is no argument as the â¦ Adding right brace and equation number. I'm short of required experience by 10 days and the company's online portal won't accept my application, Identify Episode: Anti-social people given mark on forehead and then treated as invisible by society. ! The second one is used to write expressions that are not part of a text or paragraph, and are therefore put on separate lines. Open an example in Overleaf Is Mr. Biden the first to create an "Office of the President-Elect" set? Relationship between Cholesky decomposition and matrix inversion? \documentclass{article} \begin{document} This is your only binary choices \begin{math} \left\{ \begin{array}{l} 0\\ 1 \end{array} \right. Can a smartphone light meter app be used for 120 format cameras? This typically requires some creative use of an eqnarrayto get elements shifted to a new line to align nicely. \begin{eqnarray} y &=& x^4 + 4 \nonumber \\ &=& (x^2+2)^2 -4x^2 \nonumber \\ &\le&(x^2+2)^2 \end{eqnarray} \begin{eqnarray*} e^x &\approx& 1+x+x^2/2! Post by Alirezakn » Thu Nov 22, 2018 7:02 am . If an equation is longer than one line or several formulas must be grouped together, the eqnarray environment could be used. If we have three lines then _{xxx} should be in the middle of the second line. Thanks for contributing an answer to TeX - LaTeX Stack Exchange! That can be achieve in plain LaTeX without any specific package. Aligning Multiline Equation To The Left With Only One. Would charging a car battery while interior lights are on stop a car from charging or damage it? Also that each equation is separated from the one before by an. When numbering is allowed you can label each row individually. Multiple Lines and Multiple Equations. How To Linebreak A Equation In Latex Dealing Long You. Also worked properly when code was typed in. I ask if multiple packages can be used a subenvironment of equation agree to our newsletter to notification. To mark that line as a single character, or responding to other answers and align * environments for equations. Structured environment can work as usual with line breaks LaTeX equation editing supports most of the:. Same multiple equations in several ways to format multiple equations and the command \overline and \underline a... Service, privacy policy and cookie policy we have three lines then _ { xxx should... Equation and annotation of the current line a single character operator [ &.. As a latex equation multiple lines removing the extra empty lines worked & ] thank very... Use & to separate columns and \\ to separate columns and \\ to separate columns and to... Typesetting systems part of a line break at the desired location in is! What location in Europe is known for its pipe organs a brace the. Into your RSS reader can format the equation-environment is still suitable if multiple packages can be used to bu on. With [ \\\\ ] a line break, you can work as with. Logo © 2021 Stack Exchange on opinion ; back them up with references personal! In Europe is known for its pipe organs allowed you can work as usual with line.! The â¦ LUXCO NEWS Markdown document )  Office of the result: that can be achieve in LaTeX! On stop a car from charging or damage it does with normal text 120 format?! The common LaTeX mathematical keywords PDF âºâº the % sign tells LaTeX L a E. Dealing long you equation numbering designed to split long equations automatically the (... Requires some creative use of an eqnarrayto get elements shifted to a laser if! Alignment point on each line with & and separate lines with \\ view PDF âºâº the % tells! Will help to solve your little ( or not little ) technical problems format. - just the multline environment, there is an equation is longer than line! Socially oriented website which will help to solve your little ( or not little ) technical problems multline. Latex allows two writing modes for mathematical expressions: the inline mode and the command places... Https protected against MITM attacks by other countries an alignment point on each line with & and lines. Ask can i ask if multiple packages can be achieve in plain LaTeX without any specific package at. Not as mature as the â¦ LUXCO NEWS L a T E X should treat as a single character its... ) and the display mode try the example on the right which sets same. And align * environments for aligned equations equal placing beneath unprofitable ) majors! Toggle the equation, i.e our tips on writing great answers what location in Europe is for. Also that each equation is longer than one line or several formulas be. Stack Exchange is a question and answer site for users of TeX, LaTeX ConTeXt! In LaTeX equations multiple lines structured environment can work as latex equation multiple lines with breaks! Probably do n't want the align and align * environments for aligned equations pairs of left- and columns! Which sets the same multiple equations in Keynote on Mac Apple Support writing modes mathematical. Happen to a new line to mark that line as a single character right-aligned columns n't want align! Site for users of TeX, LaTeX, ConTeXt, and related typesetting systems 120 format cameras first of! You very much, although if i may ask can i ask if multiple packages can be achieve in LaTeX! Xml file can then be used stop a car from charging or damage it LaTeX, ConTeXt, and typesetting... You agree to our terms of service, privacy policy and cookie.... Pay attention, when you Create a new line in front of the formula must... Labels in case â¦ 9, the amsmath-package to subscribe to our terms service... Clarification, or responding to other answers agree to our newsletter to get notification about new updates information! The { and } characters are used to surround multiple characters that LaTeX L a E... It works very well in the RStudio IDE ( in the middle of the comparison operator [ & ] equations. Provides the align and align * environments for aligned equations an example in Overleaf then there an. Formulas must be grouped together, the eqnarray environment could be used equation and some for... Used a subenvironment of equation an example in Overleaf then there is an equation is here separated from one... Line breaks Mac Apple Support them ï¬t within the margins as it does with text! Equation in two lines and retain the format of numbering and equal placing beneath LaTeX equations lines! Or damage it work as usual with line breaks been declared for this purpose references personal... Equation inside in order to align nicely am trying to learn more, see our tips writing! The result: that can be achieve in plain LaTeX without any specific package screenshot of the President-Elect set! New line to align the pieces of each equations surround multiple characters that LaTeX L a T X! Other countries an  Office of the result: that can be used column equations... Based on opinion ; back them up with [ \\\\ ] a line above or below the equation in lines...


# Probability question on drawing cards

#### micky123

##### New member
From a standard pack of 52 cards, I draw 3 cards at random without replacement. What is the probability that all cards drawn are both hearts and picture cards?

#### Subhotosh Khan

##### Super Moderator
Staff member
From a standard pack of 52 cards, I draw 3 cards at random without replacement. What is the probability that all cards drawn are both hearts and picture cards?

There are 4 cards (ACE included) with pictures AND heart.

How many ways can you draw 3 cards from that group ?

How many ways can you draw 3 cards from 52 cards ?

#### micky123

##### New member
Why would ace be included? I thought there are only 3 cards that are both heart and picture? (jack, queen and king)

Please kindly explain if I have gotten it wrong! Thank you.

#### Subhotosh Khan

##### Super Moderator
Staff member
Why would ace be included? I thought there are only 3 cards that are both heart and picture? (jack, queen and king)

Please kindly explain if I have gotten it wrong! Thank you.
If ACE is not included then - how many ways can you choose 3 cards from that group (Hearts and pictures) ? ------ 1 way

How many ways can you choose 3 cards (no restriction) from the deck? _____ $$\displaystyle C^{52}_{3}$$

Now calculate probability.

reference: https://math.stackexchange.com/ques...-getting-3-cards-in-the-same-suit-from-a-deck

#### micky123

##### New member
If ace is not included, then the probability is 1/22100. However, i am confused as to why there are 4 cards with pictures and heart?

Am I understanding the event incorrectly? I understood the event that “all three cards are both heart and picture” to be drawing “a jack, a queen and a king of hearts”, which is 1 out of 22100 ways.

#### pka

##### Elite Member
If ace is not included, then the probability is 1/22100. However, i am confused as to why there are 4 cards with pictures and heart?

Am I understanding the event incorrectly? I understood the event that “all three cards are both heart and picture” to be drawing “a jack, a queen and a king of hearts”, which is 1 out of 22100 ways.
BUT if I were reading this question as an editor I would object to its wording as being unclear. It is extremely unusual to use picture card what standard English uses face cards.

#### mmm4444bot

##### Super Moderator
Staff member
It is extremely unusual to use picture card what standard English uses face cards.
Your wikipedia link states that names 'picture card' and 'face card' mean the same thing.

#### Otis

##### Elite Member
confused as to why there are 4 cards with pictures and heart?
Because a lot of card manufacturers draw a picture on each ace. However, the design on the aces do not show a person.

The name 'picture card' refers only to cards containing a picture of a person.

#### micky123

##### New member
I see. So this means that it depends on the way “picture card” is defined in the question?

if ace is not considered a picture card, the ans would be (3/52)*(2/51)*(1/50).

if ace is considered a picture card, the and would be (4/51)*(3/51)*(2/50).

am i right?


The figure shown below represents a one to one and onto or bijective function. Some types of functions have stricter rules, to find out more you can read Injective, Surjective and Bijective. Each value of the output set is connected to the input set, and each output value is connected to only one input value. A function f : A -> B is said to be onto function if the range of f is equal to the co-domain of f. How to Prove a Function is Bijective without Using Arrow Diagram ? A function that is both One to One and Onto is called Bijective function. Hence every bijection is invertible. In essence, injective means that unequal elements in A always get sent to unequal elements in B. Surjective means that every element of B has an arrow pointing to it, that is, it equals f(a) for some a in the domain of f. $$Now this function is bijective and can be inverted. Infinitely Many. If it crosses more than once it is still a valid curve, but is not a function. So we can calculate the range of the sine function, namely the interval [-1, 1], and then define a third function:$$ \sin^*: \big[-\frac{\pi}{2}, \frac{\pi}{2}\big] \to [-1, 1]. The inverse is conventionally called $\arcsin$. The function f is called as one to one and onto or a bijective function, if f is both a one to one and an onto function. As pointed out by M. Winter, the converse is not true. Ah!...The beautiful invertable functions... Today we present... ta ta ta taaaann....the bijective functions! Below is a visual description of Definition 12.4. More clearly, f maps distinct elements of A into distinct images in B and every element in B is an image of some element in A. A bijective function is both injective and surjective, thus it is (at the very least) injective. And I can write such that, like that. Thus, if you tell me that a function is bijective, I know that every element in B is “hit” by some element in A (due to surjectivity), and that it is “hit” by only one element in A (due to injectivity). This is equivalent to the following statement: for every element b in the codomain B, there is exactly one element a in the domain A such that f(a)=b.Another name for bijection is 1-1 correspondence (read "one-to-one correspondence).. Definition: A function is bijective if it is both injective and surjective. My examples have just a few values, but functions usually work on sets with infinitely many elements. Mathematical Functions in Python - Special Functions and Constants; Difference between regular functions and arrow functions in JavaScript; Python startswith() and endswidth() functions; Hash Functions and Hash Tables; Python maketrans() and translate() functions; Date and Time Functions in DBMS; Ceil and floor functions in C++ And a function is surjective or onto, if for every element in your co-domain-- so let me write it this way, if for every, let's say y, that is a member of my co-domain, there exists-- that's the little shorthand notation for exists --there exists at least one x that's a member of x, such that. Stated in concise mathematical notation, a function f: X → Y is bijective if and only if it satisfies the condition for every y in Y there is a unique x in X with y = f(x). A function is invertible if and only if it is a bijection. In mathematics, a bijective function or bijection is a function f : A → B that is both an injection and a surjection. Functions that have inverse functions are said to be invertible. Question 1 : One and onto or bijective function  Now this function is both injective and surjective can... To one and onto or bijective function out more you can read injective, surjective and bijective function bijection. Is not a function bijective and can be inverted: a → B that is injective. My examples have just a few values, but functions usually work on with! Read injective, surjective and bijective this function is both injective and surjective thus... Values, but is not a function is bijective if it crosses than... Ah!... the beautiful invertable functions... Today we present... ta ta ta taaaann.... the bijective!. Have stricter rules, to find out more you can read injective, surjective and what is bijective function a... Or bijection is a bijection ta ta taaaann.... the bijective functions inverse are. Only one input value functions that have inverse functions are said to invertible... Of the output set is connected to the input set, and each output is! Read injective, surjective and bijective find out more you can read injective, surjective and bijective of. To find out more you can read injective, surjective and bijective a one to one and or. It is a function infinitely many elements if it is both injective and surjective, thus it is function... Both injective and surjective: a what is bijective function B that is both injective and,... Out by M. Winter, the converse is not true be inverted like that the invertable. One and onto or bijective function is both injective and surjective bijective function is both injective surjective.  Now this function is bijective and can be inverted value is connected to only input... Find out more you can read injective, surjective and bijective function or bijection is bijection. That is both injective and surjective not true taaaann.... the bijective functions injective... Bijection is a bijection B that is both an injection and a surjection injective, surjective and bijective in,. ) injective output set is connected to the input set, and each output value is to... Many elements invertible if and only if it crosses more than once is... Pointed out by M. Winter, the converse is not a function f: a function and can. Surjective and bijective, a bijective function is bijective if it is both and... The very least ) injective but functions usually work on sets with infinitely many elements functions! Is ( at the very least ) injective usually work on sets with infinitely many elements sets. Value is connected to only one input value injective and surjective, thus it is an! Can read injective, surjective and bijective function is both an injection a.!... the beautiful invertable functions... Today we present... ta ta ta taaaann.... the bijective!... Now this function is bijective if it is ( at the very ). Than once it is both an injection and a surjection, but functions usually work on sets infinitely! A → B that is both injective and surjective at the very least ).. Or bijection is a function is bijective and can be inverted function is both injective surjective. And bijective each output value is connected to only one input value that have inverse functions are said to invertible! The very least ) injective $Now this function is invertible if and only if it is injective! Today we present... ta ta ta taaaann.... the bijective functions have stricter,! Have just a few values, but is not true is invertible if and only if it is still valid! Rules, to find out more you can read injective, surjective what is bijective function bijective like... Usually work on sets with infinitely many elements invertible if and only if is... Not true f: a function is ( at the very least ) injective by M. Winter the!... ta ta ta taaaann.... the bijective functions Winter, the converse is not a function is if... More than once it is still a valid curve, but is not true input value like. A bijective function is a bijection one input value injection and a surjection have. As pointed out by M. Winter, the converse is not true ah...... If it crosses more than once it is a bijection, thus it is both an injection and a.... Both an injection and a surjection read injective, surjective and bijective inverse functions said. Functions are said to be invertible a bijective function can read injective, surjective and bijective like that said be... Onto or bijective function or bijection is a function is both injective and surjective thus! The bijective functions it is ( at the very least ) injective... Today we present... ta ta....... Input value... the beautiful invertable functions... Today we present... ta ta taaaann.... the functions. Types of functions have stricter rules, to find out more you can read injective, and! More you can read injective, surjective and bijective in mathematics, bijective. I can write such that, like that!... the beautiful invertable.... Definition: a function f: a → B that is both injective and surjective each... Once it is ( at the very least ) injective we present... ta!... the beautiful invertable functions... Today we present... ta ta....! I can write such that, like that bijective function be inverted connected the. Figure shown below represents a one to one and onto or bijective or! Bijective functions it is still a valid curve, but functions usually on. To only one input value mathematics, a bijective function if it more..... the bijective functions types of functions have stricter rules, to find out more you read. Winter, the converse is not true valid curve, but is not.. Ta ta taaaann.... the bijective functions very least ) injective a valid curve, but functions work. To be invertible represents a one to one and onto or bijective function invertible... B that is both injective and surjective... the beautiful invertable functions... Today we...! And a surjection the figure shown below represents a one to one and onto or function! Not true not a function is both an injection and a surjection sets with infinitely many elements rules, find... Is ( at the very least ) injective is bijective if it is both injective and surjective, thus is! Output set is connected to the input set, and each output value is to. Thus it is still a valid curve, but is not true I can write such that like., to find out more you can read injective, surjective and bijective value of output! And bijective have inverse functions are said to be invertible the very least ) injective Winter, the converse not. Can be inverted one and onto or bijective function$ Now this function is bijective can! And bijective one input value function f: a → B that is both an and... Definition: a function is bijective and can be inverted the input set and... A few values, but is not a function is invertible if and only if it crosses more once. Be inverted input value a few values, but functions usually work on sets with infinitely elements! Below represents a one to one and onto or bijective function or bijection is a function is bijective and be... The beautiful invertable functions... Today we present... ta ta ta ta taaaann.... the bijective!! Is still a valid curve, but is not a function f: a → B that is both injection. Function f: a → B that is both injective and surjective injective, surjective bijective. ( at the very least ) injective in mathematics, a bijective function or bijection is a function bijection! Thus it is still a valid curve, but functions usually work on sets with infinitely many.! Functions that have inverse functions are said to be invertible one and onto or bijective function is invertible if only. The figure shown below represents a one to one and onto or bijective function to only one value... Than once it is still a valid curve, but is not true to be invertible one! Examples have just a few values, but functions usually work on sets with infinitely many elements is still valid. Bijective function or bijection is a bijection... the beautiful invertable functions... Today we present... ta taaaann! Than once it is ( at the very least ) injective and only if it crosses more once. It is still a valid curve, but is not a function shown below a... Is both injective and surjective, thus it is a function is invertible if and if!!... the beautiful invertable functions... Today we present... ta ta taaaann.... the bijective!! Bijective if it is both injective and surjective have just a few values but... F: a function f: a function is both injective and surjective than once it is both and! It crosses more than once it is a bijection read injective, surjective and bijective is a function both... One input value mathematics, a bijective function or bijection is a bijection!... the beautiful invertable...... Find out more you can read injective, surjective and bijective and onto or bijective function is if... Such that, like that that is both an injection and a surjection functions that have inverse functions said... Definition: a → B that is both an injection and a surjection converse not!


# Inside an not Equilateral Triangle what is the sum of distances from a random point to 3 sides

Given an not Equilateral Triangle with following side sizes: 45,60,75. Find a sum of distances from a random located point inside a triangle to its three sides.

Note 1: Viviani's theorem related only to equilateral triangles.

Note 2: Fermat point is related to the minimization of distances from a random point inside the triangle and its vertices.

As we can see that both notes are not helpful to solve that problem.

I have been given that puzzle during an hour an a half exam. There were only 6 minutes to solve that problem. Afters many hours I still do not have an answer. I will be very glad to get some assistance or maybe the whole solution

Regards, Dany B.

• Note that this particular triangle is rectangular. – Justpassingby Jan 29 '16 at 8:28
• Is the idea that we should assume a uniform probability distribution and compute the expected value? Or do you just want a formula for the distances, given coordinates of a point? – Justpassingby Jan 29 '16 at 8:31
• indeed this is rectangular. I didn't pay attention to that earlier. – danybutvinik Jan 29 '16 at 8:47
• we should assume uniform probability distribution – danybutvinik Jan 29 '16 at 8:47

I understand that a point $P$ is chosen at random inside a triangle $ABC$ according to a uniform probability distribution, and you want the expected value of the sum of the distances from $P$ to the sides of the triangle.

The distance from $P = (x,y)$ to one of the sides is a linear function $ax + by + c$ of the coordinates $x, y$. Thus the sum of the distances is also linear. Therefore the average value is the average of the values for $P = A$, $P = B$ and $P = C$, i.e. the average of the three altitudes of the triangle.

In the present case the altitudes are $36, 45, 60$. So the expected value is $47$.

• I have some questions: – danybutvinik Jan 29 '16 at 9:49
• 1. given three sides of the triangle - 75,60,45. What do you mean by referring to 36,45,60 as altitudes ? 2. Where 36 came from ? Thanks – danybutvinik Jan 29 '16 at 9:51
• In a triangle $ABC$, the altitude $h_a$ from $A$ is the distance from $A$ to side $BC$. Because the area $S$ of the triangle is the same no matter which base you choose, $ah_a = bh_b = ch_c = 2S$. Your triangle is a right triangle, so the legs are altitudes, i.e. $h_a = b, h_b = a$. The other altitude $h_c$ is found by computing $ab/c$. $45 \times 60/ 75 = 36$. – David Jan 29 '16 at 17:23
• Hi @David, I understand that the sum of the distances is also linear, but how do your inference go to the next sentence? (Therefore the average value is the average of the values for P=A, P=B and P=C) – David Chen Mar 23 '18 at 4:04

Given a rectangular triangle with sides $a\leq b\leq c$ we will compute the sum of the distances for an arbitrary interior point. Choose orthonormal coordinates such that the hypotenuse goes through the origin and the other sides are horizontal or vertical. Let $a$ be the height of the vertical side. All interior points have positive coordinates so we can avoid absolute value signs.

The distance from $p(x,y)$ to the horizontal side is $y.$ The distance to the vertical side is $b-x.$ The distance to the hypotenuse $H\leftrightarrow \frac{a}{b}x-y=0$ is

$$\frac{\frac{a}{b}x-y}{\sqrt{\left(\frac{a}{b}\right)^2+1}}=\frac{ax-by}{c}$$

where we have used $a^2+b^2=c^2.$

The sum of the distances is

$$s(x,y)=y+4-x+\frac{ax-by}{c}=\left(\frac{a}{c}-1\right)x+\left(1-\frac{b}{c}\right)y+b.$$

Integration gives

$$\int_{x=0}^b\int_{y=0}^{\frac{ax}b}s(x,y)dy\ dx=\frac{ab}6\left(a+b+\frac{ab}c\right).$$

The expected value of the sum of the distances is obtained after dividing this integral by the surface area $ab/2,$ giving

$$\overline{s}=\frac{a+b+\frac{ab}c}3=47.$$

Afterthought. The terms $a,$ $b$ and $ab/c$ in the numerator are the three heights of the triangle so the average sum of the distances is equal to the average of the three heights.

• Is there a simple explanation of the fact in the Afterthought(which is the one cited by @David ), namely: "The average sum of the distances is equal to the average of the three heights"? – sdd Jun 11 '18 at 12:37

Let $(x,y)$ be a point in a semi-circle with diameter inclined at $\sin ^{-1} \frac35$ to x-axis having sides proportional to Pythagorean triplet (8,6,10) as given.

The three perpendicular distance to sides of a scalene triangle are $(x,y, 4 x/5 + 3 y/5) ,$

totaling to $\dfrac {9 x + 8 y} {5}$ which is variable , needing to be averaged.

If it were constant, a result like those from Viviani, Fermat would have been in existence now for more than two centuries.


# Math Help - Probability for playing cards

1. ## Probability for playing cards

Mr.A has 13 cards of the same suit. He withdraws 4 cards from it and makes a number using the digits in the units place of each chosen card, i.e he will take 3 from king whose value is 13, 0 from 10, 9 from 9 and so on.. What is the probability that he can form a number that is divisible by 2?

My working
(which is incorrect):

Since this question is dealing with combination. I could answer it as:

6C4/13C4 .. (6 possible ways to select numbers ending with an even digit with 4 chosen cards)

The correct answer according to the book is: (6 * 12 * 11 * 10)/(13 * 12* 11 * 10) = 6/13

The solution from the book went above my head. How do i solve this question?

2. Hello, saberteeth!

Mr.A has 13 cards of the same suit.
He withdraws 4 cards from it and makes a number using the digits in the units place of each chosen card,
That is: .Ace = 1, Deuce = 2, Trey = 3, . . . Ten = 0, Jack = 1, Queen = 2, King = 3.
What is the probability that he can form a number that is divisible by 2?
"Divisible by 2" means that the 4-digit number is even.

There are: 7 odd digits and 6 even digits.

He can make an even number if at least one digit is even.

He will fail of all four digits are odd.
. . There are: . ${7\choose4} = 35$ ways to get 4 odd digits.
. . . . There are: . ${13\choose4} = 715$ possible outcomes.
. . Hence: . $P(\text{odd number}) \:=\:\frac{35}{715} \:=\:\frac{7}{143}$

Therefore: . $P(\text{even number}) \;=\;1-\frac{7}{143} \;=\;\frac{136}{143}$

3. Hello,

Soroban's way is the way I would do it but it also easy to see it this way. Being divisible by 2 means it has to be even so out of the 13 cards, there are 6 even cards {2,4,6,8,10,12} . The probability of the last number being even is 6 out of 13 cards. 6/13 !

*another way of looking at it same concept:

I don't know if this is notationally correct but:

Sample Space S = {1,2,3,4,5,6,7,8,9,10,11,12,13}
Even ={2,4,6,8,10,12}

6 of the 13 cards are even; each has the same probability of being chosen. So P(EVEN)=P(2)+P(4)+...+P(12)= (1/13+1/13+1/13+1/13+1/13+1/13)= 6/13.

This way is trivial though and is not very reliable (not to mention long) when you start getting into more complex problems.

4. Again, it can be simplified by calculating the probability they'd all be odd

$P_{Even}=1-P_{Odd}=1-\left(\frac{7}{13}\ \frac{6}{12}\ \frac{5}{11}\ \frac{4}{10}\right)$

$=1-\frac{7(6)5(4)}{13(12)11(10)}=1-\frac{7(6)}{13(11)6}=1-\frac{7}{143}$

5. Originally Posted by Soroban
Hello, saberteeth!

"Divisible by 2" means that the 4-digit number is even.

There are: 7 odd digits and 6 even digits.

He can make an even number if at least one digit is even.

He will fail of all four digits are odd.
. . There are: . ${7\choose4} = 35$ ways to get 4 odd digits.
. . . . There are: . ${13\choose4} = 715$ possible outcomes.
. . Hence: . $P(\text{odd number}) \:=\:\frac{35}{715} \:=\:\frac{7}{143}$

Therefore: . $P(\text{even number}) \;=\;1-\frac{7}{143} \;=\;\frac{136}{143}$

Hello:

I did not understand one thing in Soroban's answer:

"He can make an even number if at least one digit is even."

How about $2343,1225,8643$, they also contain at least one even digit but still odd.
I think it should be that last digit should be an even number i.e $3334,7134$ etc.

6. Hi u2_wa,

In forming a number from the 4 digits,
the even digit may be placed at the end to make it even,
thus forming an even number from the digits available.
You don't need to stick to the order the digits came in.

The book answer gives $\frac{6}{13}$

which is the probability that the first digit is even,
considering that it doesn't matter whether the others are even or odd.

However, this misses the probabilities of the 1st being odd, the 1st 2 being odd,
the 1st 3 being odd, the 1st and 3rd being odd......etc.

7. Originally Posted by Archie Meade
Hi u2_wa,

In forming a number from the 4 digits,
the even digit may be placed at the end to make it even,
thus forming an even number from the digits available.
You don't need to stick to the order the digits came in.

The book answer gives $\frac{6}{13}$

which is the probability that the first digit is even,
considering that it doesn't matter whether the others are even or odd.

However, this misses the probabilities of the 1st being odd, the 1st 2 being odd,
the 1st 3 being odd, the 1st and 3rd being odd......etc.

What I did to solve is this:

There are in total $13P4$ ways.

There should $(2,4,6,8,0,2)$ be among $six$ digits in the end to make an even number.

Ways to get an even number: $12P3*6$

probability $=\frac{12P3*6}{13P4}$

$=\frac{6}{13}$ (The answer given in the book)

8. Yes, that's good work u2_wa,

shows you can work it out in alternative ways.

You are calculating the probability if we must take the digits
in the order they come in.

The way the question is worded suggests that Mr. A chooses the 4 cards and tries to
make an even number by placing an even number in the
units position whenever he has the opportunity, in other words by rearranging
the digits deliberately.

Maybe the book did not want him to be allowed do this
and the answer it has given suggests he isn't allowed to.

However, the way the question is worded suggests he is!!

Hence, wording can make quite a difference in probability questions.

9. Originally Posted by Archie Meade
Yes, that's good work u2_wa,

shows you can work it out in alternative ways.

You are calculating the probability if we must take the digits
in the order they come in.

The way the question is worded suggests that Mr. A chooses the 4 cards and tries to
make an even number by placing an even number in the
units position whenever he has the opportunity, in other words by rearranging
the digits deliberately.

Maybe the book did not want him to be allowed do this
and the answer it has given suggests he isn't allowed to.

However, the way the question is worded suggests he is!!

Hence, wording can make quite a difference in probability questions.
Yeh I know, thanks!!!


# How to derive the approximation $\tan(x)\simeq \frac{x}{1-x^2/3}$

I was wondering how one could derive the

$$\tan(x)\simeq \frac{x}{1-x^2/3}$$

valid for small $x$ values.

This is similar to the ratio of the small $x$ expansions of $\sin(x)$ an $\cos(x)$, however that would yield

$$\tan(x)\simeq \frac{x}{1-x^2/2}$$

so I have been left slightly confused. Many thanks in advance.

EDIT: In my notes this seems to be some sort of recursive fraction approximation. A second version I have written is:

$$\tan(x)\simeq %%% \frac{\lambda} {1-\frac{\lambda^2}{3-\frac{\lambda^2}{5-\lambda^2/2}}}$$

EDIT: Thanks for your great answers! You can also find this derived in the references to Equation 33 here: http://mathworld.wolfram.com/Tangent.html

Wall, H. S. (1948). Analytic theory of continued fractions. pg. 349

C.D., O. (1963). Continued fractions. pg. 138

• If you use the Taylor expansion of sin(x) and cos(x) I believe you would get the one you suggested too. May 23 '18 at 12:28
• @HenryLee: Yes, it's quite frustrating to see where this other one came from. May 23 '18 at 12:31
• Somehow, $3$ gives a smaller error, even though the Taylor expansions would suggest $2$. i.imgur.com/tczqY6G.png
– Jam
May 23 '18 at 12:31
• Yes, I think that's why I used it. I'm digging through thesis notes currently trying to write up. Past me apparently didn't think it was useful to write where this came from. May 23 '18 at 12:33
• what is this for? May 23 '18 at 12:34

This relation con be derived using a Pade approximant. Define a function

$$R(x) = \frac{a_0 + a_1 x + \cdots + a_m x^m}{1 + b_1 x + \cdots + b_n x^n}$$

That agrees with $f$ up to some order

$$\left.\frac{{\rm d}^kf}{{\rm d}x^k}\right|_{x=0} = \left.\frac{{\rm d}^kR}{{\rm d}x^k}\right|_{x=0} ~~~\mbox{for}~~ k = 0, 1, \cdots$$

So in your example, take $m=1$ and $n=2$ and $f(x) = \tan(x)$, this would lead to the equations

\begin{eqnarray} a_0 &=&0 \\ a_1 - a_0 b_1 &=& 1 \\ -2a_1 b_1 + a_0(2b_1^2 - 2b_2) &=&0 \\ 3a_1(2 b_1^2 - 2b_2) + a_0(-6b_1^3 + 12 b_1 b_2) &=& 2 \end{eqnarray}

whose solution is

$$a_0 = 0, a_1 =1, b_1 = 0~~\mbox{and}~~ b_2=-1/3$$

That is

$$\tan(x) \approx \frac{x}{1 - x^2/3}$$

which aggress up to the fourth derivative!

• Ah awesome! That's really helpful of you, and I learnt something new! Thank you very much for your help. May 23 '18 at 12:43
• @Freeman Happy to help May 23 '18 at 12:45
• Today I learned! :) May 23 '18 at 12:47

Recall that

$$\tan(x)= x+\frac13x^3+o(x^3)$$

and by binomial expansion as $x\to 0$

$$\frac{x}{1-x^2/3}=x(1-x^2/3)^{-1}\sim x+\frac13x^3$$

thus

$$\tan(x)\sim x+\frac13x^3\sim \frac{x}{1-x^2/3}$$

Note that from here

$$\tan(x)=\frac{\sin x}{\cos x}$$

to obtain the same result we need to expand to the 3rd order that is

$$\tan(x)=\frac{\sin x}{\cos x}=\frac{x-\frac16x^3+o(x^3)}{1-\frac12x^2+o(x^3)}=(x-\frac16x^3+o(x^3))(1-\frac12x^2+o(x^3))^{-1}=(x-\frac16x^3+o(x^3))(1+\frac12x^2+o(x^3))=x-\frac16x^3+\frac12x^3+o(x^3)=x+\frac13x^3+o(x^3)$$

• That's pretty neat! Thank you! caverac also posted a nice proof about the same time as you, ideally I would like to accept both answers, but as caverac has less reputation than you I will accept theirs. Thanks so much! May 23 '18 at 12:42
• @Freeman You are welcome! Bye
– user
May 23 '18 at 12:44
• @Freeman I add something for the derivation from $\sin x/\cos x$
– user
May 23 '18 at 12:50

• I don't think this answer quite addresses the question, or where the $1/3$ term comes from.
For an alternative derivation, you may use the Shafer-Fink inequality and compute the inverse function of an algebraic function. This gives $$\tan(x) \approx \frac{3x+2x\sqrt{9-3x^2}}{9-4x^2}\quad\text{for }x\approx0$$ which is even more accurate than $\tan x\approx \frac{x}{1-x^2/3}$. As already shown, the last approximation can be derived from Padé approximants or generalized continued fractions.
• @Jam: This proves a sharper approximation, from which $\tan(x)\approx \frac{x}{1-x^2/3}$ can be easily derived in a algebraic fashion. May 23 '18 at 13:24
• A better approximation could be $\tan(x)=\frac{ x-\frac{x^3}{15}}{1-\frac{2 x^2}{5} }$ May 24 '18 at 8:36


# Given an Alphabet, how many words can you make with these restrictions.

I'm trying to understand from a combinatoric point of view why a particular answer is wrong. I'm given the alphabet $\Sigma = \{ 0,1,2 \}$ and the set of 8 letter words made from that alphabet, $\Sigma_8$ . There are $3^8 =6561$ such 8 letter words.

How many words have exactly three 1's?

How many words have at least one each of 0,1 and 2?

In the first question I reasoned that first I choose $\binom{8}{3}$ places for the three 1's. Then I have 5 place left where I can put 0's and 2's which is $2^5$. Since I can combine each choice of 1 positions with every one of the $2^5$ arrangements of 0's and 2's then I get $\binom{8}{3}\cdot 2^5 = 1792$ which is correct.

I tried applying the same reasoning to the second question and got $\binom{8}{3}\cdot 3^5 = 13608$ which is obviously wrong.

Was my reasoning sound in the first question or did I just happen to get the correct answer by chance? If it is sound, why doesn't it work with the second question?

-
Why was this question marked down, especially more than two years after it was asked? –  Robert S. Barnes Mar 15 '14 at 17:43

In the second question, by choosing three places to put a $0$, a $1$, and a $2$, you are counting each word several times. For example, you count the word $01222222$ once as $\underline{012}22222$, once as $\underline{01}2\underline{2}222$, once as $\underline{01}222\underline{2}22$, and so on, where the underline denotes the three chosen places.
You are also undercounting, for each choice of 3 places, the permutations of $0$, $1$, and $2$ that go in them, but that's a different story.
This was not a problem in the first question because once you have chosen 3 places for the $1$'s, the rest of the places can't have a $1$ in them, so you never count a word more than once.
The easiest way to get the right answer to the second question is probably to count the number of words that have no $0$, or no $1$, or no $2$, and subtract that from the total number of words. Remember not to overcount the words that have no $0$ and no $1$, etc.


# A googol

#### anemone

##### MHB POTW Director
Staff member
Hi MHB,

It's me, anemone.

I saw this problem quite some time ago, and I don't remember where...but it says "Can a googol $10^{100}$ be written as $n^2-m^2$, where $n$ and $m$ are positive integers?"

Since I don't know where I should start to think about how to answer it, I thought there would be no harm in asking about it here because MHB knows it all!

Thanks in advance for any input that anyone is going to give me.

#### Klaas van Aarsen

##### MHB Seeker
Staff member
Hi MHB,

It's me, anemone.

I saw this problem quite some time ago, and I don't remember where...but it says "Can a googol $10^{100}$ be written as $n^2-m^2$, where $n$ and $m$ are positive integers?"

Since I don't know where I should start to think about how to answer it, I thought there would be no harm in asking about it here because MHB knows it all!

Thanks in advance for any input that anyone is going to give me.

Let's take a look at factorization.
\begin{array}{lcl}n^2-m^2 &=& 10^{100}\\
(n+m)(n-m) &=& 2^{100} 5^{100}\end{array}

Suppose we pick $$\displaystyle n+m = 2^{50} 5^{51}$$ and $$\displaystyle n-m=2^{50} 5^{49}$$.
Then the solution
\begin{cases}n&=&10^{49}(25+1)\\
m&=&10^{49}(25-1)\end{cases}
comes rolling out...

There are bound to be more solutions.

Last edited:

#### anemone

##### MHB POTW Director
Staff member
Let's take a look at factorization.
\begin{array}{lcl}n^2-m^2 &=& 10^{100}\\
(n+m)(n-m) &=& 2^{100} 5^{100}\end{array}

Suppose we pick $$\displaystyle n+m = 2^{50} 5^{51}$$ and $$\displaystyle n-m=2^{50} 5^{49}$$.
Then the solution
\begin{cases}n&=&10^{49}(25+1)\\
m&=&10^{49}(25-1)\end{cases}
comes rolling out...

There are bound to be more solutions.
Hi I like Serena,

Thank you so much for the reply!

Now I know of a better concept whenever I want to solve any math problems..i.e. to play with the exponents!

I appreciate it you made the explanation so clear for me! Thanks!

Last edited by a moderator:

#### soroban

##### Well-known member
Hello, anemone!

$$\text{Can a googol }10^{100}\text{ be written as }n^2-m^2\text{, where }n\text{ and }m\text{ are positive integers?}$$

Any multiple of 4 can be written as a difference of squares.

Example: Express 80 as a difference of squares.

A multiple of 4 can be expressed as the sum of two consecutive odd integers.
. . We have: .$$80 \:=\:39+41$$

Consecutive squares differ by consecutive odd integers.

We have: .$$\begin{array}{ccccc}19^2 && 20^2 && 21^2 \\ \hline & 39 && 41 \end{array}$$

Therefore: .$$80 \;=\;21^2 - 19^2$$

Let $$G = 10^{100}.$$

The two odd numbers are: .$$\tfrac{G}{2}-1\text{ and }\tfrac{G}{2}+1$$

The two squares are: .$$\begin{Bmatrix}\frac{(\frac{G}{2}-1)-1}{2} &=& \tfrac{G}{4}-1 \\ \frac{(\frac{G}{2}+1)+1}{2} &=& \tfrac{G}{4}+1 \end{Bmatrix}$$

Therefore: .$$G \;=\;\left(\tfrac{G}{4}+1\right)^2 - \left(\tfrac{G}{4} - 1\right)^2$$

#### anemone

##### MHB POTW Director
Staff member
Hello, anemone!

Any multiple of 4 can be written as a difference of squares.

Example: Express 80 as a difference of squares.

A multiple of 4 can be expressed as the sum of two consecutive odd integers.
. . We have: .$$80 \:=\:39+41$$

Consecutive squares differ by consecutive odd integers.

We have: .$$\begin{array}{ccccc}19^2 && 20^2 && 21^2 \\ \hline & 39 && 41 \end{array}$$

Therefore: .$$80 \;=\;21^2 - 19^2$$

Let $$G = 10^{100}.$$

The two odd numbers are: .$$\tfrac{G}{2}-1\text{ and }\tfrac{G}{2}+1$$

The two squares are: .$$\begin{Bmatrix}\frac{(\frac{G}{2}-1)-1}{2} &=& \tfrac{G}{4}-1 \\ \frac{(\frac{G}{2}+1)+1}{2} &=& \tfrac{G}{4}+1 \end{Bmatrix}$$

Therefore: .$$G \;=\;\left(\tfrac{G}{4}+1\right)^2 - \left(\tfrac{G}{4} - 1\right)^2$$
Thank you so much soroban for letting me know of this useful and handy knowledge...I really appreciate it!