Computer Programming – Core Competency Reflection

Code:

CP11 – Rahimi – Snowmen Code.py

Result:

Reflection:

This project was to present how well we understood loops and how we were able to use them to simplify our code. Before starting, I had to imagine a picture that would use a lot of repetition and would allow me to use ‘for’ loops, ‘while’ loops, and counters. I decided to make snowmen because it uses a lot of repetition of shapes. The problem I faced when creating this code was that I didn’t fully understand the loops, so I wasn’t able to optimize my use of them. When I finished, I had only one loop and I didn’t know where else to fit the missing loops. It wasn’t until I presented my problem to my teacher, that I learned I had written sequences that weren’t necessary. The purpose of the loop is to avoid writing out the code for a shape every time it is used, but that was exactly what I did. I refined my code by making a definition of each shape and learning how to use the loops to make them repeat in different parts of the picture. I had a lot of thought go into my snowflakes and arms because the use of angles in Python is very different. After a bunch of trials and errors, I learned how to reset the angle for the shape in order to create the arms and snowflakes that I wanted. In the end, developing the design for each shape was a very interesting process that taught me a lot about drawing using Python, especially when using loops or angles.

Top 5 Things I Have Learned in Pre-Calculus 11

This semester of Pre-Calc 11 has really been a challenge. There had been so many new concepts learned and many of what I learned in Math 10 finally made sense and applied to the new concepts.

Here are some things that I just learned or finally understood

 

Domain and Range

In math 10, domain and range was never a big topic. For linear graphs, the domain and range were generally all real numbers since they never really had any restrictions of where they could go up or down. It was never important to know for tests and it didn’t help with understanding the concept being taught. This year, domain and range was greatly used for graphing and explained the qualities of a graph.

We graphing quadratics, absolute values, and reciprocals, the domain and range explained what values were available and helped explain the graph.

In a quadratic, the range helped explain that the vertex is the maximum or minimum of the graph. This is because the range shows the end of all y values in the graph.

In an absolute value, the domain and range help express where the original was and how all the terms are positive. The range is always that y is positive. The domain is two parts, one for the original line that includes the critical point and for the reflection of the negative terms.

The domain and range for reciprocals showed the values that were not included. This helped create an understanding that there is a boundary, the asymptotes, that the reciprocal will get close but never touch.

 

 

 

Factoring 

Last year, I struggled with factoring. This year, since factoring is greatly important for finding x-intercepts of a quadratic, I learned and practiced to make factoring come easier to me.

I learned to organize what I know first. Since the middle term in the sum of two factors of the last term, writing beside factors of the last term helps organize and show every possibility to help you find the right answer.

I also learned quicker ways to factor quadratics with an a term.

Using a square with 4 boxes, we can put the first term in one end and the last term in the other and then find their product. We then find a factor of that product that has the sum of the middle term and input those two terms in the remaining boxes. We can then go down each row horizontally and vertically to find like terms. This gives us two factors. We have then factored the expression.

 

 

 

Discriminant 

The discriminant was a very useful thing I learned this year when working with quadratics. The discriminant is b²-4ac that refers to the quadratic standard form ax²+bx+c and is a part of the quadratic formula Image result for quadratic formula

 

The discriminant was helpful because it helped identify where the quadratic would be located roughly on the graph and if it had x-intercepts or not.

If the discriminant had a positive answer, b²-4ac > 0, the equation had 2 answers or 2 x-intercepts.

If the discriminant had 0 as the answer, b²-4ac = 0, the equation had exactly one x-intercept that was the vertex and that touched the x-axis.

If the discriminant had a negative answer, b²-4ac < 0, the equation had no x-intercepts so was either above or below the x-axis.

Image result for quadratic function with 1 x intercept

The discriminant can help give a visual. If you need to find the solution using y = 9 and do not have a graph and the discriminant shows that there are no x-intercepts, it is down facing with a vertex of (-3, -5), then we are sure that 9 will never cross the quadratic so there are no solutions.

 

 

Restrictions and Values of Variables 

Something new I learned in this class that I found interesting was that in some cases, variables can have certain values or restrictions. It was something that I never thought would be a thing. A value is when there is a variable under a root symbol.

For example, √x

Since the index is a even term, 2, everything under the root symbol has to be 0 or higher. x ≥ 0

√(x+5)

x + 5 ≥ 0

x ≥ -5

√x²

Since the exponent is even, x can be any number because the negative with cancel out.

xεR

When a variable is a denominator, restrictions have to be shown after it is fully factored for numbers that cannot replace the variable. We need to find what x equals that allows the factor to equal 0 and that number is the restriction. This is because 0 cannot be in the denominator. So, we are looking for the 0s of the factored term.

if x-4 is in the denominator, it is fully factored.

x-4 = 0

x = -4

x ≠ -4

 

x² is in the denominator

x ≠ 0

This was a new and interesting concept because it created the idea that variables are not always equal to just one number.

 

Creating Triangle

During the trigonometry unit, there were many questions that asked for triangles to be created with given angles and length and for the rest of the triangle to be answered. Something interesting I learned is that, when creating a triangle without a given image, there can be more than one answer that your calculator gives. This is because all angles in a triangle equal 180 degrees, so when only one angle is given and you find the second angle, you must assume it can be a quadrant one reference angle or a quadrant 2 reference angle. If the next number you found can be subtracted from 180 and does not have a sum with the other angle higher than 180 than there are two triangles.

For example

After using the sin law, I was able to find the angle for C. Since I had to create this triangle, I had to make sure if the triangle could be found in quadrant 2. For this, we use the angle as a reference angle, so subtract it from 180 to find the angle. If the new angle and the angle is given has a sum less than 180, that means that it is to scale with the triangle and there are two options for angle C.

Week 17 – The Sine Law

When looking at a triangle that is not a right angle triangle, we can use the sine law to find either the side or the angle.

Image result for sine law

The capital letters (A, B, C) refers to the angles

The lower case (a, b, c) refers to the length across the same letter angle.

When looking for a side, we make sure that sin(A), sin(B), sin(C) is as the denominator with the lengths (lower case letters) on the top.

When looking for an angle, we use the reciprocal (the inverse)

Since there are there are three equal signs, we fill out the law and only use two of the terms, keeping the equal sign in between.

Image result for sine law

So we are looking for R

We fill in the law with the sin on the top since we are looking for an angle

sin(R)⁄41 = sin(39)⁄28 = sin(P)⁄p

We can eliminate sin(P)⁄p since it doesn’t give us enough information to solve anything

We must use sin(39)⁄28 since it has all the information

sin(R)⁄41 = sin(39)⁄28

From here, we solve for R

If we multiply both sides by 41, we can cancel out one of the denominators

sin(R) = 41sin(39)⁄28

Then we can take the sin to the other side which becomes sin inversed

R = sin1 [41sin(39)⁄28]

Plugging this into our calculators, we get that R = 67°

Now, we need to make sure this makes sense

All triangles angle summed together equal 180°

180 – 67 – 39 = 74

This makes sense because the biggest angle should be across the biggest side.