Monthly Archives: January 2010

CSE 130 1-29-10 Lecture 3

This was a general overview of good practices. The first important note was to think with Time Efficiency. The professor pointed out how there are two ways to “sum to N”. One is to keep adding 1 each time until you each N, the other way is to use the Gaussian Summation Formula. While the Gaussian Summation Formula was something I had not heard of before, the point of the assignment was really to teach us about the assignment of an expression to a variable

Assignment Statement
Ex: sum = ( n* (n+1) )/2

    Assigns the value of an expression to a variable
    It is the only statement that does computation

Control Statement
Decide who does the work

Summary of Programs

    1. Input and Output
    2. Initialization
    3. Computation using an Expression
    4. Some kind of loop/iterative statement
    5. A decision making statement (If – Then – Else)
    – These are essential

Problem Solving Process

    – Analysis (Of Input, Output, Specifications)
    – Design (KISS)
    – Implementation (Think about Future Maintenance)
    – Testing (Individually (Modular) and Collectively)

Tips

    – Find out as Much as you can (Research the problem, obtain more info)
    – Reuse what has been done before (What succeeded, what Failed)
    – Expect Future reuse (Create a Library?)
    – Break complex problems into sub problems

Algorithm building blocks

    0. Input & Output
    1. Expressions
    2. Conditional
    3. Iteration
    4. Subprogram invocation

Leave a Comment

Filed under CSE 130

PHY 125 – Lecture 3

Percent Uncertainty = ∆A/A * 100
This is also known as fractional uncertainty. I wrote this out in more detail in HW1 Notes & Concepts.

Addition and Subtraction of Uncertainty
∆D = ∆A + ∆B

Multiplication and Division of Uncertainty
∆D/D = ∆A/A + ∆B/B

The fractional uncertainty of multiplication and division is the sum of fractional uncertainties. From there calculate backwards to get ∆D.

Things to Look for
Minimum with Uncertainty
Maximum with Uncertainty
Most Likely with Uncertainty

Uncertainty with Angles
sin(33º ± 1º)
sin ( x ± ∆x)
sin x ± ∆(sin x)
∆(sin x) / sin x

Rough Estimates (Order Of Magnitude)
Is your answer reasonable?
Use Order Of Magnitude to quickly estimate

Leave a Comment

Filed under PHY 125

MAT 125 – Lecture 2. Basic Functions and Key Properties

Second day of work and school. Today went a bit smoother; I did not miss the train on my way home from school. Work was very rushed feeling. I felt like I was finishing tasks left and right but not really making much progress. A big part of today was implementing new procedures to smooth the workflow along. I have very little patience for repetitive tasks. Macros are being created for anything the slightest bit repetitive.

On the train ride out to school I worked on the first Physics homework. I am making a file called “Notes and Concepts” which corresponds to the homework. In it I write down the various concepts the homework intended to encourage thought upon.

So onto Math lecture #2! For starters I sat in the middle right near the front. I was able to see the board better, and I just dealt with the lack of left-handed desks.

It started out with a review of basic functions, and repeated some of what we saw last week. The interesting fact this time, where KEY PROPERTIES. The professor also took time to point out the graph of almost every function he touched upon. The graphs are very important to us right now. I went through a ton of paper, and really I need to keep my paper notes as well, since it is difficult to translate so many nice drawings into PC graphics.

Particular Case Polynomial Functions
Degree of 1 = Linear function = Straight line graph
increasing graph = positive slope = a > 0
decreasing graph = negative slope = a < 0 horizontal graph = no slope = a = 0 Quadratic Equations
Smiling parabola graph = positive
Frowning parabola graph = negative

General Case Polynomials
KEY PROPERTIES
Graph is
1. Continuous
2. Smooth
3. if x goes to infinity, then f(x) is going to infinity
3. In Math: IF x → ±∞ THEN f(x) → ±∞

