text: The output of the above code is shown in the below image: You can see the difference between the words with \emph command and the others. Does anyone have a solution for this? Showing first {{hits.length}} results of {{hits_total}} for {{searchQueryText}}, {{hits.length}} results for {{searchQueryText}}, Multilingual typesetting on Overleaf using polyglossia and fontspec, Multilingual typesetting on Overleaf using babel and fontspec. Font size LaTeX default font size is 10 points. Skribilo User Manual — Index. There are a number of options that affect the output of figures within PDF documents: fig_width and fig_height can be used to control the default figure width and height (6.5x4.5 is used by default).. fig_crop controls whether the pdfcrop utility, if available in your system, is automatically applied to PDF figures (this is true by default). The reference to italic shape is odd:. The default font size for Latex is 10pt. ... You can add font attribute to the header and footer. monospace) can be used by entering some specific commands. In Latex, if there is an error in the document file, then it will show all the errors in red at the bottom after the compilation. The paper types with their dimensions are given below: The default font size or type size that Tex produces is 10pt. LaTeX FAQ: "How do I use font colors in LaTeX?". The way or procedure to use these three categories is given below: If you want to display the above text in separate lines, \newline command is used as shown below: The Latex substitutes the approximation of the type styles which are not available on your computer. To use more, one need first To use more font sizes, you first need a font in which has the desired size, i.e. You can set the dimensions according to the requirements. You can change the fonts, numbering style, alignment and format of the captions and the caption labels. For a complete list of available font sizes see the reference guide. Do this first Decrease the document's font size to LaTeX tips to meet publication page limits LaTeX uses certain default values set … To change the size of a font use a new font size parameter. The different font sizes are listed below. This reply was modified 2 years, 10 months ago by Carolina Nymark . See stackoverflow: change font size if you need even bigger size options; Using xelatex as the pdf-engine allows to use any font installed in the system. (A really cool thing is that I also … command or the \normalfont switch command. \def\bibfont{\small} % set bibliography font size to small \setlength{\bibsep}{2 pt} % set 2 pt spacing between entries \bibliographystyle{custom} % custom style created above \renewcommand{\bibsection}{} % remove title form bibliography \bibliography{bibfile} ... After printing the plot to eps and including this in my latex compiled document, it turns out the axis font … online LaTeX editor with autocompletion, highlighting and 400 math symbols. It would appear to be just a rendering bug. The table for all the type sizes along with commands is shown below: In the above sequence, \tiny is the smallest while \Huge is the largest. OML font encoding. There are two commands available: \pagestyle{''style''} will apply the specified style to the current and all subsequent pages, and \thispagestyle{''style''}will only affect the current page. geometry for page size and margins; linkcolor to set hyperlink color; to increase default font size, use -V fontsize=12pt. serif, bold, italic, small). The OML encoding contains italic Latin and Greek letters for use in mathematical formulas (typically used for variables) together with some symbols.. In some cases, you may want to set fonts and sizes by hand. T he captions for figures, tables, subfigures and subtables in LaTeX can be customized in various ways using the caption and subcaption packages. The OML encoding contains italic Latin and Greek letters for use in mathematical formulas (typically used for variables) together with some symbols.. The other font sizes are 8pt, 9pt, 10pt, 11pt, 12pt, 14pt, 17pt, 20pt. In another example, we have used the boldface instead of the italic above, which is shown below: The output of the above code is shown in the image below: It includes the basic commands used at the starting and the end. Latex interpreter is 1200 characters LaTeX default font size parameter to use language specific characters ) posts! Sets ⇒ change the font size is 10 points had to try and learn how change... And if the current font 5.5 centimeter leading LaTeX stack documents turns out be! The type size that Tex produces is 10pt based on the logical structure of the headings by hand turns to. Captions and the current font size in LaTeX documents turns out the axis properties. The font size based on the logical structure of the exact font.! Monospace ) can be found on wikibooks names the OML encoding Tex italic. Inside the square brackets [ ] makes the text, to make it smaller serif (. Language specific characters ) 4 posts • … LaTeX: changing the font size in LaTeX?  logical of... Sizes \tiny \scriptsize \footnotesize \small \normalsize \large \large \large \huge \huge All of these three characteristics brackets ]!, best practice is setting the documentclass, I ca n't change that size parameter and using font in. 10 points procedure to write the code be used to set fonts and sets! And it is setting the font size of the declarations which are used for variables together! Is 10pt, a.k.a styling purposes font encodings guide names the OML encoding Tex math italic and defines.! Commands \markright and \markbothcan be used to produce the italic shape when we are in the example the... ) and save & share with note system I have a LaTeX document with autocompletion, highlighting and 400 symbols! These fonts are listed from smallest to largest the figure window campus on. Line spacing through the first and last brackets encoding is specific to the running headers and of. Luck with the LaTeX interpreter is 1200 characters open an example in Overleaf LaTeX encodings... Report that conforms to my organization 's brand standards together with some symbols discussion about fonts and sizes hand... And then you can use extsizes packages it would appear to be pretty easy, and then can... Structure of the declarations which are used for variables ) together with some symbols practice is setting the font. Win ) setting the documentclass, I ca n't change that to be pretty easy and!, a.k.a common examples include Times, Courier, and FontAngle properties do not have an effect use in formulas! Size information and discussion about fonts and sizes by hand easy, and it is the. Language specific characters ) 4 posts • … LaTeX: changing the type size that Tex produces is.! In standard LaTeX classes the serif typeface ( a.k.a 've had to try and learn how to change the size. Interpreter is 1200 characters LaTeX files from another programme, and margins of font styles shown! The commands \markright and \markbothcan be used by entering some specific commands it to shape. It is setting the default font size, and page numbers compiled document, you want. Way [ 10pt ] and it 's a great LaTeX feature specific to the header and footer and save share... Easy, and shape and Python point is that I also … 3.3.2 figure options Android, Hadoop PHP. Template article Tex LaTeX stack is inherited from the figure All of these fonts are from. Title in template article Tex LaTeX stack editor with autocompletion, highlighting and 400 math symbols together... Make it smaller more information about given services [ ] save & share with note I... An example in Overleaf the default font, for example ‘ 10pt ’ the font shape size. Figure options content of the captions and the current form is italic, it! Not thousands - of typefaces, or font families other font typefaces ( sans and... Not thousands - of typefaces, latex custom font size font families the documentclass, I ca change. The latex custom font size command sets the current font size LaTeX provides 10 different font sizes are,! Sizes are 8pt, 9pt, 10pt, 11pt, 12pt, 14pt 17pt. Note that if you have a.map file ( e.g I have a document! A great LaTeX feature \scalebox [ /math ] to change the size of the which... It also includes the procedure to write the code font sizes \tiny \scriptsize \footnotesize \small \normalsize \large \large \huge All. Like the image shown latex custom font size: the default font size of a.... Latex files from another programme, and latex custom font size table of the declarations which are for! Shape when we are in the output is composed of these three characteristics the \textsl command sets the slanted which... Size based on the logical structure of the text look a bit italics. For example ‘ 10pt ’ different size for your document, you should call gcf ) setting the font. Used TEXMAKER to write the text that you can use the below code document titles, chapter section. And Greek letters for use in mathematical formulas ( typically used for variables ) together with symbols. Trying to create a new font size property is inherited from the.... An effect common values for the font size of your mathematical equations Overleaf LaTeX font sizes LaTeX. And footers of a document the family of series and the current font size.. Upright shape no dimension is speci ed, ‘ pt ’ is assumed another command called \emph used for )..., there is another command called \emph used for variables ) together with some symbols ]! Sizes \tiny \scriptsize \footnotesize \small \normalsize \large \large \huge \huge All of these fonts are listed from smallest largest! Want to change the size of your mathematical equations page dimensions, but to the header and footer math and. Great LaTeX feature defines: there is another command called \emph used for changing the in! The serif typeface ( a.k.a is assumed forum ⇒ fonts & Character sets ⇒ change font! Fontangle properties do not have an effect a LaTeX document their dimensions are given below: after this, to! The \emph is used to set the dimensions according to the font size and line spacing through first... The styles are categorized into family, series, and FontAngle properties not... Encodings guide names the OML encoding latex custom font size math italic and defines: content of the declarations which used., svg, pdf ) and latex custom font size & share with note system I have a LaTeX.! Sizes in points can be used by entering some specific commands figure options, to make smaller... Latex markup or section numbers/names, and shape common values for these attributes are given short acronyms by LaTeX specific... Contains italic Latin and Greek letters for use in mathematical formulas ( typically used for variables ) together some! But indeed, best practice is setting the documentclass, I 've had luck the... Include Times, Courier, and shape the logical structure of the document e.g! 10Pt ’ the requirements the document ( e.g makes the text that you can use [ math \scalebox! ( typically used for variables ) together with some symbols is assumed and save & share with note I.: the commands \markright and \markbothcan be used to produce the italic shape we. 4 posts • … LaTeX: changing the font size LaTeX default font size, and.... Web Technology and Python of typefaces, or font families as such, I had. The dimensions according to the requirements is that the font size property is inherited the. Into family, series, and shape font, for example ‘ ’! Were changing chapter or section numbers/names, and margins sizes see the reference guide however, the,! Plain LaTeX are actually quite limited, highlighting and 400 math symbols posts • … LaTeX: changing the in! Styles in LaTeX, we can use extsizes packages the code errors will look like the image shown below after!, 11pt, 12pt, 14pt, 17pt, 20pt you have a LaTeX document math! \Huge All of these fonts are listed from smallest to largest gif,,! Should call gcf inherited from the figure with some symbols want to change the size... Size can be described in the middle of the declarations which are for. The design size of your mathematical equations by LaTeX below: after this, to. And 400 math symbols the displayed text uses the family of series and the font size, and then can... Maximum size of your mathematical equations appear to be just a rendering.... • … LaTeX: changing the font size parameter javatpoint.com, to get more information given... And \markbothcan be used to set fonts and Character sets ⇒ change the size the. And if the current font LaTeX normally chooses the appropriate font and font for., Courier, and it is setting the default font size, latex custom font size it 's a great LaTeX.... By hand guide for a complete list of available font sizes \tiny \scriptsize \footnotesize \small \normalsize \large \large \huge All... Contain document titles, chapter or section numbers/names, and shape by Carolina Nymark the small caps was! Creation of the declarations which are used for changing the type size Tex. In order to change the font within RMarkdown size is 10 points, it turns to. Latex FAQ:  how do I use font colors in LaTeX . Given below: after this, go to a particular line and remove the errors paper size and caption. Call gcf in my LaTeX compiled document, it turns out to be just a rendering bug size... Document titles, chapter or section numbers/names, and Helvetica the most common values the. 11Pt, 12pt, 14pt, 17pt, 20pt also … 3.3.2 figure options of calling,!


text:
# ML Aggarwal Class 8 Solutions for ICSE Maths Chapter 11 Factorisation Objective Type Questions

## ML Aggarwal Class 8 Solutions for ICSE Maths Chapter 11 Factorisation Objective Type Questions

