Home Profile Projects Articles

Answer: Balance the Chemical Equation

Saturday, 16 of February , 2008 at 11:05 am

Question: Balance the chemical equation using Linear Algebra.

CO + CO_2 + H_2 ~~\rightarrow ~~ CH_4 + H_2O

Answer: In order to balance the chemical equations, we need to find the five unknowns (ab,c,d,e).

aCO + bCO_2 + cH_2 ~~\rightarrow ~~ dCH_4 + eH_2O

Since the number of chemical elements are conserved, we know that:

C: a+b=d
O: a+2b=e
H: 2c=4d + 2e

\therefore we need to solve the following linear system.

 \left( \begin{array}{ccccc}1 & 1 & 0 & -1 & 0 \\1 & 2& 0 & 0 & -1 \\0 & 0 & 2 & -4 & -2 \end{array} \right)\left( \begin{array}{c}a \\b\\c \\d \\e \end{array} \right) = \left( \begin{array}{c}0 \\0\\0 \end{array} \right)

This system of equations can easily be solved with Maple.

> with(Student[LinearAlgebra]):
> A := Matrix([[1, 1, 0, -1, 0, 0],
		[1, 2, 0, 0, -1, 0],
		[0, 0, 2, -4, -2, 0]]):
> ReducedRowEchelonForm(A)

According to maple, we can reduce the linear system to:

 \left( \begin{array}{ccccc}1 & 0 & 0 & -2 & 1 \\0 & 1& 0 & 1 & -1 \\0 & 0 & 1 & -2 & -1 \end{array} \right)\left( \begin{array}{c}a \\b\\c \\d \\e \end{array} \right) = \left( \begin{array}{c}0 \\0\\0 \end{array} \right)

According to the above equation, we don’t have a unique solution. However, we know that the linear system will have a solution \forall d,e \in \mathbb R where

a = 2d -e
b = -d +e
c = 2d+e

Since we know that a,b,c,d,e \in \mathbb N (where 0 \notin  \mathbb N), we can add additional constraints to our linear system. If we look at the above equations, it is easy to see that the following constraint must hold:

2d > e > d

Using the linear system and the above constraint, we find the following solutions…

CO + CO_2 + 7H_2 ~~\rightarrow ~~ 2CH_4 + 3H_2O
2CO + CO_2 + 10H_2 ~~\rightarrow ~~ 3CH_4 + 4H_2O
CO + 2CO_2 + 11H_2 ~~\rightarrow ~~ 3CH_4 + 5H_2O
3CO + CO_2 + 13H_2 ~~\rightarrow ~~ 4CH_4 + 5H_2O
2CO + 2CO_2 + 14H_2 ~~\rightarrow ~~ 4CH_4 + 6H_2O
CO + 3CO_2 + 15H_2 ~~\rightarrow ~~ 4CH_4 + 7H_2O
4CO + CO_2 + 16H_2 ~~\rightarrow ~~ 5CH_4 + 6H_2O

As you can see, there is still an infinite amount of solutions for this chemical equations. Some can be reduced, however majority of the equations can’t be reduced

Leave a comment

Category: Answers, Linear Algebra

Answer: Cubes of three Consecutive Integers

Saturday, 9 of February , 2008 at 7:05 pm

Question: Show that the sum of the cubes of any three consecutive integers is divisible by 9.

Answer: In order to solve this problem, I am going to define the questions a little more formally.

Prove that there \exists a k \in \mathbb Z where f(n) = 9k given

f(n) = (n)^3 + (n+1)^3 + (n+2)^3 and n \in \mathbb Z

I will be solving this problem using induction.

Base Case:
First we need show that the problem is true for the base case (n=0)

f(0) = 0^3 + (0 + 1)^3 + (0 + 2)^3 = 0 + 1 + 8 = 9

Therefore, there \exists a k \in \mathbb Z (which would be k = 1) where f(0) = 9k.

Induction Step (for positive values):
In order to prove that the problem holds for n \in \mathbb N, we need to show:

If f(n) = 9k ~~ \Longrightarrow ~~ \exists~a~j \in \mathbb Z where f(n+1) = 9j where n,k \in \mathbb Z

In order to prove this statement, we need to reduce f(n+1).