Power functions
f(x)=xª
1. Smooth
2. Continuous
3. Worry about the domain
Symmetric about origin = odd
Symmetric about y = Even
Even: f(x) = f(-x)
Odd: f(x) = -f(-x)

Other Examples of Power functions (Need to Specify Domain)
RADICAL
f(x) = x^½ = ²√x
x > 0
f: 0 → R (unsure)

FRACTIONAL
f(x) = x^-2 = 1/x^2
x ≠ 0
f: ?

RADICAL/FRACTIONAL
f(x) = x ^ (-3/2) = 1 / x ^ (3/2) = 1 / sqrt(x^3)
Look at what happens as the denominator approaches 0. f(x) gets closer and closer but never touches. x=0 is a Vertical Asymptote. That is, f(x) gets closer and closer but never touches the Vertical Asymptote. This is a continuous function, since the Asymptote is Vertical. Continuity is only concerned with jumps in y (that is f(x) ).

Rational Functions
f(x) = P(x) / Q(x)
Ex: f(x) = x / x²-4

Ask Yourself:
Are there Asymptotes?
What happens near the Asymptotes? In Both directions.
What happens near infinity?

ALGEBRAIC FUNCTIONS
1 + 2 = 3
Nice, Except worry about domains

Non-Algebraic Functions
(Nice in Calc 1, Not Nice in Calc 2)
Trigonometric Functions
1. Are Wavy
2. Sin, Cos are Periodic (2π)
sin(x + 2π) = sin x
cos(x + 2π) = cos x
3. sin²x + cos²x = 1
4. -1 ≤ sin x ≤ 1 & -1 ≤ cos x ≤ 1
5. Tan x , Cot x are Periodic (π) & worry about undefined
Exponential Functions
f(n) = xⁿ
Log Functions
f(x) = ln(x)

Composition of Functions
cos(ln(eª) + eª)
h ◦ g ◦ f(x)
Start with the INNER
f(x) = eª = g(y)
g(y) = g(ln(y) + y) = h(z)
h(z) = cos(z)

It felt like we covered quite a lot this class.

Leave a Comment

Filed under MAT 131

CSE 130 – Algorithms

Today we looked at the first notes the professor had posted on the CSE 130 website. I had reviewed these earlier, and included the notes in my last post. There was some new interesting bits though.

Algorithm Properties
►Complete
► Precise
► Finite
► Correctness (the end result is the correct solution to the specified problem)
► Termination (Eventually it will stop)

Iterative Refinement of solution → Efficient (Sometimes your first idea for solving a problem is not the best, so think about it some more even though you think you know the answer)

Input → PROGRAM → Output

Pseudo Code
► Be Precise
► Get and Set Statements

x + y
x and y: are Operands
+ : is an Operator

Memory – Stores data (variables, input) and program code
Processor – Looks at program in memory and calculates, line by line – Calculator

% = remainder = Modulo operator

For, Do, While = Iterative Construct = Repeat Until….

If = Conditional (Decision making statement)

Leave a Comment

Filed under CSE 130

PHY 125 – Error, Uncertainty & Tolerance

Location ← Say “Position” instead

Si (System International) is also known as mks (meter, kilogram, second)

Combination of Units
You can combine the three base units to describe other things.
Speed = miles per hour [English System] or meters per Second [Si]

Conversion of Units
1 inch = 2.54cm
1 foot = 12 ● (inch) = 12 ● (2.54 cm)

Significant Figures

    ▬Relates to the # of significant figures given in the input
    ▬Rule of thumb

Area = Width ● Height = W ● H
If we say W = 1.00m, we mean 1.00m not 1.01m or .99m
If W = 1.00m and L = 3.33m, the Area = 3.33m²

What would happen in W = 1.01m and L = 3.33m?
Then we are stuck with this slightly odd number 3.3633m², but since the input numbers contain only three significant numbers, we need to round the slightly odd number to 3.36m².