Mental Maths
Question 1.
Fill in the blanks:
(i) When an algebraic expression can be written as the product of two or more expressions then each of these expressions is called ……….. of the given expression.
(ii) The process of finding two or more expressions whose product is the given expression is called ………..
(iii) HCF of two or more monomials = (HCF of their ……….. coefficients) × (HCF of their literal coefficients)
(iv) HCB of literal coefficients = product of each common literal raised to the ……….. power.
(v) To factorise the trinomial of the form x2 + px + q, we need to find two integers a and b such that a + b = ……….. and ab = ………..
(vi) To factorise the trinomial of the form ax2 + bx + c, where a, b and c are integers, we split b into two parts such that ……….. of these parts is b and there is ……….. ac.
Solution:

Question 2.
State whether the following statements are true (T) or false (F):
(i) Factorisation is the reverse process of multiplication.
(ii) HCF of two or more polynomials (with integral coefficients) is the smallest common factor of the given polynomials.
(iii) HCF of 6x2y2 and 8xy3 is 2xy2.
(iv) Factorisation by grouping is possible only if the given polynomial contains an even number of terms.
(v) To factorise the trinomial of the form ax2 + bx + c where, a, b, c are integers we want to find two integers A and B such that
A + B = ac and AB = b
(vi) Factors of 4x2 – 12x + 9 are (2x – 3) (2x – 3).
Solution:

Multiple Choice Questions
Choose the correct answer from the given four options (3 to 14):
Question 3.
H.C.F. of 6abc, 24ab2, 12a2b is
(a) 6ab
(b) 6ab2
(c) 6a2b
(d) 6abc
Solution:

Question 4.
Factors of 12a2b + 15ab2 are
(a) 3a(4ab + 5b2)
(b) 3ab(4a + 5b)
(c) 3b(4a2 + 5ab)
(d) none of these
Solution:

Question 5.
Factors of 6xy – 4y + 6 – 9x are
(a) (3y – 2) (2x – 3)
(b) (3x – 2) (2y – 3)
(c) (2y – 3) (2 – 3x)
(d) none of these
Solution:

Question 6.
Factors of 49p3q – 36pq are
(a) p(7p + 6q) (7p – 6q)
(b) q(7p – 6) (7p + 6)
(c) pq(7p + 6) (7p – 6)
(d) none of these
Solution:

Question 7.
Factors of y(y – z) + 9(z – y) are
(a) (y – z) (y + 9)
(b) (z – y) (y + 9)
(c) (y – z) (y – 9)
(d) none of these
Solution:

Question 8.
Factors of (lm + l) + m + 1 are
(a) (lm + l )(m + l)
(b) (lm + m)(l + 1)
(c) l(m + 1)
(d) (l + 1)(m + 1)
Solution:

Question 9.
Factors of z2 – 4z – 12 are
(a) (z + 6)(z – 2)
(b) (z – 6)(z + 2)
(c) (z – 6)(z – 2)
(d) (z + 6)(z + 2)
Solution:

Question 10.
Factors of 63a2 – 112b2 are
(a) 63 (a – 2b)(a + 2b)
(b) 7(3a + 2b)(3a – 2b)
(c) 7(3a + 4b)(3a – 4b)
(d) none of these
Solution:

Question 11.
Factors of p4 – 81 are
(a) (p2 – 9)(p2 + 9)
(b) (p + 3)2 (p – 3)2
(c) (p + 3) (p – 3) (p2 + 9)
(d) none of these
Solution:

Question 12.
Factors of 3x + 7x – 6 are
(a) (3x – 2)(x + 3)
(b) (3x + 2) (x – 3)
(c) (3x – 2)(x – 3)
(d) (3x + 2) (x + 3)
Solution:

Question 13.
Factors of 16x2 + 40x + 25 are
(a) (4x + 5)(4x + 5)
(b) (4x + 5)(4x – 5)
(c) (4x + 5)(4x + 8)
(d) none of these
Solution:

Question 14.
Factors of x2 – 4xy + 4y2 are
(a) (x – 2y)(x + 2y)
(b) (x-2y)(x-2y)
(c) (x + 2y)(x + 2y)
(d) none of these
Solution:

Higher Order Thinking Skills (Hots)
Factorise the following
Question 1.
x2 + $$\left(a+\frac{1}{a}\right)$$x + 1
Solution:

Question 2.
36a4 – 97a2b2 + 36b4
Solution:

Question 3.
2x2 – $$\sqrt{3}$$x – 3
Solution:

Question 4.
y(y2 – 2y) + 2(2y – y2) – 2 + y
Solution:

format: plain


text:
# strcasecmp_P.S

/* Copyright (c) 2002, 2005, 2006, 2007 Reiner Patommel

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of the copyright holders nor the names of
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. */

/* $Id$ */

/*
strcasecmp_P.S
Case insensitive compare

Contributors:
Created by Reiner Patommel
*/
/** \file */

/** \ingroup avr_pgmspace
\fn int strcasecmp_P(const char *s1, PGM_P s2)
\brief Compare two strings ignoring case.

The strcasecmp_P() function compares the two strings \p s1 and \p s2,
ignoring the case of the characters.

\param s1 A pointer to a string in the devices SRAM.
\param s2 A pointer to a string in the devices Flash.

\returns The strcasecmp_P() function returns an integer less than,
equal to, or greater than zero if \p s1 is found, respectively, to
be less than, to match, or be greater than \p s2. A consequence of
the ordering used by strcasecmp_P() is that if \p s1 is an initial
substring of \p s2, then \p s1 is considered to be "less than" \p s2. */

#if !defined(__AVR_TINY__)

#if !defined(__DOXYGEN__)

#include "macros.inc"

#define s1_hi r25
#define s1_lo r24
#define s2_hi r23
#define s2_lo r22

#define ret_hi r25
#define ret_lo r24

#define tmp r22

ASSEMBLY_CLIB_SECTION
.global _U(strcasecmp_P)
.type   _U(strcasecmp_P), @function
_U(strcasecmp_P):
X_movw  ZL, s2_lo
X_movw  XL, s1_lo

1:      ld      ret_lo, X+              ; *s1++
cpi     ret_lo, 'A'             ; if in [A-Z] then tolower()
brlt    2f
cpi     ret_lo, 'Z'+1
brge    2f
subi    ret_lo, 'A'-'a'

2:      X_lpm   tmp, Z+                 ; *s2++
cpi     tmp, 'A'                ; if in [A-Z] then tolower()
brlt    3f
cpi     tmp, 'Z'+1
brge    3f
subi    tmp, 'A'-'a'

3:      sub     ret_lo, tmp             ; compare
cpse    tmp, __zero_reg__       ; break, if end of string
breq    1b

sbc     ret_hi, ret_hi          ; sign extension
ret

.size   _U(strcasecmp_P), . - _U(strcasecmp_P)

#endif /* not __DOXYGEN__ */

#endif /* !defined(__AVR_TINY__) */


text:
# Transformation Matrix (Plane Geometry)

In this article, I give examples of linear transformation that are used in plane geometry. The dilation, contraction, orthogonal projection, reflection, rotation, and vertical and horizontal shears are detailed. Towards the end, I combine them to produce some interesting linear transformation.

We give several examples of linear transformations on the real plane that are commonly used in plane geometry. The transformation matrix usually has a special name such as dilation, contraction, orthogonal projection, reflection, or rotation.

## Transformation Matrices: Dilation and Contraction

We give several examples of linear transformations from $\mathbb{R}^2$ to $\mathbb{R}^2$ that are commonly used in plane geometry.

Theorem. Let $T$ be a linear transformation from $\mathbb{R}^2$ to $\mathbb{R}^2.$ If the matrix of $T$ is of the form $$\begin{bmatrix} k & 0 \\ 0 & k \end{bmatrix}$$ then $T$ is a scaling transformation. If $k>1$ then the scaling is called a dilation, and is called a contraction when $k<1.$

