Making Tables with LaTeX

Tables are used to display information visually for a reader. They provide structure for the text in order to guide the comprehension of the reader. In this post, we will learn how to make basic tables.

Basic Table

For a beginner, the coding for developing a table is somewhat complex. Below is the code followed by the actual table. We will examine the code after you see it.

\documentclass{article}
\begin{document}
   \begin{tabular}{ccc}
      \hline
      Vegetables & Fruits & Nuts\\
      \hline
      lettace & mango & almond\\
      spinach & apple & cashews\\
      \hline
   \end{tabular}
\end{document}

1

We will now go through the code.

  • Line 1 is the preamble and tells LaTeX that we are making an article document class.
  • Line 2 is the declaration  to begin the document environment
  • Line 3 is where the table begins.  We create a tabular environment. IN the second set of curly braces we used the argument “ccc” this tells LaTeX to create 3 columns and each column should center the text. IF you wan left justification to use “l” and “r” for right justification
  • Line 4 uses the “\hline” declaration this draws the top horizontal line
  • Line 5 includes information for the first row of the columns. The information in the columns is separated by an ampersand ( & ) at the end of this information you use a double forward slash ( \\ ) to make the next row
  • Line 6 is a second “\hline” to close the header of the table
  • Line 7 & 8 are additional rows of information
  • Line 9 is the final “\hline” this is for the bottom of the table
  • Lines 10 & 11 close the tabular environment and the document

This is an absolute basic table. We made three columns with centered text with three rows as well.

Table with Caption

A table almost always has a caption in academics. The caption describes the contents of the table. We will use the example above but we need to add several lines of code. This is described below

  • We need to create a “table” environment. We will wrap this around the “tabular” environment
  • We need to use the “\caption” declaration with the name of the table inside curly braces after we end the “tabular” environment but before we end the table environment.
  • We will also add the “\centering” declaration near the top of the code so the caption is directly under the table

Below is the code followed by the example.

\documentclass{article}
\begin{document}
   \begin{table}
      \centering
      \begin{tabular}{ccc}
         \hline
            Vegetables & Fruits & Nuts\\
         \hline
            lettace & mango & almond\\
            spinach & apple & cashews\\
         \hline
      \end{tabular}
         \caption{Example Table}
   \end{table}
\end{document}

1.png

Conclusion

We explored how to develop a basic table in LaTeX. There are many more features and variations to how to do this. This post just provides some basic ideas on how to approach this.

Advertisements

Solving a System of Equations with Matrices: 2 Variables

This post will provide examples of solving a system of equations with 2 variables. The primary objective of using a matrix is to perform enough row operations until you achieve what is called row-echelon form. Row-echelon form is simply having ones all across the diagonal from the top left to the bottom right with zeros underneath the dia. Below is a picture of what this looks like

1.png

It is not necessary to have ones in the diagonal it simply preferred when possible. However, you must have the zeros underneath the diagonal in order to solve the system. Every zero represents a variable that was eliminated which helps in solving for the other variables.

Two-Variable System of Equations

Our first system is as follows

3x + 4y = 5
x + 2y = 1

Here is our system

1

Generally, for a 2X3 matrix, you start in the top left corner with the goal of converting this number into a 1.Then move to the second row of the first column and try to make this number a 0. Next, you move to the second column second row and try to make this a 1.

With this knowledge, the first-row operation we will do is flip the 2nd and 1st row. Doing this will give us a 1 in the upper left spot.

1.png

Now we want in the bottom left column where the 3 is currently at. To do this we need to multiply row 1 by -3 and then add row 1 to row 2. This will give us a 0.

1

We now need to deal with the middle row, bottom number, which is -2. To change this into a 1 we need to multiple rows to by the reciprocal of this which is -1/2.

1

If you look closely you will see that we have achieved row-echelon form. We have all 1s in the diagonal and only 0s under the diagonal.

Our new system of equations looks like the following

1x + 2y = 1
0x +1y = -1 or y = -1

If we substitute -1 for y in our top equation we can solove for x.

1

We now know that x = 3 and y = -1. This indicates that we have solved our system of equations using matrices and row operations.

Conclusion

Using matrices to solve a system of equations can be cumbersome. However, once this is mastered it can often be faster than other means. In addition, understanding matrices is critical to being able to appreciate complex machine learning algorithms that almost exclusively use matrices.

Education in Ancient Persia

The Persian Empire was one of the great empires of ancient civilization. It was this Empire that defeated the Babylonians. This post will provide a brief examination of the educational system of Persia.

Background

The religion of Persia was Zoroastrianism. The priestly class of Persia were called Magi. They responsible for sacred duties as well as the education of princes.

These are the same Magi that are found in the Bible in reference to the birth of Jesus. Due to their priestly responsibilities and knowledge of astronomy, this information merged to compel the Magi to head to Jerusalem to see Christ as a small child.

Teachers for the commoners were normally retired soliders. Exemption from the military began at the age of 50. At this age, if a male was able to live this long, he would turn his attention the education of the next generation.

What was Taught

The emphasis in Persian education was gymnastics, moral, and military training. The physical training was arduous, to say the least. Boys were pushed well nigh to their physical limits.

The moral training was also vigourously instilled. Boys were taught to have a strong understanding of right and wrong as well as a sense of justice. Cyrus the Great shared a story about how, as a boy, he was called to judge a case about coats. Apparently, a large student had a small coat and a small student had a large coat. The large student forced the small student to switch coats with him.

When Cyrus heard this story he decided that the large boy was right because both boys now had a coat that fitted him. The large boy had a large coat and the small boy had a small coat. However, Cyrus’ teacher was disappointed and beat him. Apparently, the question was not which coat fit which boy but rather which coat belonged to which boy.

Something that was neglected in ancient Persian education was basic literacy. The reading, writing, and arithmetic were taught at a minimal level. These skills were left for the Magi to learn almost exclusively.

How Was the Curriculum Organized

From the age of 0-7 education was in the home with the mother. From 7-15 boys were educated by the state and were even considered state property. After the age of 15, students spent time learning about justice in the marketplace.

Girls did not receive much of an education. Rather, they focused primarily on life in the home. This included raising small children and other domestic duties.

Conclusion

Persia education was one strongly dominated by the state. The purpose was primarily to mold boys into just, moral soldiers who could serve to defend and expand the empire. This system is not without merit as it held an empire together for several centuries. The saddest part may be the loss of individual freedom and expression at the expense of government will.

Making Diagram Trees with LaTeX

There are times when we want to depict hierarchical relationships in a diagram. Examples include workflow chart, organizational chart, or even a family tree. In such situations, the tree diagram feature in LaTeX can meet the need.

This post will provide an example of the development of a tree diagram used the tikz package. Specifically, we will make a vertical and a horizontal tree.

Vertical Tree

First I want you to see what our final product looks like before we go through each step to make it.

Screenshot 2018-04-17 09:02:18

As you can see it is a simple tree.

To develop the tree you need to setup the preamble with the following.

\documentclass{article}
\usepackage{tikz}
\begin{document}
\end{document}

There is nothing to see yet. All we did was set the documentclass to an article and load the tikz package which is the package we will use to make the tree.

The next step will be to make a tikzpicture environment. We also need to set some options for what we want our nodes to look like. A node is a created unit in a picture. In our completed example above there are 5 nodes or rectangles there. We have to set up how we want these nodes to look. You can set them individually or apply the same look for all nodes. We will apply the same look for all of our nodes using the every node/.style feature. Below is the initial setup for the nodes. Remeber this code goes after \begin{document} and before \end{document}

   \begin{tikzpicture}
      [sibling distance=10em,level distance=6em,
      every node/.style={shape=rectangle,draw,align=center}]
   \end{tikpicture}

The options we set are as follows

  • sibling distance = how far apart nodes on the same level are
  • level distance = how far apart nodes on different adjacent levels are
  • every node/.style = sets the shape and text alignment of all nodes

We are now ready to draw our tree. The first step is to draw the root branch below is the code. This code goes after the tikzpicture options but before \end{tikzpicture}.

\node{root branch};

Screenshot 2018-04-17 09:17:18

We will now draw our 1st child and grandchild. This can be somewhat complicated. You have to do the following

  • Remove the semicolon after {root branch}
  • Press enter and type child
  • make a curly brace and type node
  • make another curly brace and type 1st child and close this with a second curly brace
  • press enter and type child
  • type node and then a curly brace
  • type grandchild and close the curly braces three times
  • end with a semicolon

Below is the code followed by a picture

\node{root branch}
   child{node{1st child}
      child{node{grandchild}}};

Screenshot 2018-04-17 09:24:14

We now repeat this process for the second child and grandson. The key to success is keeping track of the curly braces and the semicolon. A Child node is always within another node with the exception of the root. The semicolon is always at the end of the code. Below is the code for the final vertical tree.

\node{root branch}
   child{node{1st child}
      child{node{grandchild}}}
   child{node{2nd child }
      child{node{grandchild}}};

Screenshot 2018-04-17 09:02:18.png

Horizontal tree

Horizontal trees follow all the same steps. To make a horizontal tree you need to add the argument “grow=right” to the options inside the brackets. Doing so and you will see the following.

Screenshot 2018-04-17 09:29:52

Conclusion

As you can see, make diagram trees is not overly complicated in LaTeX. The flexibility of the tikz package is truly amazing and it seems there are no limits to what you can develop with it for visual representations.

Augmented Matrix for a System of Equations

Matrices are a common tool used in algebra. They provide a way to deal with equations that have commonly held variables. In this post, we learn some of the basics of developing matrices.

From Equation to Matrix

Using a matrix involves making sure that the same variables and constants are all in the same column in the matrix. This will allow you to do any elimination or substitution you may want to do in the future. Below is an example

11

Above we have a system of equations to the left and an augmented matrix to the right. If you look at the first column in the matrix it has the same values as the x variables in the system of equations (2 & 3). This is repeated for the y variable (-1 & 3) and the constant (-3 & 6).

The number of variables that can be included in a matrix is unlimited. Generally,  when learning algebra, you will commonly see 2 & 3 variable matrices. The example above is a 2 variable matrix below is a three-variable matrix.

11

If you look closely you can see there is nothing here new except the z variable with its own column in the matrix.

Row Operations 

When a system of equations is in an augmented matrix we can perform calculations on the rows to achieve an answer. You can switch the order of rows as in the following.

1.png

You can multiply a row by a constant of your choice. Below we multiple all values in row 2 by 2. Notice the notation in the middle as it indicates the action performed.

1

You can also add rows together. In the example below row 1 and row 2, are summed to create a new row 1.

1

You can even multiply a row by a constant and then sum it with another row to make a new row. Below we multiply row 2 by 2 and then sum it with row 1 to make a new row 1.

1

The purpose of row operations is to provide a way to solve a system of equations in a matrix. In addition, writing out the matrices provides a way to track the work that was done. It is easy to get confused even the actual math is simple

Conclusion

System of equations can be difficult to solve. However, the use of matrices can reduce the computational load needed to solve them. You do need to be careful with how you modify the rows and columns and this is where the use of row operations can be beneficial.

Drawing Diagrams in LaTeX

There is an old saying that most of us are familiar with that says that “a picture is worth a thousand words.” Knowing means that a communicating cannot only include text but most also incorporate visuals as well. LaTeX allows you to develop visuals and diagrams using various packages for this purpose.

The visuals we will make are similar to those found in Microsoft Word Smart Graphics. One of the main advantages of using code to make diagrams is that they are within the document and you do not need to import images every single time you compile the document. If the image disappears it will not work but as long as the code is where you can always regenerate it.

In this post, we will use the “smartdiagram” package to make several different visuals that can be used in LaTeX. The types we will make are as follows…

  • Flow diagram
  • Circular diagram
  • Bubble diagram
  • Constellation diagram
  • Priority diagram
  • Descriptive diagram

The code for each individual diagram is almost the same as you will see. The preamble will only include the document class of “article” as well as the package “smartdiagram”. After this, we will create are document environment. Below is the preamble and the empty document environment.

\documentclass{article}
\usepackage{smartdiagram}
\begin{document}
\end{document}

Flow Diagram

The flow diagram is a diagram using boxes with arrows pointing from left to right in-between each box until the last box has an arrow that points back to the first bo indicating a cyclical nature. Below is  the code followed by the diagram

\smartdiagram[flow diagram:horizontal]{Step 1,Step2,Step3,Step4}

1

The syntax is simple.

  1. Call the declaration “\smartdiagram”
  2. Inside the brackets, you indicate the type of diagram which was “flow diagram: horizontal” for us.
  3. Next, you indicate how many boxes by typing the text and separating them by commas inside the curly braces.

This pattern holds for most of the examples in this post.

Circular Diagram

Below is a circular diagram. The syntax for the code is the same. Therefore, the code is below followed by the diagram

\smartdiagram[circular diagram:clockwise]{Step 1,Step2,Step3,Step4}

1.png

Bubble Diagram

The same syntax as before. Below is the code and diagram.

\smartdiagram[bubble diagram]{Step 1,Step2,Step3,Step4}

1.png

Constellation Diagram

This diagram looks similar to the bubble diagram but has arrows jutting out of the center. The syntax is mostly the same.

\smartdiagram[constellation diagram]{Step 1,Step2,Step3,Step4}

1.png

Priority Descriptive Diagram

This diagram is useful if the order matters

\smartdiagram[priority descriptive diagram]{Step1, Step2, Step3,Step4}

1.png

Descriptive Diagram

The coding for the descriptive diagram is slightly different. Instead of one set of curly braces, you have a set of curly braces within a set of curly braces within a final set of curly braces. The outer layer wraps the entire thing. The second layer is for circles in the diagram and the inner curly braces are for adding text to the rectangle. Each double set of curly braces are separated by a comma. Below is the code followed by the diagram.

\smartdiagram[descriptive diagram]{
{Step 1,{Sample text, Sample text}},
{Step2,{More text, more text}},
{Step3,{Text again, text again}},
{Step4,{Even more text}}
}

1.png

Hopefully, you can see the formatting of the code and see how everything lines up.

Conclusion

Developing diagrams for instructional purposes is common in many forms of writing. Here, we simply look at creating diagrams using LaTeX. The power of this software is the ability to create almost whatever you need for communication.

System of Equations and Mixture Application

Solving a system of equations with a mixture application involves combining two or more quantities. The general setup for the equations is as follows

Quantity * value = total

This equation is used for both equations. You simply read the problem and plug in the information. The examples in this post are primarily related to business as this is one of the more practical applications of solving a system of equations for the average person. However, a system of equations for mixtures can also be used for determining solutions but this is more common in chemistry.

Example 1: Making Food 

John wants to make 20 lbs of granola using nuts and raisins. His budget requires that the granola cost $3.80 per pound. Nuts are $4.50 per pound and raisins are $1.00 per pound. How many pounds of nuts and raisins can he use?

The first thing we need to determine what we know

  • cost of the raisins
  • cost of the nuts
  • total cost of the granola
  • number of pounds of granola to make

Below is all of our information in a table

Pounds * Price Total
Nuts n 4.50 4.5n
Raisins r 1 r
Granola 20 3.80 3.8(20) = 76

What we need to know is how many pounds of nuts and raisins can we use to have the total price per pound be $3.80.

With this information, we can set up our system of equations. We take the pounds column and create the first equation and the total column to create the second equation.

1

We will use elimination to solve this system. We will multiply the first equation by -1 and combine them. Then we solve for n as in the steps below

1.png

We know n = 16 or that we can have 16 pounds of nuts. To determine the amount of raisins we use our first equation in the system.

1.png

You can check this yourself if you desire.

Example 2: Interests

Below is an example that involves two loans with different interest rates. Our job will be to determine the principal amount of the loan.

Tom owes $43,080 on two student loans. The bank’s interest rate is 5.25% and the federal loan rate is 2.95%. The total amount of interest he paid last two years was 6678.72. What was the principal for each loan

The first thing we need to determine what we know

  • bank interest rate
  • Federal interest rate
  • time of repayment
  • Amount of loan
  • Interest paid so far

Below is all of our information in a table

Principal * Rate Time Total
Bank b 0.0525 1 0.0525b
Federal f 0.0295 1 0.0295f
Total 43080 1752.45

Below is our system of equation

1.png

To solve the system of equations we will use substitution. First, we need to solve for b as shown below

1.png

We now substitute  and solve

1

We know the federal loan is $22,141.30 we can use this information to find the bank loan amount using the first equation.

1.png

The bank loan was $20,938.70

Conclusion

Hopefully, it is clear by now that solving a system of equations can have real-world significance. Applications of this concept can be useful in the context of business as shown here.

Education in Ancient India

In this post, we take a look at India education in the ancient past. The sub-continent of India has one of the oldest civilizations in the world. Their culture has had a strong influence on both the East and West.

Background

One unique characteristic of ancient education in India is the influence of religion. The effect of Hinduism is strong. The idea of the caste system is derived from Hinduism with people being divided primarily into four groups

  1. Brahmins-teachers/religious leaders
  2. Kshatriyas-soldiers kings
  3. Vaisyas-farmers/merchants
  4. Sudras-slaves

This system was ridged. There was no moving between caste and marriages between castes was generally forbidden. The Brahmins were the only teachers as it was embarrassing to allow one’s children to be taught by another class. They received no salary but rather received gifts from their students

What Did they Teach

The Brahmins served as the teachers and made it their life work to reinforce the caste system through education. It was taught to all children to understand the importance of this system as well as the role of the  Brahmin at the top of it.

Other subjects taught at the elementary level include the 3 r’s. At the university level, the subjects included grammar, math, history, poetry, philosophy, law, medicine, and astronomy. Only the Brahmins completed formal universities studies so that they could become teachers. Other classes may receive practical technical training to work in the government, serve in the military, or manage a business.

Something that was missing from education in ancient India was physical education. For whatever reason, this was not normally considered important and was rarely emphasized.

How Did they Teach

The teaching style was almost exclusively rote memorization. Students would daily recite mathematical tables and the alphabet. It would take a great deal of time to learn to read and write through this system.

There was also the assistance of an older student to help the younger ones to learn. In a way, this could be considered as a form of tutoring.

How was Learning Organized

School began at 6-7. The next stage of learning was university 12 years later. Women did not go to school beyond the cultural training everyone received in early childhood.

Evidence of Learning

Learning mastery was demonstrated through the ability to memorize. Other forms of thought and effort were not the main criteria for demonstrating mastery.


Conclusion

Education in India serves a purpose that is familiar to many parts of the world. That purpose was social stability. With the focus on the caste system before other forms of education, India was seeking stability before knowledge expansion and personal development. This can be seen in many ways but can be agreed upon is that the country is still mostly intact after several thousand years and few can make such a claim even if their style of education is superior to India’s.

Making Presentations in LaTeX

One of the more interesting abilities of LaTeX is the ability to make presentations similar to those that are commonly made with PowerPoint. In this post, we will explore this capability of generating presentations with LaTeX

Setting Up The Preamble

The document class used for making presentations is called “beamer”. With this, you also need to set the theme of the presentation. The theme is the equivalent of a template in powerpoint. For our purposes, we will use the Singapore theme. After doing this the preamble is complete for our example

\documentclass{beamer}
\usetheme{Singapore}

Title Page

We will create the title page of the document. This involves using the “frame” environment. The code is below followed by the actual example.

\documentclass{beamer}
\usetheme{Singapore}
\begin{document}
 \title{Example Project}
  \subtitle{For Blog}
  \author{Yours Truly}
  \date{June 20, 2099}
  \begin{frame}
   \titlepage
  \end{frame}
\end{document}

1.png

Overview of Presentation

Another section that you can include is a table of contents. This will allow you to provide a big picture of what to expect in the presentation. The beamer class does not include animation so to make bullets appear LaTeX will create several slides and each slide will include one additional piece of information. This gives the appearance of animation when in fact it is a new slide. Below is the code with the additional information in bold. Unfortunately, you will not be able to see anything after this step because our example is incomplete.

\documentclass{beamer}
\usetheme{Singapore}
\begin{document}
\title{Example Project}
\subtitle{For Blog}
\author{Yours Truly}
\date{June 20, 2099}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}{Outline}
\tableofcontents[pausesections]
\end{frame}
\section{Beginning}
\section{Middle}
\section{End}

The “\section” declarations tell LaTeX what is in the table of contents.

Completed Presentation

We will now make several different slides that have some sample text. On each slide, we will use an “itemize” environment in order to create bullets. The bullets help to organize the text visually.  Below is the final code followed by several pictures of what it should look like.

\documentclass{beamer}
\usetheme{Singapore}
\begin{document}
 \title{Example Project}
 \subtitle{For Blog}
 \author{Yours Truly}
 \date{June 20, 2099}
 \begin{frame}
  \titlepage
 \end{frame}
 \begin{frame}{Outline}
  \tableofcontents[pausesections]
 \end{frame}
 \section{Beginning}
 \section{Middle}
 \section{End}
 \begin{frame}{Beginning} 
  \begin{itemize} 
   \item first point 
   \item Second point 
  \end{itemize}
 \end{frame}
 \begin{frame}{Middle} 
  \begin{itemize} 
   \item first point 
   \item Second point 
  \end{itemize}
 \end{frame}
 \begin{frame}{End} 
  \begin{itemize} 
   \item first point 
   \item Second point 
  \end{itemize}
 \end{frame}
\end{document}

1.png

1.png

1.png

Conclusion

The beamer class allows a person to develop simple efficient presentations using LaTeX. The main advantage may be speed. As you can type and add content fast simply with a few keystrokes rather than with mouse clicks. However, many people would find this cumbersome and you can do a great deal of typing using the outline view in Powerpoint. Despite this, it is good to know that LaTeX provides this feature.

Designing a Poster in LaTeX

LaTeX provides the option of being able to make posters. This can be useful for academics who often present posters at conferences in order to share their research. In this post, we will go through the development of a poster using LaTeX.

First, we will setup the preamble and title of the poster. The document class is “tikzposter” with a1paper and size 25pt font. We will use the “graphicx” package for inserting images, the “lipsum” package for dummy text, and the “multicol” package to divide the poster into columns. The theme we are using is “Rays” and is one of many available themes.

Before we begin the coding it will be beneficial if you see what the final product looks like.

1

This poster has two columns and a block along the bottom. The column 1 to the left has two blocks A and B. Block A has an inner block. In column 2, we have a block with a picture in it.

Coding

Next, we begin the document and insert the code for the title. Below is the code followed by what are document look likes so far.

\documentclass[25pt,a1paper]{tikzposter} %size is 84cmX120cm
\usepackage{graphicx}
\graphicspath{{YOUR DIRECTORY HERE}}
\usetheme{Rays} %theme of poster design
\usepackage{lipsum} %for dummy text
\usepackage{multicol}
\begin{document}
\title{This is Amazing}
\author{ERT Blogger}
\maketitle
\end{document}

1.png

Creating Columns

How you design the poster is up to you but in our example, we are going to create two columns with a horizontal block across the bottom. Column one will use 65% of the available space while column 2 will use the remaining 35%. We will not include the code for the horizontal block along the bottom yet.  For now, just look at the code and after the next step, you can copy it if you want.

\begin{columns}
%COLUMN 1
\column{.65}%use 65% of the available space for this column
%COLUMN 2
\column{.35} %last 1/3 of space
\end{columns}

Making Blocks

Inside column one, we are going to place two blocks of text called Block A and Block B. Inside each block you can design it however you want. You can even have blocks within blocks.

For Block A we will make a title, a small bit of text, a colored box with some bullets, more text, and lastly an inner-block with some math text. The \bigskip declaration provides spacing and the \lipsum declaration provides dummy text. The code is below followed by a screenshot of the current poster. This code must be placed before the \end{column} command.

\begin{columns}
%COLUMN 1
\column{.65}%use 65% of the available space for this column 
%Block A
\block{More Examples of LaTeX}{
\bigskip
You can even put stuff in colored boxes.\\
\coloredbox{\begin{itemize}
  \item Point 1
  \item point 2
\end{itemize}}
\lipsum[2]
\bigskip
\innerblock{here is some math for fun}
{\begin{center}
  $2^5+5x-\frac{2}{x} * 3= y$
  \end{center}
  }
}

1.png

Block B is much simpler and includes a title with some dummy text. The code is below.

%Block B 
\block{More Text}{\lipsum[1]}

Column 2

We will now turn our attention to column 2. This column uses the last 35% of remaining space and has a picture in it with some dummy text. Inside the column, we set up a block and include the graphic followed by the dummy text. The code is below with the image afterward. This code must be placed before the \end{column} command.

%COLUMN 2
\column{.35} %last 1/3 of space
\block{More Pictures}{
\includegraphics[width=\linewidth]{{"1"}.jpg}
\lipsum[4]
}

1.png

Final Block

We will now put a block that runs along the bottom of the poster. Just a title with some text. This code must be placed above the \end{document} command.

\block{The End}{
\lipsum[10-11]
}

1.png

Conclusion

Perhaps, you can see how cool and versatile LaTeX can be. You can make a poster for presentations that are rather beautiful and much more symmetrical than trying to draw boxes by hand using powerpoint.

Solving a System of Equations with Three Variables

A system of equations can be solved involving three variables. There are several different ways to accomplish this when three variables are involved. In this post, we will focus on the use of the elimination method.

Our initial system of equations is below

1.png

The values eq1,eq2 and eq3 just mean equation 1, 2, 3

To solve this system we need to first solve two equations as a system and create a fourth equation we will call eq4. We then take eq1 and eq3 to create a new system of equations that creates eq5.

It is important to note that for the first two two-variable system of equations you create that you eliminate the same variable it both systems. So fare our example when we take equation 1 and 2 to create equation 4 and then take equation 1 and 3 create equation 5 we must solve for y in both situations or else we will have problems. In addition, you must make sure that all three equations appear at least once in the two two-variable systems of equations. For our purpose, we will use eq1 twice and eq2 and eq3 once.

Eq4 and eq5 are used to find the actual values we need for all three variables. This will make more sense as we go through the example. Therefore, we are going to solve first for y for eq1 and eq2.
1.png

To eliminate y we need to multiple eq2 by 2 and then combine the equations. Below is the process and the new eq 4

1.png

We will come back to eq4. For now, we will create eq 5 by eliminating y from eq1 and eq3.

1

We are essentially done using equations 1, 2, and 3. They will not reappear until the end. We will now use equations 4 and 5 to find our answers for two of the three variables.

We now will use eq 4 and 5 to eliminate the variable x. Eliminating x will allow us to solve for z. Doing means we will multiply eq4 by -1.

1.png

We know z = -3 we can plug this value into either eq4 or 5 to find the answer for x.

1.png

Now that we know x and z we can plug the two numbers into one of the three original equations to find the value for y. Notice how the first variable we eliminated becomes the last one we solve for.

1.png

We now know all three values which are

(4, -1, -3)

What this means is that if we were to graph this three equations they would intersect at (4, -1, -3). A solving a system of equations is simply telling us where the lines of the equations intersect.

Conclusion

Solving a system of equations involving three variable is an extension of the two variable system that has already been covered. It provides a mathematician with a tool for solving for more unknown variables. There are practical applications of this as we shall see in the future,

Cross-Referencing with LaTeX

Cross-referencing allows you to refer to almost anything in your document automatically through the use of several LaTeX commands. This can become extremely valuable if you have to edit your document and things change. With whatever updates you make the cross-referencing is update automatically.

There are many different ways to cross-reference in LaTeX but we will look at the following.

  • Tables
  • Items in a list
  • Pages

When using cross-referencing you must compile the document twice in order for the numbers to show up. The first time you will only see question marks.

Tables

Below is an example of LaTeX referring to a table.

\documentclass{article}
\begin{document}
   In Table~\ref{Example} we have an example of a table
   \begin{table}[h]
   \begin{center}
   \begin{tabular}{ll}
      \hline
         Fruits&Vegetables\\
      \hline
         Mango&Lettuce\\
         Papaya&Kale\\
      \hline
   \end{tabular}
      \caption{Example} \label{Example}
   \end{center}
   \end{table}
\end{document}

1.png

How a table is created has been discussed previously, what is new here are two pieces of code.

  • ~\ref{  }
  • \label{ }

The “\label” declaration gives the table a label that can be used in the text. In the example, we labeled the table “Example”. The “~\ref” declaration is used in the text and you put the label name on the table inside the curly braces. If you look at the text we never use the number 1 in the text. LaTeX inserts this for us automatically.

The same process can be used to label images as well.

Item in List

Cross-referencing an item on a list is not that complex either. Below is an example.

\documentclass{article}
\begin{document}
   Simple list
   \begin{enumerate}
      \item Mango
      \item Papaya \label{fruit2}
      \item Apple
   \end{enumerate}
   Number \ref{fruit2} is a common fruit in tropical countries.
\end{document}

1.png

As you can see, you can label almost anything anywhere.

Referring to Pages

It is also possible to refer to pages. This can save a lot of time if you update a document and page numbers change. Below is the code and example.

\documentclass{article}
\begin{document}
 Simple list \label{list}
 \begin{enumerate}
    \item Mango
    \item Papaya \label{fruit2}
    \item Apple
 \end{enumerate}
Number \ref{fruit2} in the list on page~\pageref{list} 
is a common fruit in tropical countries.
\end{document}

1.png

We made a label right above our list and then we used the “~\pageref” declaration with the name of the label inside. This provides us with the page number automatically.

Conclusion

There are more complex ways to cross-reference. However, unless you are developing a really complex document they are not really necessary for most practical applications. The ideas presented here will work in most instances as they are.

System of Equations and Uniform Motion

This post will provide examples of the use of a system of equations to solve uniform motion applications. A system of equations is used to solve for more than one variable. In the context of uniform motion, the basic equation is as follows

distance  = rate * time

We will look at the following examples

  • Two objectives moving in the same direction
  • Affect of a headwind/tailwind

Objects Moving in the Same Directions

Below is the problem followed by the solution.

Dan leaves home and travels to Springfield at 100 kph. About 30 minutes later Sue leaves the house and also travels the same way to Springfield driving 125 kph. How long will it take Sue to catch Dan?

The easiest way to solve this is to create a table with all of the information we have. The table is below.

Names Rate * Time = Distance
Dan 100 j 100j
Sue 125 k 125k

We first need to recognize that they will drive the same distance this leads to one of our equations

1.png

However, we are not done. We also need to realize that Sue leaves half an hour later, which leads to the second equation

1.png

We can now solve our system of equations

1

We know Dan travels for 2.5 hours before Sue catches him but we need to determine how long Sue drives before she catches Dan. We will take our answer J and plug it into the original equation for k.

1

It will take Sue 2 hours to catch up with Dan.

Affect of a Headwind/Tailwind

In transportation, it is common for a plan or ship to be able to travel faster with a tailwind or downstream than with a headwind or upstream The example below shows you how to determine the speed needed to travel a certain distance in the same amount of time as well as the speed of the wind/current.

A plane can travel 548 miles in 1.5 hours with a tailwind but only 494 hours when flying into a headwind. Find the speed of the plane and the wind.

We will have two variables because there are two things we want to know

  • p = the speed of the plane
  • w = the speed of the wind

The tailwind makes the plane go faster, therefore, the speed of the plane will be the plane speed + the wind speed

The tailwind slows the plane down. Therefore, the tailwind will be the speed of the plane minus the windspeed.

Below is a table with all of the available information

Rate * Time = Distance
Tailwind p + w 1.5 548
Headwind p – w 1.5 494

The initial system of equations is as follows

1

To solve this system of equations we will use the elimination method as shown below.

1.png

The plane travels 347.33 mph. We now take the value of p plug it into one of our equations to find the speed of the wind.

1.png

The speed of the wind is 18 mph. We know the plane travels 347 + 18 = 365 mph with a tailwind and 347-18 = 329mph with a headwind.

Conclusion

A system of equations is proven to have a practical application. The assumption of a uniform speed is somewhat unrealistic in most instances. However, this assumption simplifies the calculation and prepares us for more complex models in the future.

Review of “Marie Curie’s: Search for Radium”

This post is a review of the children’s book Marie Curie’s Search for Radium (Science Stories) by Beverly Birch and Christian Birmingham (pp. 40).

The Summary

As you can surmise from the title, this book focuses specifically on Marie Curie’s discovery of Radium. As such, the text skips most of the life of Marie such as her childhood, early education, and even any insight into her marriage and children.

The book begins with Marie being interested in X-rays. Through her study of X-rays Marie finds out about rays that come from uranium. This led Marie to wonder if other elements emit electricity. She decides to test this with the help of her husband’s electrometer.

She soon begins to find other elements that emit electricity in the air. She calls this rays radiation or radioactive rays. Eventually, she discovers two new elements polonium and radium. To find these elements she had to sift through huge amounts of pitchblende a mineral in order to concentrate the radium or polonium. Radium is million times more radioactive than uranium. As such, Marie was actually slowly poisoning herself through her research.

After years of work, Marie had a thimble size amount of radium to share with the world. The blue liquid actually glows in the dark. Another sign of how dangerous it was without Marie knowing.

The Good

The visuals have an impressionistic feel to them. In many ways, a younger child can determine what is happening just from looking at the pictures.

The Bad

The book seems to narrowly focus. Marie’s husband comes out of nowhere as if she was magically married somehow. In addition, the book leaves out some of Marie’s most impressive achievements such as the fact that she won two Nobel Prizes. In fact, Marie first Noble Prize was shared with her husband and Antoine Becquerel. It was the research done with Becquerel that led to Marie’s future work with radium and a second Nobel Prize. This is never stated in the text. A passing reference is enough for such monumental achievements

The Recommendation

This book would be a reasonable read for older elementary students. However, the book need will require supplemental materials and or instruction in order for the students to truly understand the impact and influence Marie Curie had in science.

Insert Images into a LaTeX Document

We have all heard that a picture is worth a thousand words. Images help people to understand concretely what a writer is trying to communicate with text. In this post, we will look at how to include images inside documents prepared with LaTeX.

Basic Example

One way to include an image is to use the “graphicx” package and to set the path for where the image is using the “\garphicspath” declaration in the preamble of a LaTeX document. Below is an example. Included in the example is the “babel” and “blindtext” packages to create some filler text.

\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{graphicx}
\graphicspath{ {PUT THE PATH HERE} }
\begin{document}
\blindtext

\includegraphics[scale=.1]{1.jpg}

\blindtext
\end{document}

1

Inside the actual document we use the following declaration

\includegraphics[scale=.1]{1.jpg}

“\includegraphics” is the declaration. The “scale” argument reduces the size of the image. The information in the curly braces is the name of the actual file. You can see that our print out is rather ugly and needs refinement.

Adding a Caption

One thing our picture needs is a caption that describes what it is. This can be done by first creating a figure environment, placing the “\includegraphics” declaration inside it, and using the “\caption” declration. Below is an example. We will also center the image for aesthetic reasons as well.

\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{graphicx}
\graphicspath{ {PUT THE PATH HERE} }
\begin{document}
\blindtext

\begin{figure}
\centering
\includegraphics[scale=.1]{1.jpg}
\caption{Using Images in \LaTeX}
\end{figure}

\blindtext
\end{document}

1.png

We created a figure environment added our image and type a caption. LaTeX automatically added “Figure 1” to the image. In addition,  you can see that the picture moved to the top of the page. This is because environments are able to float to the best position on a page as determined by calculations made by LaTeX.

If you want the image to appear in a particular place you can add the optional arguments h,t,b,p next to the “\begin{figure}” declaration. h =  here, t = top, b = bottom, and p = separate page.

To get rid of floating use the package called “capt-of”  and the declaration “\captionof{figure or table}{name here}}”. This will freeze the image in place so that it does not move all over the place as you add content to your document. Below is the same example but using the “capt-of” package.

\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{graphicx}
\graphicspath{ {PUT PATH HERE} }
\usepackage{capt-of}
\begin{document}
\blindtext

\begin{center}
\includegraphics[scale=.1]{1.jpg}
\captionof{figure}{Using Images in \LaTeX}
\end{center}

\blindtext
\end{document}

1

This is almost like our first example except now we have a caption. We did have to create a center environment but this type of environment does not float.

Wrapping Figures

The last example is wrapping text around a figure. For this, you need the “wrapfig” package and you need to create an environment with the “Wrapfigure” command. You also must indicate where the figure should be to the left (l),  center (c), or to the right (r). Lastly, you need to indicate the width of the figure. Below is the code followed by the results.

\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{graphicx}
\graphicspath{ {/home/darrin/Downloads/} }
\usepackage{wrapfig}
\begin{document}
\blindtext

\begin{wrapfigure}{r}{7.8cm}
\includegraphics[scale=.1]{1.jpg}
\caption{Using Images in \LaTeX}
\end{wrapfigure}

\blindtext
\end{document}

1.png

In the example above, we moved the image to the left. For the width, you have to guess several times so that all of the text appears next to the figure rather than behind it.

Conclusion

This post provided several practical ways to include images in a LaTeX document. With this amount of control, you are able to make sophisticated documents that are consistently reproduced.

Solving a System of Equations with Direct Translation

In this post, we will look at two simple problems that require us to solve for a system of equations. Recall that a system of equations involves two or more variables that must be solved. With each problem, we will use the direct translation to set up the problem so that it can be solved.

Direct Translation 

Direct translation involves reading a problem and translating it into a system of equations. In order to do this, you must consider the following steps

  1. Determine what you want to know
  2. Assigned variables to what you want to know
  3. Setup the system of equations
  4. Solve the system

Example `1

Below is an example  followed by a step-by-step breakdown

The sum of two numbers is zero. One number is 18 less than the other. Find the numbers.

Step 1: We want to know what the two numbers are

Step 2: n = first number & m =  second number

Step 3: Set up system

1

Solving this is simple we know n = m – 18 so we plug this into the first equation n + m = 0  and solve for m.

1.png

Now that we now m we can solve for n in the second equation

1.png

The answer is m = 9 and n = -9. If you add these together they would come to zero and meet the criteria for the problem.

Example 2

Below is a second example involving a decision for salary options.

Dan has been offered two options for his salary as a salesman. Option A would pay him $50,000 plus $30 for each sale he closes. Option B would pay him $35,000 plus $80 for each sale he closes. How many sales before the salaries are equal

Step 1: We want to know when the salaries are equal based on sales

Step 2: d =  Dan’s salary & s = number of sales

Step 3: Set up system

1.png

To solve this problem we can simply substitute d  for one of the salaries as shown below

1

You can check to see if this answer is correct yourself. In order for the two salaries to equal each other Dan would need to sale 300 units. After 300 units option B is more lucrative. Deciding which salary option to take would probably depend on how many sales Dan expects to make in a year.

Conclusion

Algebraic concepts can move beyond theoretical ideas and rearrange numbers to practical applications. This post showed how even something as obscure as a system of equations can actually be used to make financial decisions.

Review of “Eric the Red & Leif the Lucky”

This post is a review of the book Eric the Red and Leif the Lucky by Barbara Schiller (pp. 48).

The Summary

This book covers the lives of Eric the Red and his son Leif the Lucky. Eric was a hot-tempered Viking who was banished from Iceland for murdering a man. Since he had to leave Eric decided to explore a mysterious land to the west of Iceland.

Upon his arrival, Eric explores this new land and see that this could be a place to live. After several years of exploration, Eric gives the land a name. For marketing purposes, Eric calls the place Greenland and returns to Iceland to try and convince people to come to the new country. With famine and poverty afflicting many people it was not hard to get some people to come.

From here, the book moves to focus on Eric the Red’s son Leif the Lucky. Leif was also an explorer like his father. One day, Leif hears of a strange land further to the west of Greenland. Leif decides to go and find this land for himself.

After several days of travel, Leif and his team find the new land. He arrives at the beginning of the 11th century 500 years before Columbus came to America. The men landed somewhere in what is today Canada and set up temporary living quarters and began exploring the land.

Leif decided to call this land Vinland. Vin means grapes and he named the country this because they discovered grapes in the area. After filling their boat with cargo to sail, Leif returns to Greenland to tell others and his father about Vinland.

The Vikings tried to return to Vinland (America). However, the Indians were waiting for them and fighting between the two groups made it impossible for the Vikings to stay on a permanent basis. Leif never returned to America as he became the leader of Greenland when his father Eric the Red died.

The Good

This text is highly informative and provides students with some basic understanding of the men who came to America so long ago. The black and white illustrations are also interesting as they portray Vikings in a highly traditional manner which is in a position of strength and dominance.

The Bad

The text is tough for a child to read. Therefore, they would probably need help with the reading. There also might be issues with relevance as a child would try to figure out how to connect with a story of Vikings finding America.

The Recommendation

This book would be great for older children. In addition, if it can be integrated into the learning of the students it could help with the relevancy issue. It would be somewhat unusual for a kid to pick this book up and read it for its own value but as part of an assignment/project, this text is excellent.

Prerequistes to Conducting Research

Some of the biggest challenges in helping students with research is their lack of preparation. The problem is not an ignorance of statistics or research design as that takes only a little bit of support. The real problem is that students want to do research without hardly reading any research and lacking knowledge of how research writing is communicated. This post will share some prerequisites to performing research.

Read Extensively

Extensive reading means reading broadly about a topic and not focusing too much on specifics. Therefore, you read indiscriminately perhaps limited yourself only to your general discipline.

In order to communicate research, you must first be familiar with the vocabulary and norms of research. This can be learned to a great extent through reading academic empirical articles.

The ananoloy I like to use is how a baby learns. By spends large amounts of time being exposed to the words and actions of others. The baby has no real idea in terms of what is going on at first. However, after continuous exposure, the child begins to understand the words and actions fo those around them and even begins to mimic the behaviors.

In many ways, this is the purpose of reading a great deal before even attempting to do any research. Just as the baby, a writer needs to observe how others do things, continue this process even if they do not understand, and attempt to imitate the desired behaviors. You must understand the forms of communication as well as the cultural expectations of research writing and this can only happen through direct observation.

At the end of this experience, you begin to notice a pattern in terms of the structure of research writing. The style is highly ridge with litter variation.

It is hard to say how much extensive reading a person needs. Generally, the more reading that was done in the past the less reading needed to understand the structure of research writing. If you hate to read and did little reading in the past you will need to read a lot more to understand research writing then someone with an extensive background in reading. In addition, if you are trying to write in a second language you will need to read much more than someone writing in their native language.

If you are still desirous of a hard number of articles to read I would say aim for the following

  • Native who loves to read-at least 25 articles
  • Native who hates to read-at least 40 articles
  • Non-native reader-60 articles or more

Extensive reading is just reading. There is no notetaking or even highlighting. You are focusing on exposure only. Just as the observant baby so you are living in the moment trying to determine what is the appropriate behavior. If you don’t understand you need to keep going anyway as the purpose is quantity and not quality. Generally, when the structure of the writing begins to become redundant ad you can tell what the author is doing without having to read too closely you are ready to move on.

Read Intensively

Intensive reading is reading more for understanding. This involves slows with the goal of deeper understanding. Now you select something, in particular, you want to know. Perhaps you want to become more familiar with the writing of one excellent author or maybe there is one topic in particular that you are interested in. With intensive writing, you want to know everything that is happening in the text. To achieve this you read fewer articles and focus much more on quality over quantity.

By the end of the extensive and intensive reading, you should be familiar with the following.

  • The basic structure of research writing even if you don’t understand why it is the way it is.
  • A more thorough understanding of something specific you read about during your intensive reading.
  • Some sense of purpose in terms of what you need to do for your own writing.
  • A richer vocabulary and content knowledge related to your field.

Write Academicly

Once a student has read a lot of research there is some hope that they can now attempt to write in this style. As the teacher, it is my responsibility to point out the structure of research writing which involves such as ideas as the 5 sections and the parts of each section.

Students grasp this but they often cannot build paragraphs. In order to write academic research, you must know the purpose of main ideas, supporting details, and writing patterns. If these terms are unknown to you it will be difficult to write research that is communicated clearly.

The main idea is almost always the first sentence of a paragraph and writing patterns provide different ways to organize the supporting details. This involves understanding the purpose of each paragraph that is written which is a task that many students could not explain. This is looking at writing from a communicative or discourse perspective and not at a minute detail or grammar one.

The only way to do this is to practice writing. I often will have students develop several different reviews of literature. During this experience, they learn how to share the ideas of others. The next step is developing a proposal in which the student shares their ideas and someone else’s. The final step is writing a formal research paper.

Conclusion

To write you must first observe how others write. Then you need to imitate what you saw. Once you can do it what others have done it will allow you to ask questions about why things are this way. Too often, people just want to write without even understanding what they are trying to do. This leads to paralysis at best (I don’t know what to do) to a disaster at worst (spending hours confidently writing garbage). The enemy to research is not methodology as many people write a lot without knowledge of stats or research design because they collaborate. The real enemy of research is neglecting the preparation of reading and the practicing of writing.

Solving a System of Equations by Substitution and Elimination

A system of equations involves trying to solve for more than one variable. What this means is that a system of equations helps you to see how to different equations relate or where they intersect if you were to graph them.

There are several different ways to solve a system of equations. In this post, we will solve y using the substitution and the elimination methods.

Substitution

Substitution involves choosing one of the two equations and solving for one variable. Once this is done we substitute the expression into the equation for which we did not solve a variable for. When this is done the second equation only has one unknown variable and this is basic algebra to solve.

The explanation above is abstract so here is a mathematical example

1.png

We are not done. We now need to use are x value to find our y value. We will use the first equation and replace x to find y.

1

This means that our ordered pair is (4, -1) and this is the solution to the system. You can check this answer by plugging both numbers into the x and y variable in both equations.

Elimination

Elimination begins with two equations and two variables but eliminates one variable to have one equation with one variable. This is done through the use of the addition property of equality which states when you add the same quantity to both sides of an equation you still have equality. For example 2+2 = 2 and if at 5 to both sides I get 7 + 7 = 7. The equality remains.

Therefore, we can change one equation using the addition property of equality until one of the variables has the same absolute value for both equations. Then we add across to eliminate one of the variables. If one variable is positive in one equation and negative in the other and has the same absolute value they will eliminate each other. Below is an example using the same system of equations as the previous example.

.1.png

You can take the x value and plug it into y. We already know y =1 from the previous example so we will skip this.

There are also times when you need to multiply both equations by a constant so that you can eliminate one of the variables

1.png

We now replace x with 0 in the second equation

1

Our ordered pair is (0, -3) which also means this is where the two lines intersect if they were graphed.

Conclusion

Solving a system of equations allows you to handle two variables (or more) simultaneously. In terms of what method to use it really boils down to personal choice as all methods should work. Generally, the best method is the one with the least amount of calculation.

Review “Pompeii…Buried Alive!”

This post is a review of the children’s book  Pompeii — Buried Alive! (Step into Reading) by Edith Kunhardt (pp. 48).

The Summary

This text provides the story of the eruption of Mount Vesuvius which destroyed the town of Pompeii at the base of the mountain in AD 79. The first part of the book seems to emphasize how the day of the eruption was like any other day. People were buying and selling at the market, going to the spas, visiting the temples, etc.

When the volcano initially erupts people are shocked and confused. Many people choose to flee by boarding ships to sail away from the place. For those who stayed the volcano dropped huge amounts of ash that buried almost everybody, If this did not finish someone off then the volcano dumped a huge volume of poisonous gas in the form of a pyroclastic eruption.

The disaster was seen from a distance and a boy who later became known as Pliny the Younger witnessed the events. Pliny would later write about these events which would provide historical evidence for the existence of Pompeii.

After several centuries, the original town of Pompeii is buried and forgotten and a new town was built on it. Eventually, construction workers uncover the city and archeologist descend on the site.

After doing some excavations the archeologist noticed something strange. There are many empty holes in the soil. Eventually, someone came up with the idea of dumping plaster inside them. The results were shocking. When the plaster hardens it left the impression of bodies of people in the position in which they died. It was a sobering reminder of the gruesome destruction of the volcano. Other artifacts were found such as jewelry, mosaics, and even food.

Today the original site of Pompeii is a tourist attraction.

The Good

The text is designed for young readers and it is truly simple in its writing. The illustrations are ok but a little dated.

The Bad

The author took some creative liberty in the development of the text. There is an unnamed family that provides a vechilce for depicting daily life. Since the family is unnamed it is hard to tell if they truly existed or not. This is probably not a problem for child but if they share this as if it was true it could reflect poorly on them.

The Recommendation

This is not the greatest text. There are better choices out there for explaining the destruction of Pompeii to kids. However, the price is great and you truly get what you pay fofr in this situation.

Making Lists in LaTeX

Lists are frequently used in communication in order to provide information succinctly. Often, the rules of grammar can be suspended because of the need for the list to communicate information in an unadorned way. In this post, we will learn how to make lists in LaTeX.

Basic List

For a simple list, you need to make an environment using the “itemize” declaration. Inside this environment, you must use the “\item” declaration for each bullet in the list. Below is the code and printout of a basic list in LaTeX.

\documentclass{article}
\begin{document}
   Shopping list
      \begin{itemize}
         \item lettace
         \item mango
         \item toothpaste
      \end{itemize}
\end{document}

0.jpg

As you can see this is fairly simple. THere is no need for any packages to complete this. If you want a number list instead of creating a “itemize” environment you would create an “enumerate” environment as shown below.

\documentclass{article}
\begin{document}
   Shopping list
   \begin{enumerate}
      \item lettace
      \item mango
      \item toothpaste
   \end{enumerate}
\end{document}

0

Nested List

It is possible to have lists within lists. To do this, you simply create an environment within an environment. LaTeX will automatically change the bullet type for you to enhance readability. Below is an example.

\documentclass{article}
\begin{document}
    Shopping list
    \begin{itemize}
       \item fruits
       \begin{itemize}
          \item lettace
          \item mango
        \end{itemize}
      \item other
      \begin{itemize}
         \item toothpaste
      \end{itemize}
    \end{itemize}
\end{document}

0

The example above has two levels in the list. LaTeX can go up to four levels.

Compact List

Generally, list by default in LaTeX are double-spaced. To reduce this you need to use the “paralist” package with either the “\compactitem” declaration and or the “\compactenum” declaration. Below is the same example but using the paralist features and also blending the use of bullets and numbers.

\documentclass{article}
\usepackage{paralist}
\begin{document}
   Shopping list
      \begin{compactitem}
         \item fruits
         \begin{compactenum}
             \item lettace
             \item mango
         \end{compactenum}
        \item other
        \begin{compactenum}
           \item toothpaste
        \end{compactenum}
      \end{compactitem}
\end{document}

0.jpg

Definition List

It is also possible to make a list of definition. This is useful for a glossary. In order to do this, you create a “description” environment. When you use the “\item” declaration you need to place the definition word in brackets. There are no packages needed for this. Below is the code.

\documentclass{article}
\usepackage{paralist}
\begin{document}
   \begin{description}
      \item[convoluted] complex and hard to understand
      \item [obtuse] slow to understand
   \end{description}
\end{document}

0.jpg

Conclusion

This post provided insights into the use of lists in LaTeX.

Relations and Functions

In mathematics, a relation is a connection between two distinct pieces of data or variables. For example, student name and ID number would be a relation commonly found at a school. What this means is that you can refer to a student by there name and get their ID number and vice versa.  These two pieces of information are connected and refer to each other. Another term for relation is ordered pair, however, this is more commonly use for coordinate graphing. Below is an example of several student names and ID numbers

Student Name (x values) ID Number (y values)
Jill Smith 12345
Eve Jackson 54321
John Doe 24681

Table 1

Two other pieces of information to know are domain and range. The domain represents all x values. In our table above the student names are the x values (Jill Smith, Eve Jackson, John Doe). The range is all of the y-values, THese are represented by ID number in the table above (12345, 54321, 24681).

The table above is nice and neat. However, sometimes the information is not organized into neat rows but is scrambled with the names and ID numbers not lining up. Below is the same information as the table 1 but the ID numbers are scrambled. The arrows tell who the ID number belongs to who.  This is known as mapping.

Student Name ID Number
Jill Smith ↘ 24681
Eve Jackson→ 54321
John Doe↗ 12345

If we find the ordered pair, domain and range it would be as follows.

  • Ordered pair = {(Jill Smith, 123450, (Eva Jackson, 54321), (John Doe,  24681)}
  • domain = {Jill Smith, Eva Jackson, John Doe}
  • Range = {24681, 54321, 12345}

Understanding Functions

A function is a specific type of relation. What a function does is assigns to each element in a domain. Below is an example of a function

f(x) = 2x + 7

Functions are frequently written to look the same as an equation  as shown below

y = 2x + 7

PLugging in different values of x in your function will provide you with a y as shown below

1

Here our x-value is 2 and the y-value is 11.

Of course, you can graph function as any other linear equation. Below is a visual.

save.png

Conclusion

This post explained the power of relations and functions. Relations are critical in computer science in particular relational databases. In addition., Functions are a bedrock in statistics and other forms of math. Therefore it is critical to understand these basic concepts of algebra.

Review of “Michelangelo”

This post is a review of the book Michelangelo by Diane Stanley (pp. 40).

The Summary

This book addresses the life of Michelangelo di Lodovico Buonarroti Simoni perhaps one of the greatest artists of all time. Michelangelo was born in the 15th century (1475) to a middle-class family in Italy during the Renaissance.

As as a small boy, Michelangelo was trained in stonecutting. This stokes a fire within him and he asked his father if he could be an artist apprentice. Initially, his father was angry about this as this was not an occupation for a gentleman. However, eventual the father relented and Michelangelo began his training.

With time Michelangelo learned painting and sculpting among other things and was eventually sponsored by the famous Medici family, living with them. After several years he would leave the family as politics became tense when there was a change of leadership within the Medici family who ruled Florence.

Over the next few years, Michelangelo sculpted many of his great masterpieces usually sponsored by the Catholic church. Examples include Pieta and David. The realistic nature of the statutes is due to Michelangelo’s talent as well as his knowledge of anatomy through the study of cadavers.

Michelangelo’s next project was to build a tomb for Pope Julius II. However, there was some misunderstanding and arguments over money that hounded this project. After fleeing and the returning to the Pope, Michelangelo was given the task of painting the ceiling of the Sistine Chapel. This was a monumental task as the ceiling was almost 6,000 square feet. It was all done by hand over the course of four years.

Michelangelo never married and he struggled to maintain social relationships. His work was his life and the excellence speaks for its self. He finally died at almost 90 years of age in 1564. A remarkable long life in an age of little health care and the plague.

The Good

This is an excellent text. The strong point is the pictures. The visuals are developed in a renaissance style and also include pictures of the various works Michelangelo made. The actual sculptures and paintings that he made are breath-taking. It almost appears as if Michelangelo was not even human.

The visuals also show Michelangelo as he progressed from small boy to old man. This supports the chronological nature which not all books do when sharing a biographical story.

Kids will love the pictures while older students will be able to appreciate the text. This book also provides exposure to some aspects of European and church history.

The Bad

The text is too complicated for anyone below 5th grade. Besides this, there is little to complain about in this text. In addition, a lot of background information may need to be provided in order for students to understand what is taking place in the story.

The Recommendation

This is a good book and perhaps should be a part of a teacher’s library if they want to expose kids to Renaissance art. However, it might be too detailed oriented and a more general book on art would provide the exposure kids may need

Web Scraping with R

In this post we are going to learn how to do web scrapping with R.Web scraping is a process for extracting data from a website. We have all done web scraping before. For example, whenever you copy and paste something from a website into another document such as Word this is an example of web scraping. Technically, this is an example of manual web scraping. The main problem with manual web scraping is that it is labor intensive and takes a great deal of time.

Another problem with web scraping is that the data can come in an unstructured manner. This means that you have to organize it in some way in order to conduct a meaningful analysis. This also means that you must have a clear purpose for what you are scraping along with answerable questions. Otherwise, it is easy to become confused quickly when web scraping

Therefore, we will learn how to automate this process using R. We will need the help of the “rest” and “xml2” packages to do this. Below is some initial code

library(rvest);library(xml2)

For our example, we are going to scrape the titles and prices of books from a webpage on Amazon. When simply want to make an organized data frame. The first thing we need to do is load the URL into R and have R read the website using the “read_html” function. The code is below.

url<-'https://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=books'
webpage<-read_html(url)

We now need to specifically harvest the titles from the webpage as this is one of our goals. There are at least two ways to do this. If you are an expert in HTML you can find the information by inspecting the page’s HTML. Another way is to the selectorGadget extension available in Chrome. When using this extension you simply click on the information you want to inspect and it gives you the CSS selector for that particular element. This is shown below

1.png

The green highlight is the CSS selector that you clicked on. The yellow represents all other elements that have the same CSS selector. The red represents what you do not want to be included. In this picture, I do not want the price because I want to scrape this separately.

Once you find your information you want to copy the CSS element information in the bar at the bottom of the picture. This information is then pasted into R and use the “html_nodes” function to pull this specific information from the webpage.

bookTitle<- html_nodes(webpage,'.a-link-normal .a-size-base')

We now need to convert this information to text and we are done.

title <- html_text(bookTitle, trim = TRUE) 

Next, we repeat this process for the price.

bookPrice<- html_nodes(webpage,'.acs_product-price__buying')
price <- html_text(bookPrice, trim = TRUE) 

Lastly, we make our data frame with all of our information.

books<-as.data.frame(title)
books$price<-price

With this done we can do basic statistical analysis such as the mean, standard deviation, histogram, etc. This was not a complex example but the basics of pulling data was provided. Below is what the first few entries of the data frame look like.

head(books)
##                                   title  price
## 1                          Silent Child $17.95
## 2 Say You're Sorry (Morgan Dane Book 1)  $4.99
## 3                     A Wrinkle in Time $19.95
## 4                       The Whiskey Sea  $3.99
## 5            Speaking in Bones: A Novel  $2.99
## 6 Harry Potter and the Sorcerer's Stone  $8.99

Conclusion

Web scraping using automated tools saves time and increases the possibilities of data analysis. The most important thing to remember is to understand what exactly it is you want to know. Otherwise, you will quickly become lost due to the overwhelming amounts of available information.

Line Breaks and Justification in LaTeX

In this post, we will look at line breaks and justification in LaTeX. These tools will provide a user with more nuanced command of their document.

Paragraph Break

By leaving a space between paragraphs in your document LaTeX will start a new paragraph. Below is the code followed by the output.

\documentclass{article}
\begin{document}
Hello, here is some text without a meaning. This text should show what a printed text will look like at this place. If you read this text, you will get no information.

Really?

Is there no information?

Is there a difference between this text and some nonsense like “Huardest gefburn”?

Kjift – not at all!

A blind text like this gives you information about the selected font.
\end{document}

1.png

Notice how each paragraph is indented. This is the default setting in LaTex. To remove indentation you need to use the “\noindet” declaration as shown below.

\documentclass{article}
\begin{document}
Hello, here is some text without a meaning. This text should show what a printed text will look like at this place. If you read this text, you will get no information.

\noindent

Really?
\noindent

Is there no information?
\noindent

Is there a difference between this text and some nonsense like “Huardest gefburn”?
\noindent

Kjift – not at all!
\noindent

A blind text like this gives you information about the selected font.
\end{document}

1.png

In this example, only the first paragraph is indented.

A simpler way to do this is with the short command line break \\. Below is what it looks like

\documentclass{article}
\begin{document}
Hello, here is some text without a meaning. This text should show what a printed text will look like at this place. If you read this text, you will get no information.\\
Really?\\
Is there no information? \\
Is there a difference between this text and some nonsense like “Huardest gefburn”? \\
Kjift – not at all! \\
A blind text like this gives you information about the selected font.
\end{document}

1

You can see that both “\noindent” and the short command \\ get the same results. However, the latter is probably more efficient and perhaps easier to read.

Justification

There are also ways to remove the default setting for justification. The three declaration are “\raggedright”, “\raggedleft”, and “\centering”. The “\raggedright” declaration makes the right side of the page ragged while the left side of the page is justified as shown below.

\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
{\raggedright
\Blindtext}
\end{document}

1.png

You can clearly see how the right side is truly ragged. The other packages in the code create the demo paragraph automatically for us.

The “\raggedleft” declaration does the opposite. See below

\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
{\raggedleft
\Blindtext}
\end{document}

1.png

I think we already know what centering does.

\documentclass{article} 
\usepackage[english]{babel} 
\usepackage{blindtext} 
\begin{document} 
{\centering 
\Blindtext} 
\end{document}

1.png

Conclusion

This post provided a demonstration of line breaks and justification in LaTeX.

Review of “The Titanic: Lost…and Found”

This post is a review of the book The Titanic: Lost and Found (Step-Into-Reading, Step 4) by Judy Donnelly (pp. 48).

The Summary

This text covers the classic story of the sinking of the Titanic in the early part of the 20th century. Originally build as unsinkable the Titanic collided with an iceberg and sank on its first voyage from Europe to America.

The text describes the accommodations and size of the ship. Such amenities as a pool and dining halls are depicted. At the time, the Titanic was also the largest passenger ship ever built.

When the ship had its incident with the iceberg people were supposedly laughing and joking as they were called to the deck for evacuation. This is actually an emotionally poweful moment in the text that a small child will miss. The people actually believed the foolish claim that a ship was unsinkable. To make matters worse, there were not enough lifeboats as even the builders of the ship arrogantly believed this as well.

Adding to the discouragement was the fact that a nearby ship ignored the radio calls of the sinking Titanic because their radio was turned off. When the people finally began to realize the danger they were in fear quickly set in. For whatever reason, the musicians continue to play music to try and keep the people calm and even played a hymn right before the final sinking of the ship. A somewhat chilling ending.

The book then concludes with the people in the lifeboat being rescued, it mentions changes to laws to prevent this disaster from happening again, and the final section of the text shares the story of how the Titanic was found in the 1980’s by researchers.

The Good

This book is written in simple language for small children. It can be read by early primary students. This text also provides a good introduction into one of the great tragedies of modern western history.

The illustrations also help to describe what is happening in the text. Lastly, the text is not that long and probably can be read in a few days by a child alone.

The Bad

There is little to complain about with this text. It should be in any primary teacher’s library. The only problem may be that it is a paperback book so it will not last long enduring the wear and tear that comes from small children.

The Recommendation

There will be no regrets if you purchase this book for your classroom or home.

Absolute Value Equations & Inequalities

The absolute value of a number is its distance from 0.  For example, 5 and -5 both have an absolute value of 5 because both are 5 units from 0. The symbols used for absolute value are |  | with a number or variable placed inside the vertical bars. With this knowledge lets look at an example of an absolute value.

1.png

The answer is +5 because both 5 and -5 are 5 units from 0.

In this post, we will look at equations and inequalities that use absolute values.

Solving one Absolute Value Equations

It is also possible to have inequalities with absolute values. To solve these you want to isolate the absolute value and solve the positive and also the negative version of the answer. Lastly, you never manipulate anything inside the absolute value brackets. you only manipulate and simplify values outside of the brackets. Below is an example.

1.png

As you can see absolute value inequalities involves solving two equations. Below is an example involving multiplication.

1

Notice again how the values inside the absolute value were never changed. This is important when solving absolute value inequalities.

Solving Two Absolute Values Equations

Solving two absolute values is not that difficult. You simply make one of the absolute values negative for one equation and positive for another. Below is an example.

1.png

Absolute Value Inequalities

Absolute value inequalities require a slightly different approach. You can rewrite the inequality in double inequality form and solve appropriately when the inequality is “less than.” Below is an example.

1.png

You can see that we put the absolute value in the middle and simply solved for x. you can even write this using interval notation as shown below.

1

“Greater than” inequalities are solved the same as inequalities with equal signs. You use the “or” concept to solve both inequalities.

1.png

The interval notation is as follows

1

We use the union sign in the middle is used in place of the word “or”.

Conclusion 

This post provided a brief overview of how to deal with absolute values in both equations and inequalities.

Modifying Text and Creating Commands in LaTeX

In this post, we are going to explore to separate features available in LaTeX. These two features are modifying the text size and creating custom commands.

Modifying Text

You can change the size and shape of text using many different declarations/environments in LaTeX. Declarations and environments serve the same purpose the difference is in the readability of the code. In the example below, we use an environment to make the text bigger than normal. The code is first followed by the example

\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\begin{huge}
\blindtext
\end{huge}
\end{document}

1.png

Here is what we did.

  1. We create a document with the class of article
  2. We used the “babel” and “blindtext” packages to create some filler text.
  3. Next, we began the document
  4. We create the environment “huge” for enlarging the text.
  5. We used the declaration  “\blindtext” to create the paragraph
  6. We closed the “huge” environment with the “end” declaration
  7. We end the document

If you ran this code you will notice the size of the text is larger than normal. Of course, you can bold and do many more complex things to the text simultaneously. Below is the same example but with the text bold and in italics

\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\begin{huge}
\bfseries
\textit
\blindtext
\end{huge}
\end{document}

1.png

The code is mostly the same with the addition of “\bfseries” for bold and  “\texit” for italics.

Making Commands

It is also possible to make custom commands in LaTeX. This can save a lot of time for repetitive practices. In the example below, we create a command to automatically print the name of this blog’s web address.

\documentclass{article}
\newcommand{\ert}{\bfseries{educationalresearchtechniques}}
\begin{document}
The coolest blog on the web is \ert
\end{document}

1.png

In the code, we use the declaration “\newcommand” in the preamble. This declaration had the command “\ert” which is the shorthand for the code to the right which is “\bfseries{educationalresearchtechniques}. This code tells LaTeX to bold the contents inside the brackets.

The next step was to begin the document. Notice how we used the “\ert” declaration and the entire word educationalresearchtechniques was printed in bold in the actual pdf.

It is also possible to make commands that format text. Below is an example.

\documentclass{article}
\newcommand{\mod}[1]{\textbf{\textit{#1}}}
\begin{document}
The is an example of modified \mod{text}
\end{document}

1.png

What is new is in line 2. Here we use the “\newcommand” declaration again but this time we create a command call “\mode” and give it an argument of 1 (see [1]) this is more important when you have more than one argument. Next, we put in curly brackets what we want to be done to the text. Here we want the text to be bold “\textbf” and in italics “\textit”. Lastly, we set the definition {#1}. Definition works with arguments in that argument 1 uses definition 1, argument 2 uses definition 2, etc.  Having more than one argument and definition can be confusing for beginners so this will not be explored for now.

Conclusion

This post provided assistance in understanding LaTeX’s font size capabilities as well as ways to make new commands.

Review of “Peter the Great”

In this post, we will take a look at the book Peter the Great by Diane Stanley (32 pp).

The Summary
This book covers the life and death of Peter the Great (1672-1725) one of the most influential Tsars of Russia. The book begins by showing Peter as small boy play war games with his friends. What is unique is that Peter is not the leader, despite his status, but is rather one of the junior soldiers taking orders from the other boys. This points already to an everyman personality of Peter.

The story does not neglect that Peter was royalty and shows some of the luxuries Peter enjoyed such as dancing animals and his own horses. Peter even designed and sailed his own ships.

As a student, Peter was educated by Europeans. He saw how they lived compared to how people in his country lived and it planted a seed for reformation in Peter’s heart.

I his early twenties Peter travels to Europe. While there he absorbs as much culture about Europe as possible and focuses heavily on learning various trades such as shipbuilding. His status as a King made it difficult to learn trades as people found this strange of someone of his rank.

Upon returning home, Peter began immediately to reform Russia. Immediately the long beards that Russian men favored were removed at least among the elite. In addition, the long robes were shortened. Men and women were encouraged to mingle at social settings and arranged marriages were discouraged.

Peter also built schools and canals. His greatest achievement may have been the founding and building of St. Petersburg. Today St. Petersburg is one of the largest cities in Russia.

Of course, all of these reforms had drawbacks. The poor were tax practically to death. Everything was taxed from candle to beards. Peasant young men had to spend as much as 25 years in the military. Lastly, thousands perhaps tens of thousands lost there lives in wars and building projects push by Peter.

Peter died in 1725 of a fever. He was 53 years old at the time of his death.

The Good
This book was extremely interesting. It captures your attention by giving with the rich illustration that has a renaissance feel to it. The illustrations always depict Peter as a man of action. The text is well-written and simple enough for an upper elementary student to understand and appreciate by themselves.

The Bad
There is little to complain about. This text is well-balanced between picture and text. Younger students (below grade 4) may need help with the text. Otherwise, this book is great for all kids and provides some understanding of the history of Russia.

The Recommendation
This is an excellent book to add ou your library as teacher or parent. Younger kids can enjoy the pictures while older kids can enjoy the text. Even an adult can benefit from reading this book if they have not been exposed to Russian history.

Solving Compound Inequalities

Compound inequalities are two inequalities that are joined by the word “and” or the word “or”. Solving a compound inequality means finding all values that make the compound inequality true.

For compound inequalities join ed by the word “and” we look for solutions that are true for both inequalities. Fo compound inequalities joined by the word “or” we look for solutions that work for either inequality.

It is also possible to graph compound inequalities on a number line as well as indicate the final answer using interval notation. Below is a compound inequality with the line graph solution

1.png

Solving the answer is the same as a regular equation. Below is the number line for this answer.

1.png

The empty circle at -8 means that -8 is not part of the solution. This means all values less than -8 are acceptable answers. This is why the line moves from right to left. All values less than -8 until infinity are acceptable answers. Below is the interval notation.

1

The parentheses mean that the value next to it is not included as a solution. This corresponds to the empty circle over the -8 in the lin graph. If the value should be included such as with a less/greater than sign you would use a bracket.

Double Inequality

A double inequality is a more concise version of a compound inequality. The goal is to isolate the variable in the middle. Below is an example

1.png

This is not complex. We simply isolate x in the middle using appropriate steps. The number line and interval notation or as follows

1.png

[-4, 2/3)

This time there is a bracket next to -4 which means that -4 is also a potential solution. In addition, notice how the -4 has a filled circle on the number line. This is another indication that -4 is a solution.

Practical Application

You have signed up for internet access through your cell phone. Your bill is a flat $49.00 per month please $0.05 per minute for internet use. How many minutes can you use internet per month if you want to keep your bill somewhere between $54-$74 per month?

Below is the solution using a double inequality

1

The answer indicates that you can spend anywhere from 100 to 500 minutes on the internet through your phone per month to stay within the budget. You can make the number line and develop the interval notation yourself.

Conclusion

Compound inequalities are useful for not only as an intellectual exercise. They can also be used to determine practical solutions that include more than one specific answer.