What if W = 1.01m and L = 3.3m?
Then we need to round the slightly odd number (3.333) to 3.3m². Because we are rounding to the LEAST significant number of digits in the given input.

Error and Uncertainty
Error is not as common of a term, and this concept refers to the tolerance, i.e.: Margin for Error.

width = W = 1.000m ← accurate to millimeter = 1.000 ± .001m
1.000 ± .001m = width is in the range {1.001m , 0.999m} = W±∆W
±∆W = amount of variation in W
W = measurement

*****NOTE*****
To Determine the uncertainty of a measurement, repeat the measurement to find the distribution curve.

Adding & Subtracting Uncertainty
Perimeter = P = 2L + 2W
Perimeter with uncertainty
P±∆P
= 2(L±∆L) + 2(W±∆W)
= 2L+2W ±2∆W ±2∆L
Maximum Perimeter = P +2∆W + 2∆L
Minimum Perimeter = P -2∆W – 2∆L

Leave a Comment

Filed under PHY 125

MAT 131 1st class

Note*** I am having some math formatting issues… Any my images don’t work.

Today was the first day of part-time work part-time school. I enjoyed work today. I felt more productive than usual and it was a nice tempo change, to feel as though I was applying my new knowledge.

I was able to solve a problem about automating the production of multi-manager datasheets, and it was a big timesaver. It will reduce the time it takes to create the datasheets from 1 sheet per day, to as many datasheets you need in one day. Right now it will save one person from spending eight days creating datasheets to instead spending one day using various Access Database and Excel Template tools. And we can add new multi-manager options since it will take less time to handle the overhead.

Another very quick and very simple solution to a different problem (net returns) was suggesting to create an excel spreadsheet of manager performance for quick import into our various databases. We needed a way to show net returns all of a sudden and now instead of manually creating each manager, we can instead create a clone, apply a formula (Excel) and create an instant net returns database.

Then I had to run off to the trains. I think I can take an alternate train from Hunters Point too, it is not optimal, but it would work if needed. (As long as I can make it across the campus in 5 minutes. Bike? Unicycle?)

Math class
At first I was worried. The professor started by drawing all of these circles with x’s and arrows’ all over the chalkboard. He has an unusual accent and handwriting. I think he might be from somewhere with an Arabic alphabet, I have never seen someone draw letters like this before. But back to the Math! So the board is covered in all of these circles with x’s and arrow’s between the various x’s. It turns out he was explaining one-to-one functions and function called either a onto or one-to-two. His point was we will be dealing with primarily onto functions which are reversible.

Functions
▬ In Calculus it is important to include the range in a function

Ways to Express Functions
Currently, we know four ways to express functions
▬ Algebraically
▬ Describe verbally
▬ Graphically
▬ As a Table

Review of Basic Functions
▬ f(x) = x +1 NOTE: Linear Function, straight graph
▬ f(x) = x2-1 NOTE: Polynomial Function, Smooth, curving graph
▬ f(x) = |x| NOTE: Continuous Graph
▬ Not smooth or Continuous – Has gap in Y axis, Has a Discontinuity
▬ Fractional function, function is undefined when denominator = 0
▬ Has gap in X axis. Does not have a discontinuity, since break is along x axis
▬ Even function – Symmetrical about Y axis
▬ Odd function – Symmetrical around Origin

New Math Symbols

Leave a Comment

Filed under MAT 131

CSE 130 1st Lecture

CSE 130 1/25/10

Introduction to C. I liked this class immediately. The professor seems very passionate and knowledgeable about his subject. To start with the professor handed out his syllabus and went over the basics of the class, like homework, exams and grading.

The professor covered two general areas relating to C today. The first one was the definition of computer programming and the second one was the steps involved in the programming process, ending with an algorithm translated into Binary (A series of Ones and Zeros which a computing machine can understand and follow).

Computer Programming: Algorithmic problem solving

What is an Algorithm? Step-by-step description of the problem to be solved