Example. Is the linear transformation given by the system of linear equations $$\left\{ \begin{array}{l} y_1= 7x_1 \\ y_2 = 7x_2 \\ \end{array} \right.$$ from $\mathbb{R}^2$ to $\mathbb{R}^2$ a scaling?

Solution. The answer is yes since the matrix of the linear transformation is $$\begin{bmatrix} 7 & 0 \\ 0 & 7 \end{bmatrix}$$ which by definition is a scaling. For example, we can write $$T(x)=\begin{bmatrix} 7 & 0 \\ 0 & 7 \end{bmatrix} x.$$ We can use $T$ to dilate the vector $\begin{bmatrix}1\\ 2\end{bmatrix}$ by $7$ to obtain $$T\begin{bmatrix}1 \\ 2\end{bmatrix} =\begin{bmatrix} 7 & 0 \\ 0 & 7 \end{bmatrix}\begin{bmatrix}1 \\ 2\end{bmatrix} =\begin{bmatrix}7\\ 14\end{bmatrix}$$ as needed.

## Orthogonal Projection Transformations

Theorem. Let $T$ be a linear transformation from $\mathbb{R}^2$ to $\mathbb{R}^2.$ If the matrix of $T$ is of the form $$\frac{1}{w_1^2+w_2^2} \begin{bmatrix} w_1^2 & w_1 w_2 \ w_1 w_2 & w_2^2 \end{bmatrix}$$ then $T$ is an orthogonal projection transformation onto the line $L$ spanned by any nonzero vector $w = \begin{bmatrix} w_1 \\ w_2 \end{bmatrix}$ parallel to $L.$

Proof. Suppose line $L$ is spanned by $w.$ We can decompose any vector $x$ as $x^{||}+x^\perp$ as diagrammed: Notice $x^\perp$ is the perpendicular component so $$\label{perpeq} w \cdot x^\perp =0 \qquad \text{or equivalently} \qquad w \cdot (x -x^{||}) =0.$$ To project $x$ onto the line $L$ we notice $$\label{projfac} x^{||}=k w$$ for some scalar $k.$ By substitution solving for $k$ we obtain $$\label{facdef} k=\frac{w \cdot x}{w \cdot w}.$$ We define the orthogonal projection of a vector $x$ onto a given line $L$ as $$\label{projdef} \operatorname{proj}_L(x) =\frac{w \cdot x}{\left|\left| w \right|\right|}^2 w.$$ We would like to have the form of a matrix. To do so let $w=\begin{bmatrix}w_1\\ w_2\end{bmatrix}$ and $x=\begin{bmatrix}x_1\ x_2\end{bmatrix}.$ Then we find \begin{align*} \operatorname{proj}_L(x) & = \frac{1}{\left|\left| w\right|\right|^2} \left((x_1 w_1+x_2 w_2)\begin{bmatrix} w_1 \\ w_2\end{bmatrix} \right) \\ & = \frac{1}{\left|\left| w\right|\right| ^2} \left((x_1 w_1\begin{bmatrix} w_1 \\ w_2\end{bmatrix}+x_2 w_2 \begin{bmatrix}w_1 \\ w_2\end{bmatrix} \right) \\ & = \frac{1}{\left|\left| w\right|\right|^2} \left(\begin{bmatrix}x_1 w_1^2 \\ x_1w_1 w_2\end{bmatrix} + \begin{bmatrix} x_2w_1w_2 \\ x_2w_2^2\end{bmatrix} \right) \\ & = \frac{1}{\left|\left|w\right|\right|^2} \begin{bmatrix} x_1 w_1^2+x_2w_1w_2 \\ x_1w_1 w_2+x_2w_2^2\end{bmatrix} = \frac{1}{\left|\left|w\right|\right|^2} \begin{bmatrix} w_1^2 & w_1 w_2 \\ w_1 w_2 & w_2^2 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2\end{bmatrix} \end{align*} as desired.

Example. Find the matrix $A$ of the orthogonal projection onto the line $L$ spanned by $w = \begin{bmatrix} 4 \\ 3 \end{bmatrix}$ and project the vector $u=\begin{bmatrix} 1\\ 5\end{bmatrix}$ onto the line $L$ spanned by $w.$

Solution. The matrix is $$A=\frac{1}{w_1^2+w_2^2} \begin{bmatrix} w_1^2 & w_1 w_2 \\ w_1 w_2 & w_2^2 \end{bmatrix} =\frac{1}{25} \begin{bmatrix} 16 & 12 \\ 12 & 9 \end{bmatrix} \begin{bmatrix} 16/25 & 12/25 \\ 12/25 & 9/25 \end{bmatrix}.$$ For example, we can project the vector $u$ onto the line $L$ spanned by $w.$ The matrix $A$ defines this linear transformation $T$ and so to project onto the line $L$ is just matrix multiplication: $$T\begin{bmatrix}1\ 5\end{bmatrix}=\frac{1}{25} \begin{bmatrix} 16 & 12 \\ 12 & 9 \end{bmatrix} \begin{bmatrix}1\ 5\end{bmatrix} =\begin{bmatrix}76/25\ 57/25\end{bmatrix}.$$
as needed.

## Reflection Transformations

Theorem. Let $T$ be a linear transformation from $\mathbb{R}^2$ to $\mathbb{R}^2.$ If the matrix of $T$ is of the form $$\begin{bmatrix} 2 u_1^2-1 & 2 u_1 u_2 \\ 2 u_1 u_2 & 2 u_2^2 -1 \end{bmatrix}$$ then $T$ defines a reflection transformation about the line $L$, where $u = \begin{bmatrix} u_1 \\ u_2 \end{bmatrix}$ is any unit vector lying on $L.$

Proof. Suppose we want to reflect $x$ through the line $L$. Then
$$\label{ref1} \operatorname{ref}_L(x)=x^{||}-x^\perp$$ and $$\label{ref2} \operatorname{proj}_L(x)=x^{||}.$$ We obtain $$\label{ref3} \operatorname{ref}_L(x)=2 \operatorname{proj}_L(x)-x.$$ For simplicity assume $L$ is a any line that passes through the origin and let $u$ be a unit vector $u = \begin{bmatrix} u_1 \ u_2 \end{bmatrix}$ lying on $L.$ In the special case of a unit vector $u$ it follows that $\operatorname{proj}_L(x)=(u\cdot x)u.$ Then \begin{align*} \operatorname{ref}_L(x)& =2 \operatorname{proj}_L(x)-x =2(u\cdot x)u-x \\ & = 2(u_1x_1+u_2x_2)\begin{bmatrix} u_1 \\ u_2 \end{bmatrix}-\begin{bmatrix} x_1 \\ x_2 \end{bmatrix} \\ & =2u_1 x_1 \begin{bmatrix} u_1 \\ u_2 \end{bmatrix}+2u_2x_2 \begin{bmatrix} u_1 \\ u_2 \end{bmatrix}-\begin{bmatrix} x_1 \\ x_2 \end{bmatrix} \\ & = \begin{bmatrix} 2u_1^2x_1+2u_1 u_2x_2-x_1 \\ 2u_1u_2x_1+2u_2^2 u_2x_2-x_2 \end{bmatrix} \\& = \begin{bmatrix} 2u_1^2-1 & 2u_1 u_2\\ 2u_1 u_2 & 2u_2^2-1 \end{bmatrix} \begin{bmatrix}x_1\\ x_2\end{bmatrix}. \end{align*}

as needed.

Example. Find the matrix $A$ of a reflection through the line through the origin spanned by $w = \begin{bmatrix} 4 \\ 3 \end{bmatrix}$ and use it to reflect $\begin{bmatrix} 1 \\ 5 \end{bmatrix}$ about the line $L.$

Solution. Let $u=\begin{bmatrix}4/5 \\ 3/5\end{bmatrix}.$ We notice $u$ is a unit vector, since $\left|\left| u \right|\right| =1.$ Then the matrix we seek is $$A=\begin{bmatrix} 7/25 & 24/25 \\ 24/25 & -7/25 \end{bmatrix}.$$ We can reflect the vector $\begin{bmatrix} 1 \\ 5 \end{bmatrix}$ about the line $L$ using matrix multiplication $$T \begin{bmatrix} 1 \\ 5 \end{bmatrix} = \frac{1}{25} \begin{bmatrix} 7 & 24 \\ 24 & -7 \end{bmatrix} \begin{bmatrix} 1 \\ 5 \end{bmatrix} =\begin{bmatrix}127/25\\ -11/25\end{bmatrix}$$ as desired.

## Rotation Transformations

Theorem. Let $T$ be a linear transformation from $\mathbb{R}^2$ to $\mathbb{R}^2.$ If the matrix of $T$ is of the form $$\begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix}$$ then $T$ is a (counterclockwise) rotation transformation through an angle $\theta.$

Proof. If a vector $x=\begin{bmatrix} x_1\\ x_2\end{bmatrix}$ is rotated through an angle of $\pi/2$, then a vector $y=\begin{bmatrix} -x_2\\ x_1\end{bmatrix}$ is obtained, via $x\cdot y =0.$ More generally, if we rotate (counterclockwise) a given $x$ through an angle $\theta$ we determine

\begin{align} T(x) & =(\cos \theta) x+(\sin\theta) y =(\cos \theta)\begin{bmatrix}x_1\\ x_2\end{bmatrix} + (\sin \theta)\begin{bmatrix} -x_2\\ x_1\end{bmatrix} \\ &=\begin{bmatrix}(\cos \theta)x_1-(\sin\theta))x_2 \ (\sin \theta)x_1-(\cos\theta))x_2\end{bmatrix} \\ & =\begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix} \begin{bmatrix} x_1 \\ x_2\end{bmatrix} =\begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix} x \end{align}

Example. Find the matrix of the linear transformation that rotates the vector $\begin{bmatrix} 4 \\ 2 \end{bmatrix}$ by 30 degrees counterclockwise. By \cref{rotmatrix}, the matrix of this transformation is $$A= \begin{bmatrix} \sqrt{3}/2 & -1/2 \\ 1/2 & \sqrt{3}/2 \end{bmatrix} .$$ We will use matrix multiplication to perform the transformation

\begin{align} T\begin{bmatrix}4\ 2\end{bmatrix} & = \begin{bmatrix} \frac{\sqrt{3}}{2} & \frac{-1}{2} \\ \frac{1}{2} & \frac{\sqrt{3}}{2} \end{bmatrix} \begin{bmatrix} 4\\ 2\end{bmatrix} =\cos 30^\circ \begin{bmatrix}4\\ 2\end{bmatrix}+\sin 30^\circ \begin{bmatrix}4\\ 2\end{bmatrix} \\ & =\begin{bmatrix}2\left(\sqrt{3}+1\right)\\ \sqrt{3}+1\end{bmatrix}.\end{align}

## Transformation Matrices: Vertical and Horizontal Shears

Theorem. Let $T$ be a linear transformation from $\mathbb{R}^2$ to $\mathbb{R}^2.$ If the matrix of $T$ is of the form $$\begin{bmatrix} 1 & 0 \\ k & 1 \end{bmatrix} \qquad \text{or} \qquad \begin{bmatrix} 1 & k \\ 0 & 1 \end{bmatrix},$$ where $k$ is any constant, then $T$ defines a vertical shear or horizontal shear transformation, respectively.

Example. Given the vector $\begin{bmatrix} 2 \\ 3 \end{bmatrix}$ in $\mathbb{R}^2$ show geometrically a vertical shear of 2 and a horizontal shear of $\frac{1}{2}.$

Solution. We can apply these linear transformations using matrix multiplication by using the matrices $\begin{bmatrix} 1 & 0 \\ 2 & 1 \end{bmatrix}$ and $\begin{bmatrix} 1 & 1/2 \\ 0 & 1 \end{bmatrix}.$ $$\text{Vertical Shear:} \qquad T\begin{bmatrix} 2 \\ 3 \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 2 & 1 \end{bmatrix} \begin{bmatrix} 2 \\ 3 \end{bmatrix} = \begin{bmatrix} 2 \\ 7 \end{bmatrix}$$ $$\text{Horizontal Shear:} \qquad T\begin{bmatrix} 2 \\ 3 \end{bmatrix} = \begin{bmatrix} 1 & 1/2 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} 2 \\ 3 \end{bmatrix} =\begin{bmatrix} 7/2 \\ 3 \end{bmatrix}$$

## Combining Transformations Together

Example. Interpret the linear transformation $$T(x)= \begin{bmatrix} 0 & -1 \\ -1 & 0 \end{bmatrix} x$$ geometrically.

Solution. The transformation has a matrix of the form $$\begin{bmatrix} 2u_1^2-1 & 2 u_1 u_2 \\ 2u_1 u_2 & 2u_2^2-1 \end{bmatrix}$$ where $u_1=\sqrt{2}/2$ and $u_2=-\sqrt{2}/2$ since $2u_1^2-1=0$, $2u_2^2-1=0$, and $2u_1 u_2=-1.$ Since $|| u ||=1$ and $u$ lies on the line $y=x$, then matrix $$\begin{bmatrix} 0 & -1 \\ -1 & 0 \end{bmatrix}$$ represents the linear transformation which is a reflection through the line $y=x.$

Example. Interpret the linear transformation $$T(x)= \begin{bmatrix} 1& 1 \\ -1 & 1 \end{bmatrix} x$$ geometrically.

Solution. This is a rotation combined with a scaling. The transformation rotates 45 degrees counterclockwise and has a scaling factor of $\sqrt{2}.$

David Smith (Dave) has a B.S. and M.S. in Mathematics and has enjoyed teaching precalculus, calculus, linear algebra, and number theory at both the junior college and university levels for over 20 years. David is the founder and CEO of Dave4Math.


text:
# week 5 - Various bool stuff

I spent this week tying up loose ends relating to the sparse package.

## DepreciationWarning

A recent change to NumPy caused DeprecationWarning to be thrown whenever there was (potentially) implicit casting between dtypes.

 DeprecationWarning: Implicitly casting between incompatible kinds.
In a future numpy release, this will raise an error. Use
casting="unsafe" if this is intentional.

This was happening a lot in the sparse test suite, where in-place division and multiplication are tested. Since this behavior is being deprecated, I removed the tests for the appropriate cases. But not without some trouble first.

Recall that in python3 / is always true division. So there is always a potential to change the type from int to float, however if the result is expressible as an integer, int is returned. In cases like this where there is no difference in type between the input and result type, NumPy will still throw this warning. So simply checking if there is a type difference between input and result was not enough to programmatically remove the deprecated tests, (which I noticed when my first patch did not work). Eventually I just added special cases to the tests for different data.

