Teaching Math Correctly

I am convinced that math is the most important subject in school but yet almost all math teachers fail to do it justice. What I mean by that statement is that our education system, especially when it comes to math is all about memorizing rules and speed and very little emphasis is placed on actually understanding the material thoroughly.

I believe this is partly why I’ve struggled with math, because I have to fully understand something or I get very stumped on seemingly small details because I’m busy wondering why something works this or that way. Anyone who knows me can testify that memorization is not at all my problem because when I was a teen I literally memorized over 6000 verses and I am still able to memorize things very easily. But when it comes to math memorizing rules and useful acronyms is the easiest part but understanding all the details of why we have those rules is the complicated part. A very basic example of this deals with fractions and squares. Most of us understand that when you multiply both the numerator and denominator by the same number it is essentially multiplying the entire thing by 1 and does not change the fractional value. However when my teachers began explaining how to work with and reduce something like x^m/x^n they would simply tell us to memorize a rule like if (m < n) then 1/x^n-m. I memorized that easily but I didn’t understand initially why that rule worked correctly and so I would become frustrated because they were moving on to other rules while I still didn’t understand why that rule worked. Finally I realized that x^2/x^5 is the same as multiplying the numerator and denominator by of 1/x^3 by x^2. This is when I realized that it was simply reducing a fraction like any other and I understood the rule.

I find it annoying the way math is taught because I actually love math but I rarely get the chance to take my time so that I can fully understand everything. This is precisely why I love taking programming classes from my CS professor because he recognizes how important it is to understand concepts rather than just memorizing and thus he takes his time and goes it to almost every detail you could imagine. I don’t really know what the point of this post is other than to rant about my frustration with the way math is taught because I’m convinced that most people would not hate math so much if it was taught differently.

School Is Over!

Wow, this fall has been crazy, fun and frustrating but Christmas is almost here. For three year I worked around hundreds of kids each week and never became sick, then after I lost my job I have constantly been sick over the past 6 months. This has made studying for any real length of time very hard and even harder to take long tests. The good news is my “Intro to C” programming was fun and challenging but seeing my grades each week was the best part. I finished the class with a perfect score of 100% on every assignment, quiz and test.

Unit Analysis 6

NOTE:

We are required in this class to write a Unit Analysis that states the objective of the current unit, some key concepts and the implications of those concepts. In other words, we are to define a few of the concepts we talked about and what it means to us as programmers.

Purpose:

At the end of Unit 05 we should be able to explain the concept of a struct and how it is used. We should have a solid understanding of how to work with the data stored within a struct. We will discuss and demonstrate how to create and use a typedef. Also, we will begin to look at the string library and how to use some of the more important functions.

Concepts:

  • Binary File - A file that contains machine readable code rather than plain text. These files are intended to be read by a computer system/application and not by humans.
  • Buffer - A file buffer is a place in memory designed to hold a certain amount of data before writing to a file. A buffer is the middle man between the application requesting to read/write data and the file itself.
  • fwrite()- This function is for writing to files and takes 4 parameters. The parameters are: address of data to be written, size of data to be written, number of data elements to be written, and the file where the data should be written.
  • fseek()- This function takes 3 parameters and is used for setting the file pointer at a specific point for reading or writing. The parameters are a pointer to the file, the number of byte offsets from the origin, and the position from where the origin should be.

Implications:

Working with files is a basic but very useful skill needed by almost any programmers. Without the ability to write to files or a database the information gathered and produced by a application would be of little use. We need ways to save this information for use at a later time whether by a human or computer. If the files will be read and used by humans you will want to write a standard text file which is human readable. But if the file will be read and used by computers than it is best to use the binary mode because it is optimized for computers and in a language they understand natively. The C language has a number of very useful functions for working with functions like fwrite() and fseek(). The fwrite() function allows you to write data to a file buffer which then write the data to the file itself after a certain amount of data has fill it. The concept of file buffers are very important because it would be very time consuming and create a lot of overhead if we had to write to the file every time we had 8bits available. The fwrite() function allows us to specify the mode that we want to write whether that be in plain text or binary. The fseek() function is also very useful in saving time and by allowing us to specify how where we want to start writing and how much we want to read or write. You tell it where to start by specifying how many bytes from a given point it should be placed. Again files are very useful and like databases are almost a necessity if you want to write useful applications.