The Programming Process
1. Specifications
2. Pseudo-code (Previously I used pseudo code by writing in comments first)
3. Programming Language code
4. Compile (That is, have another program translate your programming code into a machine readable language and package it into a binary or an executable)
5. Execute
5a. Debug (Not part of the lecture, but we probably just didn’t get to it yet)

Other notes of interest
 C is NOT object oriented
 C was developed by Dennis Richie at Bell Labs so he could program UNIX

CSE 130 Class notes (provided at class website)
Reviewed Package 1 – This did not seem to be completely covered in class, but that is why there are notes to review.

Algorithm Attributes: Complete, Precise, Finite

Developing an Algorithm
1) Available Input / Desired Output
2) Break into small chunks
3) Refine
4) Write Pseudo code
5) Convert to programming language

Problem Solving Process: Analysis, Design, Implementation, Testing
Analysis: Determine problem features
Design: Describe objects and methods
Implementation: Produce the classes and code
Testing: Test components individually and collectively

Leave a Comment

Filed under CSE 130

PHY 125

Thoughts on the first day of class

It rained a lot today. I’m soaking wet.

PHY 125:
This is a class about classical Mechanics: describing mechanical objects. (How its forces work). Objects are generally described in relation to an origin. To describe an object, you want to put its mass into a location and a time. There are three main standard units used in the Si (System International) to describe inertia, location and time.

Mass = Inertia/Weight (In Gravity field) = gram
Location = x,y,z coordinates in relation to an origin = meter
Time = second (Time is unique, it flows forward. You can’t go backwards (yet?))

These three basic standard units can be combined in various methods to describe mechanics.

Since Location and Mass are based off the unit of ten, there are many powers of ten which are used to describe smaller and larger units. They are:

Larger
10 power 3 = kilometer/kilogram = 1*1000

10 power 1 = meter/gram =1/1

Smaller
10 power -2 = centimeter/centigram = 1/100 = One hundredth of a meter
10 power -3 = millimeter/milligram = 1/1,000 = One thousandth of a meter
10 power -6 = micron/microgram? = 1/1,000,000 = One millionth of a meter
10 power -9 = nanometer/nanogram? = 1/1,000,000,000 = One billion of a meter
10 power -12 = picometer = 1/1,000,000,000,000 = One trillionth of a meter
10 power -15 = femtometer 1/1,000,000,000,000,000 = One quadrillionth of a meter

Leave a Comment

Filed under PHY 125

Phy 125 – Book Pages 1 – 28

    1. Read chapter, learn vocab and notation
    2. Go to class
    3. Read again, follow details, Answer exercise’s and questions
    4. Solve problems at chapter end

Quantities are italicized, units are not, and bold with arrow is vector
Symbol & Color Guide – Pg 19

Significant figures: The final result of multiplication or division should have only as many digits as the number with the least number of significant figures used in calculation

Precision – Repeatability
Accuracy – nearness to true value

The meter is the length of path traveled by light in vacuum during a time interval of 1/299,792,458 of a second

1 inch = 2.54 centimeters
mass of atoms and molecules = unified atomic mass unit (u)
1u = 1.6605 x 10^-27 kg
Speed of light = 299,792,458 m/s
5280 feet in mile

length = meter (m)
time = second (s)
mass = kilogram (kg)
Electric Current = ampere (A)
Temperature = kelvin (K)
amount of substance = mole (mol)
Luminous intensity = candela (cd)

Stopped Page 26

299 792 458 Two ninety-nine, seven ninety-two, four fifty-eight meters per second.
Meter: length light vacuum two ninety-nine, seven ninety-two, four fifty-eight

Make sure understand changing units on page 28. Practice multiplication of scientific numbers

To Check when solving
Is unit correct? Is dimension correct? Is Decimal correct? Any exponents?

Dimensional Analysis
breaking down the unit into the underlying base units

Planck length
Uncertainty
Order of Magnitude
Notion of Symmetry?

Leave a Comment

Filed under PHY 125