text:
Courses
Courses for Kids
Free study material
Free LIVE classes
More

Maharashtra Board Class 10 Solutions for Maths Chapter 5: Probability

Download Free PDF with Solutions of Probability Class 10, Chapter 5

Last updated date: 17th Mar 2023
Total views: 38.4k
Views today: 0.18k

Probability is an essential chapter for Class 10 students in the Maharashtra Board. The chapter introduces students to the concept of Probability and followed with solved examples and practice questions. In this chapter, students will be able to learn all the methods to solve questions on Probability. In order to understand the chapter in detail, refer to the PDF where solutions can be downloaded for the chapter.

These solutions for Maharashtra Board Class 10 Maths Chapter 5 Probability have been carefully designed by the subject matter experts at Vedantu who are completely well-versed with the essential topics and sub-topics included in the chapter. Downloading the Probability Chapter 5 solutions will help students gain a better understanding of the chapter.

Competitive Exams after 12th Science
Do you need help with your Homework? Are you preparing for Exams?
Study without Internet (Offline)

Access Maharashtra Board solutions for Maths class 10 chapter 5 Probability

Practice set  5.1

1. How many possibilities are there in each of the following?

1. Vanita knows the following sites in Maharashtra. She is planning to visit one of them in her summer vacation. Ajintha, Mahabaleshwar, Lonar Sarovar, Tadoba wild life sanctuary, Amboli, Raigad, Matheran, Anandavan.

2. Any day of a week is to be selected randomly.

3. Select one card from the pack of $52$ cards.

4. One number from $10$ to $20$ is written on each card. Select one card randomly.

Ans:

1. Vanita knows the following sites in Maharashtra. She is planning to visit one of them during her summer vacation. Ajintha, Mahabaleshwar, Lonar Sarovar, Tadoba wildlife sanctuary, Amboli, Raigad, Matheran, Anandavan.

So, given sites are $8$ then the possibilities are $8$.

1. Any day of a week is to be selected randomly, so in a week there are $7$ days thus, there are $7$ possibilities.

2. Select one card from the pack of $52$ cards, hence there are $52$ possibilities are there are $52$ cards available.

3. One number from $10-20$ is written on each card. Select one card randomly so, the possibility is $11$ as there are total $11$ ways to select a card randomly.

Practice set 5.2

1. For each of the following experiments write sample space ‘S’ and number of sample points $n\left( S \right)$.

1. One coin and one die are thrown simultaneously .

2. Two-digit numbers are formed using digits $2,3\And 5$ without repeating a digit.

Ans:

1. One coin and one die are thrown simultaneously

So, sample space will be $\Rightarrow S=\left\{ 1H,1T,2H,2T,3H,3T,4H,4T,5H,5T,6H,6T \right\}$

We calculated the sample space by using the formula $n\left( E_1 \right) \times n\left( E_2 \right)$.

Number of events in sample space $S$ will be $n\left( S \right)=12$.

1. Two-digit numbers are formed using digits $2,3\And 5$ without repeating a digit.

calculate the sample by using the formula $n\left( E_1 \right) \times n\left( E_2 \right)$.

So, sample space will be $S=\left\{ 23,25,32,35,52,53 \right\}$.

Number of events in sample space $S$, $n\left( S \right)=6$.

2. The arrow is rotated and it stops randomly on the disc. Find out on which color it may stop.

(Image will be uploaded soon)

Ans: As per the question it is given that the arrow is rotated and it stops randomly on the disc.

It has six options so it can be stopped at any one.

So, sample space, $\Rightarrow S=\left\{ \operatorname{Re}d,purple,orange,yellow,blue,green \right\}$

Number of events in sample space we can see are $6$thus, $n\left( S \right)=6$.

3. In the month of March $2019$, find the days on which the date is a multiple of $5$.

(Image will be uploaded soon)

Ans: First write all the multiples of $5$so, multiples of $5$are $5,10,15,20,25,30$.

Thus,

• Tuesday: $5-mar-2019$

• Sunday: $10-mar-2019$

• Friday: $15-mar-2019$

• Wednesday: $20-mar-2019$

• Monday: $25-mar-2019$

• Saturday: $30-mar-2019$

4. Form a ‘Road safety committee of two, from $2$ boys $\left( B_1,B_2 \right)$ and $2$ girls $\left( G_1,G_2 \right)$. Complete the following activity to write the sample space.

1. Committee of $2$ boys $=?$

2. Committee of$2$ girls $=?$

3. committee of $1$ boy and $1$ girl is equal to $B_1G_1,?,?,?$

4. Sample space $S=\left\{ ....,....,.....,...,...,..., \right\}$

Ans:

1. As it is clearly seen, the committee of $2$ boys will be $B_1, B_2$.

2. Committee of $2$ girls will be $G_1,G_2$.

3. Committee of $1$ boy and $1$ girl will be $\left( B_1G_1,B_1G_2,B_2G_1,B_2G_2 \right)$ any event can be possible.

4. Sample space $S=\{B_1G_1,B_1G_2,B_2G_1,B_2G_2\}$

Practice set 5.3

1. Write sample space ‘S’ and number of sample points $n\left( S \right)$ for each of the following experiments. Also write events A,B,C in the set form and write $n\left( A \right), n\left( B \right), n\left( C \right).$

1. One die is rolled.

Event A: even number on the upper face.

Event B: odd number on the upper face.

Event C: prime number on the upper face.

1. Two dice are rolled.

Event A: The sum of the digits on upper faces is a multiple of $6$.

Event B: The sum of the digits on the upper faces is minimum $10$.

Event C: The same digit on both the upper faces.

1. Three coins are tossed simultaneously.

Condition for event A: To get at least two heads.

Condition for event B: To get no head.

Condition for event C: To get head on the second coin.

1. Two digit numbers are formed using digits $0,1,2,3,4,5$ without repetition of the digits.

Condition for event A: The number formed is even

Condition for event B: The number formed is divisible by $3$.

Condition for event C: The number formed is greater than $50$.

1. From three men and two women, an environment committee of two persons is to be formed.

Condition for event A: There must be at least one woman member.

Condition for event B: One man, one woman committee to be formed.

Condition for event C: There should not be a woman member.

1. One coin and one die are thrown simultaneously.

Condition for event A: To get head and an odd number.

Condition for event B: To get a head or tail and an even number.

Condition for event C: Number on the upper face is greater than $7$ and the tail on the coin.

Ans:

A. One die is rolled.

• Event A: even number on the upper face.

• Event B: odd number on the upper face.

• Event C: prime number on the upper face.

So, sample space $\Rightarrow S=\left\{ 1,2,3,4,5,6 \right\}$, number of sample point will be $n\left( S \right)=6$.

$A=\left\{ 2,4,6 \right\},n\left( A \right)=3$

$B=\left\{ 1,3,5 \right\},n\left( B \right)=3$

$C=\left\{ 2,3,5 \right\},n\left( C \right)=3$

B. Two dice are rolled.

• Event A: The sum of the digits on upper faces is a multiple of $6$.

• Event B: The sum of the digits on the upper faces is minimum $10$.

• Event C: The same digit on both the upper faces.

So, sample space will be

$S=\left\{ \left( 1,1 \right)\left( 1,2 \right)\left( 1,3 \right)\left( 1,4 \right)\left( 1,5 \right)\left( 1,6 \right) \left( 2,1 \right)\left( 2,2 \right)\left( 2,3 \right)\left( 2,4 \right)\left( 2,5 \right)\left( 2,6 \right) \left( 3,1 \right)\left( 3,2 \right)\left( 3,3 \right)\left( 3,4 \right)\left( 3,5 \right)\left( 3,6 \right) \left( 4,1 \right)\left( 4,2 \right)\left( 4,3 \right)\left( 4,4 \right)\left( 4,5 \right)\left( 4,6 \right) \left( 5,1 \right)\left( 5,2 \right)\left( 5,3 \right)\left( 5,4 \right)\left( 5,5 \right)\left( 5,6 \right) \left( 6,1 \right)\left( 6,2 \right)\left( 6,3 \right)\left( 6,4 \right)\left( 6,5 \right)\left( 6,6 \right)\right\}$

Thus, number of sample points $n\left( S \right)=36$

$A=\left\{ \left( 1,5 \right)\left( 2,4 \right)\left( 3,3 \right)\left( 4,2 \right)\left( 5,1 \right)\left( 6,6 \right) \right\},n\left( A \right)=6$

$B=\left\{ \left( 4,6 \right)\left( 5,5 \right)\left( 5,6 \right)\left( 6,4 \right)\left( 6,5 \right)\left( 6,6 \right) \right\},n\left( B \right)=6$

$C=\left\{ \left( 1,1 \right)\left( 2,2 \right)\left( 3,3 \right)\left( 4,4 \right)\left( 5,5 \right)\left( 6,6 \right) \right\},n\left( C \right)=6$

C. Three coins are tossed simultaneously.

• Condition for event A: To get at least two heads.

• Condition for event B: To get no head.

• Condition for event C: To get head on the second coin.

Sample space $S=\left\{ HHH,HHT,HTT,HTH,THT,TTH,THH,TTT \right\}$

Thus, number of sample points $n\left( S \right)=8$.

$A=\left\{ HHH,HTH,HHT,THH \right\},n\left( A \right)=4$

$B=\left\{ TTT \right\},n\left( B \right)=1$

$C=\left\{ HHH,HHT,THH \right\},n\left( C \right)=3$

D. Two digit numbers are formed using digits $0,1,2,3,4,5$ without repetition of the digts.

• Condition for event A: The number formed is even

• Condition for event B: The number formed is divisible by $3$.

• Condition for event C: The number formed is greater than $50$.

Sample space $S=\left\{10,12,13,14,15,20,21,23,24,25,30,31,32,34,35,40,41,42,43,45,50,51,52,53,54 \right\}$

Number of sample points $n\left( S \right)=25$

$A=\left\{ 10,12,14,20,24,30,32,34,40,42,50,52,54 \right\},n\left( A \right)=13$

$B=\left\{ 12,15,21,24,30,42,45,51,54 \right\},n\left( B \right)=9$

$C=\left\{ 51,52,53,54 \right\},n\left( C \right)=4$

2. From three men and two women, an environment committee of two persons is to be formed.

• Condition for event A: There must be at least one woman member.

• Condition for event B: One man, one woman committee to be formed.

• Condition for event C: There should not be a woman member.

So, sample space will be $\Rightarrow S=\left\{{{M}_{1}}{{M}_{2}},{{M}_{1}}{{M}_{3}},{{M}_{1}}{{F}_{1}},{{M}_{1}}{{F}_{2}},{{M}_{2}}{{M}_{3}},{{M}_{2}}{{F}_{1}},{{M}_{2}}{{F}_{2}},{{M}_{3}}{{F}_{1}},{{M}_{3}}{{F}_{2}},{{F}_{1}}{{F}_{2}}\right\}$

Thus, number of sample points is $n\left( S \right)=10$

$A=\left\{ {{M}_{1}}{{F}_{1}},{{M}_{1}}{{F}_{2}},{{M}_{2}}{{F}_{1}},{{M}_{2}}{{F}_{2}},{{M}_{3}}{{F}_{1}},{{M}_{3}}{{F}_{2}},{{F}_{1}}{{F}_{2}} \right\},n\left( A \right)=7$

$B=\left\{ {{M}_{1}}{{F}_{1}},{{M}_{1}}{{F}_{2}},{{M}_{2}}{{F}_{1}},{{M}_{2}}{{F}_{2}},{{M}_{3}}{{F}_{1}},{{M}_{3}}{{F}_{2}} \right\},n\left( B \right)=6$

$C=\left\{ {{M}_{1}}{{M}_{2}},{{M}_{1}}{{M}_{3}},{{M}_{2}}{{M}_{3}} \right\},n\left( C \right)=3$

A. One coin and one die are thrown simultaneously.

• Condition for event A: To get head and an odd number.

• Condition for event B: To get a head or tail and an even number.

• Condition for event C: Number on the upper face is greater than $7$ and tail on the coin.

So, sample space will be $\Rightarrow \left\{ H1,H2,H3,H4,H5,H6,T1,T2,T3,T4,T5,T6 \right\}$