Unit Analysis 5

NOTE:

We are required in this class to write a Unit Analysis that states the objective of the current unit, some key concepts and the implications of those concepts. In other words, we are to define a few of the concepts we talked about and what it means to us as programmers.

Purpose:

At the end of Unit 05 we should be able to explain the concept of a struct and how it is used. We should have a solid understanding of how to work with the data stored within a struct. We will discuss and demonstrate how to create and use a typedef. Also, we will begin to look at the string library and how to use some of the more important functions.

Concepts:

  • Struct - A struct is a way to group related but different data types together to form a structured set of data. These created structs become a new data type that can be created and used just like an int or char.
  • Typedef - A typedef is a way to create and assign a new name to an existing data type. A good use of this is to create simple easy to remember names for structs because the syntax to use them can be very long.
  • Dot Operator- The dot operator is needed to access a data type within a struct. For example if you had a struct called address that contained an int called zip. We would access the variable zip by typing a dot between the address and zip as follows: struct address.zip
  • Strings- A string is created by assigning a set of characters to a variable that has been declared as a string. When a variable is declared as a string is allocates space in memory to hold the characters in sequence and thus it creates a string of characters.

Implications:

As we write programs we will often find that much of our input is related in some way and so we will want to find ways to group that data together. We have many different tools for doing that such as strings, arrays, and structs. Structs are useful because they allow us to create an instance of a data type over and over again with very little effort because we define it once in the beginning. We can create structs that group all the data needed for an address or a persons identity and then create an instance of that structure. Once a struct has been defined we can create an instance of it just like any other variable. For example, we can create an instance of an address by typing struct address one. In this example the struct address is the data type just like int and one would be the variable name. Instead of typing struct address every time we want to create an instance of that struct we can use a typedef to define a new name for the structure or any valid data type. This allows us to create a short easy to remember name. For example, we could type typedef struct address ADD. The ADD now becomes the name for the data type of the structure address and all that is needed to create a “address” like an int is ADD one. Finally, one way we can access the data declared within a struct we use things like the dot operator. Another example, if we wanted to access the variable int zip that is declared inside struct address we would use the dot operator and type one.zip

Now for the implications of strings; A string is literally a string of characters that have been strung together. Strings must be terminated by a NULL 0. Strings are incredibly useful and writing programs would take much longer if we would have find ways to connect a whole group of individual characters to form things like names. In the C language strings are stored within single quotes. There many different functions designed specifically for working with and manipulating strings. We can do thing like copy strings, concatenate several strings together to form one, and we can even select single character from a very long string if we want. Stings are just useful and without them we would not like programming…it would be very tedious.

Unit Analysis 4

NOTE:

We are required in this class to write a Unit Analysis that states the objective of the current unit, some key concepts and the implications of those concepts. In other words, we are to define a few of the concepts we talked about and what it means to us as programmers.

Purpose:

At the end of UNIT 4 we should be able to accurately discuss the concepts of using and array. We should also be able to demonstrate how to use arrays and extract its values through processing, sorting and looping through them. We should know not only how to extract its values but also how to move and pass values around from one array to another. We should also be able to demonstrate the use of passing values to other functions and processes. We should be able to accurately describe the details of how all these actions work including pointerarithmetic.

Concepts:

  • Array - An array in computer programming is a collection of data stored under a single variable name with different keys to reference each element in the array. These keys can be numbers or strings depending on the language and type of array. An array can be thought of like a file cabinet with four drawers, each numbered from 0 to 4 from top to bottom. You have one file cabinet but you can store files in the File Cabinet drawer 1 and/or File Cabinet Drawer 4.
  • Pointer - A pointer is an object or variable that contains the address of a place in memory.
  • Pointer-arithmetic - The process by which the correct address to store data is to be found. This happens by multiplying the size of the data type to be stored by the element number and adding that value to the first address in the array. For example, if you want to store the number 5 in the second element of the array the math would look like this: A1 + (4bytes x 1) = A5.

Implications:

Array’s can be useful for working with related data groups because they allow us to store them on a common name and reference the data stored in each element simply by using an index key along with the array’s variable name. For example you could reference the first and third element of an array called postalCodes in the following way: postalCodes[0], postalCodes[3]. In this example the 0 and 3 inside the square brackets is the key/index to referencing and accessing the data inside the array postalCodes. In order to story data inside an element you have to have a way to tell the program in what element the data should be stored. To do this we need a pointer to point to the correct address of each element and so this is where pointer-arithmetic comes into play. When you attempt to store data inside an element the program will first look at the starting address of the array, then it multiplies the data type to be stored by the element number where you want to store it. Finally it adds the two values together to find the address. This can save the programmer time so that he does not have to look up the data type of the array he is working with and then sit down and perform a bunch of math every time he want to put some data into the array. Anytime we can avoid doing math ourselves the better it will be for eveyone.

Unit Analysis 3

NOTE:

We are required in this class to write a Unit Analysis that states the objective of the current unit, some key concepts and the implications of those concepts. In other words, we are to define a few of the concepts we talked about and what it means to us as programmers.

Purpose:

The purpose of UNIT 3 is to teach us some of the concepts like local and global variables. This Unit was also designed to give us an in-depth understanding of more advanced control structures like, nest if-else statements, switch statements as well as keyword statements like break and continue. When this Unit is finished we should be able to accurately discuss these topics and write basic programs that use these control statements to make choices depending on various conditions.

Concepts:

  • Variable Scope - The scope of a variable can be described as the environment in which a particular variable is available. Some variables are available to all the functions within a program and others are only available within a specific function. So the scope refers to where in the program a variable is available.
  • Local Variable - A local variable is one that is only available within a limited range such as a function. A local variable created within main is only available to the function of main() or what ever function it may have been created within.
  • Global Variable - A global variable is just like any other variable with the exception that it is available to all areas of a program. A global variable is designed overcome the limitations of local variable which are only available for the life of a function.
  • Loop- A loop is a block of code that will continue to run over and over until a given condition is met. There are three types of loops in the C language: While Loop, Do While Loop, and For Loop. Each has the same basic idea of performing a block of text if a condition is met. The Do While loop is unique in that it will always execute the block of code at least one time before testing the condition.

Implications:

It’s important to understand the concept of variable scope, otherwise you may get a lot of error when you compile or try to use a program. In programming the two types of variables as it refers to their scope are Local Variables and Global variables. The local variable is only available within a limited range of code such as a function and the global variable is available throughout all areas of the program. If you need access to the same variable in many different areas of your program then it can be useful to create a Global variable instead of passing values from one local variable to another.

In programming loops are perhaps one of the most useful tools because it allows a programmer to write a piece of code one time and have it run anywhere from one to millions of times. Up to this point in the class we learned and implemented loops for the use of menu’s. We do this by placing the entire program of the menu and parts that cause the program to run inside a loop and the loop will continue to run the program forever until a condition is met, which is most often when a false value (or 0) is given.

Unit Analysis 2

NOTE:

We are required in this class to write a Unit Analysis that states the objective of the current unit, some key concepts and the implications of those concepts. In other words, we are to define a few of the concepts we talked about and what it means to us as programmers.

Purpose:

The purpose of UNIT 2 is to move beyond just the history and key features of the language and actually begin the process of learning the syntax of the language. In this UNIT we learned about variables, declaring data types, loops, conditional operators and more. We should be able to take this information and begin writing our first program that does more than just prints “hello world”.

Concepts:

  • Variable – A variable is a name that is used to represent space in memory allocated to hold data. In the C language variable have declared data types stating what kind of data that specific variable can hold. The data is actually stored at an address in memory and the variable provides a convenient way for programmers to reference the stored data.
  • Constants – A variable can be assigned different values depending on what is assigned to it at a given point in the program. Constant are like variables because they are a name used for holding data but unlike variable their value is assigned one time and cannot change throughout the program.
  • Assignment – In programming, the process of assignment is taking a variable and assigning it a value. This value can be an integer, a string, or even another variable. We do this by using the = sign. This syntax is used for assigning a variable a value and not for checking whether it matches a specified value.
  • Fprintf()– This is a very useful function because it allows us to write data to a file and thereby making it possible to view the output of our program longer than the time it appears on our screen. This function works by writing data to a file buffer rather than writing directly to the file.

Concepts:

When writing a program the programmer will not always know what value to expect and needs a place to store the data once it is received. For example, the program we created for the first lab was suppose to take a number as input from the keyboard and square it. This is where variables saves the programmer time by allowing us to tell the program that a specific variable will contain data and once we receive that data we tell the program to assign it to that variable. We can specify an operation to be performed on a variable such as multiplication knowing that the variable will contain a value which can be multiplied. Constants operate much the same way except their value is known ahead of time. This is extremely useful in some cases because you can write a constant many time throughout a program but declare its value only one time in the beginning. This is very useful because we won’t have to change the value dozens of times if we need to make a change, we simply change one value that represents all the places that constant is used. The fprintf() function is also a very useful function because it allows us to write the results of our output to a file. Once it is written to a file it can be viewed, opened for reading and more. This is useful because it means we don’t have to rely only on what we see on the screen but the results can be saved for later viewing. But we also learned we have to be careful that we use the right open mode or else we could end up over-writing a file with important data.

Unit Analysis 1

NOTE:

We are required in this class to write a Unit Analysis that states the objective of the current unit, some key concepts and the implications of those concepts. In other words, we are to define a few of the concepts we talked about and what it means to us as programmers.

Purpose:

The purpose of Unit 0 is to give an overview of the history and characteristics of the C language. Some of the key characteristics are its portability as a programming language, it is weekly typed, it is also very fast and therefore hard to debug. In addition to learning about C’s history and characteristic, we also learned the basic of initializing variables, getting input from the keyboard, printing to the screen, and opening and writing to files.

Concepts:

  • Portable – In programming refers to the ability to be able to code on many different kinds of operating systems. In the C language it doesn’t mean that you can take the finished executable and run it on many different machines, but you can take the code with a few changes and compile it on many different platforms.
  • Compile– The process of taking a programming language like C and translating it into code designed for the computer. The compiled code is often called object code, or machine code. There are different compilers for different operating systems. In other words, you will need a UNIX compiler to compile code to run on UNIX and a Windows compiler to compile code to run on a Windows box.
  • Weekly-Typed – This means that although you will specify a variable type, it is not strictly enforced. A great example can be seen by typing a character like ‘A’ when an integer is expected; The result will be the letter ‘A’ will be converted to its ASCII character code.
  • Main() – This function is the executable code starts. When main() is called the computer begins executing the commands within main() and will reach outside it to access things like functions.

Implications:

There are important things that should be considered when you first begin to write a program. One such example is whether or not you plan on making the program available for different platforms because if this is the case, you will want code that is portable otherwise you may end up having to completely rewrite the code for each system. The C language is portable because if you write good code, you will be able to make only a few changes and then re-compile the code on other platforms. The C language is also one that is weakly typed meaning it can accept data types such as characters and convert them. This means that it won’t always complain when you submit the wrong data type. This can cause security issues as well as making the code hard to debug.

Fall 2007 Classes About To Begin…

Well, its almost time for school to begin and I’m excited. After being unemployed for 3 months now, I’m getting very bored and I can’t wait to get busy doing something useful with my time. I will be taking MATH 119 PreCalc and CMPTR 145 Intro To C / Programming Lab. I’m a little worried about the math and my ability to keep up because being ADHD, I find myself getting these mind-freezes where I find myself just staring at the paper and wondering what I’m doing, these will last for like 10-30 seconds and about 2-8 times per hour. In a normal class or work its not a problem but it really slows me down on tests, especially when they are timed tests.

UPDATE: I made an appointment with my doctor and he filled out the papers needed to require the professors to give me extra time on test. This is good because I get time + 1/2. The tests in math are typically 50min. so I will get 75min. This is a huge relief, Praise God!.

In the computer class the professor requires that we write an analysis of the topic and material we just covered and what we learned from it. It is designed to show him we understand what we’ve been covering and are able to articulate what we’ve learned. I will post those here the night I submit my assignments and then post the grad I received on that assignment.