f(n+1) = (n+1)^3 + (n+2)^3 + (n+3)^3
= n^3 + (n+1)^3 + (n+2)^3 + (n+3)^3 - n^3
= f(n) + (n+3)^3 - n^3
= f(n) + (n+3)(n+3)(n+3) - n^3
= f(n) + (n^3 + 9n^2 +27n + 27) - n^3
= f(n) + 9(n^2 +3n + 3)
= 9k + 9(n^2 +3n + 3)
= 9(n^2 +3n + 3 + k)

Since (n^2 +3n + 3 + k) \in \mathbb Z, we have shown if f(n) = 9k it implies that \exists~a~j \in \mathbb Z where f(n+1) = 9j.

Induction Step (for negative values):
Since we already proved by induction that the problem holds for all natural numbers, all we need to do to extend this proof to all integers is to show that:

If f(n) = 9k ~~ \Longrightarrow ~~ \exists~a~j \in \mathbb Z where f(n-1) = 9j where n,k \in \mathbb Z

In order to prove this statement, we need to reduce f(n-1).

f(n-1) = (n-1)^3 + n^3 + (n+1)^3
= (n-1)^3 - (n+2)^3 + n^3 + (n+1)^3 + (n+2)^3
= f(n) + (n-1)^3 - (n+2)^3
= f(n) + (n^3 - 3n^2 + 3n - 1) + (n^3 + 6n^2 + 12n + 8)
= f(n) + (-9n^2 - 9n - 9)
= f(n) + 9(-n^2 - n - 1)
= 9k + 9(-n^2 - n - 1)
= 9(-n^2 - n - 1 + k)

Since (-n^2 - n - 1 + k) \in \mathbb Z, we have shown if f(n) = 9k it implies that \exists~a~j \in \mathbb Z where f(n-1) = 9j.

Therefore, we have proven by induction that the sum of the cubes of any three consecutive integers is divisible by 9.

Comments (2)

Category: Algebra, Answers

Answer: Voltage and Current of a Circuit

Saturday, 2 of February , 2008 at 12:45 pm

The circuit in this question is an example of a Wheatstone Bridge (for the most part). In order to make this circuit a real Wheatstone Bridge the center resistor has to be replaced with a galvanometer. This circuit was introduced to me in a lab for my first E&M course in university which we used to accurately measure the resistance of an unknown resistor.

Question: Calculate the current and voltage difference between points D and B in the following circuit.

Answer: The easiest way to solve this problem is to use Kirchhoff’s Laws. We will start off by using Kirchhoff’s first law which is defined as:

The current entering a junction must equal the current out of the junction.

\sum I_{in} = \sum I_{out}

In order to use this law, we first need to define the direction the current is traveling. It really doesn’t matter how you define the current direction. If you picked the wrong direction, the current will just be a negative value which means that it flows the opposite way. This is how I defined the current direction for the circuit.

If we apply Kirchhoff’s first law to junction B, we get the following:

I_{DB} + I_{AB} = I_{BC}

If we this law again on junction D, we get:

I_{AD} = I_{DB} + I_{DC}

Next, we will need to use Kirchhoff’s Second law which is defined as:

The potential differences across all elements around any closed circuit loop must be zero.

\displaystyle\sum_{Closed~Path} \Delta V = 0

If we apply Kirchhoff’s 2nd law and Ohm’s Law to the loop ADB, we get:

V_{AD} + V_{DB} - V_{AB} = 0
RI_{AD} + RI_{DB} - 3RI_{AB} = 0
I_{AD} + I_{DB} - 3I_{AB} = 0 because R = 1~Ohm

If we do the same thing to the loop DBC, we get:

V_{DB} + V_{BC} - V_{DC} = 0
RI_{DB} + RI_{BC} - 2RI_{DC} = 0
I_{DB} + I_{BC} - 2I_{DC} = 0 because R = 1~Ohm

Now, we will use these laws on the loop ADC, we get:

5 - V_{AD} - V_{DC} = 0
5 - RI_{AD} - 2RI_{DC} = 0
I_{AD} + 2I_{DC} = 5 because R = 1~Ohm

Therefore, we have the following system of linear equations.

I_{DB} + I_{AB} - I_{BC}= 0
I_{AD} - I_{DC} - I_{DB} = 0
I_{AD} + I_{DB} - 3I_{AB} = 0
I_{DB} + I_{BC} - 2I_{DC} = 0
I_{AD} + 2I_{DC} = 5

which we can put in matrix form.

 \left( \begin{array}{ccccc}0 & 1 & 1 & 0 & -1 \\1 & 0 & -1 & -1 & 0 \\1 & -3 & 1 & 0 & 0 \\0 & 0 & 1 & -2 & 1 \\1 & 0 & 0 & 2 & 0 \end{array} \right)\left( \begin{array}{c}I_{AD} \\I_{AB}\\I_{DB} \\I_{DC} \\I_{BC} \end{array} \right) = \left( \begin{array}{c}0 \\0\\0 \\0\\5\end{array} \right)

This system of equations can easily be solved with Maple.

> with(Student[LinearAlgebra]):
> A := Matrix([[0, 1, 1, 0, -1, 0],
		[1, 0, -1, -1, 0, 0],
		[1, -3, 1, 0, 0, 0],
		[0, 0, 1, -2, 1, 0],
		[1, 0, 0, 2, 0, 5]])
> ReducedRowEchelonForm(A)

Therefore, this means that the current going through the point D to B is \frac{25}{29}~Amps. If we use Ohm’s law, we can also determine the voltage difference between the points D and B to be \frac{25}{29}~Volts.

Leave a comment

Category: Answers, Electricity and Magnetism, Maple

Answer: Prove function has even values

Friday, 25 of January , 2008 at 9:48 pm

Question: Prove that the function n^2 -n has even values for all natural numbers (\mathbb{N} = \{0, 1, 2, 3 \ldots\}).

* Updated question for clarity.

Answer: Solving this problem is really trivial. The easiest way (by far) to solve this problem is to use Mathematical induction.

Wikipedia describes Mathematical Induction as:

The simplest and most common form of mathematical induction proves that a statement holds for all natural numbers n and consists of two steps:

  1. The basis: showing that the statement holds when n = 0.
  2. The inductive step: showing that if the statement holds for n = m, then the same statement also holds for n = m + 1.

This is exactly what we need to do to solve the problem. First, we need to prove that f(0) is even. This can easily be done:

f(0) = 0^2 - 0 = 0

Therefore, since 0 is an even number, we have satisfied the first step.

The second step is to show that if f(n) is even than f(n + 1) is also even.

f(n+1) = (n + 1)^2 - (n+1)
= (n^2 + 2n + 1) - (n+1)
= (n^2 -n) + 2n
= f(n) + 2n

If we assume f(n) is even, we know that f(n) + 2n has to be even because even + even = even.

Therefore, the function f(n) = n^2 -n is even for all n \ge 0 because:

  1. f(0) is even.
  2. If f(n) is even, it implies that f(n +1) is even.

Comments (8)

Category: Algebra, Answers

Answer: Binary operation Problem

Saturday, 19 of January , 2008 at 2:17 pm

Question: Assume that a binary operation \Box on a set X has a left unit and satisfies the identity x \Box (y \Box z) = (x \Box z) \Box y  \forall x,y,z \in X. Prove that \Box is associative and commutative.

Answer - Proving that \Box is commutative:
First, let x be equal to the left unit, x = u. Since the identity x \Box (y \Box z) = (x \Box z) \Box y is true \forall x \in X and since  u \in X because of the definition of a left unit, therefore u \Box (y \Box z) = (u \Box z) \Box y.

Since z \in X, which will mean z = u \Box z and therefore

u \Box (y \Box z) = (u \Box z) \Box y \Longrightarrow u \Box (y \Box z) = z \Box y

Because \Box is a binary operation, therefore \Box : X \times X \rightarrow X. This means that y \Box z \in X. Therefore, we know from the definition of a left unit that u \Box (y \Box z) = y \Box z.

This means:

u \Box (y \Box z) = z \Box y \Longrightarrow y \Box z = z \Box y

\therefore \Box is commutative.

Answer - Proving that \Box is associative:
Since the identity x \Box (y \Box z) = (x \Box z) \Box y is true \forall x,y,z \in X, we can rename the variables while maintaining the validity of the identity.

\therefore x \Box ( z \Box y ) = ( x \Box y) \Box z \forall x,y,z \in X

If we use the commutative law (which we just proved), we know that z \Box y = y \Box z.

\therefore x \Box ( z \Box y ) = ( x \Box y) \Box z \Longrightarrow x \Box ( y \Box z) = ( x \Box y) \Box z

This means \Box is associative.

Leave a comment

Category: Algebra, Answers