Thus, number of sample points is $n\left( S \right)=12$

$A=\left\{ H1,H3,H5 \right\},n\left( A \right)=3$

$B=\left\{ H2,H4,H6,T2,T4,T6 \right\},n\left( B \right)=6$

As, number on the upper face is greater than $7$ so, we all know that a dice does not have numbers greater than or equal to $7$. So, $n\left( C \right)=0$.

Practice set 5.4

1. If two coins are tossed, find the probability of the following events.

1. Getting at least one head

2. Getting no head

Ans:

1. As per the question given two coins are tossed

So, we all know that the formula for finding probability is

$\Rightarrow P=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

Thus, sample space will be $S=\left\{HH,HT,TH,TT \right\}$

Favorable outcomes is $3$ which are $\left\{ HH,HT,TH \right\}$

So, the probability of getting at least one head is $p\left( A \right)=\dfrac{3}{4}$.

2. As per the question given, getting no head.

So, we all know that the formula for finding probability is

$\Rightarrow P=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

Thus, sample space will be $S=\left\{HH,HT,TH,TT \right\}$

Favorable outcome is $1$ which are $\left\{TT\right\}$

So, the probability of getting no heads is $p\left( B \right)=\dfrac{1}{4}$.

2. If two dice are rolled simultaneously, find the probability of the following events.

1. The sum of the digits on the upper face is at least $10$.

2. The sum of the digits on the upper face is $33$.

3. The digit on the first die is greater than the digit on the second die.

Ans:

1. As per the question given the sum of the digits on the upper face is at least $10$

So, probability of getting the sum of the digits on the upper faces is at least $10$

$P(A)=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

The sample space will be $\Rightarrow S=\{ \left( 1,1 \right)\left( 1,2 \right)\left( 1,3 \right)\left( 1,4 \right)\left( 1,5 \right)\left( 1,6 \right) \left( 2,1 \right)\left( 2,2 \right)\left( 2,3 \right)\left( 2,4 \right)\left( 2,5 \right)\left( 2,6 \right)\left( 3,1 \right)\left( 3,2 \right)\left( 3,3 \right)\left( 3,4 \right)\left( 3,5 \right)\left( 3,6 \right) \left( 4,1 \right)\left( 4,2 \right)\left( 4,3 \right)\left( 4,4 \right)\left( 4,5 \right)\left( 4,6 \right)\left( 5,1 \right)\left( 5,2 \right)\left( 5,3 \right)\left( 5,4 \right)\left( 5,5 \right)\left( 5,6 \right) \}$

favorable outcome will be $6$ which are $\left\{ \left( 4,6 \right)\left( 5,5 \right)\left( 5,6 \right)\left( 6,4 \right)\left( 6,5 \right)\left( 6,6 \right) \right\}$.

And the total number of outcomes will be $36$

$p\left( A \right)=\dfrac{6}{36}$

$p\left( A \right)=\dfrac{1}{6}$

Hence, the probability of getting the sum of the digits on the upper face is at least $10$ will be $\dfrac{1}{6}$.

2. As per the question, the sum of the digits on the upper face is $33$.

So, probability of getting the sum of the digits on the upper face is $33$

As we all know that the maximum sum on dice could be $12$, so, the favorable outcome is $0$.

thus the probability will be $p\left( B \right)=0$.

Hence, the probability of getting the sum of the digits on the upper face is $33$ will be $0$.

3. As per the question, the digit on the first die is greater than the digit on the second die.

Thus, the probability of getting the digit on the first die is greater than the digit on the second die.

The sample space will be $\Rightarrow S=\{ \left( 1,1 \right)\left( 1,2 \right)\left( 1,3 \right)\left( 1,4 \right)\left( 1,5 \right)\left( 1,6 \right) \left( 2,1 \right)\left( 2,2 \right)\left( 2,3 \right)\left( 2,4 \right)\left( 2,5 \right)\left( 2,6 \right) \left( 3,1 \right)\left( 3,2 \right)\left( 3,3 \right)\left( 3,4 \right)\left( 3,5 \right)\left( 3,6 \right) \left( 4,1 \right)\left( 4,2 \right)\left( 4,3 \right)\left( 4,4 \right)\left( 4,5 \right)\left( 4,6 \right) \left( 5,1 \right)\left( 5,2 \right)\left( 5,3 \right)\left( 5,4 \right)\left( 5,5 \right)\left( 5,6 \right)\}$

Favorable outcomes will be

$\left( 2,1 \right),\left( 3,1 \right),\left( 3,2 \right),\left( 4,1 \right),\left( 4,2 \right),\left( 4,3 \right),\left( 5,1 \right),\left( 5,2 \right),\left( 5,3 \right),\left( 5,4 \right), \left( 6,1 \right),\left( 6,2 \right),\left( 6,3 \right),\left( 6,4 \right),\left( 6,5 \right)$

Favorable outcomes = 15

So, $P(C)=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

$p\left( C \right)=\dfrac{15}{36}$

$p\left( C \right)=\dfrac{5}{12}$

Hence, the probability of getting the digit on the first die is greater than the digit on the second die is $\dfrac{5}{12}$.

3. There are $15$ tickets in a box, each bearing one of the numbers from $1-15$One ticket is drawn at random from the box. Find the probability of event that the ticket drawn –

1. Shows an even number

2. Shows a number which is multiple of $5$.

Ans:

1. As per the question it is given that one ticket is drawn at random, even number between $1-15$ are $\left( 2,4,6,8,10,12,14 \right)=7$

And the sample space will be $\Rightarrow S=\left\{ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 \right\}=15$

Formula to find probability $p\left( E \right)=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

So the probability of the ticket showing an even number is $p\left( E \right)=\dfrac{7}{15}$.

2. As per the question it is given that one ticket is drawn at random, so number which are multiple of $5$ between $1-15$ are $\left( 5,10,15 \right)=3$, thus probability of getting a number multiple of $5$ is $\Rightarrow \dfrac{3}{15}=\dfrac{1}{5}$.

4. A two digit number is formed with digits $2,3,5,7,9$ without repetition. What is the probability that the number formed is:

1. An odd number

2. A multiple of $5$

Ans:

1. A two digit number is formed with digits $2,3,5,7,9$ without repetition.

So, the sample space of will be $\Rightarrow S=\left\{ 23,25,27,29,32,35,37,29,52,53,57,59,72,73,75,79,92,93,95,97 \right\}=20$

Favorable outcome is $\Rightarrow \left\{ 23,25,27,29,35,37,39,53,57,59,73,75,79,93,95,97 \right\}=16$

$p\left( E \right)=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

Hence, the probability is $\Rightarrow \dfrac{16}{20}=\dfrac{4}{5}$.

2. A two digit number is formed with digits $2,3,5,7,9$ without repetition.

Sample space will be $\Rightarrow S=\left\{ 23,25,27,29,32,35,37,29,52,53,57,59,72,73,75,79,92,93,95,97 \right\}=20$

Favorable outcome is $\Rightarrow \left\{ 25,35,75,95 \right\}$

$p\left( E \right)=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

Hence, the probability is $\Rightarrow \dfrac{4}{20}=\dfrac{1}{5}$.

5. A card is drawn at random from a pack of well shuffled $52$ playing cards. Find the probability that the card drawn is.

1. An ace

Ans:

1. As per the question given $52$ cards so, in a deck of there are $4$ ace thus, probability of getting an ace is so, favorable outcome is $4$ and total outcome is $52$.

Formula to find probability is $p\left( A \right)=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

$p\left( A \right)=\dfrac{4}{52}$

$p\left( A \right)=\dfrac{1}{13}$

Hence, the answer is $\dfrac{1}{13}$

2. As per the question given $52$ cards so, in a deck of there are $26$ black cards in which $13$ are spade and $13$ are club cards, favorable outcome is $13$ and total outcome is $52$.

Formula to find probability is $p\left( S \right)=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$.

$p\left( S \right)=\dfrac{13}{52}$ Hence, the probability is $\dfrac{1}{4}$.

Problem set 5

1. Choose the correct alternative answer for each of the following questions.

1. Which number cannot represent a probability?

1. $\dfrac{2}{3}$

2. $1.5$

3. $15\%$

4. $0.7$

Ans: We all know that the probability of any event lies between $0-1$. So, the correct option is (B) that is $1.5$, which is greater than $1$.

2. A die is rolled. What is the probability that the number appearing on the upper face is less than $3$?

1. $\dfrac{1}{6}$

2. $\dfrac{1}{3}$

3. $\dfrac{1}{2}$

4. $0$

Ans: First, write the favorable outcomes that is $\left\{ 1,2 \right\}=2$,

And the total number of outcomes if a single dice is thrown is $\Rightarrow S=\left\{ 1,2,3,4,5,6 \right\}$

To find the probability use $p=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

So, the probability will be

$p=\dfrac{2}{6}$

$\Rightarrow p=\dfrac{1}{3}$

Hence, the correct option is (B) that is $\dfrac{1}{3}$.

3. What is the probability of the event that a number chosen from $1-100$is a prime number?

1. $\dfrac{1}{5}$

2. $\dfrac{6}{25}$

3. $\dfrac{1}{4}$

4. $\dfrac{13}{50}$

Ans: Firstly, write the favorable outcomes so,

$\{ 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97\}=24$

And total number of outcomes is $100$

Formula to find the probability is $p=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

$p=\dfrac{24}{100}$

$p =\dfrac{6}{25}$

Hence, the total probability of event that a number chosen from $1-100$ is a prime number is $\dfrac{6}{25}$ and the correct option is (B).

4. There are $40$ cards in a bag. Each bears a number from $1-40$. One card is drawn at random. What is the probability that the card bears a number which is a multiple of $5$?

1. $\dfrac{1}{5}$

2. $\dfrac{3}{5}$

3. $\dfrac{4}{5}$

4. $\dfrac{1}{3}$

Ans: first find out the numbers which are multiple of $5$ so, $\left\{ 5,10,15,20,25,30,35,40 \right\}=8$, thus the favorable outcomes are $8$.

to find probability is $p=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

Total outcomes are $40$ so probability that the card bears a number which is a multiple of $5$ will be $\Rightarrow \dfrac{8}{40}=\dfrac{1}{5}$.

hence, option (A) is correct.

5. If $n\left( A \right)=2,p\left( A \right)=\dfrac{1}{5}$, then $n\left( S \right)=?$.

1. $10$

2. $\dfrac{5}{2}$

3. $\dfrac{2}{5}$

4. $\dfrac{1}{3}$

Ans: Applying the probability formula

$p\left( A \right)=\dfrac{n\left( A \right)}{n\left( S \right)}$

$\Rightarrow \dfrac{1}{5}=\dfrac{2}{n\left( S \right)}$

$\Rightarrow n\left( S \right)=10$

Hence, the correct option is (A) that is $10$.

1. Basketball players John, Vasim, Akash were practicing the ball drop in the basket. The probabilities of success for John, Vasim and Akash are $\dfrac{4}{5},0.83$ and $58\%$ respectively. Who had the greatest probability of success?

Ans: As per the question, probabilities of success for John, Vasim and Akash are $\dfrac{4}{5},0.83$ and $58\%$ respectively.

So, probability of success for John is $\dfrac{4}{5}=0.8$

Probability of success for Vasim is $0.83$.

Probability of success for Akash is $\Rightarrow \dfrac{58}{100}=0.58$.

Hence, the probability of success is highest for Vasim.

2. In a hockey team there are $6$ defenders, $4$ offenders and $1$ goalie. Out of these, one player is to be selected randomly as a captain. Find the probability of the selection that –

1. The goalee will be selected.

2. The defender will be selected.

Ans:

1. Probability of selection that the goalee will be, favorable outcome is $1$ and total outcome is $11$ using the formula $p\left( G \right)=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

$\Rightarrow p\left( G \right)=\dfrac{1}{11}$.

2. Probability of the selection that the defender will be, favorable outcome is $6$and total outcome is $11$.

Using the formula $p\left( D \right)=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

$\Rightarrow p\left( D \right)=\dfrac{6}{11}$.

4. Joseph kept $26$cards in a cap, bearing one English alphabet on each card. One card is drawn at random. What is the probability that the card drawn is a vowel card ?

Ans: As it is given that one card is drawn at random.

Sample space will be $\Rightarrow S=\left\{ A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z \right\}=26$

Vowel in English alphabet are $\left\{ A,E,I,O,U \right\}=5$

Using the formula $p=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

So, the probability of the selection that the card drawn is a vowel card is $p\left( V \right)=\dfrac{5}{26}$.

5. A balloon vendor has $2$ red, $3$ blue and $4$ green balloons. He wants to choose one of them at random to give it to Pranali. What is the probability of the event that Pranali gets,

1. A red balloon

2. A blue balloon

3. A green balloon

Ans: Probability will be find by using $\Rightarrow p=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

Total number of outcomes will be $\Rightarrow 2+3+4=9$.

a. Probability that Pranali gets a red balloon, favorable outcome will be $2$ so, $p\left( R \right)=\dfrac{2}{9}$

b. Probability that Pranali gets a blue balloon, favorable outcome will be $3$ so,

$p\left( B \right)=\dfrac{3}{9}$

$p\left( B \right) =\dfrac{1}{3}$

c. Probability that Pranali gets a green balloon, favorable outcome will be $4$ so, $p\left( G \right)=\dfrac{4}{9}$.

6. A box contains $5$ red, $8$ blue and $3$ green pens. Rutuja wants to pick a pen at random. What is the probability that the pen is blue?

Ans: To find probability use $p=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

Total number of outcome will be $5+8+3=16$

Probability that Rutuja picks blue pen, favorable outcome will be $8$ so,

$p\left( B \right)=\dfrac{8}{16} =\dfrac{1}{2}$

Hence, the probability is $\dfrac{1}{2}$.

7.Six faces of a die are as shown below.

(Image will be updated soon)

If the die is rolled once, find the probability of –

1.  ‘A’ appears on upper face.

2. ‘D’ appears on upper face.

Ans: To find probability use $p=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

Sample space will be $\Rightarrow S=\left\{ A,B,C,D,E,A \right\}=6$

A. We can see that A is appearing two times then the favorable outcome is $2$.

So, probability of getting A on upper face will be

$p\left( A \right)=\dfrac{2}{6} =\dfrac{1}{3}$

B. D is appearing single time so, the probability of getting D on the upper face will be $p\left( D \right)=\dfrac{1}{6}$.

8.A box contains $30$ tickets, bearing only one number from $1$ to $30$ on each. If one ticket is drawn at random, find the probability of an event that the ticket drawn bears.

1. an odd number

2. a complete square number.

Ans:To find probability use $p=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

Sample space will be $S=\left\{ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 \right\}$

n(S) = 30

1. Odd numbers between $1$ to $30$ are $\left( 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29 \right)=15$

favorable outcome will be $15$

So, probability of getting an odd number if one ticket is drawn at random will be

$\Rightarrow p\left( O \right)=\dfrac{15}{30} =\dfrac{1}{2}$

2. Complete squares between $1$ to $30$are $\left\{ 1,4,9,16,25 \right\}=5$.

The favorable outcome will be $5$.

So, probability of getting a complete square if one ticket is drawn at random will be

$\Rightarrow p\left( S \right)=\dfrac{5}{30} =\dfrac{1}{6}$

9. Length and breadth of a rectangular garden are $77m$ and$50m$. There is a circular lake in the garden having diameter$14m$. Due to wind, a towel from a terrace on a nearby building fell into the garden. Then find the probability of the event that it fell in the lake.

(image will be updated soon)

Ans: first find the area of lake by applying $\pi {{r}^{2}}$,

So, the area of lake will be

$A = \dfrac{22}{7}\times \dfrac{14}{2}\times \dfrac{14}{2} = 154{{m}^{2}}$

Now, find the area of the garden so, area of garden= length $\times$ breadth.

$Area = 77\times 50 = 3850{{m}^{2}}$

To find probability use $p=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

So, total number of outcome will be and favorable outcome will be $154$

Hence, the probability of fell in lake will be

$p\left( E \right)=\dfrac{154}{3850} =\dfrac{1}{25}$

10.In a game of chance, a spinning arrow comes to rest at one of the numbers$1,2,3,4,5,6,7,8$.

All these are equally likely outcomes. Find the probability that it will rest at

1. $8$

2. An odd number

3. A number greater then $2$

4. A number less than $9$

Ans: To find probability use $p=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

So, sample space will be $\Rightarrow S=\left\{ 1,2,3,4,5,6,7,8 \right\}=8$

1. Clearly the probability of rest at $8$ will be $p=\dfrac{1}{8}$.

2. Total odd numbers are $1,3,5,7=4$, so favorable outcomes are $4$. Thus, $\Rightarrow \dfrac{4}{8}=\dfrac{1}{2}$.

3. Numbers greater than $2$ are $3,4,5,6,7,8=6$. Thus, favorable outcome will be $6$ probability of will rest at a number greater than $2$ will be

$\Rightarrow p=\dfrac{6}{8} =\dfrac{3}{4}$

4. Number less than $9$ are $1,2,3,4,5,6,7,8=8$ so, favorable outcome will be $8$, probability of will rest at a number less than $9$will be

$\Rightarrow p=\dfrac{8}{8} =1$

11. There are six cards in a box, each bearing a number from $0$ to $5$. Find the probability of each of the following events, that a card drawn shows.

1. A  natural number

2. A number less than $1$

3. A whole number

4. A number is greater than $5$.

Ans: To find probability use $p=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

Sample space will be $\Rightarrow S=\left\{ 1,2,3,4,5 \right\}=5$

1. Natural numbers between $0$ to $5$ are $1,2,3,4,5=5$, thus, a favorable outcome will be $5$.

So, the probability of getting a natural number is $p\left( N \right)=\dfrac{5}{6}$.

2. Number less than $1$ is $0$ so, probability of getting a number less than $1$ will be $\Rightarrow p=\dfrac{0}{5} = 0$

3. Whole numbers between $0$ to $5$ are $0,1,2,3,4,5$.

Thus, the favorable outcome will be $6$.

So, probability of getting a whole number is

$p\left( W \right)=\dfrac{6}{6} =1$

4. A number greater than $5$ is none, so the probability of getting a number greater than $5$ will be $0$.

12.A bag contains $3$ red, $3$ white and $3$ green balls. One ball is taken out of the bag at random. What is the probability that the ball drawn is

1. Red

2. Not red

3. Either red or white

Ans: To find probability use $p=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

sample space will be $\Rightarrow S=\left\{ R,R,R,W,W,W,G,G,G \right\}=9$

1. Probability of getting a red ball, favorable outcome is $3$ thus,

$\Rightarrow p\left( R \right)=\dfrac{3}{9}=\dfrac{1}{3}$

2. Probability of getting not red so, $3$ white and $3$ green are $3+3=6$, favorable outcome is $6$.

so, probability of getting no red is

$\Rightarrow p=\dfrac{6}{9} =\dfrac{2}{3}$

3. Probability of getting either red or white so $3$ red and $3$ white will be $3+3=6$.

Thus, the favorable outcome will be $6$.

So, probability of getting either red or white will be

$\Rightarrow p\left( E \right)=\dfrac{6}{9} =\dfrac{2}{3}$

13.Each card bears one letter from the word ‘mathematics’ The cards are placed on a table upside down. Find the probability that a card drawn bears the letter ‘m’.

Ans: To find probability use, $p=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

Sample space will be $\Rightarrow S=\left\{ MATHEMATICS \right\}=11$

As ‘m’ appears two times in mathematics, a favourable outcome will be $2$.

Probability that a card drawn bears the letter ‘m’ will be $p\left( M \right)=\dfrac{2}{11}$.

14.Out of $200$ students from a school, $135$ like Kabbaddi and the remaining students do not like the game. If one student is selected at random from all the students, find the probability that the student selected doesn’t like Kabbaddi.

Ans:

To find probability use $p=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

Total number of outcomes will be $200$.

So, firstly the number of students who don't like kabaddi $\Rightarrow 200-135=65$.

Thus, favorable outcome will be $65$

Hence, the probability of student’s doesn’t like kabbaddi will be

$\Rightarrow p\left( K \right)=\dfrac{65}{200} =\dfrac{13}{40}$

15.A two digit number is to be formed from the digits $0,1,2,3,4$. Repetition of the digits is allowed. Find the probability that the number so formed is a .

1. Prime number

2. Multiple of $4$

3. Multiple of $11$

Ans: To find probability use $p=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

1. Sample space will be $\Rightarrow S=\left\{ 10,11,12,13,14,20,21,22,23,24,30,31,32,33,34,40,41,42,43,44 \right\}=20$

So, the number of sample points will be $20$.

Probability of getting a prime number, $\left\{ 11,13,23,31,41,43 \right\}=6$, favorable outcome is $6$.

$\Rightarrow p\left( P \right)=\dfrac{6}{20} =\dfrac{3}{10}$

2. Probability of getting a multiple of $4$, favorable outcome will be $\left\{ 14,20,24,32,40,44 \right\}=6$

$\Rightarrow p\left( M \right)=\dfrac{6}{20} =\dfrac{3}{10}$

3. Probability of getting a number multiple of $11$, favorable outcome will be $\left\{ 11,22,33,44 \right\}=4$

$\Rightarrow p\left( M \right)=\dfrac{4}{20} =\dfrac{1}{5}$

16.The faces of a die bear numbers $0,1,2,3,4,5$. If the die is rolled twice, then find the probability that the product of digits on the upper face is zero.

Ans: To find probability use $p=\dfrac{\text{favorable outcomes}}{\text{total number of outcomes}}$

Sample space will be $\Rightarrow S=\left\{ \left( 0,0 \right)\left( 0,1 \right)\left( 0,2 \right)\left( 0,3 \right)\left( 0,4 \right)\left( 0,5 \right) \left( 1,0 \right)\left( 1,1 \right)\left( 1,2 \right)\left( 1,3 \right)\left( 1,4 \right)\left( 1,5 \right) \left( 2,0 \right)\left( 2,2 \right)\left( 2,3 \right)\left( 2,4 \right)\left( 2,5 \right) \left( 3,0 \right)\left( 3,1 \right)\left( 3,2 \right)\left( 3,3 \right)\left( 3,4 \right)\left( 3,5 \right) \left( 4,0 \right)\left( 4,1 \right)\left( 4,2 \right)\left( 4,3 \right)\left( 4,4 \right)\left( 4,5 \right) \left( 5,0 \right)\left( 5,1 \right)\left( 5,2 \right)\left( 5,3 \right)\left( 5,4 \right)\left( 5,5 \right)\right\}=36,$

In situation $1$: when the die is rolled twice the face has $0$ twice times.

So, probability of the product of digits on the upper face is zero will be $\Rightarrow \dfrac{1}{6}\times \dfrac{1}{6}=\dfrac{1}{36}$.

In situation $2$: when the die is rolled twice one face is having zero and the second face is having a number between $1$ to $5$.

So, probability of the products of digits on the upper face is zero will be $\Rightarrow \dfrac{1}{6}\times \dfrac{5}{6}=\dfrac{5}{36}$

Thus, total probability of digit on upper face is having zero is

$\Rightarrow \dfrac{1}{36}+\dfrac{5}{36}=\dfrac{6}{36} =\dfrac{1}{6}$

Importance of Maharashtra Board Textbook Solutions for Class 10 Maths Probability

The Chapter 5 of the Class 10 syllabus of Maths for the Maharashtra Board, Probability, is quite crucial. The chapter discusses all the important topics. They also get to learn the formulas and its application in real life.

1. Access to solutions by experts: Getting guidance and learning from experts who have curated the answers that focus on learning standards specific to the age group. It also provides well explained and easy to understand solutions for a student.

2. Beneficial for resolving doubts: Sometimes, questions asked in the chapter become challenging to comprehend, especially for students who find Maths difficult. The textbook solutions can present them with elaborative and comprehensive answers or solutions which will benefit them in case of doubts.

3. Learning through mistakes: When a student is trying to solve a question, it is often observed that they get the correct answers but do not follow the proper method. In such cases, textbook solutions can help them understand the experts' approach, which they can use while finding the answers.

4. Practice with the right approach: Practicing the questions by following correct methods and techniques becomes significant for a student. These practice questions become the building blocks for their further question-solving practice. Hence, it is crucial to solving many questions based on a concept with the right approach.

Benefits of using Vedantus' PDF Solutions for Class 10 Maths Maharashtra Board

• The solutions for Class 10 Chapter 5 for the Maharashtra Board Students have been created by Vedantu experts. With amplified knowledge about the concepts, they have left no detail unexplained in the chapter. Students can use elaborate explanations, examples, etc., to gain further understanding of the chapter.

• Solutions for Probability will help students understand how to solve complex problems related to the chapter. These solutions have been explained in a way that is easy to comprehend for students.

• They can prepare properly for their examinations by solving the problems with the help of the solutions. All details about different ways to solve Probability have been explained. Students can build a strong foundation for the chapter with these solutions.

• During revision, these solutions and practice sets can come in handy to revisit anything when you are having doubts about your answers.

Complete Your Practice With Maharashtra Board Class 10 Maths Chapter 5 Solutions

Download Maharashtra board Class 10 Maths solutions Chapter 5 Probability and start your practice today. With time, you can download more practice sets and solutions to strengthen your problem solving.


text:
Standard Entropy of Vaporization for Mercury

$\Delta S = \frac{q_{rev}}{T}$

Dylan Davisson 2B
Posts: 50
Joined: Thu Jul 27, 2017 3:00 am
Been upvoted: 2 times

Standard Entropy of Vaporization for Mercury

Why is the standard entropy of vaporization for mercury so high considering that it appears stable since it does not participate in hydrogen bonding?

Krupa Prajapati
Posts: 50
Joined: Sat Jul 22, 2017 3:00 am

Re: Standard Entropy of Vaporization for Mercury

Mercury has a high entropy of vaporization because there are metallic bonds between the mercury atoms, which make it more organized.

format: plain


text:
In part 1 we learned how to convert a TensorFlow 1.x code to its eager version, the eager version to its graph representation, and faced the problems that arise when working with functions that create a state.

In part 2 we learned that tf.function creates a new graph for every different input value if the input is not a tf.Tensor object but a Python native type and how this could slow down (or speed up if correctly used) the execution. Moreover, the differences between the tf.autograph generated source code and what happens, instead, when using AutoGraph trough tf.function have been highlighted.

In this third and last part, we analyze what happens when tf.function is used to convert a function that contains “complex” Python constructs in its body. Should we design functions thinking about how they are going to be converted?

## AutoGraph capabilities and limitations

In the TensorFlow repository, in the python/autograph folder, we can find a document that explains which are the capabilities and the limitations of the AutoGraph module together with a list of the Python constructs it is able to convert.

The table in the section “Python Language Support Status” contains all the Python constructs that AutoGraph explicitly supports, plan to support, or won’t support. Among them, we can find the widely used while, for, if statements, the Python built-in print, len, range, and the iterator construct.

In the next sections, various Python functions that use these Python constructs are analyzed, to understand if the function body gets converted as we expect or if it is required to design the functions thinking about the graph conversion.

## if … else

Here’s the function we are going to analyze:

@tf.function
def if_else(a, b):
if a > b:
tf.print("a > b", a, b)
else:
tf.print("a <= b", a, b)

It’s trivial: when a is greater than b then it prints a > b followed by the value of a and b; otherwise it prints a <= b and their value.

Step 1: graph conversion

As seen in the previous articles, the tf.autograph package can be used to inspect the result of the graph conversion.

print(tf.autograph.to_code(if_else.python_function))

The generated code is:

def tf__if_else(a, b):
cond = a > b

def get_state():
return ()

def set_state(_):
pass

def if_true():
ag__.converted_call(
"print",
tf,
ag__.ConversionOptions(
recursive=True,
force_conversion=False,
optional_features=(),
internal_convert_user_code=True,
),
("a > b", a, b),
None,
)
return ag__.match_staging_level(1, cond)

def if_false():
ag__.converted_call(
"print",
tf,
ag__.ConversionOptions(
recursive=True,
force_conversion=False,
optional_features=(),
internal_convert_user_code=True,
),
("a <= b", a, b),
None,
)
return ag__.match_staging_level(1, cond)

ag__.if_stmt(cond, if_true, if_false, get_state, set_state)

The conversion is trivial too: the if_stmt maps, more or less, with the tf.cond function; the first parameter is the condition to check, the second is the branch to take when the condition is True, the third the branch to take otherwise. The get_state and set_state methods basically do nothing and we can safely ignore them.

Step 2: execution

As seen in part 2 tf.function by design does not do the boxing of the Python native types; therefore we use a tf.Tensor produced by a tf.constant operation as input.

x = tf.constant(1)
if_else(x, x)

As expected, the output is: a <= b 1 1.

## if … elif … else

Let’s change the function a little bit, adding an elif statement. The function now is:

@tf.function
def if_elif(a, b):
if a > b:
tf.print("a > b", a, b)
elif a == b:
tf.print("a == b", a, b)
else:
tf.print("a < b", a, b)

Step 1: graph conversion

The generated function, with the removed tf.print conversion and (get|set)\_state function definitions, is

def tf__if_elif(a, b):
cond_1 = a > b

def if_true_1():
# tf.print("a > b", a, b)
return ag__.match_staging_level(1, cond_1)

def if_false_1():
cond = a == b

def if_true():
# tf.print(a == b, a, b)
return ag__.match_staging_level(1, cond)

def if_false():
# tf.print(a < b, a,b)
return ag__.match_staging_level(1, cond)

ag__.if_stmt(cond, if_true, if_false, get_state, set_state)
return ag__.match_staging_level(1, cond_1)

ag__.if_stmt(cond_1, if_true_1, if_false_1, get_state_1, set_state_1)

The conversion seems correct: two tf.cond nested. The inner tf.cond is defined inside the false branch of the outer one. The outer tf.cond checks if a > b, and if it is True then it prints a > b, otherwise executes the if_false_1 branch that contains the inner tf.cond.

The inner tf.cond has the equality condition cond = a == b to verify; if it holds, it prints a == b, otherwise it prints a < b.

Step 2: execution

x = tf.constant(1)
if_elif(x, x)

Executing it, we expect to see a == b, 1, 1 since this is the truth. However, the output is a < b 1 1. WHAT?

OK then, debug time.

Update (14 Sept 2019): as Raphael Meudec pointed out in the tweet below, this behavior has been changed in TensorFlow 2.0-rc0 and it works as expected. However, the lessons presented later in the article are still valid: following them helps you writing idiomatic TensorFlow 2.0 code.

Step 3: debugging

The AutoGraph representation looks correct. Moreover, we can try by using the non-converted function to see if everything goes as expected in eager mode.

x = tf.constant(1)
if_elif.python_function(x, x)

In eager mode the output is correct: a == b 1 1. So we do expect to see the same output when we feed the function with two tf.Tensor objects that hold the same value

x, y = tf.constant(1), tf.constant(1)
if_elif.python_function(x, y)

Surprise! The output is a < b 1 1. What’s going on?

### Lesson 1: not all operators are created equal

This lesson is not about AutoGraph or tf.function but is about tf.Tensor.

This “weird” behavior that also happens when the eager mode is enabled is due to the different way the __eq__ operator for the tf.Tensor objects have been overridden.

There is a question on StackOverflow and a related Github issue about this. In short: the __eq__ operator has been overridden, but the operator does not use tf.equal to check for the Tensor equality, it just checks for the Python variable identity (if you are familiar with the Java programming language, this is precisely like the == operator used on string objects). The reason is that the tf.Tensor object needs to be hashable since it is used everywhere in the TensorFlow codebase as key for dict objects.

OK then, to solve it is required to do not rely upon the __eq__ operator but use tf.equal to check if the equality holds.

However, something should still sound strange: why when invoking the graph-converted function, passing the same tf.Tensor x, the execution produces a < b 1 1 instead of a == b 1 1 as it happens in eager execution?

### Lesson 2: how AutoGraph (don’t) converts the operators

So far we supposed that AutoGraph is able to translate not only the if, elif, and else statements to the graph equivalent, but also the Python built-in operators like __eq__, __gt__, and __lt__. In practice, this conversion (still?) does not happen at all.

In the previously converted graph-code, the two condititions are expressed as a > b and a == b and not as function calls to AutoGraph converted functions (ag__.converted_call(...)).

In practice, what happens is that the cond is always False. We can verify this assertion by adding an additional elif to the previous function and calling it again.

@tf.function
def if_elif(a, b):
if a > b:
tf.print("a > b", a, b)
elif a == b:
tf.print("a == b", a, b)
elif a < b:
tf.print("a < b", a, b)
else:
tf.print("wat")
x = tf.constant(1)
if_elif(x,x)

Output: wat.

Hurray?

### Lesson 3: how to write a function

To have the very same behavior in both eager and graph execution we have to know that:

1. The semantic of the operations matters.
2. There are operators that have been overridden following a different semantic (respect to the most natural one, common in Python).
3. AutoGraph converts Python statements naturally (if, elif, …) but it requires some extra care when designing a function that is going to be tf.function decorated.

In practice, and this is the most important lesson, use the TensorFlow operators explicitly everywhere (in the end, the Graph is still present, and we are building it!).

Thus, we can write the correctly eager and graph-convertible function by using the correct tf. methods.

@tf.function
def if_elif(a, b):
if tf.math.greater(a, b):
tf.print("a > b", a, b)
elif tf.math.equal(a, b):
tf.print("a == b", a, b)
elif tf.math.less(a, b):
tf.print("a < b", a, b)
else:
tf.print("wat")

The generated graph code now looks like (removed long parts for clarity):

def tf__if_elif(a, b):
cond_2 = ag__.converted_call("greater", ...)  # a > b

def if_true_2():
ag__.converted_call("print", ...)  # tf.print a > b
return ag__.match_staging_level(1, cond_2)

def if_false_2():
cond_1 = ag__.converted_call("equal", ...)  # tf.math.equal

def if_true_1():
ag__.converted_call("print", ...)  # tf.print a == b
return ag__.match_staging_level(1, cond_1)

def if_false_1():
cond = ag__.converted_call("less", ...)  # a < b

def if_true():
ag__.converted_call("print", ...)  # tf.print a < b
return ag__.match_staging_level(1, cond)

def if_false():
ag__.converted_call("print", ...)  # tf.print wat
return ag__.match_staging_level(1, cond)

ag__.if_stmt(cond, if_true, if_false, get_state, set_state)
return ag__.match_staging_level(1, cond_1)

ag__.if_stmt(cond_1, if_true_1, if_false_1, get_state_1, set_state_1)
return ag__.match_staging_level(1, cond_2)

ag__.if_stmt(cond_2, if_true_2, if_false_2, get_state_2, set_state_2)

Now that every single part of the function has been converted (note the ag__converted_call everywhere) the function works as we want, also when it is converted to its graph representation.

## for … in range

Following the previous 3 lessons, writing a function that uses a for loop is trivial. To be entirely sure that the code is correctly graph-converted, we can design the function by using the tensorflow tf. methods to help the conversion. So, for a simple function that sums the number from 1 to X-1 the correct way of designing it is to use:

1. An external tf.Variable since the function creates a state and from part 1 we know how to deal with it.
2. Use tf.range instead of range since tf.range exists and therefore it is just better to use it.
x = tf.Variable(1)
@tf.function
def test_for(upto):
for i in range(upto):

x.assign(tf.constant(0))
test_for(tf.constant(5))
print("x value: ", x.numpy())

The value of the x variable is 10, as expected.

The reader is invited to convert the function to its graph representation and check if every statement has been correctly converted.

Question (please feel free to answer in the comment section!): what happens if the line x.assign_add(1) is replaced by x = x + i?

## Conclusions

Writing functions that work correctly in both eager mode and their graph-converted representation requires to know some subtleties that in this three-part particle have been highlighted. To summarize them:

• Functions that create a state need a dedicated design since in eager mode they just work while when converted the stateful objects can create problems. (part 1)
• AutoGraph does not perform the boxing of the Python native type, and this can slow down the execution a lot (part 2); use tf.Tensor whenever possible!
• tf.print and print are different objects; there is a clear distinction between the first call (AutoGraph + function execution + tracing) and any other call of the graph-converted function (part 2).
• The operator overloading of tf.Tensor has its own peculiarities. In order to be 100% confident of your function design, and making it also work when it is graph-converted, I highly recommend to use the TensorFlow operators explicitly (call tf.equal(a,b) instead of a == b and so on).

## Announcement

The article is finished, but I hope to say something pleasing by announcing that I’m authoring my first book about TensorFlow 2.0 and Neural Networks!

Hands-On Neural Networks with TensorFlow 2.0

Understand TensorFlow, from static graph to eager execution, and design neural networks

The book is divided into two parts: the first part is more theoretical and is about machine learning and neural networks, with a focus on the intuitive idea behind the presented concepts. The second part, that’s the main topic of the book, is about the TensorFlow architecture (from 1.x to 2.0) followed by the implementation of several neural-networks-based solutions to challenging machine learning problems, all using TensorFlow 2.0.

If you want to receive an email when the book is out and also stay up-to-date with the latest articles, leave your email in the form below!


text:
# The Growth Investment Strategy

The growth strategy ranks companies high that have superior growth metrics compared to their peers. Companies are therefore compared to their peers in terms of their growth rates. There are growth companies in every industry, because even if the growth in the industry is low or negative, there are companies that grow more (or shrink less) than their competitors and therefore gain market share.

Investors should choose the growth strategy if they expect the stock markets to rise, as stock with high growth usually achieve higher returns than their competitors in such environments.

## Metrics of the growth strategy

### Profit growth

Defined as:

$\frac{Profit \ (cy) - Profit \ (py) }{\ Revenue \ (py)}$

For financial companies, we use operating profit as profit metric. For all other companies, we measure profit at EBITDA or EBIT (in case of segment reporting) level.

### Shareholder returns

Defined as:

$\frac{ Current \ IV + Dividens }{\ Original \ IV \ }$

This ratio is also referred to as total investor return or total investment return. We use the current investment value at the end of the current period and the original investment value at the end of the previous period.

### Revenue growth

Defined as:

$\frac{Revenue \ (cy) - Revenue \ (py) }{\ Revenue \ (py)}$

cy = Current Year
py = Previous Year
IV = Investment Value


text:
# Step by step: electron-nuclear Energy in terms of density n(r)

## Modified: 2019/08/12

As for many-body system, the E generally is not a functional of n alone, only the $E_{e-n}[n]$ is:

$$E_{e-n}[n] = \int v(r)n(r) \mathrm{d}r^3 .$$

Here we indicate how this functional derived.

### The definition of density

The single-particle operator of density is:

$$\hat{n}(r) = ∑_{i=1}^{N} δ(r-r_i)$$

For many-body system, the electron density $n(r)$ is found by calculating the expectation value of the single-particle density operator for the many-body wavefunction:

\begin{align} n(r) &= ⟨Ψ|\hat{n}(r)|Ψ⟩ = ∑_{i=1}^{N} ∫ δ(r-r_i) |Ψ(r_1, r_2, …, r_N)|^2 d^3 r_1 d^3 r_2 … d^3 r_N \\ &= ∫ |Ψ(r,r_2,…,r_N)|^2 d^3 r_2 d^3 r_3 … d^3 r_N + ∫ |Ψ(r_1,r,r_3,…,r_N)|^2 d^3 r_1 d^3 r_3 … d^3 r_N + … \\ &= N ∫ |Ψ(r,r_2,…,r_N)|^2 d^3 r_2 d^3 r_3 … d^3 r_N \end{align}

Assuming wavefunction is nomalized to unity:

$$∫ n(r)\mathrm{d}^3 r = N$$

### Derivation of electron energy in ion potential

The operator of electron-nuclear interactions can be write as:

$$\hat{V}_{n-e} = -\sum_{i}^{N_e} \sum_{I}^{N_n} \frac{Z_I}{|r_i-R_I|}$$

then energy of electron-nuclear interactions is:

\begin{align} E_{n-e} &= ⟨Ψ(r_1,r_2,…,r_N)|\hat{V}_{n-e}|Ψ(r_1,r_2,…,r_N)⟩ \\ &= -\sum_{i}^{N_e} \sum_{I}^{N_n} ∫ Ψ^{*}(r_1,r_2,…,r_N) \frac{Z_I}{|r_i-R_I|} Ψ(r_1,r_2,…,r_N) d^3 r_1 d^3 r_2 … d^3 r_N \end{align}

Since operator does not contain any derivatives:

$$E_{n-e} = -\sum_{i}^{N_e} \sum_{I}^{N_n} ∫ \frac{Z_I}{|r_i-R_I|} |Ψ(r_1,r_2,…,r_N)|^2 d^3 r_1 d^3 r_2 … d^3 r_N$$

Expend ∑ of electrons in a way that is much similar to the one we followed in the calculation of the density:

\begin{align} E_{e-n} &= -\sum_{I}^{N_n}\left[ ∫ \frac{Z_I}{|r_1-R_I|} |Ψ|^2 d^3 r_1 d^3 r_2 … d^3 r_N + … + ∫ \frac{Z_I}{|r_N-R_I|} |Ψ|^2 d^3 r_1 d^3 r_2 … d^3 r_N \right] \\ &= -\sum_{I}^{N_n} \left[ ∫ \frac{Z_I}{|r_1-R_I|} d^3 r_1 |Ψ(r_1,r_2,…,r_N)|^2 d^3 r_2 … d^3 r_N + … \right] \end{align}

For each of electron terms in the sum, the second integral is the definition of density $n(r)$, therefore:

\begin{align} E_{n-e} &= -\frac{1}{N_e} \sum_{I}^{N_n} \left[ ∫ \frac{Z_I}{|r_1-R_I|}n(r_1) + ∫ \frac{Z_I}{|r_1-R_I|}n(r_1) + … \right] \\ &= -\sum_{I}^{N_n} ∫\frac{Z_I}{|r-R_I|}n(r) d^3 r = ∫ n(r)v_{n-e}(r) \mathrm{d}^3 r \end{align}


text:
## A Differentiator With a Difference

November 3, 20076 comments

Some time ago I was studying various digital differentiating networks, i.e., networks that approximate the process of taking the derivative of a discrete time-domain sequence. By "studying" I mean that I was experimenting with various differentiating filter coefficients, and I discovered a computationally-efficient digital differentiator. A differentiator that, for low fequency signals, has the power of George Foreman's right hand! Before I describe this differentiator, let's review a few...

## A brief look at multipath radio channels

October 31, 20078 comments

Summary: Discussion of multipath propagation and fading in radio links

Radio channels, their effects on communications links and how to model them are a popular topic on comp.dsp. Unfortunately, for many of us there is little or no opportunity to get any "hands-on" experience with radio-related issues, because the required RF measurement equipment is not that easily available.

This article gives a very simple example of a radio link that shows multipath propagation and...

## Delay estimation by FFT

September 22, 200747 comments
Given x=sig(t) and y=ref(t), returns [c, ref(t+delta), delta)] = fitSignal(y, x);:Estimates and corrects delay and scaling factor between two signals Code snippet

This article relates to the Matlab / Octave code snippet: Delay estimation with subsample resolution It explains the algorithm and the design decisions behind it.

Introduction

There are many DSP-related problems, where an unknown timing between two signals needs to be determined and corrected, for example, radar, sonar,...

## Exact Near Instantaneous Frequency Formulas Best at Zero Crossings

July 20, 2017
Introduction

This is an article that is the last of my digression from trying to give a better understanding of the Discrete Fourier Transform (DFT). It is along the lines of the last two.

In those articles, I presented exact formulas for calculating the frequency of a pure tone signal as instantaneously as possible in the time domain. Although the formulas work for both real and complex signals (something that does not happen with frequency domain formulas), for real signals they...

## Fibonacci trick

October 10, 20164 comments

I'm working on a video, tying the Fibonacci sequence into the general subject of difference equations.

Here's a fun trick: take any two consecutive numbers in the Fibonacci sequence, say 34 and 55.  Now negate one and use them as the seed for the Fibonacci sequence, larger magnitude first, i.e.

$-55, 34, \cdots$

Carry it out, and you'll eventually get the Fibonacci sequence, or it's negative:

$-55, 34, -21, 13, -8, 5, -3, 2, -1, 1, 0, 1, 1 \cdots$

This is NOT a general property of difference...

## Exact Near Instantaneous Frequency Formulas Best at Peaks (Part 2)

June 11, 20174 comments
Introduction

This is an article that is a continuation of a digression from trying to give a better understanding of the Discrete Fourier Transform (DFT). It is recommended that my previous article "Exact Near Instantaneous Frequency Formulas Best at Peaks (Part 1)"[1] be read first as many sections of this article are directly dependent upon it.

A second family of formulas for calculating the frequency of a single pure tone in a short interval in the time domain is presented. It...


text:
# Hamiltonian Path

#### Algorithms hamiltonian path Graph Algorithms

Before starting with the Hamiltonian path let's get clear with what path actually is it is traversing a graph such that we do not repeat a vertex nor we repeat a edge but the starting and ending vertex must be same i.e. we can repeat starting and ending vertex only then we get a cycle.

### What are NP, P, NP-complete and NP-Hard problems

P : It is a set of problems that can be solved by a deterministic Turing machine in Polynomial time.

NP : It is a set of decision problems that can be solved by a Non-deterministic Turing Machine in Polynomial time. P is subset of NP (any problem that can be solved by deterministic machine in polynomial time can also be solved by non-deterministic machine in polynomial time).
It can also be said as a decision problems which can be solved by a polynomial time via a Lucky Algorithm, a magical algorithm that always makes a right guess among the given set of choices.

NP Complete : They are the hardest problems in NP set.
A decision problem L is NP-complete if:

1. L is in NP (Any given solution for NP-complete problems can be verified quickly, but there is no efficient known solution).
2. Every problem in NP is reducible to L in polynomial time (Reduction is defined below).

NP Hard : A problem is NP-Hard if it follows property 2 mentioned above, doesn’t need to follow property 1. Therefore, NP-Complete set is also a subset of NP-Hard set.

Hamiltonian Path is a path in a directed or undirected graph that visits each vertex exactly once. The problem to check whether a graph (directed or undirected) contains a Hamiltonian Path is NP-complete, so is the problem of finding all the Hamiltonian Paths in a graph.

Following images explains the idea behind Hamiltonian Path more clearly :

Graph shown is Fig. 1 indicates does not contain any Hamiltonian Path

Graph shown is Fig. 2 containing two Hamiltonian Paths

==Graph shown is Fig. 3 Hamiltonian Paths which are highlighted==

Graph shown is Fig. 4 Hamiltonian Paths which are highlighted

### Some way of checking whether a graph contains a Hamiltonian Path or not

A Hamiltonian Path in a graph having N vertices is nothing but a permutation of the vertices of the graph [v1, v2, v3, ......vN-1, vN] , such that there is an edge between vi and vi+1 where 1 ≤ i ≤ N-1. So it can be checked for all permutations of the vertices whether any of them represents a Hamiltonian Path or not. For example, for the graph given in Fig. 2 there are 4 vertices, which means total 24 possible permutations, out of which only following represents a Hamiltonian Path.

0-1-2-3
3-2-1-0
0-1-3-2
2-3-1-0

#### Following is the pseudo code of the above algorithm:

function check_all_permutations(adj[][], n)
for i = 0 to n
p[i]=i
while next permutation is possible
valid = true
for i = 0 to n-1
valid = false
break
if valid == true
return true
p = get_next_permutation(p)
return false

The function get_next_permutation(p) generates the lexicographically next greater permutation than p.

Following is the C++ implementation:

bool check_all_permutations(bool adj[][MAXN], int n){
vector<int>v;
for(int i=0; i<n; i++)
v.push_back(i);
do{
bool valid=true;
for(int i=0; i<v.size()-1; i++){
valid=false;
break;
}

}
if(valid)
return true;
}while(next_permutation(v.begin(), v.end()));
return false;
}

### Time Complexity

Time complexity of the above method can be easily derived.
For a graph having N vertices it visits all the permutations of the vertices, i.e. N! iterations and in each of those iterations it traverses the permutation to see if adjacent vertices are connected or not i.e N iterations, so the complexity is O( N * N! ).

### Code to print the Hamiltonian Path

#include <iostream>
#include <vector>
using namespace std;

// data structure to store graph edges
struct Edge {
int src, dest;
};

// class to represent a graph object
class Graph
{
public:
// An array of vectors to represent adjacency list

// Constructor
Graph(vector<Edge> const &edges, int N)
{
// resize the vector to N elements of type vector<int>

// add edges to the undirected graph
for (unsigned i = 0; i < edges.size(); i++)
{
int src = edges[i].src;
int dest = edges[i].dest;

}
}
};

void printAllHamiltonianPaths(Graph const& g, int v, vector<bool>
visited, vector<int> &path, int N)
{
// if all the vertices are visited, then
// Hamiltonian path exists
if (path.size() == N)
{
// print Hamiltonian path
for (int i : path)
cout << i << " ";
cout << endl;

return;
}

// Check if every edge starting from vertex v leads
// to a solution or not
{
// process only unvisited vertices as Hamiltonian
// path visits each vertex exactly once
if (!visited[w])
{
visited[w] = true;
path.push_back(w);

// to solution or not
printAllHamiltonianPaths(g, w, visited, path, N);

// Backtrack
visited[w] = false;
path.pop_back();
}
}
}

// main function
int main()
{
// consider complete graph having 4 vertices
vector<Edge> edges = {
{0, 1}, {0, 2}, {0, 3}, {1, 2}, {1, 3}, {2, 3}
};

// starting node
int start = 0;

// Number of vertices in the graph
int N = 4;

// create a graph from edges
Graph g(edges, N);

// add starting node to the path
vector<int> path;
path.push_back(start);

// mark start node as visited
vector<bool> visited(N);
visited[start] = true;

printAllHamiltonianPaths(g, start, visited, path, N);

return 0;
}

Output :

0 1 2 3
0 1 3 2
0 2 1 3
0 2 3 1
0 3 2 1
0 3 1 2

### Question

#### Which of the following algorithm can be used to solve the Hamiltonian path problem efficiently?

branch and bound
iterative improvement
divide and conquer
greedy algorithm
The Hamiltonian path problem can be solved efficiently using branch and bound approach. It can also be solved using a backtracking approach.

#### Harshita Sahai

Maintainer at OpenGenus | Previously Software Developer, Intern at OpenGenus (June to August 2019) | B.Tech in Information Technology from Guru Gobind Singh Indraprastha University (2017 to 2021)


text:
# What is the limit of (x + (sqrt(x^2 + 2x)) as x goes to negative infinity?

Refer to explanation

#### Explanation:

Divide and multiply with conjugate $x - \sqrt{{x}^{2} + 2 x}$

Hence we have

lim_(x->-oo)((x+sqrt(x^2+2x))*(x-sqrt(x^2+2x)))/(x-sqrt(x^2+2x))= lim_(x->-oo)(x^2-(x^2+2x))/((x-sqrt(x^2+2x)))= lim_(x->-oo)(2x)/(x(sqrt(1+2/x)-1))= lim_(x->-oo)2/(sqrt(1+2/x)-1)= lim_(x->-oo) (-2)/(1+sqrt(1+2/x))=-1

Remarks

Notice that since $x$ is tending to $- \infty$ then $x = - \sqrt{{x}^{2}}$. So when you let $x$ enter the square root in the denominator the minus that was originally there becomes a plus due to cancellation.


text:
# Does math scare you?

Apparently there is a study out from the University of Chicago that focuses on the brain’s responses of people who suffer from math anxiety.  According to study, math anxiety can actually cause pain!  Check out this article from UChicago and tell me what you think!

# Hey all… I’m back!

So sorry for the lull in posting all! I moved a few weeks ago and then with the storm we lost power!!

Many posts in progress, should have a few up this week!

# PokeMath

Found this one on Facebook, I have no idea where it came from originally though…

I do like the choices though…. often contemplated option b 🙂

# Love and math

xkcd comic “Useless” by Randall Monroe

Wandering through some great webcomics and came across xkcd by Randall Monroe… I found this one rather funny and somewhat high school appropriate…

# Let’s be Rational!

Number Classifications Chart

Today’s topic is another foundational math concept – number classification!  (I can hear you snoring cheering already!)

So what’s the big deal, right? A number’s a number, isn’t it?  Well, yes and no, just like a square is a shape with certain attributes, numbers themselves can be categorized.  Take the chart I have so cleverly created.  (BTW, if you need it to study or use in a classroom, take it! If you need a better size, or the original .png file, let me know!)

The first great divide of numbers is if they are Real or Imaginary.  Imaginary numbers result from trying to take the square root of a negative number.  They most often occur in the school realm when you are trying to find where a parabola intersects with the x-axis.  If it doesn’t intersect, your answer will be an imaginary number.   They have lots of other uses and they will definitely be the subject of a future post.  Real numbers, on the other hand, are the ones we use everyday.

• Decimals – how much your paycheck is worth,
• fractions – a quarter of a cup of sugar,
• and integers – You owe Joe $5 and you only have$3, you still owe Joe money (hopefully he’s not the gangster type…),

are all examples of Real numbers.

When you break Real numbers down, there are irrational and rational numbers – not so different from people :P.

Irrational numbers, much like some people I know, go on and on forever, without end, (much like this post if I’m not careful 🙄 ).  Examples of irrational numbers are Euler’s e, $\sqrt{5}$ and $\pi$.  These numbers have approximate values, but, in fact, are infinitely long decimals.  In contrast, rational numbers do end, and can always be expressed as a fraction.  Examples of rational numbers include 27, -43, $\frac{2}{7}$ and \$403.99.

A subset (smaller group) of rational numbers is integers.  These numbers are the ones that have 1 as the bottom of the fraction (denominator), such as 34, -17, and 0.  If the integer is 0 or a positive number, we call even call it a whole number.  With the exception of 0, all whole numbers are also called natural, or counting, numbers (because we count with them – there are 5 fingers on my hand, I can’t be -7 feet tall…although sometimes I feel that way :|).

Well this has been the longest post so far, but hopefully it has presented the number family tree in an easy understandable fashion 🙂

Now go read something fattening, you just gave your brain a workout.

# Does it make sense?!

As the first real math topic of this blog, it is only appropriate I start with the concept of math sense.  Ever look at your bill at a restaurant and know that your total is right, even though you didn’t memorize the exact cost of each item?  How about that time you were in math class and the answer you got after using the formula just didn’t look right?  That would be your number sense kicking in… and be glad you have it!

So many students just plug away and whatever answer they get must be right…  When I taught, I tried to instill in my students the need to check the answer.   A forgotten sign or incorrect step will result in a wrong answer, but there is no consequence to this, other than getting the answer wrong… it’s not like they are building a bridge or going to Mars … but we should teach them like they are!

If you are a teacher, I find anecdotes like the two here to be helpful in driving home my point to check you answers… and I would suggest as a teacher, to have your students check their answers as part of their work.  Maybe require it for the first quarter, by then it will become habit 😉

If you are a student, ALWAYS go back and check… it may mean the difference between an A and an A- today, but it could be a million dollar rocket explosion, or at least a bad tip at a restaurant, tomorrow!


text:
# Suppose $a,b$ belong to an integral domain, $b\neq 0$, and $a$ is not a unit. Show that $\langle ab\rangle$ is a proper subset of $\langle b\rangle$.

Suppose that $a$ and $b$ belong to an integral domain, $b\neq 0$, and $a$ is not a unit. Show that $\langle ab\rangle$ is a proper subset of $\langle b\rangle$.

How can I solve this problem?

-
First observe that if $b=0$, then $\langle b\rangle=\langle ab\rangle=\langle 0\rangle$. Now, suppose $a$ is a unit. Then $a^{-1}(ab)=b\in\langle ab\rangle$, while $ab\in\langle b\rangle$, so $\langle ab\rangle=\langle b\rangle$. Does that help? –  Tabes Bridges Oct 27 '12 at 5:22

Hint $\rm\ \ (ab)\supset (b)\:\Rightarrow\:ab\:|\:b\:\Rightarrow\: a\:|\:1,\:$ since $\rm\:b\ne 0\:\Rightarrow\:b\,$ cancellable (in a domain).
Since always $\langle ab\rangle \subseteq \langle b\rangle$ suppose that $\langle b\rangle =\langle ab\rangle$. Then $b=xab$ for some $x$ in your domain. Since $b \neq 0$ you get $xa=1$.


text:
# Commutative Ring Theory/Bézout domains

Let ${\displaystyle R}$ be a Bézout domain. Then ${\displaystyle R}$ is a GCD domain.
Proof: Given any two elements ${\displaystyle a,b\in R}$, we may consider the ideal ${\displaystyle I=\langle a,b\rangle }$ generated by ${\displaystyle a}$ and ${\displaystyle b}$. By the definition of Bézout domains, ${\displaystyle I=\langle c\rangle }$ for at least one ${\displaystyle c\in R}$ (which is moreover unique up to similarity). Then ${\displaystyle \langle c\rangle \leq \langle a\rangle }$ and ${\displaystyle \langle c\rangle \leq \langle b\rangle }$, so that by the characterisation of divisibility by principal ideals, ${\displaystyle c}$ is a common divisor of ${\displaystyle a}$ and ${\displaystyle b}$. Moreover, if ${\displaystyle d\in R}$ is another common divisor of ${\displaystyle a}$ and ${\displaystyle b}$, then ${\displaystyle a,b\in \langle d\rangle }$, so that ${\displaystyle \langle a,b\rangle =\langle c\rangle \leq \langle d\rangle }$, so that ${\displaystyle d|c}$. Hence, ${\displaystyle c}$ is a greatest common divisor of ${\displaystyle a}$ and ${\displaystyle b}$. ${\displaystyle \Box }$


text:
Displaying Mathematical Notation in a Web Page

Many of my articles include mathematical formulas with specialist characters and formatting, and as they are usually well known formulas I can usually "borrow" them from places such as Wikipedia by taking screenshots. If you cannot do this for some reason then in this article I'll look at alternatives using TeX and MathJax.

TeX: Typesetting for Mathematics

If you see a mathematical formula such as this

printed in a book then it was probably typeset using a system called TeX which was created specifically for the purpose. I'll look at TeX in more detail later, but to give you a flavour of how it works, the plus or minus sign is represented by \pm and the square root symbol is \sqrt. The TeX representation for the whole formula is:

x = -b \pm \sqrt{b^2-4ac} \over 2a

There are many backslash-prefixed representations of mathematical symbols in the TeX specification which, when parsed, are converted to the appropriate character. Any other content is displayed as-is, for example the x = -b at the beginning of the formula.

There are a number of specialized TeX editors available, mostly free, which you may like to look into if you get into TeX in a big way. Wikipedia provides comparison of TeX editors.

You'll probably also want to check out the TeX Users Group which has many resources including references and tutorials.

MathML and MathJax

Browsers cannot handle TeX so the W3C created MathML for representing mathematical notation. It's XML based so consists of a set of < and > delimited tags with the names prefixed by the letter m.

Unfortunately browser support is poor (in particular Edge does not support it at all) so it isn't a universal solution.

A better option is to create your mathematical notation in TeX and use a JavaScript library called MathJax which will convert and display TeX within the browser. You can include MathJax in your pages and have it carry out the conversion in your user's browser, or alternatively take screenshots and include them in your page. My opinion is that the latter is the better option because MathJax is fairly heavyweight in terms of download size, and also there is a slight but noticeable time lag when using MathJax which users might find jarring.

The Project

This project consists of a single HTML page with a number of formulas in TeX which are converted and displayed by MathJax. The purpose of the page is to give an introduction to TeX and to demonstrate MathJax in action. You can also use the page for editing and testing your own TeX which you can copy and paste into your site or use to grab screenshots.

You can grab the project file from the ZIP or GitHub repository linked to below.

TeX Examples

TeX isn't particularly complex and quickly gaining a working knowledge of how it works is well within the capabilities of the sort of people who read articles like this. Learning the basics and a handy reference of the large number of symbols should be all you need.

In this section I will explore a number of examples which should cover most requirements, and which can be expanded on by simply looking up the relevant backslashed TeX codes. Each is included in the HTML file, along with the MathJax rendering. The screenshots are from the file open in a browser.

A simple one to start with. The TeX specific parts of the code are:

• Everything after the G is embedded in { and }

• The subscripts are created using _1 and _2

• The division is denoted using \over

• The squared symbol is created with ^2

Nothing new here, I just included it to give context to the next equation.

A couple of new pieces of notation here:

• \pm denotes the plus-or-minus symbol

• \sqrt is used for the square root symbol

Also note how { and } are used to specify what is incorporated within \over and within \sqrt.

Again nothing new, but this example does emphasise that often most of the formula is left as-is with just a minimum of TeX-specific notation.

A more complex example using notation we've already seen. As there is only one term after the square roots we don't need to use curly brackets.

A few Greek letters flying around here. For upper case we use, for example, \Delta and for lower case we use \phi. The dot multiplication symbol is \cdot.

A much more complex example with a few interesting features.

• the \; forces a space. Without it sin and x are squashed up together

• The large sum symbol is created with \sum

• n=0 is added with the underscore subscript notation

• The infinity symbol is added (not very intuitively) with ^ and \infinity

• The final power, 2n+1, needs to go in curly brackets

This looks a bit horrendous but only because there is a lot of repetition.

• The large opening and closing brackets are created with \left and \right.

• The opening and closing floor symbols (like a double-height L and its mirror image, denoting rounding down to the nearest integer) are created with \bigg \lfloor and \bigg \rfloor.

Nothing really new but note the embedded curly brackets.

Hopefully you now have a feel for how TeX works, and can copy and adapt bits of my code for your own needs. Probably the easiest way to do this is to edit the TeX in this article's HTML page and refresh the page until you get what you want. Having now implemented no less that nine formulae in TeX I am aware that a bit of trial and error is needed, but it's easy to pick up a feel for how TeX works and to develop the knack of using it.

Rendering TeX Using MathJax

Once you have a formula in TeX you can use the MathJax library to render it within the browser. This is exactly what the HTML page that goes with this article does, and it simply a matter of adding the JavaScript file and embedding the TeX between appropriate delimiters. The basic usage described below is enough to get you up and running and may be all you'll ever need, but if you want to dig deeper check out the MathJax documentation.

This is how to include MathJax from its CDN.

<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

There are also plugins for content management systems including Wordpress and Drupal.

There are two types of TeX delimiter, $$. . .$$ (or $. . .$ which is equivalent) and $$. . .$$. The first of these renders so-called "displayed mathematics" suitable for use on its own line. The second is so-called "in-line mathematics" using a more compact formatting suitable for inclusion with other text.

This is the quadratic formula with "displayed mathematics" delimiters.

$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$

All of the formulae in the HTML page use the $$syntax but you just need to change the delimiters for inline content. I'd suggest that you don't use inline for anything but the simplest single-line mathematics. Anything using \over, \bigg etc. is squashed up in an awkward way in the inline format so looks much better in glorious isolation. This is the same formula with$$ . . .  and $$. . .$$ delimiters. The second one looks OK here but would look a bit awkward amongst normal text.

If you right-click on one of the MathJax generated formulas you'll get a context menu.

This includes options to view and copy the TeX and MathML.


text:
## Precalculus (6th Edition) Blitzer

$\frac{1}{2}$
The number $\frac{1}{2}$ is rational because it can be expressed as a quotient of two integers, but it is not an integer because it is not a whole number or a negative whole number.


text:
# A point of a closed convex set?

1. Jun 25, 2007

### Mathman23

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

Given D a a closed convex in R4 which consists of points $$(1,x_2,x_3,x_4)$$ which satisfies that that $$0\leq x_2,0 \leq x_3$$ and that $$x_2^2 - x_3 \leq 0$$

3. The attempt at a solution

Then to show that either the point a: = (1,-1,0,1) or b:=(1,0,0,-1) is part of the convex set D.

They must satisfy the equation $$l = b \cdot t + (1-t) \cdot b$$ and

$$l = a \cdot t + (1-t) \cdot a$$ which proves that either of the two points lies on a line segment l which belongs to the convex set.

Am I on the right track?

2. Jun 26, 2007

### quasar987

You want to show that a and b belong to D?

D has be entirely defined, and the fact that it is convex doesn't have anything to do with the problem as far as i can see. The second coordinate of a is negative, so it violates $$0\leq x_2$$.

3. Jun 26, 2007

### HallsofIvy

Staff Emeritus
And b is almost as trivial!


text:
# Convergence Test Help

#### Senn

##### New member

Determine if this series diverges, converges conditionally, or converges absolutely.

I said the series converges conditionally due to AST because the limit of this series when positive is 0, but the positive series is diverging when compared to 1/k using the limit comparison test.
However, the answer is that this series is diverging, and I wanted to know what I am doing wrong.

#### Dr.Peterson

##### Elite Member
View attachment 33596
Determine if this series diverges, converges conditionally, or converges absolutely.

I said the series converges conditionally due to AST because the limit of this series when positive is 0, but the positive series is diverging when compared to 1/k using the limit comparison test.
However, the answer is that this series is diverging, and I wanted to know what I am doing wrong.
Who says it diverges? Do you fully trust that source? Or is your own work sufficiently convincing to consider that maybe the source is wrong? (Or that you misread it?)

Last edited:

#### blamocur

##### Senior Member
View attachment 33596
Determine if this series diverges, converges conditionally, or converges absolutely.

I said the series converges conditionally due to AST because the limit of this series when positive is 0, but the positive series is diverging when compared to 1/k using the limit comparison test.
However, the answer is that this series is diverging, and I wanted to know what I am doing wrong.
You answer looks correct to me, and my simple script agrees: the series converge to approximately -0.28094 (with [imath]\infty[/imath] set to [imath]5\times10^8[/imath] )

#### lookagain

##### Elite Member
. . . the series converge to approximately -0.28094 (with [imath]\infty[/imath] set to [imath]5\times10^8[/imath] )

WolframAlpha shows that it approximately equals 0.396454 at this link:

#### blamocur

##### Senior Member
I did get my sign wrong, i.e. it should 0.28094. As for WalframAlpha, strangely it returns 0.347280... when I asked for more digits.

#### blamocur

##### Senior Member
I did get my sign wrong, i.e. it should 0.28094. As for WalframAlpha, strangely it returns 0.347280... when I asked for more digits.
... and WalframAlpha agrees with my answer when I ask for [imath]\sum_{k=2}^\infty (-1)^k 9 \frac{\log (k)}{k+6}[/imath] :

#### topsquark

##### Senior Member
I did get my sign wrong, i.e. it should 0.28094. As for WalframAlpha, strangely it returns 0.347280... when I asked for more digits.
To the corner with you!

-Dan

#### Subhotosh Khan

##### Super Moderator
Staff member
... and WalframAlpha agrees with my answer when I ask for [imath]\sum_{k=2}^\infty (-1)^k 9 \frac{\log (k)}{k+6}[/imath] :
Where did that '9' come from?

#### BigBeachBanana

##### Senior Member
Where did that '9' come from?
$$\displaystyle \log(k^9)=9\log(k)$$

#### BigBeachBanana

##### Senior Member
My script agrees with blamocur.

I find lookagain's link odd as it includes [imath]i?[/imath]

Last edited:

#### nasi112

##### Full Member
View attachment 33596
Determine if this series diverges, converges conditionally, or converges absolutely.

I said the series converges conditionally due to AST because the limit of this series when positive is 0, but the positive series is diverging when compared to 1/k using the limit comparison test.
However, the answer is that this series is diverging, and I wanted to know what I am doing wrong.
Always trust the tests.

$$\displaystyle \frac{9}{k+6} < \frac{9\ln k}{k + 6}$$

$$\displaystyle \sum_{k=2}^{\infty}\frac{9}{k+6}$$ is a divergent p-series, so $$\displaystyle \sum_{k=2}^{\infty}\frac{\ln(k^9)}{k+6}$$, diverges by the comparison test.

We have two options now, it's whether $$\displaystyle \sum_{k=2}^{\infty}(-1)^k\frac{\ln(k^9)}{k+6}$$ diverges or converges conditionally.

Now, I will try the alternating series test.

$$\displaystyle \lim_{k \rightarrow \infty}\frac{9\ln(k)}{k+6} = 0$$

$$\displaystyle \frac{9\ln(k+1)}{(k+7)} \times \frac{(k+6)}{9\ln(k)} < 1$$ for $$\displaystyle k \geq 7$$

Therefore, $$\displaystyle \sum_{k=2}^{\infty}(-1)^k\frac{\ln(k^9)}{k+6}$$, converges conditionally.

Note that I started the comparison test first. A better practice is to start the alternating series first.

If $$\displaystyle \frac{9\ln(k+1)}{(k+7)} \times \frac{(k+6)}{9\ln(k)}$$ is not obvious whether it is $$\displaystyle > 1$$ or $$\displaystyle < 1$$, take the limit.

$$\displaystyle \lim_{k \rightarrow \infty}\frac{9\ln(k+1)}{(k+7)} \times \frac{(k+6)}{9\ln(k)} = 1$$

If the limit is $$\displaystyle 1$$, here is the trick,

You know that $$\displaystyle \frac{\ln(k + 1)}{\ln(k)}$$ is always $$\displaystyle > 1$$. If its limit is $$\displaystyle 1$$, it means that it approaches $$\displaystyle 1$$ from above. In other words, $$\displaystyle \frac{\ln(k + 1)}{\ln(k)} \approx 1.0000001$$.

You know that $$\displaystyle \frac{k + 6}{k+7}$$ is always $$\displaystyle < 1$$. If its limit is $$\displaystyle 1$$, it means that it approaches $$\displaystyle 1$$ from below. In other words, $$\displaystyle \frac{k + 6}{k + 7} \approx 0.9999999$$.

And $$\displaystyle 1.0000001 \times 0.9999999$$ must be $$\displaystyle < 1$$

#### blamocur

##### Senior Member
Always trust the tests.

$$\displaystyle \frac{9}{k+6} < \frac{9\ln k}{k + 6}$$

$$\displaystyle \sum_{k=2}^{\infty}\frac{9}{k+6}$$ is a divergent p-series, so $$\displaystyle \sum_{k=2}^{\infty}\frac{\ln(k^9)}{k+6}$$, diverges by the comparison test.

We have two options now, it's whether $$\displaystyle \sum_{k=2}^{\infty}(-1)^k\frac{\ln(k^9)}{k+6}$$ diverges or converges conditionally.

Now, I will try the alternating series test.

$$\displaystyle \lim_{k \rightarrow \infty}\frac{9\ln(k)}{k+6} = 0$$

$$\displaystyle \frac{9\ln(k+1)}{(k+7)} \times \frac{(k+6)}{9\ln(k)} < 1$$ for $$\displaystyle k \geq 7$$

Therefore, $$\displaystyle \sum_{k=2}^{\infty}(-1)^k\frac{\ln(k^9)}{k+6}$$, converges conditionally.

Note that I started the comparison test first. A better practice is to start the alternating series first.

If $$\displaystyle \frac{9\ln(k+1)}{(k+7)} \times \frac{(k+6)}{9\ln(k)}$$ is not obvious whether it is $$\displaystyle > 1$$ or $$\displaystyle < 1$$, take the limit.

$$\displaystyle \lim_{k \rightarrow \infty}\frac{9\ln(k+1)}{(k+7)} \times \frac{(k+6)}{9\ln(k)} = 1$$

If the limit is $$\displaystyle 1$$, here is the trick,

You know that $$\displaystyle \frac{\ln(k + 1)}{\ln(k)}$$ is always $$\displaystyle > 1$$. If its limit is $$\displaystyle 1$$, it means that it approaches $$\displaystyle 1$$ from above. In other words, $$\displaystyle \frac{\ln(k + 1)}{\ln(k)} \approx 1.0000001$$.

You know that $$\displaystyle \frac{k + 6}{k+7}$$ is always $$\displaystyle < 1$$. If its limit is $$\displaystyle 1$$, it means that it approaches $$\displaystyle 1$$ from below. In other words, $$\displaystyle \frac{k + 6}{k + 7} \approx 0.9999999$$.

And $$\displaystyle 1.0000001 \times 0.9999999$$ must be $$\displaystyle < 1$$
Where do 1.0000001 and 0.9999999 come from?

#### nasi112

##### Full Member
Where do 1.0000001 and 0.9999999 come from?
Plug a large number and you will have an idea (a pattern) what is going on in $$\displaystyle \infty$$. Say $$\displaystyle 9999999$$.

$$\displaystyle \frac{\ln(9999999 + 1)}{\ln(9999999)} \approx 1.000000006 \approx 1.00000001$$

$$\displaystyle \frac{(9999999 + 6)}{(9999999 + 7)} \approx 0.9999999$$

I should have written $$\displaystyle 1.00000001$$ (7 zeros) instead of $$\displaystyle 1.0000001$$ (6 zeros). But it does not matter much as we are here to compare:

$$\displaystyle 0.99999990$$
$$\displaystyle 1.00000001$$ (We care only for the last digit here $$\displaystyle \geq$$ 1)

$$\displaystyle 1.00000001 \times 0.99999990 < 1$$

If the numbers were, for example,

$$\displaystyle 0.99999999$$
$$\displaystyle 1.00000001$$

As long as the last digit is $$\displaystyle 1$$ or $$\displaystyle 0$$,

$$\displaystyle 1.00000001 \times 0.99999999 < 1$$

If the last digit is not $$\displaystyle 1$$, we look at the digit above it. If it is $$\displaystyle 9$$, then we have an expression $$\displaystyle > 1$$. If the last digit is not $$\displaystyle 1$$ and the digit above it is $$\displaystyle 0$$, then we have an expression $$\displaystyle < 1$$.

These are the most frequent cases that you will encounter:

a. ($$\displaystyle < 1$$)
0.99999999
1.00000001

b. ($$\displaystyle > 1$$)
0.99999999
1.00000002 (or any number above 1)

c. ($$\displaystyle < 1$$)
0.99999990
1.00000001 (or any number above 1)

The position of the digit $$\displaystyle 1$$ is not the last. To understand this, I will give an example below.
d. ($$\displaystyle > 1$$)
0.99999999
1.00010000 (or any number above 1)

-----
Let us flip the series upside down and see what happens.

$$\displaystyle \frac{\ln(9999999)}{\ln(9999999+1)} \approx 0.99999999$$

$$\displaystyle \frac{(9999999 + 7)}{(9999999 + 6)} \approx 1.0000001$$

We are comparing:

0.99999999
1.00000010 (the position of the digit $$\displaystyle 1$$ is not the last)

We have an expression $$\displaystyle > 1$$.

#### Steven G

##### Elite Member
Always trust the tests.

$$\displaystyle \frac{9}{k+6} < \frac{9\ln k}{k + 6}$$
That inequality is not always true (try k=2). You need to say that it is eventually true.

#### Steven G

##### Elite Member
$$\displaystyle \frac{9\ln(k+1)}{(k+7)} \times \frac{(k+6)}{9\ln(k)} < 1$$ for $$\displaystyle k \geq 7$$
And this inequality is true for k≥7 because....
Where is your proof of this??
Saying 1.0000001×0.9999999 must be <1 is true but it is also true that 2x3=6.
What if you had 1.00001*.99999999999 which is greater than 1?
You just can't just say that statements are true just because you want them to be true!

Last edited:

#### nasi112

##### Full Member
And this inequality is true for k≥7 because....
Where is your proof of this??
Saying 1.0000001×0.9999999 must be <1 is true but it is also true that 2x3=6.
What if you had 1.00001*.99999999999 which is greater than 1?
You just can't just say that statements are true just because you want them to be true!
I cannot prove it by myself. This method was provided by our professor and it is guaranteed to always work. Prove me wrong!

1.00001*.99999999999 > 1

The idea of this method is that we don't really need to know exactly what happens in $$\displaystyle \infty$$. It is enough to understand the behavior of the two functions in the way to infinite.

When plugging a large number (same number) in $$\displaystyle f(x)$$ and $$\displaystyle g(x)$$ and you get $$\displaystyle f(x) \times g(x) < 1$$ or $$\displaystyle f(x) \times g(x) > 1$$, no matter how further you go, you will get the same result.

#### nasi112

##### Full Member
That inequality is not always true (try k=2). You need to say that it is eventually true.
If we do a comparison in infinite series, we don't care about the first few terms. Even without saying eventually, it is understandable.

#### blamocur

##### Senior Member
I cannot prove it by myself. This method was provided by our professor and it is guaranteed to always work. Prove me wrong!
Unlike the presumption of innocence in the rule of law there is no presumption of correctness in math. I.e., a statement is not considered proven correct until proven wrong.


text:
## Vector Field Approximation on Regular Surfaces in Terms of Outer Harmonic Representations

• The present work deals with the (global and local) modeling of the windfield on the real topography of Rheinland-Pfalz. Thereby the focus is on the construction of a vectorial windfield from low, irregularly distributed data given on a topographical surface. The developed spline procedure works by means of vectorial (homogeneous, harmonic) polynomials (outer harmonics) which control the oscillation behaviour of the spline interpoland. In the process the characteristic of the spline curvature which defines the energy norm is assumed to be on a sphere inside the Earth interior and not on the Earth’s surface. The numerical advantage of this method arises from the maximum-minimum principle for harmonic functions.
• Vektorfeldapproximation auf regulären Flächen mittels Outer Harmonics

$Rev: 13581$


text:
## The Comprehensive Guide to URL Parameter Encryption in PHP

The question of how to encrypt/decrypt a URL parameter (such as a username, email address, or primary key for a relational database) has become increasingly common, so we'd like to offer a simple and actionable solution for people who are asking the same (or a very similar) question.

# Don't.

Cryptography is a tricky field, especially for newcomers. To a security expert, it's immediately obvious why encrypting URL parameters is a bad idea. Let me explain why, and then I'll offer a superior alternative solution.

## Why Encrypting URL Parameters is a Bad Idea

Typically, the desired result of encrypting a URL looks like this:

One problem arises that, given the desired outcome of a very short URL (which is a common constraint to any system that sends URLs over SMS), there isn't enough room to both encrypt the desired information and then authenticate the encrypted output. Encryption without message authentication is totally broken.

Unless you're a cryptographer or security engineer, you wouldn't know these details. In this situation, encryption adds complexity and lots of room for nefarious errors to your application, for no real benefit. Obfuscation is a trivial task, as we'll demonstrate below; why add unnecessary complexity if you can avoid it?

Do not encode sensitive data. This includes sensitive integers, like numeric passwords or PIN numbers. This is not a true encryption algorithm.

The hashids protocol has been publicly broken by simple cryptanalysis techniques.

This might seem like an attractive solution, but it won't stop users from trivially teasing the underlying database row ID out of your obfuscated URL parameter. Hashids are not secure; don't use them.

## What Should I Do Instead?

Okay, by this point, we hope you're convinced that neither encryption nor hashids are the way to go forward. Encryption is very hard to get right, and hashids are not secure.

But knowing this doesn't solve your problem: How can you serve content via an obfuscated URL without resorting to encryption?

A little bit of math:

• In MySQL, an INTEGER(11) UNSIGNED primary key can hold about 4 billion rows. This is equal to 32 bits.
• If you generate 9 raw bytes from a cryptographically secure pseudorandom number generator (72 bits of possible values), then base64 the result, you will end up with a 12 character identifier.
• 72 bits of possible values means a 50% chance of collision at $2^{36}$ records, according to the birthday problem.

This means you have a 50% chance of only two duplicate random values after about 69 billion records (a far cry beyond your 4 billion storage capacity). This means that you will almost never have a collision. You should still make sure every selector you generate is unique before inserting a new one, of course.

Furthermore, this record is completely randomly generated and has nothing to do with the rest of the data stored in your database. There is no pattern to be found. (The closest relevant buzz-word here is a "zero knowledge".)

Instead of encrypting URL parameters, add a column that stores a random 12-character string for each row (which is generated by base64-encoding 9 bytes from a CSPRNG), and use that in your URLs and SELECT queries.

use ParagonIE\ConstantTime\Base64UrlSafe;
/**
* Generate a selector
*
* @return string (12 characters)
*/
function generateSelector(): string
{
return Base64UrlSafe::encode(random_bytes(9));
/* Equivalent:
return strtr(base64_encode(random_bytes(9)), '+/', '-_');
*/
}

(Code snippet above uses paragonie/constant_time_encoding.)

This problem is simpler and less likely to cause bugs or implementation errors now and going forward.

### A Quick Note about Access Controls

An obfuscated URL does not obviate the need for access controls. The use case here is, "I want to serve a unique ID for a particular resource without leaking metadata about the activity level of our app."

Do not use obfuscated URLs as a backdoor into your application.

### But What if I Really Want to Encrypt URL Parameters?

If after seeing our above recommendation you still want to go forward with encrypting your GET parameters, don't write your own cryptography. Use a peer-reviewed, secure PHP cryptography library instead.

### Update: "How about timing attacks when selecting the token that way?"

This question was posed by Niklas Keller after the initial publication of this blog post. We feel that it's interesting enough to answer here in detail.

Unless you know otherwise, you should generally assume that database lookups are vulnerable to timing attacks. You can design this URL obfuscation scheme in a timing-attack-resistant way, but it will result in a longer URL parameter and a little bit more application complexity. Be forewarned that fixed/random delays are not a solution for timing attacks.

The solution here is to employ split tokens (which is very similar to our secure implementation of "remember me" cookies).

Instead of adding one column (selector above), we're going to add two: selector and verifier. Our URLs will consist of the two concatenated together.

When we perform a lookup, we'll grab the first $N$ (let's say 12) characters and feed it into the selector. If a record is found, we will pull the row then compare the remainder of our URL parameter with verifier using PHP's hash_equals() function. If hash_equals() doesn't return true, act like the row was not found.

Even if an attacker can use a timing side-channel on the first 12 characters of a URL, if the remaining $M$ characters (let's say 24) are not vulnerable to timing attacks.

use ParagonIE\ConstantTime\Base64UrlSafe;
/**
* Generate a selector
*
* @param bool $skipUniqueCheck * @return string (12 characters) */ function generateSelector(bool$skipUniqueCheck = false): string
{
/** @var \PDO $db */ global$db;
if ($skipUniqueCheck) {$selector = Base64UrlSafe::encode(random_bytes(9));
} else {
$iterations = 0; do { if (++$iterations > 128) {
throw new RuntimeException('Unexpected high number of selector collisions.');
}
$selector = Base64UrlSafe::encode(random_bytes(9));$exists = $db->prepare("SELECT count(*) FROM users WHERE selector = ?");$exists->execute([$selector]); } while ($exists->fetchColumn() > 0);
}
return $selector; } /** * Generate a validator * * @return string (24 characters) */ function generateValidator(): string { return Base64UrlSafe::encode(random_bytes(18)); } /** * Validate a URL input * * @param string$selector (string, 36 chars)
* @return array
* @throws Exception
*/
function getUserBySelector(string $selector): array { /** @var \PDO$db */
global $db; if (preg_match('/^[0-9A-Za-z\-_]{36}$/', $selector)) {$stmt = $db->prepare("SELECT * FROM users WHERE selector = ?");$stmt->execute([substr($selector, 0, 12)])$user = $stmt->fetch(PDO::FETCH_ASSOC); if (!empty($user)) {
if (hash_equals(substr($selector, 12),$user['validator']))) {
return \$user;
}
}
}
throw new Exception('Invalid URL');
}

Since this information isn't as sensitive as a long-term authentication token, we don't really need to hash the verifier in the database (but there's no harm in doing so, provided you don't need to retrieve the full URL at will).

## Conclusion

Don't use encryption to obfuscate URL parameters. Use a random look-up instead.

#### P.I.E. Staff

Paragon Initiative Enterprises

Paragon Initiative Enterprises is a Florida-based company that provides software consulting, application development, code auditing, and security engineering services. We specialize in PHP Security and applied cryptography.

## Need Technology Consultants?

Will tomorrow bring costly and embarrassing data breaches? Or will it bring growth, success, and peace of mind?

Our team of technology consultants have extensive knowledge and experience with application security and web/application development.

We specialize in cryptography and secure PHP development.