Calculating Product of Values in Same Column

Slides:



Advertisements
Similar presentations
3.3 Logarithmic Functions and Their Graphs
Advertisements

Query Methods (SQL). What is SQL A programming language for databases. SQL (structured Query Language) It allows you add, edit, delete and run queries.
Class 7.2: Graphical Analysis and Excel Solving Problems Using Graphical Analysis.
Mathematics and Graphing in Chemistry Lab 1. Outline Mathematics in Chemistry Units Rounding Digits of Precision (Addition and Subtraction) Significant.
TH EDITION LIAL HORNSBY SCHNEIDER COLLEGE ALGEBRA.
Some Introductory Programming 1. Structured Query Language (SQL) - used for queries. - a standard database product. 2. Visual Basic for Applications -
Graphs of Exponential and Logarithmic Functions
Properties of Logarithms Tools for solving logarithmic and exponential equations.
Some Introductory Programming 1. Structured Query Language - used for queries. - a standard database product. 2. Visual Basic for Applications - use of.
Basic Maths Session 4: Logarithms. Intended learning objectives  At the end of this session you should be able to:  understand the concept of logarithms,
3-3 : Functions and their graphs
Unit 4: Mathematics Introduce the laws of Logarithms. Aims Objectives
Exponential Functions and an Introduction to Logarithmic Functions
MAC 1105 Section 4.3 Logarithmic Functions. The Inverse of a Exponential Function 
Unit 11, Part 2: Introduction To Logarithms. Logarithms were originally developed to simplify complex arithmetic calculations. They were designed to transform.
Unit 11, Part 2: Day 1: Introduction To Logarithms.
Unit 11, Part 2: Introduction To Logarithms. Logarithms were originally developed to simplify complex arithmetic calculations. They were designed to transform.
Section 3.3a!!!. First, remind me… What does the horizontal line test tell us??? More specifically, what does it tell us about the function This function.
Formal Computational Skills Week 1: Functions. Overview By the end you should: Be able to evaluate a function Know how to visualise a function Know what.
Turn in your Quiz!!! Complete the following:. Section 11-5: Common Logarithms The questions are… What is a common log? How do I evaluate common logs?
Logarithms Definition Graphing. What’s a Log? the logarithm of a number to a given base is the power or exponent to which the base must be raised in order.
Basic Maths Session 4: Logarithms. Intended learning objectives  At the end of this session you should be able to:  understand the concept of logarithms,
Introduction We have seen how to Integrate in C1 In C2 we start to use Integration, to work out areas below curves It is increasingly important in this.
11.4 Properties of Logarithms. Logarithms A logarithm is an operation, a little like taking the sine of an angle. Raising a constant to a power is called.
Copyright © 2013, 2009, 2005 Pearson Education, Inc. 1 4 Inverse, Exponential, and Logarithmic Functions Copyright © 2013, 2009, 2005 Pearson Education,
MATLAB – PT1 The purpose of this workshop is to get you started and to have fun with MATLAB! Let’s talk a little and decide on what we will be covering.
Section 6.5 – Properties of Logarithms. Write the following expressions as the sum or difference or both of logarithms.
Exponentials and Logarithms This chapter is focused on functions which are exponential These functions change at an increasing/decreasing rate Logarithms.
3.3 Day 1 Properties of logarithms –Use the product rule. –Use the quotient rule. –Use the power rule. –Expand logarithmic expressions. Pg. 407 # 2-36.
Exponential and log graphs Logarithms Identify all the graphs in the diagrams below. (2,16) (0,1) 0 y x  (3,125) 0 y x (0,1)  0 y 1 (4,16) x  0 y.
Math – Exponential Functions
Section 7.6 Functions Math in Our World. Learning Objectives  Identify functions.  Write functions in function notation.  Evaluate functions.  Find.
Exponential Notation This course requires very little math – just a small number of fairly simple formulas. One math concept we’ll need (for the decibel.
Steve Greer hrsbstaff.ednet.ns.ca/sgreer
Quick Graphs of Linear Equations
Graphing Technique; Transformations
Logarithmic Functions and Their Graphs
Section 1.1 The Distance and Midpoint Formulas; Graphing Utilities; Introduction to Graphing Equations.
Multiplying by powers of 10 Decimals
Warm Up Determine whether each equation is a linear equation. If so, write the equation in standard form and determine the x-intercept and the y-intercept.
Exponential and Logarithmic Functions
Dead Man Visiting Farrokh Alemi, PhD Narrated by …
Exponential Notation This course requires very little math – just a small number of fairly simple formulas. One math concept we’ll need (for the decibel.
Welcome! September 29, Homework Quiz 3.3 Homework Questions??
Without a calculator ! Mrs. Volynskaya Introduction To Logarithms
GROUP BY & Subset Data Analysis
SQL for Predicting from Likelihood Ratios
Pre-AP Pre-Calculus Chapter 3, Section 4
SQL for Calculating Likelihood Ratios
Logarithmic Functions
Rank Order Function Farrokh Alemi, Ph.D.
Undergraduate Courses
Transformations of Linear Functions
Test of Independence through Mutual Information
Date Functions Farrokh Alemi, Ph.D.
Propagation Algorithm in Bayesian Networks
Standard Form Section 5-5.
Tonga Institute of Higher Education IT 141: Information Systems
LONG MULTIPLICATION is just multiplying two numbers.
Mr Watson’s Introduction to Spreadsheets
Tonga Institute of Higher Education IT 141: Information Systems
Graphing Exponential Functions
Expectation Farrokh Alemi Ph.D.
By the end of the lesson, I want you to be able to say…
Logarithms Definition Graphing.
Exponential and Logarithmic Functions
Y X Equation of Lines.
MATH 1310 Section 5.3.
Exponential and Logarithmic Functions
Presentation transcript:

Calculating Product of Values in Same Column Farrokh Alemi, Ph.D. In this section we discuss how the course on databases is related to additional courses in the program. This brief presentation was organized by Alemi and narrated by xxx.

Easy & Hard Way If we want to calculate the product of values in different columns, it is easy to do. We have a function that does it for us. For example, the product of 2 and 4 in two different columns can be easily calculated.  This SQL command puts the product of 2 times 4 in Column 3.

Easy & Hard Way , [Column 1] * [Column 2] AS [Column 3]  This SQL command puts the product of 2 times 4 in Column 3. The star between the two column names is an internal math function that calculates the product of the two columns. This is easy to do. We do not need to make the function.

Easy & Hard Way When all values are in the same column, this is a lot harder to do. In many query languages, there is no simple internal function that can calculate the product of values in the same column. There is no math function that will be able to multiply 2 and 4 and get us to 8. All we know how to do with data in one column is use the sum function to add the values together. In this video we show you how to use the sym function to calculate a product of values in the same column of data.

log(x) + Log(y) = Log(xy) Easy & Hard Way log(x) + Log(y) = Log(xy) We use a well known relationship that the sum of log of values is the log of product of the values. We transform the data to logs, calculate the sum of logs, this produces the log of the product. We now transfer back to the initial scale and report the product.

Logarithm Function Let us start with understanding the logarithm function. Here the x axis or the horizontal axis shows the value of x, the values in the column of data. The Y axis shows the logirthm of x. The graph of the logarithm to natural base crosses the horizontal axis at 1.

Logarithm Function It passes through the points with coordinates of 2 and 0.69.

Logarithm Function Also the point with coordinates 4 and 1.39.

Logarithm Function And 8 and 2.08 because e to power of 2.08 is 8, where e is the natural number of 2.718.

Logarithm Function The graph never crosses the y axis but does get close to it as x values get closer to 0.

log([Column 1]) 0.69 Suppose the values in column 1 are 2 and 4. We want to calculate the product of these values. The first step is to take the log of these values for 2 it is 0.69.

log([Column 1]) 1.39 0.69 For 4 it is 1.39.

Sum(log([Column 1])) 2.08 1.39 0.69 We now sum the calculated log values. Which gives us the value of 2.08.

Exp(Sum(log([Column 1]))) 2.08 1.39 0.69 In the last step we take antilog or in other words we take e to the power of 2.08, which gives us the X value of 8.

Exp(Sum(log([Column 1]))) 0.69 1.39 2.08 So we see that taking the exponential of sum of the log of the values in the column produces the product of the value. In this case, it multiplied 2 by 4 and gave us the resulting 8.

Exception: Log of zero is not defined Exp(Sum(iif([Column 1]=0, 0,log([Column 1]))) Exception: Log of zero is not defined There are two exceptions to this method. First, log of zero is not defined so we have to calculate situations where there is a 0 in the column using a different method. We know when the column contains a zero the product of the values in the column is zero. So we insert that with an if statement into the code.

Exception: Calculated number cannot exceed largest allowed Exp(IIF(Sum(iif([Column 1]=0, 0,log([Column 1]))>100, 100, Sum(iif([Column 1]=0, 0,log([Column 1]))) Exception: Calculated number cannot exceed largest allowed The second exceptions occurs when the sum of the log of the numbers is so large that e to its power exceeds the largest number allowed in the computer. Here again we need to insert an if statement that controls for very large numbers. In this case, we are saying if the sum of the log of the column values exceeds 100 then assume it is 100; otherwise enter the sum as calculated. In this manner the sum never exceeds e to the power of 100

Product of values in a column This video has shown how to code the data to calculate the product of the values within one column of data.