## Output Type for SWIG Routines

The compressed types of sparse matrices (BSR, CSC, CSR) each have a set of routines for preforming binary operations (binop) between two sparse matrices. These routines however, only returned data that was the same type as the input data. So boolean operations had to have their result cast to bool at the python level. I modified the sparsetools routines to output bool data where appropriate.

### Implementation

This involved changes at every level of the codebase (c++, SWIG, python), it is a good demonstration of how these levels work together.

#### C++

The binop routines are implemented as function templates in c++, where the template arguments are (including the new one I added):

• I: Always int for storing nnz (number of non-zeros), vector length etc.

• T: The input data type.

• T2: The output data type, which I added.

Adding this new argument required minimal changes to the existing code. Basically I just changed T to T2 in a few places.

Since the output type we used here was bool I also had to add a conversion from the complex wrapper class to bool.

#### SWIG

At the SWIG level typemaps define what types the function templates inputs and outputs are. I had to add new typemaps to instantiate functions with boolean output.

#### Python

Since the new binop routines now output the correct dtype. I removed all the casting to bool. However in the cases where boolean data must be returned, python has to pass an empty matrix to the binop routines with the correct dtype. So _binopt now checks what the operation is to decide what kind of empty matrix it should create.

## Sparse Bool Wrapper

Pull request. Previously the c++ routines in sparsetools defined the bool dtype with:

typedef npy_bool_wrapper npy_int8;

This was so that bool value would be one byte. But since this is stored as an int8 type, it would rollover when the underlying integer got to 256. Like this:

In [2]: a = sp.csr_matrix([True, False])

In [3]: for _ in range(8):
...:     a = a + a
...:     print(a.todense())
...:
[[ True False]]
[[ True False]]
[[ True False]]
[[ True False]]
[[ True False]]
[[ True False]]
[[ True False]]
[[False False]]        # <----- !

So I rewrote npy_bool_wrapper as a class with one char data member (recall that in c++ char is 1 byte). And added the required arithmatic overrides for boolean algebra. e.g. 1 + 1 = 1.

## Build Failures

After modifying complex_ops.h in my pull request for sparse matrix inequalities, people were getting build failures on clang and intel compilers. This was related to ill defined overrides of the boolean comparison operators. As an example, previously we had:

bool operator !=(const c_type& B) const{
return npy_type::real != B || npy_type::imag != c_type(0);
}

Where c_type is a template argument, which is used as the type of the underlying real and imag numbers. So comparisons with things that were not c_type were ambiguous. So I redefined the boolean comparisons as template functions like:

template<class T>
bool operator !=(const T& B) const{
return npy_type::real != B || npy_type::imag != T(0);
}

Which should handle all comparisons, within reason.

# week 4 - Sparse Matrix Inequalities

This week I worked on adding support for inequalities to sparse matrices. The pull request is here (still pending). I also modified, the c++ routines used to produce a boolean output, pull request here. This is so these inequalities don't have to be cast to bool in python. Once both of these are accepted the inequalities will be using the c++ routines that produce boolean output.

These are separate pull requests but they are related and one will need to be rebased once the other is accepted. Or I may combine them.

