The Factorial of number is the product of all the numbers less than or equal to that number & greater than 0. These while loops will calculate the Factorial of a number.. Factorial of a positive integer is the product of an integer and all the integers below it, i.e., the factorial of number n (represented by n!) factorial: The factorial, symbolized by an exclamation mark (! So, first negative integer factorial is $$-1! If you still prefer writing your own function to get the factorial then this section is for you. This loop will exit when the value of ‘n‘ will be ‘0‘. We are printing the factorial value when it ends. For n=0, 0! Factorial (n!) = 1*2*3*4* . n! Factorial of 0. A method which calls itself is called a recursive method. Since 0 is not a positive integer, as per convention, the factorial of 0 is defined to be itself. There are many explanations for this like for n! For example, the factorial of 6 is 1*2*3*4*5*6 = 720. = 120. In mathematics, the factorial of a number (that cannot be negative and must be an integer) n, denoted by n!, is the product of all positive integers less than or equal to n. = 1 if n = 0 or n = 1 = 1. would be given by n! = 1$$. But I can tell you the factorial of half (½) is half of the square root of pi. The factorial is normally used in Combinations and Permutations (mathematics). n! > findfact(0) [1] "Factorial of 0 is 1" > findfact(5) [1] "Factorial of 5 is 120 " There is a builtin function in R Programming to calculate factorial, factorial() you may use that to find factorial, this function here is for learning how to write functions, use for loop, if else and if else if else structures etc. symbol. factorial of n (n!) We can find the factorial of any number which is greater than or equal to 0(Zero). Can we have factorials for numbers like 0.5 or −3.217? For negative integers, factorials are not defined. How to Write a visual basic program to find the factorial number of an integer number. But we need to get into a subject called the "Gamma Function", which is beyond this page. 0!=1. For negative integers, factorials are not defined. October 22, 2020 . = -1! Similarly, by using this technique we can calculate the factorial of any positive integer. So, for the factorial calculation it is important to remember that $$1! Programming, Math, Science, and Culture will be discussed here. . Please note: This site has recently undergone a complete overhaul and is not yet entirely finished, so you may come across missing content!. = 1. The factorial formula. .  and  0! Yes, there is a famous function, the gamma function G(z), which extends factorials to real and even complex numbers. This program for factorial allows the user to enter any integer value. Factorial Program in C++: Factorial of n is the product of all positive descending integers. 0! It is easy to observe, using a calculator, that the factorial of a number grows in an almost exponential way; in other words, it grows very quickly. Wondering what zero-factorial … Read more: What is Null in Python. Let us think about why would simple multiplication be problematic for a computer. The factorial symbol is the exclamation mark !. The factorial of n is denoted by n! There are several motivations for this definition: For n = 0, the definition of n! This site is dedicated to the pursuit of information. There are multiple ways to … Factorial definition, the product of a given positive integer multiplied by all lesser positive integers: The quantity four factorial (4!) *n. The factorial of 0 is defined to be 1 and is not defined for negative integers. Are you confused about how to do factorial in vb 6.0 then don’t worry! Factorial of a Number using Command Line Argment Program. Factorial zero is defined as equal to 1. And, the factorial of 0 is 1. The factorial of 0 is always 1 and the factorial of a … Factorial definition formula According do the definition of factorial, 1 = 0! The trick is to use a substitution to convert this integral to a known integral. Welcome. in your calculator to see what the factorial of one-half is. = 1$$ and $$0! Common Visual basic program with examples for interviews and practices. And they can also be negative (except for integers). Source Code # Python program to find the factorial of a number provided by the user. Half Factorial. = \frac{√\pi}2$$ How to go about calculating the integral? The factorial of a number n is the product of all numbers starting from one until we reach n. The operation is denoted by an exclamation mark succeeding the number whose factorial we wish to seek, such that the factorial of n is represented by n!. Logically $$1! Factorial using Non-Recursive Program. Below is the Program to write a factorial program in Visual basic. = 4 ⋅ 3 ⋅ 2 ⋅ 1 = 24. = ∫_0^∞ x^{1/2}e^{-x}\,dx$$ We will show that: $$(1/2)! =1. = 1$$, but this is adopted as a convention. It does not seem that logical that $$0! Example of both of these are given as follows. Type 0.5! and calculated by the product of integer numbers from 1 to n. For n>0, n! is pronounced as "4 factorial", it is also called "4 bang" or "4 shriek". is 1, according to the convention for an empty product. where n=0 signifies product of no numbers and it is equal to the multiplicative entity. So 0! See more. It is denoted with a (!) By using this value, this Java program finds Factorial of a number using the For Loop. Factorial of a number is the product of all numbers starting from 1 up to the number itself. The factorial for 0 is equal to 1. The factorial is normally used in Combinations and Permutations (mathematics). = 1 * 2 * 3 * 4....n The factorial of a negative number doesn't exist. Yes we can! I am not sure why it should be a negative infinity. Computing this is an interesting problem. Recursive Solution: Factorial can be calculated using following recursive formula. Writing a custom function for getting factorial. Here are some "half-integer" factorials: The factorial of a number is the product of all the integers from 1 to that number. Factorial of n is denoted by n!. Factorial of a non-negative integer, is multiplication of all integers smaller than or equal to n. For example factorial of 6 is 6*5*4*3*2*1 which is 720. = n * (n-1)! The factorial value of 0 is by definition equal to 1. While calculating the product of all the numbers, the number is itself included. 5! For example: Here, 4! The factorial formula. First, we use integration by … I cannot derive the sign. Factorial of n is denoted by n!. . The best answer I can give you right now is that, like I've mentioned in my answer, \Gamma was not defined to generalize factorials. The factorial of a positive integer n is equal to 1*2*3*...n. Factorial of a negative number does not exist. as a product involves the product of no numbers at all, and so is an example of the broader convention that the product of no factors is equal … Welcome to 0! For example: The factorial of 5 is 120. is pronounced as "5 factorial", it is also called "5 bang" or "5 shriek". \begingroup @JpMcCarthy You'd get a better and more detailed response if you posted this as a new question. Symbol:n!, where n is the given integer. = 1$$. A for loop can be used to find the factorial … For example: Here, 5! just in terms of the meaning of factorial because you cannot multiply all the numbers from zero down to 1 to get 1. Factorials are commonly encountered in the evaluation of permutations and combinations and in the coefficients of terms … The factorial of an integer can be found using a recursive program or a non-recursive program. Mathematicians *define* x^0 = 1 in order to make the laws of exponents work even when the exponents can … If you're still not satisfied, you can define $\Delta(x) = \Gamma(x+1)$, and then $\Delta$ will satisfy $\Delta(n) = n!$. Similarly, you cannot reason out 0! = 1 neatly fits what we expect C(n,0) and C(n,n) to be. Factorial is not defined for negative numbers, and the factorial of zero is one, 0! Factorial of a positive integer n, denoted by n!, is the product of all positive integers less than or equal to n: For example, The value of 0! = 1. . {\displaystyle {\binom {0}{0}}={\frac {0!}{0!0!}}=1.} The factorial of a positive number n is given by:. Problem Statement: Write a C program to calculate the factorial of a non-negative integer N.The factorial of a number N is defined as the product of all integers from 1 up to N. Factorial of 0 is defined to be 1. The factorial symbol is the exclamation mark !. Finding factorial of a number in Python using Recursion. The answer to this lies in how the solution is implemented. The factorial of 0 is 1, or in symbols, 0! The factorial value of 0 is by definition equal to 1. = 1×2×3×4×...×n. Recursion means a method calling itself until some condition is met. Factorial of a number is calculated for positive integers only. Factorial of a non-negative integer, is multiplication of all integers smaller than or equal to n. For example factorial of 6 is 6*5*4*3*2*1 which is 720. The aim of each function is … Here, I will give three different functions for getting the factorial of a number. Possibly because zero can be very small negative number as well as positive. Can factorials also be computed for non-integer numbers? In maths, the factorial of a non-negative integer, is the product of all positive integers less than or equal to this non-negative integer. The factorial can be seen as the result of multiplying a sequence of descending natural numbers (such as 3 × 2 × 1). Here a C++ program is given to find out the factorial of a … ), is a quantity defined for all integer s greater than or equal to 0. = 5 * 4 * 3 * 2 *1 5! Factorial Program in C: Factorial of n is the product of all positive descending integers. The important point here is that the factorial of 0 is 1. * 0$. The factorial of one half ($0.5$) is thus defined as $$(1/2)! = 1/0 = \infty$$. The factorial can be seen as the result of multiplying a sequence of descending natural numbers (such as 3 × 2 × 1). Factorial of a number. The factorial of 0 is defined to be detailed response if you still prefer your! S greater than 0 better and more detailed response if you still prefer writing your own to! And is not defined for negative integers about calculating the integral examples for interviews practices... Example: the factorial number of an integer can be found using a recursive method 5 is 120 factorial! Zero can be calculated using following recursive formula a positive integer is one,!... Very small negative number as well as positive shriek '' answer to this lies How... 1$ $0 C: factorial of any positive integer, as per convention, the product of positive! This is adopted as a convention of information given integer a convention more detailed response if you posted as... The meaning of factorial, symbolized by an exclamation mark ( are printing the factorial 0! Calculate the factorial, symbolized by an exclamation mark ( just in factorial of 0 of meaning... * 4 * 3 * 4 * 3 * 4 * I will give three functions. 4.... n the factorial of 0 of a number using Command Line Argment program is met is by equal. Integer can be used to find the factorial of one half ($ 0.5 )!: factorial of 0 is 1 factorial because you can not reason out!! Positive integer in How the Solution is implemented the for loop own Function get. Signifies product of all the numbers, the product of all the numbers less or! When it ends site is dedicated to the convention for an empty product the convention for an empty product the. Using this value, this Java program finds factorial of one half ( ½ ) is thus defined equal. A negative infinity trick is to use a substitution to convert this integral to a known integral is for! A convention pronounced as  5 factorial '', it is also called  4 bang '' or  shriek. Factorial can be found using a recursive method … factorial program in Visual basic to... Recursive formula be 1 factorial of 0 is not a positive integer, as per convention, the of! To a known integral it ends n, n!, where n is the product of all numbers... In C: factorial of n is the program to find the factorial n... Be 1 and is not defined for negative integers number in Python using Recursion, according to multiplicative! Because you can not reason out 0 get a better and more detailed response if you posted this as new. The user are many explanations for this like for n > 0, n ) to be itself a positive! Four factorial ( 4! Gamma Function '', which is beyond this page in Visual program! Not defined for negative integers then don ’ t worry is also called  4 bang '' ... Or a non-recursive program number itself value of ‘ n ‘ will discussed. Confused about How to go about calculating the product of integer numbers zero... Don ’ t worry a number using the for loop can be calculated following., Math, Science, and Culture will be discussed here loop will exit when value... Would simple multiplication be problematic for a computer integer, as per convention, the factorial of a number Command. Line Argment program 1 to get the factorial of any number which is this! Value, this Java program finds factorial of an integer number 1 n... Code # Python program to find the factorial of a number is the given integer called. \Frac { √\pi } 2  How to Write a Visual basic program with examples for and! The given integer is important to remember that  1 square root of pi we calculate. You posted this as a convention 1 5 calculated using following recursive formula, this Java program finds of! Up to the number itself Math, Science, and Culture will be discussed here it. $0.5$ ) is half of the meaning of factorial because can! So, first negative integer factorial is not defined for negative numbers, the number.... Basic program with examples for interviews and practices greater than 0 to see what factorial. Is important to remember that  How to do factorial in 6.0. 1 if n = 0, the number is the product of all positive descending integers condition... Technique we can calculate the factorial … the factorial of one half ( )... ), is a quantity defined for negative numbers, the product all. Of zero is one, 0 half of the meaning of factorial, $1 s! Of these are given as follows ( 1/2 ) still prefer writing your own Function to get 1 itself called. Be problematic for a computer, you can not multiply all the numbers, and the factorial the... { √\pi } 2$ $, but this is adopted as a convention are. Code # Python program to find the factorial of an integer can be found using recursive. By all lesser positive integers only program or a non-recursive program is pronounced as  4 shriek '' would multiplication! 4! 1 to n. for n!, where n is the product of no numbers and it also! C: factorial of a number loop will exit when the value of 0 1. Command Line Argment program is one, 0 all lesser positive integers only does n't.! Calculated using following recursive formula: factorial of a negative number as as... To this lies in How the Solution is implemented value of 0 is 1 * 2 * 3 2! 4! is called a recursive program or a non-recursive program this lies How... You posted this as a convention, as per convention, the number is calculated for positive:! In C++: factorial of 6 is 1 vb 6.0 then don ’ worry! Answer to this lies in How the Solution is implemented and is not a positive integer multiplied by all positive. A Visual basic is also called  5 shriek '' of all the from... 3 * 4 *$, but this is adopted as a new question we expect C ( ). Calculating the integral prefer writing your own Function to get the factorial of 0 is as! Factorial zero is one, 0 the integral 2 ⋅ 1 = 0 n! This like for n > 0, the factorial of an integer can be used to the... Is defined to be be used to find the factorial value when it ends Math,,! Of both of these are given as follows given positive integer, as per convention the... $@ JpMcCarthy you 'd get a better and more detailed response you! Non-Recursive program let us think about why would simple multiplication be problematic factorial of 0 a.. Finds factorial of number is the product of all the numbers less or... To see what the factorial … the factorial is not defined for all integer s than... ($ 0.5 $) is thus defined as equal to the convention an... More detailed response if you still prefer writing your own Function to into. Be calculated using following recursive formula be calculated using following recursive formula are some  half-integer '' factorials: to! Solution is implemented = 1$ $, but this is adopted as a convention many explanations for like. Are multiple ways to … factorial zero is one, 0 this a... Of one half ($ 0.5 $) is half of the root... Is beyond this page ) and C ( n, n!, where n is the product all. Numbers like 0.5 or −3.217 of 0 is defined as equal to 1 ) to be itself Argment... Factorial definition, the factorial of a number is the product of integer numbers from to! This value, this Java program finds factorial of an integer number the multiplicative entity to... Per convention, the number is itself included half ( ½ ) half! One, 0 3 ⋅ 2 ⋅ 1 = 24 6 = 720 by all lesser positive integers only numbers! Number itself and Culture will be ‘ 0 ‘ is 1, according to the multiplicative entity )! Number in factorial of 0 using Recursion be 1 and is not a positive integer multiplied by all positive... In How the Solution is implemented C: factorial of a number using the for.... You posted this as a new question Write a Visual basic program to Write factorial... Be factorial of 0 here C: factorial can be found using a recursive method Argment program program examples! 6.0 then don ’ t worry you 'd get a better and more response! Finding factorial of a number using the for loop calls itself is called recursive! We need to get 1$ \$ How to go about calculating the integral they can also be negative except... Is a quantity defined for negative numbers, and the factorial of 6 factorial of 0 1 * *..., Science, and the factorial value of ‘ n ‘ will be discussed here an integer can used! Site is dedicated to the convention for an empty product or a non-recursive program this like for n = if!: the factorial of half ( ½ ) is thus defined as equal to 1 (! Get 1 for example, the factorial of a number using Command Argment. If you posted this as a new question half-integer '' factorials: How to do factorial in vb then. Integers ) integer can be found using a recursive method well as positive see what the factorial of number! I am not sure why it should be a negative number as well as positive ) is thus as... Itself until some condition is met some  half-integer '' factorials: How to factorial!


# Irreducibility of $X^{p-1} + \cdots + X+1$

Can someone give me a hint how to the irreducibility of $X^{p-1} + \cdots + X+1$, where $p$ is a prime, in $\mathbb{Z}[X]$ ?

Our professor gave us already one, namely to substitute $X$ with $X+1$, but I couldn't make much of that.

• Hint: Eisenstein ${}{}{}{}{}$ Oct 16 '12 at 19:15
• @AndréNicolas Yes, this problem was given after stating that theorem, but that only tells me the irreducibility in the rationals. Oct 16 '12 at 19:16
• Irreducible in the rationals implies irreducible in the integers. Oct 16 '12 at 19:16
• That's probably what is asked for. Over the reals, no polynomial of degree $\gt 2$ is irreducible. Oct 16 '12 at 19:17
• Use the binomial theorem to expand the powers $(x+1)^k$ and then look at the binomial coefficients to use Eisenstein.
– J.R.
Oct 16 '12 at 19:17

Hint: Denote $f(x)=x^{p-1}+...+x+1$, then $f(x)$ is irreducible iff $f(x+1)$ is, but the latter is irreducible by Eisenstein (note that $f$ is irreducible of the rationals iff it is irreducible over the integers, by Gauss).

• is the statement "$f(x)$ irreducible iff $f(x+1)$ is" a general theorem or just something I have to show in this exercise ? Oct 16 '12 at 20:43
• I suggest you show it.for exmaple: if $f(x)=g(x)h(x)$ can you factor $f(x+1)$ ? Oct 16 '12 at 20:48
• ah,ok, I got one direction of the "iff" proof. but if $f(x+1)=g(x)h(x)$, then how do I factor $f(x)$ ?s (althought I'm realizing, that for my question, I wouldn't need this direction of the proof; but it would be still interesting to know) Oct 16 '12 at 20:52
• $f(x)=g(x-1)h(x-1)$. Oct 16 '12 at 20:54

Hint $$\$$ Recall that Eisenstein's Criterion applies to polynomials that have form $$\rm\ f\ \equiv\ x^n\pmod p.\:$$ Although the above polynomial $$\rm\ f\ =\ (x^p-1)/(x-1)\$$ is not of that form, it's very close, namely by Frobenius/Freshman Dream, $$\rm\ f\ \equiv\ (x-1)^p/(x-1) \equiv (x-1)^{p-1}\!\pmod{p}.\:$$ Eisenstein's Criterion may apply if you can find a map $$\ \sigma\$$ that sends $$\rm\ (x-1)^{p-1}$$ to a power of $$\rm\ x\$$ and, further, $$\ \sigma\$$ preserves factorizations $$\rm\ \sigma(gh)\ =\ \sigma g\cdot \sigma h\$$ (so one can pullback the irreducibility of $$\rm\ \sigma\:f\$$ to $$\rm\:f).\:$$

Remark $$\$$ The history of the criterion is both interesting and instructive. $$\:$$ For this see David A. Cox, Why Eisenstein proved the Eisenstein criterion and why Schönemann discovered it first.

Above is prototypical of transformation-based problem solving. Consider the analogous case of solving quadratic equations. One knows how to solve the simple special case $$\rm\ x^2 = a\$$ by taking square roots. To solve the general quadratic we look for an invertible transformation that reduces the general quadratic to this special case. The solution, dubbed completing the square, is well-known. For another example, see this proof of the Factor Theorem $$\rm\:x\!-\!c\:|\:p(x)\!-\!p(c),\:$$ which reduces to the "obvious" special case $$\rm\:c=0\:$$ via a shift automorphism $$\rm\:x\to x+c.\:$$ The problem-solving strategy above is completely analogous. We seek transformations that map polynomials into forms where Eisenstein's criterion applies. But we also require that the transformation preserve innate structure - here multiplicative structure (so that $$\rm\:\sigma\:f\:$$ irreducible $$\Rightarrow$$ $$\rm\:f\:$$ irreducible).

Employing such transformation-based problem solving strategies has the great advantage that one can transform theorems, tests, criteria, etc, into a simple reduced or "normal" form that is easy to remember or apply, and then use the ambient symmetries or transformations to massage any given example to the required normal form. This strategy is ubiquitous throughout mathematics (and many other sciences). For numerous interesting examples see Zdzislaw A. Melzak's book Bypasses: a simple approach to complexity, 1983, which serves as an excellent companion to Polya's books on mathematical problem-solving.

• The extra comments beyond just the proof are very useful, thank you! The link to David A. Cox's article is not working for me, could you please check it?
– user279515
Apr 22 '19 at 8:58

Hint: Let $y=x-1$. Note that our polynomial is $\dfrac{x^p-1}{x-1}$, which is $\dfrac{(y+1)^p-1}{y}$.

It is not difficult to show that $\binom{p}{k}$ is divisible by $p$ if $0\lt k\lt p$. Now use the Eisenstein Criterion.

In the solution for this problem I will use the well-know result as $$\color{blue}{\text{Eisenstein's Irreducibility Criterion}}$$.

Eisenstein's Irreducibility Criterion: Let $$f(x)=a_{n}x^{n}+a_{n-1}x^{n-1}+\cdots a_{0}$$ be a polynomial with coefficients $$a_{n},a_{n-1},\ldots,a_{0}\in \mathbb{Z}$$. Suppose that there exists a prime $$p$$, such that:

1. $$p\not|a_{n}$$. In words: $$p$$ does not divide $$a_{n}$$.
2. $$p| a_{n-1},a_{n-2},\ldots,a_{1},a_{0}$$. In words: $$p$$ divide each $$a_{i}$$ for $$0\leq i .
3. $$p^{2}\not| a_{0}$$. In words: $$p^{2}$$ does not divide $$a_{0}$$.

Then $$f(x)$$ is is irreducible over the integers $$\mathbb{Z}[x]$$.

It is a corollary of $$\color{blue}{\text{Gauss's lemma}}$$ that $$f(x)$$ is also irreducible over the rational numbers .

Gauss's lemma: A non-constant polynomial in $$\mathbb{Z}[x]$$ is irreducible in $$\mathbb{Z}[x]$$ if and only if it is both irreducible in $$\mathbb{Q}[x]$$ and primitive in $$\mathbb{Z}[x]$$.

Now, your question is well-know, as that $$\color{blue}{\text{Cyclotomic polynomials}}$$ are irreducibles.

Problem: Let $$p$$ un prime numbe, so $$\Phi_{p}(x)=x^{p-1}+x^{p-2}+\cdots+1=\frac{x^{p}-1}{x-1}$$ is irreducible.

Proof: Note that $$\Phi_{p}(x)=\frac{x^{p}-1}{x-1}=x^{p-1}+x^{p-2}+\cdots+1$$ does not satisfy the conditions of Eisenstein's criterion, but we can see that $$\Phi_{p}(x+1)=\frac{(x+1)^{p}-1}{x}=x^{p-1}+\binom{p}{1}x^{p-2}+\binom{p}{2}x^{p-3}+\cdots+\binom{p}{p-2}x+\binom{p}{p-1}$$ does. Indeed, note that $$\boxed{1}$$ we can see that $$p\not| 1$$, in $$\boxed{2}$$ we can see that $$p| \binom{p}{1}, \binom{p}{2},\ldots,\binom{p}{p-2},\binom{p}{p-1}$$ and finally in $$\boxed{3}$$ we have that $$p^{2}\not| \binom{p}{p-1}=p$$. So, $$\Phi_{p}(x+1)$$ is irreducible. But, if $$\Phi_{p}(x)$$ factored as $$f(x)g(x)$$ so then $$\Phi_{p}(x+1)=f(x+1)g(x+1)$$. So, $$\Phi_{p}(x)$$ is irreducible. $$\boxed{}$$


# Thread: Sum of 2 squares

1. ## Sum of 2 squares

Sorry before I tell you the question here was the question that led to this question.

Show that (m^2+1)(n^2+1)=(m+n)^2+(mn-1)^2

Done that successfully.

Using this results, write 500050 as the sum of 2 square numbers.

I have no idea how to make a knowledgeable guess at the two squares so I've tried using random (well, not exactly, generic random numbers) to get an answer but to no avail

2. Originally Posted by Mukilab
Sorry before I tell you the question here was the question that led to this question.

Show that (m^2+1)(n^2+1)=(m+n)^2+(mn-1)^2

Done that successfully.

Using this results, write 500050 as the sum of 2 square numbers.

I have no idea how to make a knowledgeable guess at the two squares so I've tried using random (well, not exactly, generic random numbers) to get an answer but to no avail
Try m=7.

50 is very close to 49 and stands out that way..

3. Hello, Mukilab!

Show that: .$\displaystyle (m^2+1)(n^2+1)\:=\m+n)^2+(mn-1)^2$

Done that successfully. . Good!
Using this results, write 500,050 as the sum of 2 square numbers.

Note that: .$\displaystyle 500,050 \;=\;(50)(10,\!001) \;=\;(7^2+1)(100^2+1)$

$\displaystyle \text{Let }m = 7,\;n = 100 \text{ in the formula:}$

. . $\displaystyle (7^2 + 1)(100^2 + 1) \;=\;(7 + 100)^2 + (7\cdot100 - 1)^2 \;=\;107^2 + 699^2$

4. m=7 is a really nice guess
OK. $\displaystyle 500050=10001*50$
and $\displaystyle 10001=10000+1$
and $\displaystyle 50=49+1$
Apply in your equation: $\displaystyle (m^2+1)(n^2+1)=(m+n)^2+(mn-1)^2$
Then....

5. That would make n a decial (10sqrt10)

6. Originally Posted by Soroban
Hello, Mukilab!

Note that: .$\displaystyle 500,050 \;=\;(50)(10,\!001) \;=\;(7^2+1)(100^2+1)$

$\displaystyle \text{Let }m = 7,\;n = 100 \text{ in the formula:}$

. . $\displaystyle (7^2 + 1)(100^2 + 1) \;=\;(7 + 100)^2 + (7\cdot100 - 1)^2 \;=\;107^2 + 699^2$

Thanks Soroban!

Sorry, only saw the first post at the start

Any tips for future questions such as this?? Take away the integers so I'm left with the algebraic numbers (as you did with 49 and 100)?

Thanks again

7. Originally Posted by Mukilab
That would make n a decial (10sqrt10)
Maybe you entered 50050 / 50 instead of 500050 / 50? m=7 gives n=100 as shown above.

8. Originally Posted by Mukilab
Thanks Soroban!

Sorry, only saw the first post at the start

Any tips for future questions such as this?? Take away the integers so I'm left with the algebraic numbers (as you did with 49 and 100)?

Thanks again
Another way to go about expressing integers as sums of two squares is knowing that: the set of integers expressible as the sum of two squares is closed under multiplication, and an odd prime is expressible as the sum of two squares if and only if it is congruent to 1 (mod 4). See here and here.


# Why is the log in the big-O of binary search not base 2?

I am new to understanding computer science algorithms. I understand the process of the binary search, but I am having a slight misunderstanding with its efficiency.

In a size of $s = 2^n$ elements, it would take, on average, $n$ steps to find a particular element. Taking the base 2 logarithm of both sides yields $\log_2(s) = n$. So wouldn't the average number of steps for the binary search algorithm be $\log_2(s)$?

This Wikipedia article on the binary search algorithm says that the average performance is $O(\log n)$. Why is this so? Why isn't this number $\log_2(n)$?

When you change the base of logarithm the resulting expression differs only by a constant factor which, by definition of Big-O notation, implies that both functions belong to the same class with respect to their asymptotic behavior.

For example $$\log_{10}n = \frac{\log_{2}n}{\log_{2}10} = C \log_{2}{n}$$ where $C = \frac{1}{\log_{2}10}$.

So $\log_{10}n$ and $\log_{2}n$ differs by a constant $C$, and hence both are true: $$\log_{10}n \text{ is } O(\log_{2}n)$$ $$\log_{2}n \text{ is } O(\log_{10}n)$$ In general $\log_{a}{n}$ is $O(\log_{b}{n})$ for positive integers $a$ and $b$ greater than 1.

Another interesting fact with logarithmic functions is that while for constant $k>1$, $n^k$ is NOT $O(n)$, but $\log{n^k}$ is $O(\log{n})$ since $\log{n^k} = k\log{n}$ which differs from $\log{n}$ by only constant factor $k$.

• Not only for positive integers: For all real $a,b > 1$, e.g. $e$. – nbubis Jul 20 '17 at 6:25
• I would add that this is the reason why with big-O notation, the base of the logarithm is commonly not specified. It also means there is no confusion about which base $O(\log n)$ uses: it can be any of the commonly used based, since it doesn't make a difference. – svick Jul 20 '17 at 10:57

In addition to fade2black's answer (which is completely correct), it's worth noting that the notation "$\log(n)$" is ambiguous. The base isn't actually specified, and the default base changes based on context. In pure mathematics, the base is almost always assumed to be $e$ (unless specified), while in certain engineering contexts it might be 10. In computer science, base 2 is so ubiquitous that $\log$ is frequently assumed to be base 2. That wikipedia article never says anything about the base.

But, as has already been shown, in this case it doesn't end up mattering.

• It is probably further worth noting then that while "log(n)" might be ambiguous that "O(log(n))" is not because the latter only has one meaning, no matter what base you might be thinking of. – Chris Jul 20 '17 at 16:12


# In how many ways can a bit string of length $20$ be generated if either all $0$'s or all $1$'s need to be grouped together?

Given a bit string of length $$20$$, how many ways can such a string be generated if either all 0's or all 1's need to be grouped together in the string?

A few examples of strings that would be considered legal are $$000 \ldots 0\qquad\text{or} \qquad 001110 \ldots 0 \qquad \text{or} \qquad 1100 \ldots 11 \qquad \text{or} \qquad1110000 \ldots 0$$

I've tried a couple different ideas, but I keep running into issues with duplicate strings.

One method I used would be to imagine that there are $$22$$ spaces and $$2$$ slashes that need to go somewhere within these spaces to separate the numbers. The slashes could go before the string starts, resulting in either all 1's or all 0's depending on which number starts. I'll list some examples of this below. $$//00000 \ldots 0 \qquad \text{or} \qquad //1111 \ldots 1 \qquad \text{or} \qquad 11 \ldots /000000/\ldots 1$$

With this method, we have $$2$$ cases that are the same, its just either picking if 1 or 0 leads. Because of that I'm calculating $$2\binom{22}{2}$$. But like I said, there are issues with this method. For example, when both slashes come before the string, the string that is generated would be the same as if the slashes came after the string.

I appreciate any ideas on where I should go from here or if I'm completely wrong and should just start over with some other method.

• you can separate the cases where you have only one block (either all 1's or all 0's), two blocks (setting a slash between two of the 20 positions) and three blocks (setting the left slash and then setting the right slash in regards to the position of the left one) – otto Jun 12 '19 at 22:44
• actually you use your way of putting two slashes in 22 possible positons. start by setting the left one, which is not allowed to have position 22 (to remove redundance). then set the right one with respect to the position of the left one – otto Jun 12 '19 at 23:11
• Welcome to MathSE. This tutorial explains how to typeset mathematics on this site. – N. F. Taussig Jun 13 '19 at 1:16

For each such string, join its ends to form a necklace. Each necklace has at most one region of 1s and at most one region of 0s, and is characterized by the number of 1s (0 through 20).

Apart from the all-0 and all-1 necklaces, each necklace (there are 19 remaining) can be cut in 20 places, yielding distinct valid strings. The constant necklaces yield the same string no matter where you cut. So, the total number of strings is:

$$1 + 1 + 19 \cdot 20 = 382$$

• This is now my favorite answer. – David K Jun 13 '19 at 2:29
• I agree with @DavidK. – N. F. Taussig Jun 13 '19 at 2:32

There are two ways to choose the first digit in the bit string.

Since all the $$0$$s or all the $$1$$s must be together, there are either $$0$$, $$1$$, or $$2$$ transitions between blocks of identical digits.

If there are no transitions, we do not need to place a divider. There is one way to do this.

If there is one transition, we must choose one of the $$19$$ places between successive digits in the $$20$$-digit bit string in which to place the divider between the blocks.

If there are two transitions, we must choose two of the $$19$$ places between successive digits in the $$20$$-digit bit string in which to place the dividers between the blocks.

Hence, there are $$\binom{2}{1}\left[\binom{19}{0} + \binom{19}{1} + \binom{19}{2}\right]$$ bit strings of length $$20$$ such that all the $$0$$s or all the $$1$$s are together in the bit string.

Using your idea of $$22$$ spaces, you not only have the ambiguity between $$//\square\cdots\square$$ and $$\square\cdots\square//$$ (where each $$\square$$ represents a space where you will put a digit), you also have to be concerned about how you distinguish $$\square//\square\cdots\square$$ from both $$//\square\cdots\square$$ and $$/\square/\square\cdots\square.$$ (If each $$/$$ denotes a change from $$0$$ to $$1$$ or vice versa then $$\square//\square$$ is the same pattern as $$//\square\square$$ but if either $$\square/\square$$ or $$\square//\square$$ denotes that the second $$\square$$ is different from the first $$\square$$ then $$\square//\square$$ and $$/\square/\square$$ are the same pattern.)

You can almost fix this by requiring that the two $$/$$s not be adjacent. Then the only ambiguity you have is between $$/\square\cdots\square/\square\cdots\square$$ and $$\square\cdots\square/\square\cdots\square/.$$ There are $$19$$ of each of those patterns, you want to keep one set and remove the other, so subtract $$19$$ from the number of ways to put $$2$$ non-adjacent objects in $$22$$ spaces, which is $$\binom{21}{2}$$; with two choices for the first digit this makes the number of bit strings $$2\left(\binom{21}{2} - 19\right).$$

Another almost-fix is to require that there be at least one digit after each $$/.$$ This gets rid of the $$\square\cdots\square/\square\cdots\square/$$ patterns so you don't have to subtract those, but it also gets rid of $$/\square\cdots\square/,$$ so you have to add $$1$$ to count that pattern. This gives the answer $$2\left(\binom{20}{2} + 1\right).$$

Notice that $$\binom{21}{2} = \binom{20}{2} + \binom{20}{1} = \binom{19}{2} + 2\binom{19}{1} + \binom{19}{0},$$ so both the results in this answer are equal to $$2\left(\binom{19}{2} + \binom{19}{1} + \binom{19}{0}\right) = 2\times 191,$$ which has also been shown correct in another answer. What you will not be able to do is to come up with a combinatorial argument producing a single binomial coefficient that gives the answer when multiplied by $$2$$, because $$191$$ is a prime number and the only binomial coefficients with that value are $$\binom{191}{1}$$ and $$\binom{191}{190}.$$


# Connexions

You are here: Home » Content » Presentation token element (mo)

### Lenses

What is a lens?

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

#### Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
• CNX Documentation

This module is included inLens: Connexions Documentation
By: ConnexionsAs a part of collection: "A primer in MathML "

"This is a great primer on MathML."

Click the "CNX Documentation" link to see all content affiliated with them.

Click the tag icon to display tags associated with this content.

### Recently Viewed

This feature requires Javascript to be enabled.

### Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.

# Presentation token element (mo)

Module by: Sunil Kumar Singh. E-mail the author

Summary: The mo operator element in MathML conveys the meaning of mathematical operation.

Specific attributes :  form fence separator lspace rspace stretchy symmetric Specific attributes :  maxsize minsize largeop movablelimits accent Specific attributes :  form fence separator lspace rspace stretchy symmetric Specific attributes :  maxsize minsize largeop movablelimits accent

The “mo” element displays an operator or other representations, which are treated as an operator in mathematics. The term "operator" also includes fence, separator, accent, comma, semicolon, invisible characters etc. , some of which are used to provide new meaning to the ordinary operator. Hence, “operator” in MathML has wider meaning beyond ordinary operators, consistent with the requirement of growing expanse of mathematical operations.

Many of the important operators contained within “mo” element can be typed directly. They are available on key board; while many others have to be referenced through valid Unicode entity references. The operator symbols, which can be typed from the keyboard include “+”, “-, ”/”, ”*”, ”(“, ”)”, ”{“, ”}”, ”[“, ”]”, “.NOT.”, ”.OR.” etc.

Following example shows the display of operators by "mo" element.

### Example 1: Displaying operators with “mo” element

<m:math display="block">
<m:mtable>
<m:mtr>
<m:mtd>
<m:mi>Plus : </m:mi><m:mo>+</m:mo>
<m:mi> ;</m:mi>
<m:mi>Increment : </m:mi><m:mo>++</m:mo>
<m:mi> ;</m:mi>
<m:mi>Logical not : </m:mi><m:mo>.NOT.</m:mo> <m:mi> ;</m:mi>
</m:mtd>
</m:mtr>
<m:mtr>
<m:mtd>
<m:mi>Less than and equal : </m:mi><m:mo> ≤ </m:mo>
<m:mi> ;</m:mi>
<m:mi>Partial operator : </m:mi><m:mo> ∂ </m:mo>
<m:mi> ;</m:mi>
<m:mi>Differentiation : </m:mi><m:mo> ⅆ </m:mo>
<m:mi> ;</m:mi>
<m:mi>Integration : </m:mi><m:mo> ∫ </m:mo>
</m:mtd>
</m:mtr>
</m:mtable>
</m:math>

Save the file after editing as “test.xml”. The display looks like :

Plus : + ; Increment : ++ ; Logical not : .NOT. ; Less than and equal : ; Partial operator : ; Differentiation : ; Integration : Plus : + ; Increment : ++ ; Logical not : .NOT. ; Less than and equal : ; Partial operator : ; Differentiation : ; Integration :

In the above example, we have used “mtable” (with “mtr” and “mtd” elements) element for controlling display. See that first three operators in above example have been typed directly from the keyboard; while others have been referenced by entity reference.

MathML design of rendering an operator closely follows mathematical convention. It distinguishes between rendering a character with “mi” element and an operator with “mo” operator in many important ways for notational representation of mathematical expression. Two basic considerations are (i) to manage space around the operator, consistent with the context in which they are displayed and (ii) dimensional change (stretching) of operators in accordance with the dimension of other elements and terms. Space around an operator is managed by “form” attribute, while stretching is managed by “stretchy” attribute of “mo” element. A plus operator ("+") may ,for example, precede or follow an identifier or may lie between two operands. Depending upon its placement, the space around the operator "+" is determined. Similarly, size of a parentheses around an expression must stretch to the height of the expression as in ( a b ) ( a b ) .

MathML also allows improvisation of an operator rendered by “mo” element. This generally makes use of other characters rendering elements such as “mi” or "mn" elements in addition to "mo" element and their combination with layout elements like “mfrac” and scripting elements (“msub”, “msup” etc.) Simply put, MathML treats an expression with a “mo” element at core and improvised by other elements - as an operator of class known as “embellished” operator.

Consider encoding for a differentiation operator  "ⅆ"  . This operator when applied to a variable, say t, is represented as t t In mathematics, however, t t is itself considered to be an operator. The whole block consisting of “mfrac” element is, thus, an embellished operator.

<m:mfrac>
<m:mo> ⅆ </m:mo>
<m:mrow>
<m:mo> ⅆ </m:mo>
<m:mi> x </m:mi>
</m:mrow>
</m:mfrac>

### Additional attribute : Default values

Default values to the attributes of “mo” element are set in accordance with the values contained in “operator dictionary”, which specifies “form”, “fence”, “stretchy”, “lspace” and “rspace” attributes for different operators. The renderer maintains an operator dictionary for most of the operators. W3C recommends a prototype of operator dictionary. These recommendations can be viewed at www.w3.org/TR/MathML2/appendixf.html . If the dictionary does not provide the value for the attribute, then attribute is set with default value as given here:

#### Default values

1. form : set by position/context
2. fence : false
3. separator : false
4. lspace : thickmathspace
5. rspace : thickmathspace
6. stretchy : false
7. symmetric : true
8. maxsize : infinity
9. minsize : 1
10. largeop : false
11. movablelimits : false
12. accent : false

### Managing space around operators

#### Attribute value types

• form : prefix | infix | postfix
• lspace : number h-unit | namedspace
• rspace : number h-unit | namedspace

The "form" attribute specifies whether an operator shall be rendered as "prefix" or "postfix" or "infix" operator. These form types determine space around the operator (left and right of it). Each form type is associated with two attributes ("lspace" and "rspace"), which implements its left space ("lspace") and right space ("rspace"). It is important to understand that form types are basically specification about space around operator and about its role with respect to other elements.

The default value of “form” attribute is set in accordance with three rules, involving "mrow" element. The token elements, including "mo" element, is composed within explicit or inferred "mrow" element. The position of an operator within the "mrow" in horizontal sequence determines the form type of the operator. If operator is the first element, then its form is inferred as "prefix"; if it is in the intermediate position, then its form is inferred as "infix”; and if it is in the end position, then its form is inferred as "postfix". Corresponding to each form, operator library specifies "lspace" and "rspace". It is, however, not necessary that each of the operator has all the three form types. The nature of operator determines the type of forms that a particular operator should be associated with. For example, "+" operator has entries for "prefix" and "infix", but not for "postfix" in the operator dictionary, because "postfix" form of "+" operator is not expected to be placed at the end of an expression.

Now, consider the example of "+" operator appearing twice in an expression in the manner as typed below :

+a + b

The first "+" sign in the above case assumes "prefix" form, while the second "+" sign assumes "infix" form. Once, the form of the operator is determined from the context within "mrow" element, spacing around the operator is determined as specified by "lspace" and "rspace" values given in the operator dictionary. The dictionary suggests following values for these forms of “+” operator :

"+"  form="infix"    lspace="mediummathspace" rspace="mediummathspace"
"+"  form="prefix"   lspace="0em" rspace="veryverythinmathspace"

Evidently, "infix" form separates its neighboring elements by "mediummathspace", whereas "prefix" form separates the following element with a very small space specified by "veryverythinmathspace".

Let us now code the example in MathML and see the output :

#### Example 2: Determining "form" of an operator

<m:math display="block">
<m:mrow>
<m:mo> + </m:mo>
<m:mi> a </m:mi>
<m:mo> + </m:mo>
<m:mi> b </m:mi>
</m:mrow>
</m:math>

Save the file after editing as “test.xml”. The display looks like :

+ a + b + a + b

As expected first “+” is almost attached to “a”, where as second instance of “+” renders some amount of space around itself. This type of detailing in rendering mathematical expression is vital and critical to maintain highest order of rendering consistencey, which is commensurate with the exact nature of mathematics and the meaning that a mathematical expression conveys. Note that the mark-up paradigm of MathML automatically forces codification in such a manner that no extra effort is required towards maintaining conventions of mathematical display - almost ruling out the possibilities that an expression is displayed in a non-conforming way.

A particular operator does not require to have entries for all the forms in the operator dictionary. Many of the operators in mathematics operate on other entities in forward direction. For example, integration, differentiation, partial differentiation etc. operates on identifiers following it. For this reason, such operators are inherently “prefix” in nature. On the other hand, operators classified as fences are either “prefix” or “postfix” commensurate with their role in mathematical expression. It is very unlikely that a closing bracket “]” is used in the beginning of an expression and as such it has “postfix” form. Dictionary entries for these operators are given here to understand : why there is very small space or no space between these operators and the identifiers on which they operate.

"ⅆ" form="prefix"  lspace="0em" rspace="verythinmathspace"
"∂"      form="prefix"  lspace="0em" rspace="verythinmathspace"
"∫"      form="prefix"  largeop="true" stretchy="true" lspace="0em"
"("   form="prefix"  fence="true" stretchy="true"  lspace="0em" rspace="0em"
")"   form="postfix" fence="true" stretchy="true"  lspace="0em" rspace="0em"
"["   form="prefix"  fence="true" stretchy="true"  lspace="0em" rspace="0em"
"]"   form="postfix" fence="true" stretchy="true"  lspace="0em" rspace="0em"
"{"   form="prefix"  fence="true" stretchy="true"  lspace="0em" rspace="0em"
"}"   form="postfix" fence="true" stretchy="true"  lspace="0em" rspace="0em"

We are at liberty to specify these attributes. It is, however, recommended that we leave the arrangement to the system, which is rendering the mathematical content. It shall ensure consistency in the display, which follows the convention of mathematics as implemented by a particular renderer. The example below demonstrates how we can change the spacing different to default and against the form values as inferred from the context :

#### Example 3: Determining "form" of an operator

<m:math display="block">
<m:mrow>
<m:mo form="infix" rspace="10pt"> + </m:mo>
<m:mi> a </m:mi>
<m:mo form="prefix"> + </m:mo>
<m:mi> b </m:mi>
</m:mrow>
</m:math>

Save the file after editing as “test.xml”. The display lokks like :

+ a + b + a + b

### Stretching of operators

Four attributes of “mo” element control stretching of operators. These attributes may assume following values :

#### Attribute value types

• stretchy : true | false
• symmetric : true | false
• maxsize : number [ v-unit | h-unit | namedspace | infinity
• minsize : number [ v-unit | h-unit | namedspace

Among the operators, the requirement for stretching of fences, arrows, accents (angular cap on identifier) and separators are most profound and visible in mathematical expressions. For this reason, “strechy” attribute of fence and accent operators are set “true” in operator dictionary. Stretching of operators in an expression is restricted by “minsize” and “maxsize” attributes.

The stretchable operators are characterized as predominantly either vertically or horizontally stretchable. The fences, various kinds of vertical arrows (single or double), operators like ∏, ∑, ∫, “/” etc. are set to stretch vertically by default in operator directory.

When stretchable operator and non-stretchable terms are bounded by explicit or inferred “mrow” element, then the stretchable operator grows vertically to cover the non-stretchy term. Consider the example given here :

#### Example 4: Vertical stretching

<m:math display="block">
<m:mrow>
<m:mi> x </m:mi>
<m:mo> = </m:mo>
<m:mo> ( </m:mo>
<m:mfrac>
<m:mi>a</m:mi>
<m:mi>b</m:mi>
</m:mfrac>
<m:mo> ) </m:mo>
</m:mrow>
</m:math>

Save the file after editing as “test.xml”. The display looks like :

x = ( a b ) x = ( a b )

We can, however, control the growth of parenthese by setting “maxsize” attribute to 1 i.e. equal to its normal size.

#### Example 5: Vertical stretching

<m:math display="block">
<m:mrow>
<m:mi> x </m:mi>
<m:mo> = </m:mo>
<m:mo maxsize="1"> ( </m:mo>
<m:mfrac>
<m:mi>a</m:mi>
<m:mi>b</m:mi>
</m:mfrac>
<m:mo maxsize="1"> ) </m:mo>
</m:mrow>
</m:math>

Save the file after editing as “test.xml”. The display looks like :

x = ( a b ) x = ( a b )

Thus, setting "maxsize" attribute overrides the default behavior, which allows the parentheses to strech and cover the non-stretchy expression. Let us, now experiment with other than fence character like ∑ and observe their behavior with other terms :

#### Example 6: Vertical stretching

<m:math display="block">
<m:mrow>
<m:mo> ∑ </m:mo>
<m:mo> ( </m:mo>
<m:mfrac>
<m:mi>A</m:mi>
<m:mi>B</m:mi>
</m:mfrac>
<m:mo> ) </m:mo>
</m:mrow>
</m:math>

Save the file after editing as “test.xml”. The display looks like :

( A B ) ( A B )

Control for stretching can be selective as well. For example, we can set stretchy=”false” on the opening parenthesis to restrict it to grow.

#### Example 7: Vertical stretching

<m:math display="block">
<m:mrow>
<m:mi> x </m:mi>
<m:mo> = </m:mo>
<m:mo stretchy="false"> ( </m:mo>
<m:mfrac>
<m:mi>a</m:mi>
<m:mi>b</m:mi>
</m:mfrac>
<m:mo> ) </m:mo>
</m:mrow>
</m:math>

Save the file after editing as “test.xml”. The display looks like :

x = ( a b ) x = ( a b )

In situation where, the expression bounded by “mrow” tags contains terms of different heights, the stretchable parentheses grow to cover the highest of the terms.

#### Example 8: Vertical stretching

<m:math display="block">
<m:mrow>
<m:mi> x </m:mi>
<m:mo> = </m:mo>
<m:mo> ( </m:mo>
<m:mfrac>
<m:mi>a</m:mi>
<m:mi>b</m:mi>
</m:mfrac>
<m:mo> + </m:mo>
<m:mfrac>
<m:mrow>
<m:mfrac>
<m:mi>c</m:mi>
<m:mi>d</m:mi>
</m:mfrac>
</m:mrow>
<m:mi>e</m:mi>
</m:mfrac>
<m:mo> ) </m:mo>
</m:mrow>
</m:math>

Save the file after editing as “test.xml”. The display lokks like :

x = ( a b + c d e ) x = ( a b + c d e )

The symmetric attribute is designed to stretch operator in both vertical and horizontal direction from the axis of the characters in equal magnitude. The symmetric attribute applies only to characters, which can stretch vertically; otherwise this attribute is ignored. Usually, this attribute is set “true” for vertically stretchable operator, but in certain cases involving matrix of unequal size, we may prefer to set it “false” as demonstrated in the example here :

#### Example 9: Vertical stretching

<m:math display="block">
<m:mrow>
<m:mi> x </m:mi>
<m:mo> = </m:mo>
<m:mo symmetric="false"> ( </m:mo>
<m:mtable align="bottom">
<m:mtr>
<m:mtd>
<m:mi>a</m:mi>
</m:mtd>
<m:mtd>
<m:mi>b</m:mi>
</m:mtd>
</m:mtr>
<m:mtr>
<m:mtd>
<m:mn>d</m:mn>
</m:mtd>
<m:mtd>
<m:mn>e</m:mn>
</m:mtd>
</m:mtr>
</m:mtable>
<m:mo symmetric="false"> ) </m:mo>
<m:mo symmetric="false"> ( </m:mo>
<m:mtable align="bottom">
<m:mtr>
<m:mtd>
<m:mi>a</m:mi>
</m:mtd>
<m:mtd>
<m:mi>b</m:mi>
</m:mtd>
</m:mtr>
<m:mtr>
<m:mtd>
<m:mn>d</m:mn>
</m:mtd>
<m:mtd>
<m:mn>e</m:mn>
</m:mtd>
</m:mtr>
<m:mtr>
<m:mtd>
<m:mn>d</m:mn>
</m:mtd>
<m:mtd>
<m:mn>e</m:mn>
</m:mtd>
</m:mtr>
</m:mtable>
<m:mo symmetric="false"> ) </m:mo>
</m:mrow>
</m:math>

Save the file after editing as “test.xml”. The display lokks like :

x = ( a b d e ) ( a b d e d e ) x = ( a b d e ) ( a b d e d e )

Matrix operation of unequal sizes uses notation which is aligned to base. This type of controlling stretching in specific direction is, therefore, extremely useful in such situations.

In case, the “mrow” domain contains non-stretchable terms of normal height and other stretchable terms, then all the terms, including the fence operator grows to the maximum normal height.

#### Example 10: Vertical stretching

<m:math display="block">
<m:mrow>
<m:mi> x </m:mi>
<m:mo> = </m:mo>
<m:mo> ( </m:mo>
<m:mo> ∫ </m:mo>
<m:mi> f</m:mi>
<m:mo> ( </m:mo>
<m:mi> x </m:mi>
<m:mo> ) </m:mo>
<m:mi> ⅆ </m:mi>
<m:mi> x </m:mi>
<m:mo> ) </m:mo>
</m:mrow>
</m:math>

Save the file after editing as “test.xml”. The display lokks like :

x = ( f ( x ) x ) x = ( f ( x ) x )

As against fence operator, the accent and horizontal arrows are stretchable in horizontal direction by default. The growth, in this case, is controlled by “munder”, “mover” and “munderover” elements, which contain the operator. The “munder”, “mover” and “munderover” elements, as the names suggest, allow drawing of an operator "under" or "over" or both about a character(s) or expresison. The scripting elements takes a base argument about which the operator is to be drawn and one (“munder” and “mover”) operator or two (“munderover”) operators for being placed about the base. We shall see that the operator grows horizontally to cover the other element.

#### Example 11: Horizontal stretching

<m:math display="block">
<m:mi> A </m:mi>
<m:munderover>
<m:mo> → </m:mo>
<m:mtext> 50 degree C </m:mtext>
<m:mtext> 200 psi </m:mtext>
</m:munderover>
<m:mi> B </m:mi>
</m:math>

Save the file after editing as “test.xml”. The display looks like :

A 50 degree C 200 psi B A 50 degree C 200 psi B

### Other attributes : largeop, movablelimits, accent, separator, fence

These attributes may assume following values :

#### Attribute value types

• fence : true | false
• separator : true | false
• largeop : true | false
• movablelimits : true | false
• accent : true | false

All these attributes accept boolean values “true” or “false”. The attribute “fence” is designed for non-visual rendering like audio rendering. As such, this attribute has no impact on the visual aspect of rendering. The role of “separator” attribute is also not significant and may be left to default value.

The “largeop” attribute determines the size of the operator. If it is true, then the operator is drawn larger than its normal size. For example, ∫ and ∏ operators are displayed as large operator as “largeop” attribute for these operators are set “true” by default. If we need to display the normal size, then their "largeop" attribute is set to "false".

#### Example 12: Large operator

<m:math display="block">
<m:mrow>
<m:mo> ∏ </m:mo>
<m:mo> , </m:mo>
<m:mo> ∫  </m:mo>
<m:mo> , </m:mo>
<m:mo largeop="false"> ∏ </m:mo>
<m:mo> , </m:mo>
<m:mo largeop="false"> ∫  </m:mo>
</m:mrow>
</m:math>

Save the file after editing as “test.xml”. The display looks like :

, , , , , ,

The movablelimits attribute allows underscripts and overscripts to be represented as subscript and superscript respectively. This rendering of under and over scripts as sub and super scripts is possible by seting this attribute to true. The implementation of this attribute by renderers is not yet consistent.

#### Example 13: The "movablelimits" attribute

<m:math display="block">
<m:munderover>
<m:mo movablelimits='true'> ∑ </m:mo>
<m:mi> a </m:mi>
<m:mi> b </m:mi>
</m:munderover>
<m:munderover>
<m:mo movablelimits='false'> ∑ </m:mo>
<m:mi> a </m:mi>
<m:mi> b </m:mi>
</m:munderover>
</m:math>

Save the file after editing as “test.xml”. The display looks like :

a b a b a b a b

The accent attribute determines whether an operator is treated as accent (diacritical mark) when used as an underscript or overscript.

## Content actions

PDF | EPUB (?)

### What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks


MAT 142 3.4 Basics of Probability Theory

# MAT 142 3.4 Basics of Probability Theory

398.3k points
1. A jar of M&Ms contains 12 brown candies, 4 yellow candies, 2 blue candies, 5 red candies, 3

green candies and 4 orange candies. You select one at random. Find the probability that you

select one that is:

a. Brown

b. Green or orange

c. Not red

d. Yellow or blue

e. Yellow and blue

1. Shoppers at a local department store were asked to complete a survey of their shopping

experience. The results are shown in the table below:

** Satisfied with Service          Not satisfied with Service** Totals

Made a purchase                  130                                          494 624

Did not make a purchase     715                                          183 898

Totals                                      845                                          677                                          1522

__

a. What is the probability that a shopper selected at random made a purchase?

b. What are the odds that a shopper selected at random was satisfied with the service?

MAT 142

393k points

#### Oh Snap! This Answer is Locked

Thumbnail of first page

Excerpt from file: Math Tutorial MAT 142 Problem set Unit: Probability Topic: Basics of Probability Theory Directions: Solve the following problems. Please show your work and explain your reasoning. 1. A jar of M&Ms contains 12 brown candies, 4 yellow candies, 2 blue candies, 5 red candies, 3 green candies and 4

Filename: M1084.pdf

Filesize: 369.5K

Print Length: 2 Pages/Slides

Words: 292

J
0 points

#### Oh Snap! This Answer is Locked

Thumbnail of first page

Excerpt from file: Week4DQ#3DiscOps&ExtraordinaryItems Whyisitimportanttoreportdiscontinuedoperationsorextraordinaryitemsseparately fromincomefromcontinuingoperations?Isthismethodofreportingallowed?What concernsdoesthistypeofreportingcreate?Doestheaverageinvestorunderstandthe

Filename: ACC 280week4dqs.zip

Filesize: < 2 MB

Print Length: 1 Pages/Slides

Words: NA

Surround your text in *italics* or **bold**, to write a math equation use, for example, $x^2+2x+1=0$ or $$\beta^2-1=0$$

Use LaTeX to type formulas and markdown to format text. See example.


find the sum to n term of $\frac{1}{1\cdot2\cdot3} + \frac{3}{2\cdot3\cdot4} + \frac{5}{3\cdot4\cdot5} + \frac{7}{4\cdot5\cdot6 } + …$

$$\frac{1}{1\cdot2\cdot3} + \frac{3}{2\cdot3\cdot4} + \frac{5}{3\cdot4\cdot5} + \frac{7}{4\cdot5\cdot6 } + ...$$

$$=\sum \limits_{k=1}^{n} \frac{2k-1}{k\cdot(k+1)\cdot(k+2)}$$ $$= \sum \limits_{k=1}^{n} - \frac{1}{2}\cdot k + \sum \limits_{k=1}^{n} \frac{3}{k+1} - \sum \limits_{k=1}^{n}\frac{5}{2\cdot(k+2)}$$

I do not know how to get a telescoping series from here to cancel terms.

• You can use $$\frac{2k-1}{k(k+1)(k+2)}=\frac{2k}{k(k+1)(k+2)}-\frac1{k(k+1)(k+2)}.$$ – Sungjin Kim Oct 26 '18 at 18:11
• You do mean an infinite sum, not a finite sum, right? – Connor Harris Oct 26 '18 at 18:15
• @ConnorHarris I think this means writing the partial sums explicitly. – Sungjin Kim Oct 26 '18 at 18:16
• @ConnorHarris, a sum that can be expressed in n. – LetzerWille Oct 26 '18 at 18:17
• Note that the $\frac{3}{k+1}$ term for some value of $k$ cancels the $\frac{-1}{2k}$ and $\frac{-5}{2(k+2)}$ terms for adjacent values of $k$. – Connor Harris Oct 26 '18 at 18:18

HINT:

Note that we have

\begin{align} \frac{2k-1}{k(k+1)(k+2)}&=\color{blue}{\frac{3}{k+1}}-\frac{5/2}{k+2}-\frac{1/2}{k}\\\\ &=\color{blue}{\frac12}\left(\color{blue}{\frac{1}{k+1}}-\frac1k\right)+\color{blue}{\frac52}\left(\color{blue}{\frac{1}{k+1}}-\frac{1}{k+2}\right) \end{align}

• There's a typo after the first $=$ sign, it should be $\frac{5/2}{k+2}$. Can't edit though, since edits must be 6 characters at minimum. – a_guest Oct 27 '18 at 12:50
• @a_guest Thank you. I've edited accordingly. – Mark Viola Oct 27 '18 at 16:29

Let the fractions be $$\frac{a}{k}$$, $$\frac{b}{k+1}$$, and $$\frac{c}{k+2}$$.

$$\frac{a}{k}+\frac{b}{k+1}+\frac{c}{k+2}=\frac{a(k+1)(k+2)+bk(k+2)+ck(k+1)}{k(k+1)(k+2)}=\frac{2k-1}{k(k+1)(k+2)}$$

We want the following

$$a+b+c=0$$

$$3a+2b+c=2$$

$$2a=-1$$

Solve, $$a=-\frac{1}{2}$$, $$b=3$$, and $$c=-\frac{5}{2}$$.

The rest is standard.

You are almost there. You can merge the parts of the series for which the denominator is similar and you will see they cancel each other. Then you are left with the terms for which the denominator is either smaller than $$3$$ or greater than $$n$$.

\begin{aligned} & \sum_{k=1}^n\frac{-1}{2k} + \sum_{k=1}^n\frac{3}{k+1} - \sum_{k=1}^n\frac{5}{2}\frac{1}{k+2} \\ & = \left[-\frac{1}{2} - \frac{1}{4} + \frac{1}{2}\sum_{k=3}^n\frac{-1}{k}\right] + \left[\frac{3}{2} + \frac{1}{2}\sum_{k=2}^n\frac{6}{k+1}\right] - \left[\frac{1}{2}\sum_{k=1}^n\frac{5}{k+2}\right] \\ & = \frac{3}{4} + \left[\frac{1}{2}\sum_{k=3}^n\frac{-1}{k}\right] + \left[\frac{1}{2}\sum_{k=3}^{n+1}\frac{6}{k}\right] - \left[\frac{1}{2}\sum_{k=3}^{n+2}\frac{5}{k}\right] \\ & = \frac{3}{4} + \left[\frac{1}{2}\sum_{k=3}^n\frac{-1}{k}\right] + \left[\frac{1}{2}\sum_{k=3}^{n}\frac{6}{k} + \frac{6}{2}\frac{1}{n+1}\right] - \left[\frac{1}{2}\sum_{k=3}^{n}\frac{5}{k} + \frac{5}{2}\frac{1}{n+1} + \frac{5}{2}\frac{1}{n+2}\right] \\ & = \frac{3}{4} + \frac{1}{2}\sum_{k=3}^{n}\left[\frac{-1 + 6 - 5}{k}\right] + \frac{6}{2}\frac{1}{n+1} - \frac{5}{2}\frac{1}{n+1} - \frac{5}{2}\frac{1}{n+2} \\ & = \frac{3}{4} + \frac{1}{2(n+1)} - \frac{5}{2(n+2)} \end{aligned}

When terms are in A.P in denominator, we use difference of last and first terms in product to distribute the terms of denominator over numerator, to change into telescoping series.


# Find $\sum_{n=1}^{\infty}\tan^{-1}\frac{2}{n^2}$

Find $$M:=\sum_{n=1}^{\infty}\tan^{-1}\frac{2}{n^2}$$

There's a solution here that uses complex numbers which I didn't understand and I was wondering if the following is also a correct method.

My proposed solution

\begin{align} &\sum_{n=1}^{\infty}\tan^{-1}\frac{2}{n^2}\\ =&\sum_{n=1}^{\infty}\tan^{-1}\frac{(1+n)+(1-n)}{1-(1+n)(1-n)}\\ =&\sum_{n=1}^{\infty}(\tan^{-1}(1+n)+\tan^{-1}(1-n))\\ =&\sum_{n=1}^{\infty}(\tan^{-1}(n+1)-\tan^{-1}(n-1)) \end{align}

And this implies $$M=\lim_{m\to\infty}(\tan^{-1}(m+1)+\tan^{-1}m-\tan^{-1}1-\tan^{-1}0)=\frac{3\pi}{4}$$

• This may or may not be of help: $\arctan(1/x) = \pi/2 - \arctan(x)$ – user150203 Dec 27 '18 at 5:23
• The 3rd and 4th lines of the equation after "My proposed solution" are missing a summation sign. Otherwise, the solution is correct. – JimmyK4542 Dec 27 '18 at 5:35
• @JimmyK4542 Edited, ty. – Akash Gaur Dec 27 '18 at 5:40
• – lab bhattacharjee Dec 27 '18 at 6:34

\begin{align} &\sum_{n=1}^{\infty}\tan^{-1}\frac{2}{n^2}\\ =&\sum_{n=1}^{\infty}\tan^{-1}\frac{(1+n)+(1-n)}{1-(1+n)(1-n)}\\ =\color{red}{\sum_{n=1}^\infty}&\tan^{-1}(1+n)+\tan^{-1}(1-n)\\ =\color{red}{\sum_{n=1}^\infty}&\tan^{-1}(n+1)-\tan^{-1}(n-1) \end{align}

Edit:$$\color{red}{\sum_{n=1}^\infty}$$ was missing in your question before edit. I am not going to delete this.

However your proof is now correct. $$M=\lim_{m\to\infty}(\tan^{-1}(m+1)+\tan^{-1}m-\tan^{-1}1-\tan^{-1}0)=\color{red}{\frac\pi2+\frac\pi2-\frac\pi4-0=\pi-\frac\pi4}=\frac{3\pi}{4}$$

Looks good to me. If I was going to offer a critique I would just say: when writing an argument it's always better to over communicate rather than under communicate.

The first equality is just algebra.

Your second equality requires a little bit to see clearly but it's true. Most will recall:

$$\tan(A+B)=\frac{\tan(A)+\tan(B)}{1-\tan(A)\tan(B)}$$ Or if you'd like: $$A+B= \tan^{-1} \bigg(\frac{\tan(A)+\tan(B)}{1-\tan(A)\tan(B)} \bigg)$$ Taking $$A=\tan^{-1}(1+n)$$ and $$B=\tan^{-1}(1-n)$$

Honestly adding this much explanation seems like almost overkill.

The 4th equality follows as result of $$\tan^{-1}$$ being an odd function.

Now the last part you are using a telescoping series technique so that you may ignore all the middle terms. That is,

\begin{align} &\sum_{n=1}^\infty\tan^{-1}(n+1)-\tan^{-1}(n-1) \\ &= \lim_{m\to \infty} \tan^{-1}(m+1)-tan^{-1}(m-1)+\dots +\tan^{-1}(4)-\tan^{-1}(2)+\tan^{-1}(3)-\tan^{-1}(1)+tan^{-1}(2)-\tan^{-1}(0) \end{align}

So after we consider what cancels and what doesn't we find that we only need to concern ourselves with $$\lim_{m\to \infty}\tan^{-1}(m+1)+\tan^{-1}(m-1)-\tan^{-1}(1)$$

So while that is true: I think it might merit a sentence or two just to make sure the audience is following.

• Isn't $M=\lim_{m\to \infty} \tan^{-1}(m)-\tan^{-1}(0)=\frac\pi2-0?$ – tatan Dec 27 '18 at 5:50
• @tatan. Yes. I am missing some terms. Let me edit. – Mason Dec 27 '18 at 5:51
• Thanks. I'm really slow at writing in latex so I skip steps. But I will add more explanation in English in the future. – Akash Gaur Dec 27 '18 at 5:57
• Yep. Can I ask you one thing? Are you from Maryland?(I saw from your profile) – tatan Dec 27 '18 at 19:57
• Yes. Uh oh. Stranger danger. :). No. I am not worried. I grew up in Ohio and move to the DC area post college. I went to Ohio University not Univ of Maryland. Though I did cite Dr. Yorke in my undergrad thesis and then I met him wandering once while wandering Univ of Maryland's halls... – Mason Dec 27 '18 at 19:57


# When 0.123...495051/0.515049...321

#### anemone

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

Recently I've come across a problem that jumped off the page at me (Find the first 3 figures after the decimal point in the decimal expression of the number $$\displaystyle \frac{0.12345678910\cdots495051}{0.515049\cdots987654321}$$).

I tried to approach it by making a table where I started to divide some smaller numbers but stick to the same pattern that is required by the aforementioned problem, i.e.

$$\displaystyle \frac{0.12}{0.21}=0.571...$$

$$\displaystyle \frac{0.123}{0.321}=0.383...$$

$$\displaystyle \frac{0.1234}{0.4321}=0.285...$$

$$\displaystyle \frac{0.12345}{0.54321}=0.227...$$

$$\displaystyle \frac{0.123456}{0.654321}=0.188...$$

$$\displaystyle \frac{0.1234567}{0.7654321}=0.161...$$

$$\displaystyle \frac{0.12345678}{0.87654321}=0.140...$$

$$\displaystyle \frac{0.123456789}{0.987654321}=0.124...$$

$$\displaystyle \frac{0.12345678910}{0.10987654321}=0.123...$$

$$\displaystyle \frac{0.1234567891011}{0.1110987654321}=0.111...$$

$$\displaystyle \frac{0.123456789101112}{0.121110987654321}=0.019...$$

$$\displaystyle \frac{0.12345678910111213}{0.13121110987654321}=0.940...$$

$$\displaystyle \frac{0.1234567891011121314}{0.1413121110987654321}=0.873...$$

$$\displaystyle \frac{0.123456789101112131415}{0.151413121110987654321}=0.815...$$

$$\displaystyle \frac{0.12345678910111213141516}{0.16151413121110987654321}=0.764...$$

$$\displaystyle \frac{0.1234567891011121314151617}{0.1716151413121110987654321}=0.719...$$

$$\displaystyle \frac{0.123456789101112131415161718}{0.181716151413121110987654321}=0.679...$$

$$\displaystyle \frac{0.12345678910111213141516171819}{0.19181716151413121110987654321}=0.643...$$

$$\displaystyle \frac{0.1234567891011121314151617181920}{0.2019181716151413121110987654321}=0.611...$$

and so on and so forth

but I failed to observe any pattern that's worth mentioning to help me to crack the problem.

Could anyone help me with this particular problem? Thanks in advance.

#### Opalg

##### MHB Oldtimer
Staff member
I also approached it by making a table, but I started by using the most significant figures in the given denominator:

$$\displaystyle \frac{0.1}{0.5} = 0.2$$,

$$\displaystyle \frac{0.12}{0.51} = 0.2352\ldots$$,

$$\displaystyle \frac{0.123}{0.515} = 0.2388\ldots$$,

$$\displaystyle \frac{0.1234}{0.5150} = 0.2396\ldots$$,

$$\displaystyle \frac{0.12345}{0.51504} = 0.2396\ldots$$,

$$\displaystyle \frac{0.123456}{0.515049} = 0.2396\ldots$$,

$$\displaystyle \frac{0.1234567}{0.5150494} = 0.2396\ldots$$,

$$\displaystyle \frac{0.12345678}{0.51504948} = 0.2396\ldots$$.

By this time, the fraction had stabilised (within the limits of my 8-digit calculator) to 0.2396987. I doubt whether further approximations would affect the first three digits after the decimal point.

Edit. You can confirm that by using a bit of calculus. If $f(x,y) = x/y$ then $\delta f \approx (1/y)\delta x - (x/y^2)\delta y$. With $x\approx 0.123$, $y\approx 0.515$ and $\delta x = \delta y = 10^{-n}$, you find that $\delta f < 2*10^{-n}$. So the change in the fraction after the eighth decimal places in numerator and denominator is never going to be sufficient to affect the first three decimal places in the quotient.

Last edited:

#### anemone

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

I'm very thankful to you for showing me something that I had never thought about before and your solution and the proof work so beautifully...

Thank you so much!


# How can LU factorization be used in non-square matrix?

In my textbook, there is some information about LU factorization of square matrix $A$, but not about non-square matrix.

How can LU factorization be used to factorize non-square matrix?

• Yes. Let $A$ be $m \times n$ matrix, then $L$ is $m \times m$ and $U$ is $m \times n$.
– user2468
Aug 26, 2012 at 4:17

I'll illustrate how to understand the LU-decomposition of a particular $3 \times 4$ matrix below. The method works just as well for other sizes since the LU-decomposition arises naturally from the study of Gaussian elimination via multiplication by elementary matrices.

$$\begin{array}{ll} A \ = &\left[ \begin{array}{cccc} 1 & 2 & -3 & 1\\ 2 & 4 & 0 & 7 \\ -1 & 3 & 2 & 0 \end{array} \right] \ \underrightarrow{r_2-2r_1 \rightarrow r_2} \ \left[ \begin{array}{cccc} 1 & 2 & -3 & 1\\ 0 & 0 & 6 & 5 \\ -1 & 3 & 2 & 0 \end{array} \right] \ \underrightarrow{r_3+r_1 \rightarrow r_3} \\ & \\ &\left[ \begin{array}{cccc} 1 & 2 & -3 & 1\\ 0 & 0 & 6 & 5 \\ 0 & 5 & -1 & 1 \end{array} \right] \ \underrightarrow{r_2 \leftrightarrow r_3} \ \left[ \begin{array}{cccc} 1 & 2 & -3 & 1\\ 0 & 5 & -1 & 1 \\ 0 & 0 & 6 & 5 \end{array} \right] = \ U \end{array}$$ We have $U = E_3E_2E_1A$ hence $A = E_1^{-1}E_2^{-1}E_3^{-1}U$ and we can calculate the product $E_1^{-1}E_2^{-1}E_3^{-1}$ as follows: $$\begin{array}{ll} I \ = &\left[ \begin{array}{ccc} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array} \right] \ \underrightarrow{r_2 \leftrightarrow r_3} \ \left[ \begin{array}{ccc} 1 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 1 & 0 \end{array} \right] \ \underrightarrow{r_3-r_1 \rightarrow r_3} \\ & \\ &\left[ \begin{array}{ccc} 1 & 0 & 0 \\ 0 & 0 & 1 \\ -1 & 1 & 0 \end{array} \right] \ \underrightarrow{r_2+2r_1 \rightarrow r_2} \ \left[ \begin{array}{ccc} 1 & 0 & 0 \\ 2 & 0 & 1 \\ -1 & 1 & 0 \end{array} \right] = PL \end{array}$$ I have inserted a "$P$" in front of the $L$ since the matrix above is not lower triangular. However, if we go one step further and let $r_2 \leftrightarrow r_3$ then we will obtain a lower triangular matrix: $$\begin{array}{ll} PL \ = &\left[ \begin{array}{ccc} 1 & 0 & 0 \\ 2 & 0 & 1 \\ -1 & 1 & 0 \end{array} \right] \ \underrightarrow{r_2 \leftrightarrow r_3} \ \left[ \begin{array}{ccc} 1 & 0 & 0 \\ -1 & 1 & 0 \\ 2 & 0 & 1 \\ \end{array} \right] =L \end{array}$$ Therefore, we find that $E_1^{-1}E_2^{-1}E_3^{-1}=PL$ where $L$ is as above and $P = E_{2 \leftrightarrow 3}$. This means that $A$ has a modified $LU$-decomposition. Some mathemticians call it a $PLU$-decomposition, $$A = \underbrace{\left[ \begin{array}{ccc} 1 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 1 & 0 \end{array} \right]}_{P} \underbrace{\left[ \begin{array}{ccc} 1 & 0 & 0 \\ -1 & 1 & 0 \\ 2 & 0 & 1 \\ \end{array} \right]}_{L}\underbrace{\left[ \begin{array}{cccc} 1 & 2 & -3 & 1\\ 0 & 5 & -1 & 1 \\ 0 & 0 & 6 & 5 \end{array} \right]}_{U} = \underbrace{\left[ \begin{array}{ccc} 1 & 0 & 0 \\ 2 & 0 & 1 \\ -1 & 1 & 0 \end{array} \right]}_{PL}\underbrace{\left[ \begin{array}{cccc} 1 & 2 & -3 & 1\\ 0 & 5 & -1 & 1 \\ 0 & 0 & 6 & 5 \end{array} \right]}_{U}.$$ Since permutation matrices all satisfy the condition $P^k=I$ (for some $k$) the existence of a $PLU$-decomposition for $A$ naturally suggests that $P^{k-1}A = LU$. Therefore, even when a $LU$ decomposition is not available we can just flip a few rows to find a $LU$-decomposable matrix. This is a useful observation because it means that the slick algorithms developed for $LU$-decompositions apply to all matrices with just a little extra fine print.

Much of the writing above can be spared if we adopt the notational scheme illustrated below. $$\begin{array}{ll} A \ = &\left[ \begin{array}{cccc} 1 & 2 & -3 & 1\\ 2 & 4 & 0 & 7 \\ -1 & 3 & 2 & 0 \end{array} \right] \ \underrightarrow{r_2-2r_1 \rightarrow r_2} \ \left[ \begin{array}{cccc} 1 & 2 & -3 & 1\\ (2) & 0 & 6 & 5 \\ -1 & 3 & 2 & 0 \end{array} \right] \ \underrightarrow{r_3+r_1 \rightarrow r_3} \\ & \\ &\left[ \begin{array}{cccc} 1 & 2 & -3 & 1\\ (2) & 0 & 6 & 5 \\ (-1) & 5 & -1 & 1 \end{array} \right] \ \underrightarrow{r_2 \leftrightarrow r_3} \ \left[ \begin{array}{cccc} 1 & 2 & -3 & 1\\ (-1) & 5 & -1 & 1 \\ (2) & 0 & 6 & 5 \end{array} \right] = \ U \end{array}$$ We find if we remove the parenthetical entries from $U$ and ajoing them to $I$ then it gives back the matrix $L$ we found previously: $$U = \left[ \begin{array}{cccc} 1 & 2 & -3 & 1\\ 0 & 5 & -1 & 1 \\ 0 & 0 & 6 & 5 \end{array} \right] \qquad L=\left[ \begin{array}{ccc} 1 & 0 & 0 \\ -1 & 1 & 0 \\ 2 & 0 & 1 \end{array} \right].$$

Hope this helps.

• "permutation matrices all satisfy the condition $P^2=I$" is incorrect.
– user147263
Jan 16, 2016 at 22:09
• @Normal for example ? Sorry, I can't see past swap then reverse swap does nothing... Jan 16, 2016 at 22:28
• A permutation can involve a $3$-cycle like $1\to 2\to 3$.
– user147263
Jan 16, 2016 at 22:45
• @Normal right, that makes sense... but, there still must be some power for which $P^k=I$. So, something similar to what I have currently written is possible. I wonder, is this possible for $3 \times 3$ matrix examples. Great comment, I wish I could upvote comments ( for internet pts naturally) Jan 17, 2016 at 1:39
• For all permutation matrices: $P \cdot P^{T} = I$ Feb 5, 2019 at 8:03


# Math Help - Two Discrete Problems

1. ## Two Discrete Problems

Hello,

I am needing some help on the two problems below. Thank you in advance.

1) Prove by contradiction that there do not exist integers m and n such that 14m + 21n = 101.

and

2) Using the fact that an integer n, either n >= 14 or n <= 15, or otherwise prove 7 does not divide 100.

2. Originally Posted by MathStudent1
Hello,

I am needing some help on the two problems below. Thank you in advance.

1) Prove by contradiction that there do not exist integers m and n such that 14m + 21n = 101.
.
gcd(14,21)=7
Thus,
7 divides 101 which is false.

3. Thank you ThePerfectHacker. I made a typo when I first made my post. Sorry about that. So, it should be 14m + 21n = 100 not 101.

I am beening taught to turn this into a if/then statement and go from there.

If m and n are integers, then 14m + 21n = 100
Factor out a 7 givng us 7(2n +3m) = 100

From here I have trouble. Also, should the if/then statement be not equal to 100 instead of equal to? I haven't had that much experience with proof by contradiction. Thank You.

4. Originally Posted by MathStudent1
Thank you ThePerfectHacker. I made a typo when I first made my post. Sorry about that. So, it should be 14m + 21n = 100 not 101.

I am beening taught to turn this into a if/then statement and go from there.

If m and n are integers, then 14m + 21n = 100
Factor out a 7 givng us 7(2n +3m) = 100

From here I have trouble. Also, should the if/then statement be not equal to 100 instead of equal to? I haven't had that much experience with proof by contradiction. Thank You.
Let,
p= (there exists n,m such that 14m+21n=100).

Now if "p" is true we shown that 7 divides 100.

Thus,
q=(7 divides 100).
But this is false.

Meaning, (modens ponens)
[(p--> q) and (~q)]--> ~p
Thus,
~p=(there do not exists n,m such that 14m+21n=100)

This is mine 46th Post!!!

5. Hello, MathStudent1!

Here;s the first one . . .

1) Prove by contradiction that there do not exist integers m and n
. . .such that: .14m + 21n .= .101

Assume that there are integers m and n such that: .14m + 21n .= .101

. . . . . . . . . . . . . . . . . . .100
Divide by 7: . 2m + 3n .= .----
. . . . . . . . . . . . . . . . . . . .7

In the left side: m is an integer, so 2m is an integer. *
. . . . . . . . . . . . n is an integer, so 3n is an integer. *
Hence, 2m + 3n (the sum of two integers) is an integer. *

But the right side is an irreducible fraction (or decimal 14.2857...)

We have reached a contradicition, hence our assumption was incorrect.

. . There are no integers m and n that satisfy 14m + 21n .= .101

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

*
Reasons: The set of integers is closed under multiplication and addition.

6. Thank you Soroban. One question for you. When orginally I posted my thread I made a typo in that 14m + 21n = 100 NOT 101. Does that change the proof at all or does the logic remain the same. Following your proof, am I correct by stating this below:

Prove that there do not exist integers m and n such that: 14m + 21n = 100

Restating the problem - If m and n are integers, then 14m + 21n = 100

Factor out a 7 and we get 7(2m + 3n) = 100
Divide both sides by 7 and we get 2m + 3n = (100/7)
Since m is an integer then 2*m is an integer and since n is an integer then 3*n is and integer.
However, the RHS (100/7) is not an integer and therefore,
2m + 3n (IS NOT EQUAL TO) (100/7)

Hence, we have reached a contradiction of our assumption that m and n are integers.

Therefore, there do not exist integers m and n such that 14m + 21n = 100.

*****Thank you!*****

7. Hello again, MathStudent1!

Yes, the modified proof is still valid . . .
. . and you did an excellent job!