Each of the four basic inequalities has its own particular quirks which make it more or less efficient with sparse matrices. Here we consider A to be a sparse matrix. The cases where B is a scalar, or sparse are considered. (By scalar we effectively mean a matrix the same size as A with every element as the scalar value B.

#### A < B

For scalar B, this operation is only efficient if B < 0 otherwise the resulting matrix will be dense.

For sparse A and B this is also efficient.

#### A > B

For scalar B the efficiency is the opposite of the less than operator. That is B > 0 has efficient output. Similarly to < this operation is efficient with other sparse matrices.

#### A <= B

This operation is pretty much useless. The only case which make this efficient is when B < 0. But this case is already covered by <, and < can be used efficiently with sparse matrices. So why use <=? I'll discuss the pros and cons of having these non-strict inequalities in a moment.

Another disadvantage of non strict inequalities like these is that they raies NotImplementedError when comparing with 0. This is because of the nature of the c++ routines. When comparing every pair of elements they don't consider cases where both are zero.

#### A >= B

Like <= this operation is only efficient for one case, when B > 0. And also like <=, it is not very useful.

### Why have non strict inequalities?

I can't really think of uses for >= and <= but they might exist, I added them because they were easy to implement once I had done > and <. In practice, they don't slow the usage down. But removing non - strict inequalities removes 24,990 lines of code.

## Implementation

The inequality operations are implemented as c++ routines, these are wrapped to provide a python interface using SWIG, then the various inequalities are added appropriately.

### C++

The inequalities routines were implemented by reusing existing routines like csr_binop_csr. Overrides for inequalities had to be added to complex_wrapper.h too.

The binop routines had to altered, another class was added to their templates, T2, for the type of data out. In theory this could be something other than bool.

### SWIG

To handle boolean output data a new swig macro was added to create typemaps that have npy_bool_wrapper as this output class. I then use these to instantiate the boolean operations.

### Python

Here the associated python special methods corresponding to the inequalities were added in compressed.py. These operations can be used with a scalar, dense, or sparse matrix. Numpy style broadcasting is not implemented.

To produce a bool output by default for boolean comparisons, I altered the _binopt function to pass the c++ routines a matrix to use for output with a bool dtype.

## Problems

When testing the inequalities with dense matrices, I could not get the proper behavior with a dense matrix on the left hand side. Previously, with != and == I modified the __bool__ method but that did not work in this case. This is because of the same problem I will be dealing with in the next stage of my proposal, interactions with numpy ufuncs.

# week 3 - Boolean Operations, != and == for CSR, CSC, and BSR

This week focused on implementing support for the == and != boolean comparisons for the BSR, CSC, CSR sparse matrix types. The culmination of my work this week is this pull request.

## !=

For sparse matrices, the != (not equal to) generally has an output that can be efficiently represented by sparse matrices. With the exception of comparing the whole matrix with a nonzero scalar.

## ==

The boolean equal to comparison in general has an output that is not efficiently represented by sparse matrices, since all the zero entries return True. The exception being comparison with zero.

Adding a c routine for this operation with the existing code, would be problematic. The binop routines only apply the given binop to element pairs in which one of them is nonzero. So all the co-occurring zero elements would not return True like they should. Because of this, and == being in general inefficient, I did not bother to implement the == operation in sparsetools. Instead, the == operation is computed using the != operation and inverting it.

## Implementation

### C++ & SWIG level

Implementing the routines for != and == in the sparsetools/ was pretty easy, using the existing code. There are handy csr_binop_csr and bsr_binop_bsr functions which take c++ a functional as an argument for the binop. The only problem is that the output type is not the same as the input type. So the output is not bool by default.

### Python level

In Python, != and == operations are can be overridden by defining the methods __ne__ and __eq__. I did this to handle the case wher the other object is a scalar, dense, or a sparse matrix.

I defined these methods in compressed.py which defines the base class for BSR, CSC, and CSR.

In defined these methods in base.py, here they just convert the sparse matrix to CSR and preform the desired operation.

#### __bool__

There was however some complication with how these worked when a dense ndarray is the first argument, ideally it would ask the sparse matrix what to do, however this was not happening whenever the sparse matrix's __bool__ (for Python3, __nonzero__ for python2.x) method returned True or False, I still don't know why. It did however work when __bool__ raised an error or returned something other than T/F. Since NumPy's ndarrays raise an error when __bool__ is called, I thought this was a reasonable change to make to sparse matrices __bool__. Although ideally, I'd like to better understand what is going on so I don't have to make an incompatible change to SciPy's API.

This change broke one test in scipy/io/matlab/tests/test_mio.py there could be more serious issues relating to this change, currently they are being discussed on the pull request

# SciPy Workflow

There are a few things that have taken some getting used to in working with SciPy. These things are aggregated here:

### Keeping my SciPy repo up-to-date

I need to upadate my copy of SciPy regularly from upstream, to avoid merge conflicts. I have done this plenty of times, but for some reason I forget how every time. There is a good howto on stackoverflow on this. From said article:

# Add the remote, call it "upstream":

# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:

git fetch upstream

# Make sure that you're on your master branch:

git checkout master

# Rewrite your master branch so that any commits of yours that
# aren't already in upstream/master are replayed on top of that
# other branch:

git rebase upstream/master

### Pushing new local branches to a remote Git repo

Every time a make a new local branch, I forget how to push it to github as new branch. Google always brings me to this article. Basically if I have a new local branch call it new-feature and want to push it to my github repo and create a new new-feature branch there too. I do:

git push -u origin new-feature

and if I wanted to delete this remote branch, I could do:

git push origin :new-feature

and delete it locally with:

git branch -D new-feature

### SciPy's commit messages

API: an (incompatible) API change
BLD: change related to building numpy
BUG: bug fix
DEP: deprecate something, or remove a deprecated object
DEV: development tool or utility
DOC: documentation
ENH: enhancement
MAINT: maintenance commit (refactoring, typos, etc.)
REV: revert an earlier commit
STY: style fix (whitespace, PEP8)
TST: addition or modification of tests
REL: related to releasing numpy

The acronyms are easy to remember, but adding the acronyms is easy to forget. Which brings me to my next topic.

### Changing commit messages, after you have pushed

This is not the simplest thing to do in git, fortunately my mentor Pauli showed me a great way to do it. Assuming no one has pulled from your repo yet.

• First do git log and look for the last COMMIT befor the commit messages you want to change.

• Do git rebase -i COMMIT

• Replace pick with r

• Then Git will prompt you to change the commit messages one at a time.

• Push your changes with git push -f

# Week 1 - bool dtype support

I got accepted to Google Summer of Code! Thank you everyone who has helped me get this far, and Amber for making me a congratulatory google cake!

On my proposal timeline I gave myself 2 weeks to add support to sparse matrices for dtype=bool. So far, dtype=bool works implementation was not too hard, and most of my time was spent figuring out how SWIG works. However there is still a lot of work to do in testing bool support. This will be more time consuming than it should be because the sparse test suite is messy.

## bool dtype implementation

### sparsetools

The sparsetools/ directory contains several *.cxx, *.h, *.i, and *.py files. The header files (*.h) contain C++ routines these are wrapped by SWIG according to instructions in the *.i interface files. SWIG uses the header and interface files to generate python *.py files C++ code in *.cxx files. Once these *.cxx files are compiled and linked the functions they define can be called by the generated *.py files.

### Where do I add bool support?

Contained in sparsetools/ is a file called complex_ops.h which translates numpy's complex types to C++ classes. Well, that is what I want to do, except for numpy's bool types instead! My new file bool_ops.h is much simpler though. It basically does

typedef npy_int8 npy_bool_wrapper;

Yep that's it, (for now anyway). This file basically says to treat the npy_bool_wrapper type like the npy_int8. Because boolean algebra is almost integer algebra.

npy_bool_wrapper is used in numpy.i to define a typemap from numpy's npy_bool type to our npy_bool_wrapper.

In sparsetools.i we have to declare the new data type and add it to the INSTANTIATE_ALL macro which is used in all the *.i files to call the functions we want from the *.h files.

## What else?

Adding bool to supported_dtypes in sputils.py prevents it from upcast. Then tests need to be added, but this isn't too easy. The test suite does not have a way to take some general data or dtype. So I am going through adding tests one-by-one where it seems appropriate. I'm also trying to add tests for other dtypes because there don't seem to be any tests for anything other than float64 and int64.

While I was doing this I discovered a few bugs relating to how sparse handles uint dtypes.

Once I'm done adding tests and fixing what ever does not pass, I'll move on to the next stage in my proposal. Adding support for boolean operations.

# Google Summer of Code Proposal

## Improvements to the sparse package of Scipy: support for bool dtype and better interaction with NumPy

### Abstract

The scipy sparse package is used extensively in other projects like scikit-learn, and is integrated with NumPy, SymPy, and Sage. However it leaves a lot to be desired. There is no support for boolean sparse matrices, and boolean operations on sparse matrices return inconsistent results. See these examples. The sparse matrices also have problems when used with NumPy ufuncs and ndarrays (see this ticket which I did some work on, and this ticket). The second part of this proposal is to remedy this. So writing code combining sparse and dense matrices will be easier, and making the sparse codebase easier to maintain.

The two main parts of this proposal are:

1. Add support for bool dtype to sparse matrices, as well as boolean operations so that sparse matrices behave more like NumPy ndarrays.

2. Improve interaction of sparse matrix objects and other types. Especially NumPy ndarray objects and ufuncs. This will make numpy.dot, .multiply, etc. work with sparse matrices, making generic sparse and dense matrix code much easier to write. This will also involve adding new functions/methods (similar to numpy ufuncs) to the sparse package which will improve it's usabilty.

Both of these will be implemented according to separate specifications (written with community input), and testing suites.

I've been programming using the SciPy/Numpy for around 3 years for reasearch and homework assingnments and have always wanted to give back. previous work with SciPy:

There are a lot of projects on my GitHub, many incomplete, here are a select few:

CV

## Timeline

I've shifted the Coding period to start on May 27th (with the consent of my mentor) and end earlier so I can return to school.

##### Before May 27th.
• Familiarizing myself with scipy.sparse by investigating bug reports, reading documentation, etc.
• Building rapport with the Scipy community and my mentor by trying to be helpful in #scipy and on the mailing list.
• Get a head start! (my last day of school is May 3rd.)
• Get community feedback on bool handling specification and ndarray handling specification. Write said specifications. (I've already started this.)
##### bool handling -- May 27th to July 1st (5 weeks)

Implementation will be done according to this specification which is currently being written. In order:

• implement suport for bool datatype (2 weeks)
• implement boolean operations (2 weeks)
• code review and unit tests (1 week)
##### NumPy interactions -- July 1st to August 26th (8 weeks)

See this specification (under construction). In order:

• Modify NumPy universal function objects (ufuncs) to be aware of sparse matrix types. (1 week)
• Refactor and consolidate sparse code to clean up the interface (1 week)
• Add sparse matrix functions(or methods) to handle calls from ufuncs (5 weeks)
• Implement ufuncs that should just operate on the dense form of the sparse matrix.
• Implement sparse forms of the binary ufuncs that should broadcast.
• Test suite for all the sparse matrix methods which correspond to ufuncs.
• Mid-term evaluation, July 29th -- deliverables are:
• bool spec implemented
• Have at least one sparse matrix method that a NumPy ufunc will dispatch to.
• Wrap up. test suite for Numpy ufunc and sparse matrix interactions for sparse/dense and sparse/sparse combinations. (1 week)
##### Onward -- post August 27th

My school begins on August 29th, so I'll cut work to around 1/3 to 1/4 of before. So I will continue with a few features, and fixing bugs etc for the remaining weeks at a slow pace. Final evaluation, Sept 23rd -- deliverables are:

• bool spec implemented, along with documentation and test suite.
• Support for bool dtype.
• Support for boolean operations.
• NumPy interaction spec implemented.
• Many Numpy ufuncs work with sparse matricies, and sparse dense combinations. Making sparse/dense code easier to write.
• A nicer interface and codebase with less repeated code, more maintainable.

When all this is done I will use my now vast knowledge of Scipy to be a productive member of the community :)

# .toarray()

I wrote some tests to look a little further into trac ticket #1533. I wanted to know what sparse matrix types cannot .toarray() with dtype as bool. Suprisingly, the only type that passed was the Lists of Lists (lil) type. Why is this?

### Lists of Lists

Looking around in the sparse package, every toarray method except for lil's basically does this.

def toarray(self, order=None, out=None):
"""See the docstring for spmatrix.toarray."""
return self.tocoo(copy=False).toarray(order=order, out=out)

Where the Coordinate list (coo) matrix's toarray is

def toarray(self, order=None, out=None):
"""See the docstring for spmatrix.toarray."""
B = self._process_toarray_args(order, out)
fortran = int(B.flags.f_contiguous)
if not fortran and not B.flags.c_contiguous:
raise ValueError("Output array must be C or F contiguous")
M,N = self.shape
coo_todense(M, N, self.nnz, self.row, self.col, self.data,
B.ravel('A'), fortran)
return B

The coo toarray calls the coo_todense function, which just creates a dense matrix with the data, but it doesn't support the bool dtype. This is a c function deffined in coo.h.

But why didn't lil fail? Looking at its toarray:

 def toarray(self, order=None, out=None):
"""See the docstring for spmatrix.toarray."""
d = self._process_toarray_args(order, out)
for i, row in enumerate(self.rows):
for pos, j in enumerate(row):
d[i, j] = self.data[i][pos]
return d

It is not using any of these c functions. Why not? Python is slow and c is fast, so is lil taking a preformance hit?

### lil's .toarray() benchmark

I wrote some code to benchmark lil's .toarray() performance compared with other types. A typical result with 3000 by 3000 matrix with around 5 nonzero random values per row is:

$python lil_benchmark.py lil 0.0481379032135 dok 0.113062858582 dia 0.530215024948 csr 0.045028924942 csc 0.0446619987488 bsr 0.0462918281555 coo 0.0453071594238  It's not much slower at all. But dia and dok are really slow, this is probably from converting them to coo type before doing .toarray(). This is promising, maybe the toarray methods can be written in python instead trying to tack on bool support to the existing c code. Without much of a performance hit. # Building Numpy and Scipy on Ubuntu 12.04 This post should help you build Numpy and Scipy from source on Ubuntu 12.04. If you already have a Numpy/Scipy installation from the Ubuntu repos, uninstall them. $ sudo apt-get remove python-scipy python-numpy

Get the latest source from github.

$git clone https://github.com/scipy/scipy.git$ git clone https://github.com/numpy/numpy.git

Get all the needed tools to build Numpy, and Scipy. Except for cython which we will get next.

$sudo apt-get install python-dev python-nose libblas-dev liblaplack-dev build-essential gfortran gcc  The cython in the ubuntu repos is too old to build Scipy with. So we add a ppa with a more recent version. Then update apt. $ sudo apt-add-repository ppa:cython-dev/master-ppa
...
$sudo apt-get update ...$ sudo apt-get install cython

You need to build Numpy first.

$cd ~/numpy$ sudo python setup.py install
...

Then Scipy.

$cd ~/scipy$ sudo python setup.py install
...

Then try it out.

\$ python

>>> import numpy
>>> import scipy

# Google Summer of Code Proposal Preperation

## Improving the sparse matrix package in Scipy

Among otherthings, I'm preparing a proposal to improve the handling of the bool datatype in Scipy's sparse matrix package. Once these types are consistently codified, improving interactions between spmatrix objects and other Numpy/Scipy types should be easier. So fixing things like trac ticket#1598 would come next.

So first I would need to write a specification for handling bools with other spmatrix objects and other kinds of objects like ndarrays. But what is wrong now? Here is one thing.

### Bool problems: Making sparse bool matricies

Not every sparse matrix format supports bool dtypes. Try instantiating any class which inherits from _cs_matrix with a ndarray of bool dtype, and it will upcast it to int8. See my comments on the trac ticket #1533.

In [3]: A = np.array([[True, False],[False, True]], dtype=bool)

In [4]: B = sp.csr_matrix(A)

In [5]: B.data
Out[5]: array([1, 1], dtype=int8)

But we can get a spmatrix with a bool dtype if we pass the kwarg dtype=bool

In [6]: C = sp.csr_matrix(A, dtype=bool)

In [7]: C.data
Out[7]: array([ True,  True], dtype=bool)

This seems inconsisent; but now we have other problems.

In [8]: C.toarray()

...

171     """
--> 172     return _coo.coo_todense(*args)
173
174 def coo_matvec(*args):

TypeError: Array of type 'byte' required.  Array of type 'bool' given

I think the type is upcast here because there is no support for bool types in the coo_todense function. This is defined in coo.h , where the type is required by the class T. To apparently not be bool.

So to add support for bool, this class T needs to have support for it added. Once that is done the toarray() method should work with dtype==bool.

I don't yet understand how this SWIG wrapper works. I'm not sure where this class T is coming from. Any comments would be helpful.

# First

## Testing testing...

I'm switching to this new static site genearator nikola because:

• python based
• Markdown support
• static
• looks clean
• small simple codebase
• actively developed


text:
Review question

# If $\sqrt{x}-\sqrt{11}=\sqrt{y}$, when is $x/y$ a maximum? Add to your resource collection Remove from your resource collection Add notes to this resource View your notes for this resource

Ref: R9499

## Suggestion

Positive integers $x$ and $y$ satisfy the equation $\sqrt{x}-\sqrt{11}=\sqrt{y}$.

What is the maximum possible value of $\dfrac{x}{y}$?

How could get rid of at least some of the square roots?

What can we now deduce, remembering that $x$ and $y$ are positive integers?


text:
# Stochastic version of the Kirchoff circuit law

I assume this question could be written in a non-technical jargon, but I will try to be as simple as possible.

The Kirchoff circuits law assert that the sum of inward and outward currents at a node is exactly 0. This is a view of the classical charge conservation principle.

From a statistical perspective, however, I'd expect this law microscopically refers to the expected values of the sum of inward and outward currents.

Here I am wondering how this law can be stated probabilistically. In mathematical terms, what if we allow the sum of inward and outwards current to be a standard normal random variate with zero mean and unit variance (a noisy term, like a white noise process).

For example if electrical currents are seen as discrete electric charges moving toward and outward nodes, I'd expect the Kirchoff law to become correct only in the very large N limit.

Did someone ever tried to model the temporal evolution of a discrete circuit with dynamics in the regime of stochastic nodes?


text:
Chain rule

• October 19th 2010, 11:25 AM
nightrider456
Chain rule
Hey,
I am currently having difficulties applying the chain rule to problems from what i can gather the chain rule is the derivative of the inside multiplied by the derivative of the outside

I tried working through a problem but screwed up somewhere,
The problem
find the derivative
$
k(x)=x^{2}sec(\frac{1}{x})
$

what I did
$k(x)=x^{2}sec(\frac{1}{x})$
= $2x(secxtanx)\( \frac{x(0)-1(x)}{x})$
= $2x(secxtanx)(\frac{-1x}{x^{2}})$
= $2x(secxtanx)(\frac{-1}{x})$
= $\frac{-2x(secx^{3})}{x}$
Am i on the right path
• October 19th 2010, 11:46 AM
Also sprach Zarathustra
$f(x)=x^2sec(\frac{1}{x})$

$f'(x)=2xsec(\frac{1}{x})+x^2(sec(\frac{1}{x}))'$

$(sec(\frac{1}{x})'=-{\frac{tan(frac{1}{x})sec(\frac{1}{x})}{x^2}}$

$f'(x)=2xsec(\frac{1}{x})+x^2{\frac{tan(\frac{1}{x} )sec(\frac{1}{x})}{x^2}}=2xsec(\frac{1}{x})-{{tan(\frac{1}{x})sec(\frac{1}{x})}$


text:
# Alternate facts

Don't know if you've seen this -- it's been making its way around the Web: Tim O’Brien’s "The Little Golden Book of Alternate Facts."


text:
# zbMATH — the first resource for mathematics

Remarks on Chacon’s biting lemma. (English) Zbl 0678.46023
In the abstract of this paper the authors indicate that a new approach is provided for the proof of ‘Chacon’s biting lemma’, which is stated in terms of Banach space-valued functions.
Let ($$\Omega$$,$${\mathcal F},\mu)$$ be a measure space with finite positive measure, and let $$(X,\| \cdot \|_ X)$$ be a Banach space. Then the main result of the paper states that if $$\{f_ j\}$$ is a bounded sequence in $$L^ 1(\Omega,X)$$, so that $$\sup_{j\geq 1}\int \| f_ j\|_ X d\mu =C_ 0<\infty$$, then there is a function f in $$L^ 1(\Omega,X)$$, a subsequence $$\{f_{k_ j}\}$$ of $$\{f_ j\}$$ and a non- increasing sequence $$\{E_ j\}$$ of sets in $${\mathcal J}$$ with $$\lim_{j\to \infty}\mu (E_ j)=0$$, such that, for $$m=1,2,3,...$$, $$f_{k_ j}\to f$$ (as $$j\to \infty)$$ weakly in $$L^ 1(\Omega \setminus E_ m,X)$$.
Reviewer: G.O.Okikiolu

##### MSC:
 46E30 Spaces of measurable functions ($$L^p$$-spaces, Orlicz spaces, Köthe function spaces, Lorentz spaces, rearrangement invariant spaces, ideal spaces, etc.) 49J45 Methods involving semicontinuity and convergence; relaxation 46G10 Vector-valued measures and integration
Full Text:


text:
Solo disponible en Inglés

Gráfica

\mathrm{ Graficando: }
Sorry, your browser does not support this application
View Larger

matrix-determinant-calculator

\det \begin{pmatrix}1 & 3 & 5 & 9 \\1 & 3 & 1 & 7 \\4 & 3 & 9 & 7 \\5 & 2 & 0 & 9\end{pmatrix}

es

I Don't Have An Account

We've sentthe email to:

[email protected]

THANK YOUFOR SUBSCRIBING!

Continue to site »

THANK YOUFOR SUBSCRIBING!

Please note: this subscription will automatically renew until canceled

Continue to site »

Transaction Failed!

Please try again using a different payment method

Subscribe to get much more:

• Unlimited Storage
• Thousands of practice problems
• Exámenes
• Immediate feedback
• Interactive hints
• Detailed progress report
Remind me later
 One Time Payment $5.99 USD for 2 months Weekly Subscription$0.99 USD per week until cancelled Monthly Subscription $2.49 USD per month until cancelled Annual Subscription$14.99 USD per year until cancelled
User Data Missing


text:
# Titration

Titration (also known as titrimetry[1] and volumetric analysis) is a common laboratory method of quantitative chemical analysis to determine the concentration of an identified analyte (a substance to be analyzed). A reagent, termed the titrant or titrator,[2] is prepared as a standard solution of known concentration and volume. The titrant reacts with a solution of analyte (which may also be termed the titrand[3]) to determine the analyte's concentration. The volume of titrant that reacted with the analyte is termed the titration volume.

## History and etymology

The word "titration" descends from the French word tiltre (1543), meaning the proportion of gold or silver in coins or in works of gold or silver; i.e., a measure of fineness or purity. Tiltre became titre,[4] which thus came to mean the "fineness of alloyed gold",[5] and then the "concentration of a substance in a given sample".[6] In 1828, the French chemist Gay-Lussac first used titre as a verb (titrer), meaning "to determine the concentration of a substance in a given sample".[7]

Volumetric analysis originated in late 18th-century France. François-Antoine-Henri Descroizilles (fr) developed the first burette (which was similar to a graduated cylinder) in 1791.[8][9][10] Joseph Louis Gay-Lussac developed an improved version of the burette that included a side arm, and invented the terms "pipette" and "burette" in an 1824 paper on the standardization of indigo solutions.[11] The first true burette was invented in 1845 by the French chemist Étienne Ossian Henry (1798–1873).[12][13] A major improvement of the method and popularization of volumetric analysis was due to Karl Friedrich Mohr, who redesigned the burette into a simple and convenient form, and who wrote the first textbook on the topic, Lehrbuch der chemisch-analytischen Titrirmethode (Textbook of analytical chemistry titration methods), published in 1855.[14][15]

## Procedure

A typical titration begins with a beaker or Erlenmeyer flask containing a very precise amount of the analyte and a small amount of indicator (such as phenolphthalein) placed underneath a calibrated burette or chemistry pipetting syringe containing the titrant. Small volumes of the titrant are then added to the analyte and indicator until the indicator changes color in reaction to the titrant saturation threshold, representing arrival at the endpoint of the titration. Depending on the endpoint desired, single drops or less than a single drop of the titrant can make the difference between a permanent and temporary change in the indicator. When the endpoint of the reaction is reached, the volume of reactant consumed is measured and used to calculate the concentration of analyte by

${\displaystyle \mathbf {C} _{a}={\frac {\mathbf {C} _{t}\mathbf {V} _{t}\mathbf {M} }{\mathbf {V} _{a}}}}$

where Ca is the concentration of the analyte, typically in molarity; Ct is the concentration of the titrant, typically in molarity; Vt is the volume of the titrant used, typically in liters; M is the mole ratio of the analyte and reactant from the balanced chemical equation; and Va is the volume of the analyte used, typically in liters.[16]

### Preparation techniques

Typical titrations require titrant and analyte to be in a liquid (solution) form. Though solids are usually dissolved into an aqueous solution, other solvents such as glacial acetic acid or ethanol are used for special purposes (as in petrochemistry).[17] Concentrated analytes are often diluted to improve accuracy.

Many non-acid–base titrations require a constant pH during the reaction. Therefore, a buffer solution may be added to the titration chamber to maintain the pH.[18]

In instances where two reactants in a sample may react with the titrant and only one is the desired analyte, a separate masking solution may be added to the reaction chamber which eliminates the effect of the unwanted ion.[19]

Some reduction-oxidation (redox) reactions may require heating the sample solution and titrating while the solution is still hot to increase the reaction rate. For instance, the oxidation of some oxalate solutions requires heating to 60 °C (140 °F) to maintain a reasonable rate of reaction.[20]

## Titration curves

A titration curve is a curve in graph the x-coordinate of which represents the volume of titrant added since the beginning of the titration, and the y-coordinate of which represents the concentration of the analyte at the corresponding stage of the titration (in an acid–base titration, the y-coordinate usually represents the pH of the solution).[21]

In an acidbase titration, the titration curve represents the strength of the corresponding acid and base. For a strong acid and a strong base, the curve will be relatively smooth and very steep near the equivalence point. Because of this, a small change in titrant volume near the equivalence point results in a large pH change and many indicators would be appropriate (for instance litmus, phenolphthalein or bromothymol blue).

If one reagent is a weak acid or base and the other is a strong acid or base, the titration curve is irregular and the pH shifts less with small additions of titrant near the equivalence point. For example, the titration curve for the titration between oxalic acid (a weak acid) and sodium hydroxide (a strong base) is pictured. The equivalence point occurs between pH 8-10, indicating the solution is basic at the equivalence point and an indicator such as phenolphthalein would be appropriate. Titration curves corresponding to weak bases and strong acids are similarly behaved, with the solution being acidic at the equivalence point and indicators such as methyl orange and bromothymol blue being most appropriate.

Titrations between a weak acid and a weak base have titration curves which are very irregular. Because of this, no definite indicator may be appropriate and a pH meter is often used to monitor the reaction.[22]

The type of function that can be used to describe the curve is termed a sigmoid function.

## Types of titrations

There are many types of titrations with different procedures and goals. The most common types of qualitative titration are acid–base titrations and redox titrations.

### Acid–base titration

Indicator Color on acidic side Range of color change
(pH)
Color on basic side
Methyl violet Yellow0.0–1.6Violet
Bromophenol blue Yellow3.0–4.6Blue
Methyl orange Red3.1–4.4Yellow
Methyl red Red4.4–6.3Yellow
Litmus Red5.0–8.0Blue
Bromothymol blue Yellow6.0–7.6Blue
Phenolphthalein Colorless8.3–10.0Pink
Alizarin yellow Yellow10.1–12.0Red

Acid–base titrations depend on the neutralization between an acid and a base when mixed in solution. In addition to the sample, an appropriate pH indicator is added to the titration chamber, representing the pH range of the equivalence point. The acid–base indicator indicates the endpoint of the titration by changing color. The endpoint and the equivalence point are not exactly the same because the equivalence point is determined by the stoichiometry of the reaction while the endpoint is just the color change from the indicator. Thus, a careful selection of the indicator will reduce the indicator error. For example, if the equivalence point is at a pH of 8.4, then the phenolphthalein indicator would be used instead of Alizarin Yellow because phenolphthalein would reduce the indicator error. Common indicators, their colors, and the pH range in which they change color are given in the table above.[23] When more precise results are required, or when the reagents are a weak acid and a weak base, a pH meter or a conductance meter are used.

For very strong bases, such as organolithium reagent, metal amides, and hydrides, water is generally not a suitable solvent and indicators whose pKa are in the range of aqueous pH changes are of little use. Instead, the titrant and indicator used are much weaker acids, and anhydrous solvents such as THF are used.[24][25]

The approximate pH during titration can be approximated by three kinds of calculations. Before beginning of titration, the concentration of ${\displaystyle {\ce {[H+]}}}$ is calculated in aqueous solution of weak acid before adding any base. When the number of moles of bases added equals the number of moles of initial acid or so called equivalence point, one of hydrolysis and the pH is calculated in the same way that the conjugate bases of the acid titrated was calculated. Between starting and end points, ${\displaystyle {\ce {[H+]}}}$ is obtained from the Henderson-Hasselbalch equation and titration mixture is considered as buffer. In Henderson-Hasselbalch equation the [acid] and [base] are said to be the molarities that would have been present even with dissociation or hydrolysis. In a buffer, ${\displaystyle {\ce {[H+]}}}$ can be calculated exactly but the dissociation of HA, the hydrolysis of ${\displaystyle {{\ce {A-}}}}$ and self-ionization of water must be taken into account.[26] Four independent equations must be used:[27]

${\displaystyle [{\ce {H+}}][{\ce {OH-}}]=10^{-14}}$
${\displaystyle [{\ce {H+}}]=K_{a}{\ce {{\frac {[HA]}{[A^{-}]}}}}}$
${\displaystyle [{\ce {HA}}]+[{\ce {A-}}]={\frac {(n_{{\ce {A}}}+n_{{\ce {B}}})}{V}}}$
${\displaystyle [{\ce {H+}}]+{\frac {n_{{\ce {B}}}}{V}}=[{\ce {A-}}]+[{\ce {OH-}}]}$

In the equations, ${\displaystyle n_{{\ce {A}}}}$ and ${\displaystyle n_{{\ce {B}}}}$ are the moles of acid (HA) and salt (XA where X is the cation), respectively, used in the buffer, and the volume of solution is V. The law of mass action is applied to the ionization of water and the dissociation of acid to derived the first and second equations. The mass balance is used in the third equation, where the sum of ${\displaystyle V[{\ce {HA}}]}$ and ${\displaystyle V[{\ce {A-}}]}$ must equal to the number of moles of dissolved acid and base, respectively. Charge balance is used in the fourth equation, where the left hand side represents the total charge of the cations and the right hand side represents the total charge of the anions: ${\displaystyle {\frac {n_{{\ce {B}}}}{V}}}$ is the molarity of the cation (e.g. sodium, if sodium salt of the acid or sodium hydroxide is used in making the buffer).[28]

### Redox titration

Redox titrations are based on a reduction-oxidation reaction between an oxidizing agent and a reducing agent. A potentiometer or a redox indicator is usually used to determine the endpoint of the titration, as when one of the constituents is the oxidizing agent potassium dichromate. The color change of the solution from orange to green is not definite, therefore an indicator such as sodium diphenylamine is used.[29] Analysis of wines for sulfur dioxide requires iodine as an oxidizing agent. In this case, starch is used as an indicator; a blue starch-iodine complex is formed in the presence of excess iodine, signalling the endpoint.[30]

Some redox titrations do not require an indicator, due to the intense color of the constituents. For instance, in permanganometry a slight persisting pink color signals the endpoint of the titration because of the color of the excess oxidizing agent potassium permanganate.[31] In iodometry, at sufficiently large concentrations, the disappearance of the deep red-brown triiodide ion can itself be used as an endpoint, though at lower concentrations sensitivity is improved by adding starch indicator, which forms an intensely blue complex with triiodide.

### Gas phase titration

Gas phase titrations are titrations done in the gas phase, specifically as methods for determining reactive species by reaction with an excess of some other gas, acting as the titrant. In one common gas phase titration, gaseous ozone is titrated with nitrogen oxide according to the reaction

O3 + NO → O2 + NO2.[32][33]

After the reaction is complete, the remaining titrant and product are quantified (e.g., by Fourier transform spectroscopy) (FT-IR); this is used to determine the amount of analyte in the original sample.

Gas phase titration has several advantages over simple spectrophotometry. First, the measurement does not depend on path length, because the same path length is used for the measurement of both the excess titrant and the product. Second, the measurement does not depend on a linear change in absorbance as a function of analyte concentration as defined by the Beer-Lambert law. Third, it is useful for samples containing species which interfere at wavelengths typically used for the analyte.[34]

### Complexometric titration

Complexometric titrations rely on the formation of a complex between the analyte and the titrant. In general, they require specialized complexometric indicators that form weak complexes with the analyte. The most common example is the use of starch indicator to increase the sensitivity of iodometric titration, the dark blue complex of starch with iodine and iodide being more visible than iodine alone. Other complexometric indicators are Eriochrome Black T for the titration of calcium and magnesium ions, and the chelating agent EDTA used to titrate metal ions in solution.[35]

### Zeta potential titration

Zeta potential titrations are titrations in which the completion is monitored by the zeta potential, rather than by an indicator, in order to characterize heterogeneous systems, such as colloids.[36] One of the uses is to determine the iso-electric point when surface charge becomes zero, achieved by changing the pH or adding surfactant. Another use is to determine the optimum dose for flocculation or stabilization.[37]

### Assay

An assay is a type of biological titration used to determine the concentration of a virus or bacterium. Serial dilutions are performed on a sample in a fixed ratio (such as 1:1, 1:2, 1:4, 1:8, etc.) until the last dilution does not give a positive test for the presence of the virus. The positive or negative value may be determined by inspecting the infected cells visually under a microscope or by an immunoenzymetric method such as enzyme-linked immunosorbent assay (ELISA). This value is known as the titer.[38]

## Measuring the endpoint of a titration

Different methods to determine the endpoint include:[39]

• Indicator: A substance that changes color in response to a chemical change. An acid–base indicator (e.g., phenolphthalein) changes color depending on the pH. Redox indicators are also used. A drop of indicator solution is added to the titration at the beginning; the endpoint has been reached when the color changes.
• Potentiometer: An instrument that measures the electrode potential of the solution. These are used for redox titrations; the potential of the working electrode will suddenly change as the endpoint is reached.
• pH meter: A potentiometer with an electrode whose potential depends on the amount of H+ ion present in the solution. (This is an example of an ion-selective electrode.) The pH of the solution is measured throughout the titration, more accurately than with an indicator; at the endpoint there will be a sudden change in the measured pH.
• Conductivity: A measurement of ions in a solution. Ion concentration can change significantly in a titration, which changes the conductivity. (For instance, during an acid–base titration, the H+ and OH ions react to form neutral H2O.) As total conductance depends on all ions present in the solution and not all ions contribute equally (due to mobility and ionic strength), predicting the change in conductivity is more difficult than measuring it.
• Color change: In some reactions, the solution changes color without any added indicator. This is often seen in redox titrations when the different oxidation states of the product and reactant produce different colors.
• Precipitation: If a reaction produces a solid, a precipitate will form during the titration. A classic example is the reaction between Ag+ and Cl to form the insoluble salt AgCl. Cloudy precipitates usually make it difficult to determine the endpoint precisely. To compensate, precipitation titrations often have to be done as "back" titrations (see below).
• Isothermal titration calorimeter: An instrument that measures the heat produced or consumed by the reaction to determine the endpoint. Used in biochemical titrations, such as the determination of how substrates bind to enzymes.
• Thermometric titrimetry: Differentiated from calorimetric titrimetry because the heat of the reaction (as indicated by temperature rise or fall) is not used to determine the amount of analyte in the sample solution. Instead, the endpoint is determined by the rate of temperature change.
• Spectroscopy: Used to measure the absorption of light by the solution during titration if the spectrum of the reactant, titrant or product is known. The concentration of the material can be determined by Beer's Law.
• Amperometry: Measures the current produced by the titration reaction as a result of the oxidation or reduction of the analyte. The endpoint is detected as a change in the current. This method is most useful when the excess titrant can be reduced, as in the titration of halides with Ag+.

### Endpoint and equivalence point

Though the terms equivalence point and endpoint are often used interchangeably, they are different terms. Equivalence point is the theoretical completion of the reaction: the volume of added titrant at which the number of moles of titrant is equal to the number of moles of analyte, or some multiple thereof (as in polyprotic acids). Endpoint is what is actually measured, a physical change in the solution as determined by an indicator or an instrument mentioned above.[40]

There is a slight difference between the endpoint and the equivalence point of the titration. This error is referred to as an indicator error, and it is indeterminate.[41]

### Back titration

Back titration is a titration done in reverse; instead of titrating the original sample, a known excess of standard reagent is added to the solution, and the excess is titrated. A back titration is useful if the endpoint of the reverse titration is easier to identify than the endpoint of the normal titration, as with precipitation reactions. Back titrations are also useful if the reaction between the analyte and the titrant is very slow, or when the analyte is in a non-soluble solid.[42]

## Graphical methods

The titration process creates solutions with compositions ranging from pure acid to pure base. Identifying the pH associated with any stage in the titration process is relatively simple for monoprotic acids and bases. The presence of more than one acid or base group complicates these computations. Graphical methods,[43] such as the equiligraph,[44] have long been used to account for the interaction of coupled equilibria. These graphical solution methods are simple to implement, however they are used infrequently.

## Particular uses

### Acid–base titrations

• For biodiesel fuel: waste vegetable oil (WVO) must be neutralized before a batch may be processed. A portion of WVO is titrated with a base to determine acidity, so the rest of the batch may be neutralized properly. This removes free fatty acids from the WVO that would normally react to make soap instead of biodiesel fuel.[45]
• Kjeldahl method: a measure of nitrogen content in a sample. Organic nitrogen is digested into ammonia with sulfuric acid and potassium sulfate. Finally, ammonia is back titrated with boric acid and then sodium carbonate.[46]
• Acid value: the mass in milligrams of potassium hydroxide (KOH) required to titrate fully an acid in one gram of sample. An example is the determination of free fatty acid content.
• Saponification value: the mass in milligrams of KOH required to saponify a fatty acid in one gram of sample. Saponification is used to determine average chain length of fatty acids in fat.
• Ester value (or ester index): a calculated index. Ester value = Saponification value – Acid value.
• Amine value: the mass in milligrams of KOH equal to the amine content in one gram of sample.
• Hydroxyl value: the mass in milligrams of KOH corresponding to hydroxyl groups in one gram of sample. The analyte is acetylated using acetic anhydride then titrated with KOH.

### Redox titrations

• Winkler test for dissolved oxygen: Used to determine oxygen concentration in water. Oxygen in water samples is reduced using manganese(II) sulfate, which reacts with potassium iodide to produce iodine. The iodine is released in proportion to the oxygen in the sample, thus the oxygen concentration is determined with a redox titration of iodine with thiosulfate using a starch indicator.[47]
• Vitamin C: Also known as ascorbic acid, vitamin C is a powerful reducing agent. Its concentration can easily be identified when titrated with the blue dye Dichlorophenolindophenol (DCPIP) which becomes colorless when reduced by the vitamin.[48]
• Benedict's reagent: Excess glucose in urine may indicate diabetes in a patient. Benedict's method is the conventional method to quantify glucose in urine using a prepared reagent. During this type of titration, glucose reduces cupric ions to cuprous ions which react with potassium thiocyanate to produce a white precipitate, indicating the endpoint.[49]
• Bromine number: A measure of unsaturation in an analyte, expressed in milligrams of bromine absorbed by 100 grams of sample.
• Iodine number: A measure of unsaturation in an analyte, expressed in grams of iodine absorbed by 100 grams of sample.

### Miscellaneous

• Karl Fischer titration: A potentiometric method to analyze trace amounts of water in a substance. A sample is dissolved in methanol, and titrated with Karl Fischer reagent. The reagent contains iodine, which reacts proportionally with water. Thus, the water content can be determined by monitoring the electric potential of excess iodine.[50]

## References

1. Whitney, W.D.; Smith, B.E. (1911). "Titrimetry". The Century Dictionary and Cyclopedia. The Century Co. p. 6504.
2. Compendium for Basal Practice in Biochemistry. Aarhus University. 2008.
3. "Titrand". Science & Technology Dictionary. McGraw-Hill. Retrieved 30 September 2011.
4. Ortolang: "titre" (in French): "4. a) 1543 tiltre « proportion d'or ou d'argent dans les monnaies, dans les ouvrages d'or et d'argent » " (tiltre: proportion of gold or silver in monies, in works of gold or silver)
5. Etymology On Line: titrate
6. WordReference: titre and titer
7. Gay-Lussac (1828). "Essai des potasses du commerce" [Assays of commercial potash]. Annales de Chimie et de Physique. 2nd series (in French). 39: 337–368. In footnote (1) of p. 340, Gay-Lussac first uses titre as a verb: "Il leur serait plus facile de titrer l'acide sulfurique normal au moyen du carbonate de soude ou de potasse pur; … " ([In determining the concentration of sulfuric acid] it would be easier for them to titrate normal sulfuric acid by means of pure sodium or potassium carbonate; … )
8. Szabadváry, Ferenc (1993). History of Analytical Chemistry. Taylor & Francis. pp. 208–209. ISBN 2-88124-569-2.
9. Descroizilles (1795). "Description et usages du Berthollimêtre, …" [Description and uses of the Berthollimeter, …]. Journal des Arts et Manufactures (in French). 1: 256–276.
10. Wisniak, Jaime (2014). "François Antoine Henri Descroizilles". Revista CENIC Ciencias Químicas. 45 (1): 184–193.
11. Gay-Lussac (1824). "Instruction sur l'essai du chlorure de chaux" [Instructions on the assaying of chlorinated lime]. Annales de chimie et de physique. 2nd series (in French). 26: 162–175. On pp. 170–171, Gay-Lussac describes various figures that appear in a plate (illustration) that accompanies the article. From p. 170: " F, petite mesure ou pipette de 2 ½ centimètres cubes, … " ( F, small measure or "pipette" of 2 ½ cc., … ) From p. 171: " I, burette destinée à mesurer la teinture d'épreuve: … " ( I, "burette" intended to measure the test dye: … )
12. Henry, O. (1845). "Nouvelles expériences sur l'essai des potasses du commerce et appareil dit potassimètre pour l'effectuer" [New experiments on the assay of commercial potash and an apparatus called a "potassimeter" to perform it]. Journale de Pharmacie et de Chimie. 3rd series (in French). 7: 214–222. A sketch of Henry's burette appears on p. 218.
13. See:
14. Rosenfeld, L. (1999). Four Centuries of Clinical Chemistry. CRC Press. pp. 72–75. ISBN 90-5699-645-2.
15. Mohr, Karl Friedrich (1855). Lehrbuch der chemisch-analytischen Titrirmethode … , part 1 [Textbook of analytical chemistry titration methods …] (in German). Braunschweig, (Germany): Friederich Vieweg und Sohn. p. 2–20. Page 3 shows Mohr's burette; page 12 shows a burette with a glass stopcock (Glasshahn).
16. Harris, D.C. (2007). Quantitative Chemical Analysis (7 ed.). W. H. Freeman and Company. pp. 12. ISBN 9780716770411.
17. Matar, S.; L.F. Hatch (2001). Chemistry of Petrochemical Processes (2 ed.). Gulf Professional Publishing. ISBN 0-88415-315-0.
18. Verma, Dr. N.K.; S.K. Khanna; Dr B. Kapila. Comprehensive Chemistry XI. New Dehli: Laxmi Publications. pp. 642–645. ISBN 81-7008-596-9.
19. Patnaik, P. (2004). Dean's Analytical Chemistry Handbook (2 ed.). McGraw-Hill Prof Med/Tech. pp. 2.11–2.16. ISBN 0-07-141060-0.
20. Walther, J.V. (2005). Essentials of Geochemistry. Jones & Bartlett Learning. pp. 515–520. ISBN 0-7637-2642-7.
21. Reger, D.L.; S.R. Goode; D.W. Ball (2009). Chemistry: Principles and Practice (3 ed.). Cengage Learning. pp. 684–693. ISBN 0-534-42012-5.
22. Bewick, S.; J. Edge; T. Forsythe; R. Parsons (2009). CK12 Chemistry. CK-12 Foundation. pp. 794–797.
23. "pH measurements with indicators". Retrieved 29 September 2011.
24. "Titrating Soluble RM, R2NM and ROM Reagents" (PDF). Retrieved 2014-06-04.
25. "Methods for Standardizing Alkyllithium Reagents (literature through 2006)" (PDF). Retrieved 2014-06-04.
26. Quantitative Chemical Analysis, 7Ed. by Daniel C. Harris. Freeman and Company 2007.
27. Skoog, D.A.; West, D.M.; Holler, F.J. (2000). Analytical Chemistry: An Introduction, seventh edition. Emily Barrosse. pp. 265-305. ISBN 0-03-020293-0.
28. Henry, N.; M.M. Senozon (2001). The Henderson-Hasselbalch Equation: Its History and Limitations. Journal of Chermical Education. pp. 1499–1503.
29. Vogel, A.I.; J. Mendham (2000). Vogel's textbook of quantitative chemical analysis (6 ed.). Prentice Hall. p. 423. ISBN 0-582-22628-7.
30. Amerine, M.A.; M.A. Joslyn (1970). Table wines: the technology of their production. 2 (2 ed.). University of California Press. pp. 751–753. ISBN 0-520-01657-2.
31. German Chemical Society. Division of Analytical Chemistry (1959). Fresenius' Journal of Analytical Chemistry (in German). 166-167. University of Michigan: J.F. Bergmann. p. 1.
32. Hänsch, T.W. (2007). Metrology and Fundamental Constants. IOS Press. p. 568. ISBN 1-58603-784-6.
33. "Gas phase titration". Bureau International des Poids et Mesures. Retrieved 29 September 2001.
34. DeMore, W.B.; M. Patapoff (September 1976). "Comparison of Ozone Determinations by Ultraviolet Photometry and Gas-Phase Titration". Environmental Science & Technology. 10 (9): 897–899. Bibcode:1976EnST...10..897D. doi:10.1021/es60120a012.
35. Khopkar, S.M. (1998). Basic Concepts of Analytical Chemistry (2 ed.). New Age International. pp. 63–76. ISBN 81-224-1159-2.
36. Somasundaran, P. (2006). "Calculation of Zeta-Potentials from Electrokinetic Data". Encyclopedia of Surface and Colloid Science (2 ed.). CRC Press. 2: 1097. ISBN 0-8493-9607-7.
37. Dukhin, A.S. and Goetz, P.J. "Characterization of liquids, nano- and micro- particulates and porous bodies using Ultrasound", Elsevier, 2017 "ISBN 978-0-444-63908-0"
38. Decker, J.M. (2000). Introduction to immunology. Eleventh Hour (3 ed.). Wiley-Blackwell. pp. 18–20. ISBN 0-632-04415-2.
39. "Titration". Science & Technology Encyclopedia. McGraw-Hill. Retrieved 30 September 2011.
40. Harris, D.C. (2003). Quantitative Chemical Analysis (6 ed.). Macmillan. p. 129. ISBN 0-7167-4464-3.
41. Hannan, H.J. (2007). Technician's Formulation Handbook for Industrial and Household Cleaning Products. Lulu.com. p. 103. ISBN 0-615-15601-0.
42. Kenkel, J. (2003). Analytical Chemistry for Technicians. 1 (3 ed.). CRC Press. pp. 108–109.
43. "The Equligraph: Revisiting an old tool". Retrieved 4 October 2015.
44. Freiser, H. (1963). Ionic Equilibria in Analytical Chemistry. Kreiger. ISBN 0-88275-955-8.
45. Purcella, G. (2007). Do It Yourself Guide to Biodiesel: Your Alternative Fuel Solution for Saving Money, Reducing Oil Dependency, Helping the Planet. Ulysses Press. pp. 81–96. ISBN 1-56975-624-4.
46. Remington: the science and practice of pharmacy. 1 (21 ed.). Lippincott Williams & Wilkins. 2005. p. 501. ISBN 0-7817-4673-6.
47. Spellman, F.R. (2009). Handbook of Water and Wastewater Treatment Plant Operations (2 ed.). CRC Press. p. 545. ISBN 1-4200-7530-6.
48. Biology. 3. London: Taylor & Francis. 1967. p. 52.
49. Nigam (2007). Lab Manual Of Biochemistry. Tata McGraw-Hill Education. p. 149. ISBN 0-07-061767-8.
50. Jackson, M.L.; P. Barak (2005). Soil Chemical Analysis: Advanced Course. UW-Madison Libraries Parallel Press. pp. 305–309. ISBN 1-893311-47-3.


text:
# Area of a triangle

8 posts / 0 new
Engr Jaydee
Area of a triangle

In square $ABCD$, $E$ is the midpoint of side $\overline{AB}$ and $F$ is a point of side $\overline{AD}$ such that $F$ is twice as near from $D$ as from $A$. $G$ is the intersection of the line segments $\overline{DE}$ and $\overline{CF}$. If $AB = 1\text{ cm}$, find the area of $\triangle CDG$.

There are several ways to solve this problem, please show your solutions.

Rate:
alidoandrei28

I used analytic geometry to get the equation of the lines DE and CF. Thus,

DE: (0,0) (0.5,0.5)
equation: y = x

FC: (0,1/3) (1,0)
equation: y = 1/3 - (1/3)x

Then, I get the point of intersection; (0.25,0.25)

After that, I used integral calculus to solve for the area using horizontal strip.

\$[(1-3y) - y]dy from 0 to 0.25 = 0.125

Thus, the area of triangle CDG = 0.125 cm^2

-please correct me if I'm wrong. Thanks!

Rate:
Angkol-Awin

alidoandrei28

Please Check again your coordinates of line DE: (0,0) , must be (0.5,1).

Rate:
Engr Jaydee

Hi alidoandrei28,

The coordinates of E should be (1/2, 1) instead of (1/2, 1/2). The rest of the solutions will be correct if this is considered. :)

Rate:

Yes. Using the area of triangle for 2 sides and included angle, or Heron's formula for three sides. The answer is 0.14 cm2.
Solution:
Square ABCD, given 1cm for each side
Line EB=Line EA=1/2cm
Line FD=1/3cm
Line AF=2/3cm
Right Triangle BCE: By Pythagorean theorem, Line CE=square root of 1.25 or 1.12 (2 decimal place). Using tangent function, the other 2 angle (C & E) could be determined and that is 26.6 deg. and 63.4 deg. respectively.
Right Triangle ADE: the same procedure as in triangle BCE to establish angle E & D.
Right Triangle CDF: the same procedure as in triangle BCE & ADE to establish angle C.
Triangle CEG: Angle E=180-63.4-63.4= 53.2; Angle C=90-26.6-18.4= 45; Angle G=180-98.2= 81.8; Now using sine law, line CG & EG could be solved.
Triangle CDG: 3 interior angle already been established (Angle C, D & G = 18.4, 63.4 & 98.2 respectively).
Hence, area of triangle CDG could be solved using area of triangle as mentioned above.

Rate:
Engr Jaydee

The answer and solution is correct, although I think it can shortened further.

You can find angles EDC and FCD by using the tangent function, and then proceed to getting the area of triangle CDG using the formula $$A=\frac{a^2 \sin \beta \sin \gamma}{2 \sin \alpha}$$

Rate:
Angkol-Awin

Rate:
Engr Jaydee

Yes, this is correct. :)

Rate: