Merge remote-tracking branch 'origin/main'
@ -0,0 +1,20 @@
|
||||
1. Suppose that the following declarations are in effect:....
|
||||
a. `14`
|
||||
b. `34`
|
||||
c. `4`
|
||||
d. `true`
|
||||
e. `false`
|
||||
|
||||
2. Suppose that `high`, `low`, and `middle` are all pointer variables of the same type, and the `low` and `high` point to elements of an array. Why is the following statement illegal, and how could it be fixed?
|
||||
```c
|
||||
middle = (low + high) / 2
|
||||
```
|
||||
The above statement is illegal because you can't add an `int *` to an `int *`. The below operation is legal because you can perform pointer subtraction, and because `low` is defined on the left hand side of the equation, then adding a long to a pointer is valid.
|
||||
```c
|
||||
middle = low + (high - low) / 2;
|
||||
```
|
||||
|
||||
3. What will be the contents of the `a` array after the following statements are executed?
|
||||
```c
|
||||
{10, 9, 8, 7, 6, 5, 4, 3, 2, 1}
|
||||
```
|
136
education/computer engineering/ECE1400/C.md
Normal file
@ -0,0 +1,136 @@
|
||||
# Compilation Steps
|
||||
|
||||
1. Preprocessing: The preprocessor obeys commands that begin with #, also known as directives
|
||||
Commands for the preprocessor are called directives. Directives begin with a pound sign, and they do not end with a semicolon.
|
||||
|
||||
Example:
|
||||
```c
|
||||
#include <stdio.h>
|
||||
```
|
||||
2. Compiling. A compiler translates then translates the program into machine instructions.
|
||||
3. Linking: The generated objects are combined to create a complete executable.
|
||||
|
||||
The preprocessor is typically integrated with the compiler.
|
||||
|
||||
# Types
|
||||
## Strings
|
||||
A string literal is characters enclosed in double quotation marks.
|
||||
|
||||
A newline can be inserted using `\n`.
|
||||
|
||||
## Integers
|
||||
An integer is a way to store a whole number. In C, integers are signed by default.
|
||||
|
||||
Values of an integer type are whole numbers.
|
||||
|
||||
Integers are divided into two categories, signed, and unsigned.
|
||||
|
||||
If the sign bit is zero, it's a positive value, and if it's 1, the value is negative.
|
||||
|
||||
They cal be declared using `[short|long] [signed|unsigned] int`, resulting in 6 possible combinations
|
||||
C99 adds a `long long` int
|
||||
## Floats
|
||||
A float is a decimal value. Slower arithmetic and inexact values are both drawbacks of using floats.
|
||||
|
||||
## Characters
|
||||
In C, a `char` denotes a single byte of arbitrary encoding.
|
||||
|
||||
## Variables
|
||||
A variable must be declared before it is assigned.
|
||||
|
||||
## Arrays
|
||||
### Finding the size of an array
|
||||
```c
|
||||
int arr[10];
|
||||
// The size of an array can be found by
|
||||
// determining the number of bytes allocated total and dividing that by the size of each element in the array.
|
||||
int arr_size = sizeof(arr) / sizeof(arr[0]);
|
||||
|
||||
```
|
||||
|
||||
# Pointers
|
||||
`&` gives you the address of a variable
|
||||
`*` gives you the value in memory that an address points to.
|
||||
|
||||
To update the value a pointer points at, you can dereference on the left hand side of the assignment operator:
|
||||
```c
|
||||
// Update the value `p` points at to be 7
|
||||
*p = 7;
|
||||
```
|
||||
|
||||
Because of how operator precedence works, parentheses should be placed around the dereference operator and the variable
|
||||
```c
|
||||
// Increment the value pointed to by `p`
|
||||
(*p)++;
|
||||
```
|
||||
# Formatting specifiers
|
||||
# Standard library
|
||||
## Formatting specifiers
|
||||
| Specifier | Function |
|
||||
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `%d` | Decimal representation: Display a value as a base 10 (hence the decimal) integer. |
|
||||
| `%f` | Fixed point decimal representation. Specify the number of places to round to by adding a decimal and a number, eg `%.2f` would round to two decimal places. |
|
||||
| `%e` | Exponential floating point number representation. |
|
||||
| `%g` | Either fixed point or exponential representation, whichever has a more compact representation. |
|
||||
For number formatting specifiers, the convention is as follows:
|
||||
`%-a.bX`
|
||||
`%`: Start of the formatting specifier
|
||||
`-`: (optional) If included, justify value left in space. Otherwise, justify right in space
|
||||
`a`: (optional) If included, the size of the field in characters.
|
||||
`.`: Separator between `a` and `b`. Optional if `b` is not specified
|
||||
`b`: The number of decimal places to round to
|
||||
`X`: The type of format to use, and the end of the specifier. Use `d` for integer base 10 (decimal) representation, `f` for fixed point decimal, and `e` for exponential notation, and `g` to select between fixed point and exponential, whichever is shorter.
|
||||
## `printf`
|
||||
Used to write a string to stdout with the ability to format variables into the string.
|
||||
|
||||
Write a string to standard output. `f` indicates that it's a formatting string. The string will not include move the cursor to a newline, append `\n` to the end of the string to do so.
|
||||
|
||||
Printf accepts a variable number of arguments, the first argument is the formatting string, then following arguments are the arguments to be inserted into the string.
|
||||
|
||||
TODO: examples
|
||||
## `scanf`
|
||||
Read value(s) from stdin.
|
||||
|
||||
`scanf` is to stdin as `printf` is to stdout.
|
||||
|
||||
The format of the input is specified using [formatting specifiers](#Formatting%20specifiers), and all following arguments are pointers pointing to variables to update.
|
||||
|
||||
|
||||
### Examples
|
||||
```c
|
||||
// Read a float from standard input into the variable `v`.
|
||||
float v;
|
||||
// Here, `v` is uninitialized
|
||||
scanf("%f", &v);
|
||||
|
||||
printf("You input: %f", v);
|
||||
```
|
||||
|
||||
### Behavior
|
||||
The validity of a `scanf` call is not necessarily checked at compile time, and so the number of outputs specified should match the number of inputs.
|
||||
|
||||
For each formatting specifier specified in the string, `scanf` will attempt to locate an appropriate value in the input, skipping whitespace and newlines if necessary until the beginning of a number is reached.
|
||||
|
||||
When asked to read an integer, `scanf` searches for one of:
|
||||
- A digit
|
||||
- A plus or minus sign
|
||||
It will continue to read until it reaches a nondigit (whitespace is not skipped in this case, and it is counted as a nondigit). If it doesn't encounter a valid digit first, it will return early.
|
||||
|
||||
When asked to read a float, `scanf` searches for one of:
|
||||
- A plus sign or minus sign
|
||||
- A series of digits (possibly containing a decimal point), followed by an exponent (optional). An exponent consists of the letter `e` or `E`, an optional sign, and one or more digits.
|
||||
`%e`, `%f`, and `%g` all follow the same rules for recognizing floating point numbers.
|
||||
|
||||
If an ordinary character is included in the pattern matching string, it will be matched then discarded before proceeding to the next character.
|
||||
## `rand`
|
||||
```c
|
||||
// `srand` creates a seed to use for rng
|
||||
srand(time(NULL));
|
||||
|
||||
// `rand` generates a random integer between 0 and `RAND_MAX`
|
||||
// To pick a number between a particular range, you can use the modulo
|
||||
// operator.
|
||||
// The below example picks a number between zero and four.
|
||||
int num = rand() % 4;
|
||||
|
||||
```
|
@ -0,0 +1,30 @@
|
||||
> 1. If `i` is a variable and `p` points to `i`, which of the following expressions are aliases for `i`?
|
||||
|
||||
a. `*p`
|
||||
g. `*&i`
|
||||
|
||||
> 2. If `i` is an `int` variable and `p` and `q` are pointers to `int`, which of the following assignments are legal?
|
||||
|
||||
e. `p = *&q;`
|
||||
f. `p = q;`
|
||||
i. `*p = *q`
|
||||
|
||||
> 3. The following function supposedly computes the sum and average of the numbers in the array `a`, which has length `n`. `avg` and `sum` point to the variables that the function should modify, unfortunately the function contains several errors, find and correct them.
|
||||
|
||||
```c
|
||||
void avg_sum(double a[], int n, double *avg, double *sum)
|
||||
{
|
||||
int i;
|
||||
|
||||
// This was assigning a pointer to a float,
|
||||
// the dereference operator was missing
|
||||
*sum = 0.0;
|
||||
for (i = 0; i < n; i++)
|
||||
// This wasn't increasing the value
|
||||
// `sum` points to, it was modifying the address stored in the pointer
|
||||
(*sum) += a[i];
|
||||
// Missing dereference operators
|
||||
*avg = *sum / n;
|
||||
|
||||
}
|
||||
```
|
@ -0,0 +1,34 @@
|
||||
1. Suppose that the following declarations are in effect:....
|
||||
a. `14`
|
||||
b. `34`
|
||||
c. `4`
|
||||
d. `true`
|
||||
e. `false`
|
||||
|
||||
2. Suppose that `high`, `low`, and `middle` are all pointer variables of the same type, and the `low` and `high` point to elements of an array. Why is the following statement illegal, and how could it be fixed?
|
||||
```c
|
||||
middle = (low + high) / 2
|
||||
```
|
||||
The above statement is illegal because you can't add an `int *` to an `int *`. The below operation is legal because you can perform pointer subtraction, and because `low` is defined on the left hand side of the equation, then adding a long to a pointer is valid.
|
||||
```c
|
||||
middle = low + (high - low) / 2;
|
||||
```
|
||||
|
||||
3. What will be the contents of the `a` array after the following statements are executed?
|
||||
```c
|
||||
{10, 9, 8, 7, 6, 5, 4, 3, 2, 1}
|
||||
```
|
||||
|
||||
5. Suppose that `a` is a one dimensional array and `p` is a pointer variable. assuming that the assignment `p = a` has just been performed, which of the following expressions are illegal because of mismatched types? Of the remaining expressions, which are true (have a nonzero value)?
|
||||
The following expressions are illegal because of mismatched types:
|
||||
- (a) `p == a[0]` - Comparison between `int *` and `int`
|
||||
The rest of the expressions are true.
|
||||
|
||||
8. Rewrite the following function to use pointer arithmetic...
|
||||
```c
|
||||
void store_zeros(int *a, int n) {
|
||||
for (int i = 0; i < n; i++) {
|
||||
*(a + i) = 0;
|
||||
}
|
||||
}
|
||||
```
|
@ -0,0 +1,70 @@
|
||||
> **1.** The following function calls supposedly write a single new-line character, but some are incorrect. Identify which calls don't work and explain why.
|
||||
|
||||
b. `printf("%c", "\n");` - This is invalid because the double quotes make `\n` a string, but it's being displayed with the `%c`formatting specifier.
|
||||
c. `printf(%s, '\n');` - This is invalid because it's trying to display a `char` using the string formatting specifier.
|
||||
e. `printf('\n');` - `printf`'s first argument should be a string, not a `char`.
|
||||
h. `putchar("\n");` - `putchar`'s first argument should be a `char`, not a string.
|
||||
i. `puts('\n');` - `puts`'s first argument should be a string, not a `char`.
|
||||
j. `puts("\n");` - `puts` will write a newline after writing a string, so this will write two newlines.
|
||||
|
||||
---
|
||||
|
||||
> **2.** Suppose that `p` has been declared as follows:
|
||||
```c
|
||||
char *p = "abc";
|
||||
```
|
||||
> Which of the following function calls are legal? Show the output produced by each legal call, and explain why all the others are illegal.
|
||||
```c
|
||||
// A - Not legal, because putchar accepts a `char`, not a pointer.
|
||||
putchar(p);
|
||||
// B - Legal, output: `a`
|
||||
putchar(*p);
|
||||
// C - Legal, output: `abc`
|
||||
puts(p)
|
||||
// D - Illegal, `puts` accepts a pointer to a null terminated string, not a `char`.
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
> **3.** Suppose that we call `scanf` as follows:
|
||||
```c
|
||||
scanf("%d%s%d", &i, s, &j);
|
||||
```
|
||||
> If the user enters `12abc34` `56def78`, what will be the values of `i`, `s`, and `j` after the call? (Assume that `i` and `j` are `int` variables and `s` is an array of characters.)
|
||||
|
||||
- `i`: `12`
|
||||
- `s`: `"abc34"`
|
||||
- `j`: `56`
|
||||
|
||||
---
|
||||
|
||||
> **7.** Suppose that `str` is an array of three characters. Which one of the following statements is not equivalent to the other three?
|
||||
```c
|
||||
// A
|
||||
*str = 0;
|
||||
// B
|
||||
str[0] = '\0';
|
||||
// C
|
||||
strcpy(str, "");
|
||||
// D
|
||||
strcat(str, "");
|
||||
```
|
||||
(d) is different because it effectively does nothing (concatenates `"abc"` with an empty string). The rest of them make `str` effectively empty by setting the first character to a null byte.
|
||||
|
||||
---
|
||||
|
||||
> **9.** What will be the value of the string `s1` after the following statements have been executed?
|
||||
```c
|
||||
// Assuming `str` is an empty string with enough space to store everything:
|
||||
strcpy(str, "tire-bouchon");
|
||||
// "tire-bouchon"
|
||||
strcpy(&str[4], "d-or-wi");
|
||||
// "tired-or-wir"
|
||||
strcat(str, "red?");
|
||||
// "tired-or-wired?"
|
||||
```
|
||||
|
||||
Expected output:
|
||||
```c
|
||||
"tired-or-wired?"
|
||||
```
|
@ -0,0 +1,50 @@
|
||||
> **12.** Suppose that the macro `M` has been defined as follows:
|
||||
```c
|
||||
#define M 10
|
||||
```
|
||||
> Which of the following tests will fail?
|
||||
```c
|
||||
// C will fail, because `M` is defined.
|
||||
#ifndef M
|
||||
|
||||
// E will fail, because `M` is defined
|
||||
#if !defined(M)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
> **13.** Show what the following program will look like after preprocessing. You may ignore any lines added to the program as a result of including the `<stdio.h>` header.
|
||||
|
||||
```c
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
f();
|
||||
|
||||
}
|
||||
|
||||
void f(void) {
|
||||
printf("N is %d\n", 100);
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
> **15.** Suppose that a program needs to display messages in either English, French, or Spanish. Using conditional compilation, write a program fragment that displays one of the following three messages, depending on whether or not the specified macro is defined.
|
||||
|
||||
```c
|
||||
#ifdef ENGLISH
|
||||
#define MESSAGE "Insert Disk 1"
|
||||
#endif
|
||||
|
||||
#ifdef FRENCH
|
||||
#define MESSAGE "Inserez Le Disque 1"
|
||||
#endif
|
||||
|
||||
#ifdef SPANISH
|
||||
#define MESSAGE "Inserte El Disco 1"
|
||||
#endif
|
||||
|
||||
printf(MESSAGE);
|
||||
```
|
@ -0,0 +1,83 @@
|
||||
> **1.** Section 15.1 listed several advantages of dividing a program into multiple source files.(a). Describe several other advantages
|
||||
|
||||
- Easier to scale horizontally as developers are added to the team
|
||||
- Reduced cognitive load from less global scope to keep track of
|
||||
|
||||
> (b). Describe some disadvantages
|
||||
- Increased complexity
|
||||
- Need to maintain/troubleshoot a build system
|
||||
|
||||
---
|
||||
|
||||
> **2.** Which of the following should *not* be put in a header file? Why not?
|
||||
|
||||
b. Function definitions - Functions should only be defined once, and this allows multiple files to share the same function definition
|
||||
|
||||
---
|
||||
|
||||
> **3.** We saw that writing `#include <file>` instead of `#include "file"` may not work if file is one that we've written. Would there be any problem with writing `$include "file"` instead of `#include <file>` if *file* is a system header?
|
||||
|
||||
Yes, `""` is a path relative to the current file, whereas `<>` is a path to the system's standard library headers.
|
||||
|
||||
---
|
||||
|
||||
> **4.** Assume that `debug.h` is a header file with the following contents...
|
||||
>(a). What is the output when the program is executed?
|
||||
|
||||
```
|
||||
Output if DEBUG is defined:
|
||||
Value of i: 1
|
||||
Value of j: 2
|
||||
Value of i + j: 3
|
||||
Value of 2 * i + j - k: 1
|
||||
```
|
||||
|
||||
> (b). What is the output if the `#define` directive is removed from `testdebug.c`?
|
||||
|
||||
```
|
||||
Output if DEBUG is not defined:
|
||||
```
|
||||
|
||||
> (c). Explain why the output is different in parts (a) and (b)
|
||||
|
||||
When `DEBUG` is defined, any instances of the `PRINT_DEBUG` token are replaced with a `printf` call during compile time, but when it's not defined, they're replaced with nothing.
|
||||
|
||||
> (d). Is it necessary for the `DEBUG` macro to be defined *before* `debug.h` is included in order for `PRINT_DEBUG` to have the desired effect? Justify your answer.
|
||||
|
||||
Macro invocations are evaluated sequentially, and so if `DEBUG` was defined after `PRINT_DEBUG`, then any usages of `PRINT_EVALUATION` would be have like `DEBUG` was not defined.
|
||||
|
||||
---
|
||||
|
||||
> **5.** Suppose that a program consists of three source files - `main.c`, `f1.c`, and `f2.c`- Plus two header files, `f1.h` and `f2.h`. All three source files include `f1.h` but only `f1.c` and `f2.c` include `f2.h`. Write a makefile for this program, assuming that the compiler is `gcc` and that the executable file is to be named `demo`.
|
||||
```makefile
|
||||
demo: main.o f1.o f2.o
|
||||
gcc -o demo main.o f1.o f2.o
|
||||
|
||||
main.o: main.c f1.h
|
||||
gcc -c main.c
|
||||
|
||||
f1.o: f1.c f1.h f2.h
|
||||
gcc -c f1.c
|
||||
|
||||
f2.o: f2.c f2.h
|
||||
gcc -c f2.c
|
||||
|
||||
```
|
||||
---
|
||||
|
||||
> **6.** The following questions refer to the program described in Exercise 5.
|
||||
> (a). Which files need to be compiled when the program is built for the first time?
|
||||
|
||||
`f1.c`, `f1.h`, `f2.c`, `f2.h`, `main.c`, `main.h`
|
||||
|
||||
> (b). If `f1.c` is changed after the program has been built, which files need to be recompiled?
|
||||
|
||||
Just `f1.c`.
|
||||
|
||||
> (c). If `f1.h` is changed after the program has been built, which files need to be recompiled?
|
||||
|
||||
All source files, because they all include `f1.h`.
|
||||
|
||||
> (d). If `f2.h` is changed after the program has been built, which files need to be recompiled?
|
||||
|
||||
`f1.c` and `f2.c`.
|
@ -0,0 +1,21 @@
|
||||
|
||||
Yes they are, different structs can have the same field names.
|
||||
|
||||
> 2
|
||||
|
||||
```c
|
||||
struct c1 C1 { 0.0, 1.0};
|
||||
|
||||
struct c1 C2 { 1.0, 1.0};
|
||||
```
|
||||
|
||||
> 8a
|
||||
```c
|
||||
const struct color MAGENTA { 255, 0, 255};
|
||||
```
|
||||
|
||||
>11
|
||||
|
||||
20 bytes
|
||||
|
||||
UNCOMPLETED
|
@ -0,0 +1,90 @@
|
||||
> **4.** Suppose that the following declarations are in effect:
|
||||
```c
|
||||
struct point {int x, y; };
|
||||
struct rectangle { struct point upper_left, lower_right; };
|
||||
struct rectangle *p;
|
||||
```
|
||||
> Assume that we want `p` to point to a rectangle structure whose upper left corner is at $(10, 25)$, and whose lower right corner is at $(20, 15)$. Write a series of statements that allocate such a structure and initialize it as indicated.
|
||||
|
||||
```c
|
||||
struct rectangle rect = { { 10, 25 }, { 20, 15 } };
|
||||
p = ▭
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
> **5.** Suppose that `f` and `p` are declared as follows:
|
||||
```c
|
||||
struct {
|
||||
union {
|
||||
char a, b;
|
||||
int c;
|
||||
} d;
|
||||
int e[5];
|
||||
} f, *p = &f;
|
||||
```
|
||||
> Which of the following statements are legal?
|
||||
|
||||
(a) `p->b = ' ';`
|
||||
(b) `p->e[3] = 10;` - **Legal**
|
||||
(c) `(*p).d.a = '*';` - **Legal**
|
||||
(d) `p->d->c = 20;`
|
||||
|
||||
---
|
||||
|
||||
> **7.** The following loop is supposed to delete all nodes from a linked list and release the memory that they occupy. Unfortunately, the loop is incorrect. Explain what's wrong with it and show how to fix the bug.
|
||||
```c
|
||||
for (p = first; p != NULL; p = p->next)
|
||||
free(p);
|
||||
```
|
||||
|
||||
The above loop won't function because it deallocates the entry, then attempts to access the pointer to the next item, *after* it's already been freed.
|
||||
|
||||
A functional example might look like this:
|
||||
```c
|
||||
struct entry *p = first;
|
||||
while (p != NULL) {
|
||||
void *current = p;
|
||||
p = p->next;
|
||||
free(p);
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
> **9.** True or false: If `x` is a structure and `a` is a member of that structure, then `(&x)->a` is the same as `x.a`. Justify your answer.
|
||||
|
||||
**True**: The arrow operator is used to access a member of a struct through a pointer. `(&x)` creates a pointer to the `x` struct, therefore the arrow operator can be used to access fields on `x`.
|
||||
|
||||
---
|
||||
|
||||
> **13.** The following function is supposed to insert a new node into its proper place in an ordered list, returning a pointer to the first node in the modified list. Unfortunately, the function doesn't work correctly in all cases. Explain what's wrong with it and show how to fix it. Assume that the `node` structure is the one defined in Section 17.5.
|
||||
```c
|
||||
struct node *insert_into_ordered_list(struct node *list, struct node *new_node) {
|
||||
struct node *cur = list, *prev = NULL;
|
||||
while (cur->value <= new_node->value) {
|
||||
prev = cur;
|
||||
cur = cur->next;
|
||||
}
|
||||
prev->next = new_node;
|
||||
new_node->next = cur;
|
||||
return list;
|
||||
}
|
||||
```
|
||||
|
||||
In the above code, if the new item needs to be inserted at the *end* of the list, it breaks, because `cur` is set to `NULL`, then it attempts to access `cur->value`.
|
||||
```c
|
||||
struct node *insert_into_ordered_list(struct node *list, struct node *new_node) {
|
||||
struct node *cur = list, *prev = NULL;
|
||||
while (cur->value <= new_node->value) {
|
||||
prev = cur;
|
||||
cur = cur->next;
|
||||
if (cur->next == NULL) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
prev->next = new_node;
|
||||
new_node->next = cur;
|
||||
return list;
|
||||
}
|
||||
```
|
@ -0,0 +1,47 @@
|
||||
# \#2
|
||||
Directives:
|
||||
```c
|
||||
#include <stdio.h>
|
||||
```
|
||||
|
||||
Statements:
|
||||
```c
|
||||
printf("Parkinson's Law: \nWork expands so as to ");
|
||||
printf("fill the time\n");
|
||||
printf("available for its completion.\n");
|
||||
return 0;
|
||||
```
|
||||
|
||||
Output:
|
||||
```
|
||||
Parkinson's Law:
|
||||
Work expands so as to fill the time
|
||||
available for its completion.
|
||||
|
||||
```
|
||||
# \#5
|
||||
(A): `100_bottles` is not a legal C identifier because C identifiers cannot start with a number.
|
||||
# \#6
|
||||
Double underscores are typically used to denote statements reserved by the compiler, and in C++, double underscores are used in name mangling and so they cannot be used entirely. More subjectively, it can be hard to tell how many underscores are present.
|
||||
# \#7
|
||||
(A): `for`
|
||||
(E): `while`
|
||||
|
||||
# \#8
|
||||
14.
|
||||
|
||||
Work:
|
||||
1. `answer`
|
||||
2. `=`
|
||||
3. `(`
|
||||
4. `3`
|
||||
5. `*`
|
||||
6. `q`
|
||||
7. `-`
|
||||
8. `p`
|
||||
9. `*`
|
||||
10. `p`
|
||||
11. `)
|
||||
12. `/`
|
||||
13. `3`
|
||||
14. `;`
|
@ -0,0 +1,37 @@
|
||||
# 1.
|
||||
a. `86,1040`
|
||||
b. `3.02530e+01`
|
||||
c. `83.1620`
|
||||
d. `1e-06 `
|
||||
|
||||
# 2.
|
||||
```c
|
||||
float x = 0.12345;
|
||||
// a
|
||||
printf("%-8.1e", x);
|
||||
// b
|
||||
printf("%10.6e", x);
|
||||
// c
|
||||
printf("%8.3f", x);
|
||||
// d
|
||||
printf("%-6.0f", x);
|
||||
```
|
||||
|
||||
# 3.
|
||||
a. Equivalent
|
||||
b. Equivalent
|
||||
c. Equivalent
|
||||
d. Equivalent
|
||||
|
||||
# 4.
|
||||
`i`: `10`
|
||||
`x`: `0.3f`
|
||||
`j`: `5`
|
||||
|
||||
# 5.
|
||||
`x`: `12.3f`
|
||||
`i`: `45`
|
||||
`f`: `0.6f`
|
||||
|
||||
|
||||
|
@ -0,0 +1,26 @@
|
||||
# 1.
|
||||
a. `1 2`
|
||||
b. `0`
|
||||
c. `1`
|
||||
d. `0`
|
||||
# 3.
|
||||
a. `1`
|
||||
b. `-1`, `-2`
|
||||
c. `-1`, `-1`
|
||||
d. `1`, `2`
|
||||
# 9.
|
||||
a. `63 8`
|
||||
b. `1 2 3`
|
||||
c. `0 1 3`
|
||||
d. `0 0 0`
|
||||
# 11.
|
||||
a. `0 2`
|
||||
b. `4 11 6`
|
||||
c. `0 8 7`
|
||||
d. `15 4 5 4`
|
||||
|
||||
# 15.
|
||||
a. `i = 2, j = 2`
|
||||
b. `i = 1`, `j = 2`
|
||||
c. `i = 1`, `j = 2`
|
||||
d. `i = 1`, `j = 3`
|
103
education/computer engineering/ECE1400/Chapter 5 Exercises.md
Normal file
@ -0,0 +1,103 @@
|
||||
> 2. The following program fragments illustrate the logical operators. Show the output produced by each, assuming that `i`, `j`, and `k` are `int` variables.
|
||||
|
||||
a. `i = 10; j = 5;`
|
||||
```c
|
||||
printf("%d", !i < j);
|
||||
|
||||
// Expected output: `1`, because `!i` evaluates to 0, and 0 is less than 5, so that expression evaluates to true, or 1.
|
||||
```
|
||||
|
||||
b. `i = 2; j = 1;`
|
||||
```c
|
||||
printf("%d", !!i + !j);
|
||||
|
||||
// Expected output: `1`, because !!2 evaluates to 1, and !j evaluates to 0
|
||||
```
|
||||
|
||||
c. `i = 5; j = 0; k = -5;`
|
||||
```c
|
||||
printf("%d", i && j || k);
|
||||
|
||||
// Expected output: `1`, because i && j should evaluate to 0, but `0 || 1` should evalulate to true.
|
||||
```
|
||||
|
||||
d. `i = 1; j = 2; k = 3;`
|
||||
```c
|
||||
printf("%d", i < j || k);
|
||||
|
||||
// Expected output: `1`
|
||||
```
|
||||
|
||||
> 4. Write a single expression whose value is either `-1`, `0`, or `1` depending on whether `i` is less than, equal to, or greater than `j`, respectively.
|
||||
|
||||
```c
|
||||
/*
|
||||
If i < j, the output should be -1.
|
||||
If i == j, the output should be zero
|
||||
If i > j, the output should be 1.
|
||||
*/
|
||||
(i > j) - (i < j)
|
||||
```
|
||||
|
||||
> 6. Is the following `if` statement legal?
|
||||
```c
|
||||
if (n == 1-10)
|
||||
printf("n is between 1 and 10\n");
|
||||
```
|
||||
|
||||
Yes the statement is *legal*, but it does not produce the intended effect. It would not produce an output when `n = 5`, because `1-10` evaluates to `-9`, and `-9 != 5`.
|
||||
|
||||
> 10. What output does the following program fragment produce? (Assume that `i` is an integer variable.)
|
||||
```c
|
||||
int i = 1;
|
||||
switch (i % 3) {
|
||||
case 0: printf("zero");
|
||||
case 1: printf("one");
|
||||
case 2: printf("two");
|
||||
}
|
||||
```
|
||||
|
||||
The program would print `onetwo` because each case is missing a `break` statement.
|
||||
|
||||
> 11. The following table shows the telephone area codes in the state of Georgia along with the largest city in each area:
|
||||
|
||||
| Area code | Major city |
|
||||
| --------- | ---------- |
|
||||
| 229 | Albany |
|
||||
| 404 | Atlanta |
|
||||
| 470 | Atlanta |
|
||||
| 478 | Macon |
|
||||
| 678 | Atlanta |
|
||||
| 706 | Columbus |
|
||||
| 762 | Columbus |
|
||||
| 770 | Atlanta |
|
||||
| 912 | Savannah |
|
||||
> Write a switch statement whose controlling expression is the variable `area_code`. If the value of `area_code` is not in the table, the `switch` statement will print the corresponding city name. Otherwise, the `switch` statement will display the message `"Area code not recognized."` Use the techniques discussed in section 5.3 to make the `switch` as simple as possible.
|
||||
```c
|
||||
int area_code;
|
||||
|
||||
switch (area_code) {
|
||||
case 404:
|
||||
case 470:
|
||||
case 678:
|
||||
case 770:
|
||||
printf("Atlanta");
|
||||
break;
|
||||
case 706:
|
||||
case 762:
|
||||
printf("Columbus");
|
||||
break;
|
||||
case 229:
|
||||
printf("Albany");
|
||||
break;
|
||||
case 478:
|
||||
printf("Macon");
|
||||
break;
|
||||
case 912:
|
||||
printf("Savannah");
|
||||
break;
|
||||
default:
|
||||
printf("Area code not recognized.");
|
||||
break;
|
||||
}
|
||||
```
|
@ -0,0 +1,58 @@
|
||||
> 1. What output does the following program fragment produce?
|
||||
```c
|
||||
i = 1;
|
||||
while (i <= 128) {
|
||||
printf("%d ", i);
|
||||
i *= 2;
|
||||
}
|
||||
```
|
||||
|
||||
Output:
|
||||
```
|
||||
1 2 4 8 16 32 64 128
|
||||
```
|
||||
|
||||
> 2. What output does the following program fragment produce?
|
||||
```c
|
||||
i = 9384
|
||||
do {
|
||||
printf("%d ", i);
|
||||
i /= 10;
|
||||
} while (i <= 128);
|
||||
```
|
||||
|
||||
Output:
|
||||
```
|
||||
9384 938 93 9
|
||||
```
|
||||
|
||||
> 3. What output does the following `for` statement produce?
|
||||
```c
|
||||
for (i = 5, j = i - 1; i > 0, j > 0; --i, j = i - 1)
|
||||
printf("%d ", i);
|
||||
```
|
||||
|
||||
Output:
|
||||
```
|
||||
5 4 3 2
|
||||
```
|
||||
|
||||
> 4. Which one of the following statements is not equivalent to the other two (assuming that the loop bodies are the same?)
|
||||
```c
|
||||
for (i = 0; i < 10; i++) // (a)
|
||||
for (i = 0; i < 10; ++i) // (b)
|
||||
for (i = 0; i ++ < 10; ) // (c)
|
||||
```
|
||||
|
||||
Answer:
|
||||
C is not the same as A and B, because the increment takes place before the loop body is executed.
|
||||
|
||||
> 5. Which one of the following statements is not equivalent to the other two (assuming that the loop bodies are the same)?
|
||||
```c
|
||||
while (i < 10) {...} // (a)
|
||||
for (; i < 10;) {...} // (b)
|
||||
do {...} while (i < 10); // (c)
|
||||
```
|
||||
|
||||
Answer:
|
||||
C is not the same as A and B, because the block is executed before the condition is checked.
|
@ -0,0 +1,48 @@
|
||||
> 3. Which of the following aren not legal types in C?
|
||||
|
||||
a. `short unsigned int`
|
||||
b. `short float`
|
||||
c. `long double`
|
||||
d. `unsigned long`
|
||||
|
||||
Answer:
|
||||
b. `short float`
|
||||
|
||||
> 4. If `c` is a variable of type `char`, which of the following statements is illegal?
|
||||
|
||||
```c
|
||||
char c;
|
||||
// A:
|
||||
i += c; // i has type int
|
||||
// B:
|
||||
c = 2 * c - 1;
|
||||
// C:
|
||||
putchar(c);
|
||||
// D:
|
||||
printf(c);
|
||||
```
|
||||
|
||||
Answer:
|
||||
D is illegal because `printf` operates on strings, not `char`s.
|
||||
|
||||
> 6. For each of the following items of data, specify which one of the types `char`, `short`, `int`, or `long`is the smallest one guaranteed to be large enough to store the item.
|
||||
|
||||
Answer:
|
||||
A. Days in a month: `char`
|
||||
B. Days in a year: `short`
|
||||
C. Minutes in a day: `short`
|
||||
D. Seconds in a day: `long`
|
||||
|
||||
> 10. Suppose that `i` is a variable of type `int`, `j` is a variable of type `float`, and `k` is a variable of type `unsigned int`. What is the type of the expression `i + (int) j * k`?
|
||||
|
||||
Answer:
|
||||
`unsigned int`
|
||||
|
||||
> 15. Use `typedef` to create types named `Int8`, `Int16`, and `Int32`. Define the types so that they represent 8 bit, 16 bit, and 32 bit integers on your machine.
|
||||
|
||||
Answer:
|
||||
```C
|
||||
typedef char Int8;
|
||||
typedef short Int16;
|
||||
typedef long Int32;
|
||||
```
|
@ -0,0 +1,69 @@
|
||||
> 1. We discussed using the expression `sizeof(a) / sizeof(a[0]` to calculate the number of elements in an array. The expression `sizeof(a) / sizeof(t)` where `t` is the type of `a`'s elements would also work, but it's considered an inferior technique. Why?
|
||||
|
||||
Answer:
|
||||
Using the type of the array's first element means that if you change the type of an array, it won't break the code that calculates the number of elements.
|
||||
|
||||
> 3. Write a declaration of an array named weekend containing seven `bool` values. Include an initialize that makes the first and last values `true`; all other values should be `false`.
|
||||
|
||||
Answer:
|
||||
```c
|
||||
bool weekend[] = {true, [1 ... 5] = false, true};
|
||||
```
|
||||
|
||||
> 5. Calculators, watches, and other electronic devices often rely on 7 segment displays for numerical output. To form a digit, such devices turn on some of the seven segments while leaving others off.
|
||||
>
|
||||
> Here's what the array might look like, with each row representing one digit:
|
||||
```c
|
||||
const int segments[10][7] = {{1, 1, 1, 1, 1, 1, 0}, ...};
|
||||
```
|
||||
> I've given you the first row of the initializer, fill in the rest.
|
||||
|
||||
Answer:
|
||||
```c
|
||||
const int segments[10][7] = {
|
||||
{1, 1, 1, 1, 1, 1, 0}, // 0
|
||||
{0, 1, 1, 0, 0, 0, 0}, // 1
|
||||
{1, 1, 0, 1, 1, 0, 1}, // 2
|
||||
{1, 1, 1, 1, 0, 0, 1}, // 3
|
||||
{0, 1, 1, 0, 0, 1, 0}, // 4
|
||||
{1, 0, 1, 1, 0, 1, 1}, // 5
|
||||
{1, 0, 1, 1, 1, 1, 1}, // 6
|
||||
{1, 1, 1, 0, 0, 0, 0}, // 7
|
||||
{1, 1, 1, 1, 1, 1, 1}, // 8
|
||||
{1, 1, 1, 1, 0, 1, 1} // 9
|
||||
};
|
||||
```
|
||||
|
||||
>10. Write a declaration for an 8x8 `char` array named `chess_board`. Include an initializer that puts the following data into the array, one character per array element:
|
||||
\[omitted]
|
||||
|
||||
```c
|
||||
char chess_board[8][8] = {
|
||||
{'r', 'n', 'b', 'q', 'k', 'b', 'n', 'r'},
|
||||
{'p', 'p', 'p', 'p', 'p', 'p', 'p', 'p'},
|
||||
{' ', '.', ' ', '.', ' ', '.', ' ', '.'},
|
||||
{'.', ' ', '.', ' ', '.', ' ', '.', ' '},
|
||||
{' ', '.', ' ', '.', ' ', '.', ' ', '.'},
|
||||
{'.', ' ', '.', ' ', '.', ' ', '.', ' '},
|
||||
{' ', '.', ' ', '.', ' ', '.', ' ', '.'},
|
||||
{'.', ' ', '.', ' ', '.', ' ', '.', ' '},
|
||||
{'P', 'P', 'P', 'P', 'P', 'P', 'P', 'P'},
|
||||
{'R', 'N', 'B', 'K', 'Q', 'B', 'N', 'R'},
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
> 11. Write a program fragment that declares an 8x8 `char` array named `checker_board` and then uses a loop to store the following data into the array (one character per array element).
|
||||
|
||||
```c
|
||||
char checker_board[8][8];
|
||||
for (int row = 0; row < 8; row++) {
|
||||
for (int column = 0; column < 8; column++) {
|
||||
if ((column + row) % 2 == 0) {
|
||||
checker_board[row][column] = 'B';
|
||||
} else {
|
||||
checker_board[row][column] = 'R';
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
@ -0,0 +1,78 @@
|
||||
> 1. The following function, which computes the area of a triangle, contains two errors. Locate the errors and show how to fix them. (*Hint*: There are no errors in the formula)
|
||||
```c
|
||||
double triangle_area(double base, height)
|
||||
double product;
|
||||
{
|
||||
product = base * height;
|
||||
return product / 2;
|
||||
}
|
||||
```
|
||||
|
||||
Answer:
|
||||
```c
|
||||
// A type annotation is needed for `height`
|
||||
double triangle_area(double base, double height)
|
||||
{
|
||||
// The `product` variable declaration was not in the function block.
|
||||
double product;
|
||||
product = base * height;
|
||||
return product / 2;
|
||||
}
|
||||
```
|
||||
|
||||
> 2. Write a function `check(x, y, n)` that returns `1` if both `x` and `y` fall between zero and `n - 1` inclusive. The function should return 0 otherwise. Assume that `x`, `y`, and `n` are all of type int
|
||||
```c
|
||||
int check(int x, int y, int n) {
|
||||
int in_range = 1;
|
||||
if (x < 0 || y < 0) {
|
||||
in_range = 0;
|
||||
}
|
||||
if (x > n - 1 || y > n - 1) {
|
||||
in_range = 0;
|
||||
}
|
||||
|
||||
return in_range;
|
||||
}
|
||||
```
|
||||
|
||||
> 7. Suppose that function `f` has the following definition:
|
||||
> `int f(int a, int b) { ... }`
|
||||
> Which of the following statements are legal? Assume that `i` has type `int` and `x` has type `double`).
|
||||
|
||||
Answer:
|
||||
All of them are legal and will compile and run. (c) and (d) are what I would consider bad practice because they perform an implicit conversion from a double to an int, and should include an explicit cast.
|
||||
|
||||
> 8. Which of the following would be valid prototypes for a function that returns nothing and has one double parameter?
|
||||
|
||||
Answer:
|
||||
(a) and (b).
|
||||
Parameters must contain a type annotation but they do not need to specify a name. A function prototype declaration must specify a return type.
|
||||
|
||||
> 9. What will be the output of the following program?
|
||||
```c
|
||||
#include <stdio.h>
|
||||
|
||||
void swap (int a, int b);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int i = 1, j = 2;
|
||||
swap(i, j);
|
||||
printf("i = %d, j = %d\n", i, j);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void swap(int a, int b)
|
||||
{
|
||||
int temp = a;
|
||||
a = b;
|
||||
b = temp;
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Answer:
|
||||
```
|
||||
i = 1, j = 2
|
||||
```
|
||||
Because function parameters are passed by value and not reference in C, modifications to `a` and `b` are limited to the scope of `swap`.
|
@ -0,0 +1,322 @@
|
||||
# Banana Cake
|
||||
## Instructions
|
||||
|
||||
1. Assume an action set of {add \<ingredient>, stir, bake, cool}. Draw a flowchart, using the paradigm discussed in class, to show the process of baking a banana cake. Use Google to find a typical list of ingredients.
|
||||
2. Represent the flowchart from problem 1 as pseudocode.
|
||||
|
||||
## Flowchart
|
||||
```d2
|
||||
vars: {
|
||||
d2-config: {
|
||||
dark-theme-id: 200
|
||||
}
|
||||
}
|
||||
grid-columns: 3
|
||||
|
||||
begin: {
|
||||
shape: oval
|
||||
# near: top-left
|
||||
}
|
||||
|
||||
begin -> add 3c flour\
|
||||
-> add 1 1/2 tsp baking soda\
|
||||
-> add 1/2 tsp cinnamon\
|
||||
-> add 1/2 tsp salt\
|
||||
-> stir\
|
||||
-> add 3 mashed bananas\
|
||||
-> add 1 tsp lemon juice\
|
||||
-> stir again\
|
||||
-> add 3 eggs\
|
||||
-> add 2tsp vanilla extract\
|
||||
-> stir a final time\
|
||||
-> bake @ 350f for 50 min\
|
||||
-> let cool for 1 hour\
|
||||
-> end
|
||||
end: {
|
||||
shape: oval
|
||||
# near: bottom-right
|
||||
}
|
||||
```
|
||||
|
||||
## Pseudocode
|
||||
```c
|
||||
/**************************************
|
||||
* Function Title: BakeBananaCake
|
||||
*
|
||||
* Summary: Bake a banana cake
|
||||
*
|
||||
* Inputs: none
|
||||
* Outputs: none
|
||||
**************************************
|
||||
* Pseudocode
|
||||
*
|
||||
* Begin
|
||||
* Add 3c flour
|
||||
* Add 1 1/2 tps baking soda
|
||||
* Add 1/2 tsp cinnamon
|
||||
* Add 1/2 tsp salt
|
||||
* Stir
|
||||
* Add 3 mashed bananas
|
||||
* Add 1 tsp lemon juice
|
||||
* Stir
|
||||
* Add 3 eggs
|
||||
* Add 2tsp vanilla extract
|
||||
* Stir a final time
|
||||
* Bake @ 350F for 50 min
|
||||
* Cool for 1 hour
|
||||
* End
|
||||
**************************************/
|
||||
```
|
||||
|
||||
# Walking
|
||||
## Instructions
|
||||
3. Assume an action set of {walk \<value> steps, turn to \<value> degrees}. Draw a flowchart showing a shady path and a sunny path to get from the west doors of the Engineering Building to the south-east doors of the TSC. Pick a meaningful “if” condition to select one of the two paths. Use real-world data in your design.
|
||||
|
||||
4. Represent the flowchart from problem 3 as pseudocode.
|
||||
|
||||
%%
|
||||
Assuming a step distance of 2.5 feet.
|
||||
|
||||
Shady path:
|
||||
1. Turn to 270 degrees
|
||||
2. Walk 112 steps
|
||||
3. Turn to 225 degrees
|
||||
4. Walk 124 steps
|
||||
5. Turn to 270 degrees
|
||||
6. Walk 361 steps
|
||||
7. Turn to 0 degrees
|
||||
8. Walk 176 steps
|
||||
9. Turn to 270 degrees
|
||||
10. Walk 62 steps
|
||||
|
||||
|
||||
Sunny path:
|
||||
1. Turn to 270 degrees
|
||||
2. Walk 73 steps
|
||||
3. Turn to 0 degrees
|
||||
4. Walk 94 steps
|
||||
5. Turn to 275 degrees
|
||||
6. Walk 467 steps
|
||||
7. Turn to 180 degrees
|
||||
8. Walk 86 steps
|
||||
9. Turn to 270 degrees
|
||||
10. Walk 80 steps
|
||||
|
||||
%%
|
||||
|
||||
## Flowchart
|
||||
```d2
|
||||
vars: {
|
||||
d2-config: {
|
||||
dark-theme-id: 200
|
||||
}
|
||||
}
|
||||
classes: {
|
||||
turn-0: {
|
||||
label: turn to 0 degrees
|
||||
}
|
||||
turn-90: {
|
||||
label: turn to 90 degrees
|
||||
}
|
||||
turn-180: {
|
||||
label: turn to 180 degrees
|
||||
}
|
||||
turn-270: {
|
||||
label: turn to 270 degrees
|
||||
}
|
||||
}
|
||||
beginning: {shape: oval}
|
||||
beginning -> if
|
||||
if: {
|
||||
shape: diamond
|
||||
label: if (shady)\n<then else>\nendif
|
||||
|
||||
}
|
||||
if -> shady: {
|
||||
direction: up
|
||||
label: if shady path
|
||||
}
|
||||
shady {
|
||||
grid-columns: 2
|
||||
1.class: turn-270
|
||||
1 -> 2
|
||||
2.label: walk 112 steps
|
||||
2 -> 3
|
||||
3.label: turn to 225 degrees
|
||||
3 -> 4
|
||||
4.label: walk 124 steps
|
||||
4 -> 5
|
||||
5.class: turn-270
|
||||
5 -> 6
|
||||
6.label: walk 361 steps
|
||||
6 -> 7
|
||||
7.class: turn-0
|
||||
7 -> 8
|
||||
8.label: walk 176 steps
|
||||
8 -> 9
|
||||
9.class: turn-270
|
||||
9 -> 10
|
||||
10.label: walk 62 steps
|
||||
}
|
||||
end: {shape: oval}
|
||||
if -> end
|
||||
if -> sunny: if sunny path
|
||||
sunny {
|
||||
grid-columns: 2
|
||||
1.class: turn-270
|
||||
1 -> 2
|
||||
2.label: walk 73 steps
|
||||
2 -> 3
|
||||
3.class: turn-0
|
||||
3 -> 4
|
||||
4.label: walk 94 steps
|
||||
4 -> 5
|
||||
5.label: turn to 275 degrees
|
||||
5 -> 6
|
||||
6.label: walk 361 steps
|
||||
6 -> 7
|
||||
7.class: turn-0
|
||||
7 -> 8
|
||||
8.label: walk 176 steps
|
||||
8 -> 9
|
||||
9.label: turn to 270 degrees
|
||||
9 -> 10
|
||||
10.label: walk 80 steps
|
||||
}
|
||||
```
|
||||
|
||||
## Pseudocode
|
||||
```c
|
||||
/**************************************
|
||||
* Function Title: WalkToTscFromEngr
|
||||
*
|
||||
* Summary: Walk from the west entrance of the engineering building
|
||||
* to the southeast entrace of the taggart student center, using either
|
||||
* a shady or sunny path
|
||||
*
|
||||
* Inputs: shady (boolean)
|
||||
* Outputs: none
|
||||
**************************************
|
||||
* Pseudocode
|
||||
*
|
||||
* Begin
|
||||
* If (shady) then
|
||||
* Turn to 270 degrees
|
||||
* Walk 112 steps
|
||||
* Turn to 225 degrees
|
||||
* Walk 124 steps
|
||||
* Turn to 270 degrees
|
||||
* Walk 361 steps
|
||||
* Turn to 0 degrees
|
||||
* Walk 176 steps
|
||||
* Turn to 270 degrees
|
||||
* Walk 62 steps
|
||||
* Else
|
||||
* Turn to 270 degrees
|
||||
* Walk 73 steps
|
||||
* Turn to 0 degrees
|
||||
* Walk 94 steps
|
||||
* Turn to 275 degrees
|
||||
* Walk 467 steps
|
||||
* Turn to 180 degrees
|
||||
* Walk 86 steps
|
||||
* Turn to 270 degrees
|
||||
* Walk 80 steps
|
||||
* EndIf
|
||||
* End
|
||||
**************************************/
|
||||
```
|
||||
|
||||
# 4 Way Intersection
|
||||
## Instructions
|
||||
5. Develop a flowchart that describes the behavior of a set of traffic lights that control a 4-way intersection. Assume the light can either be red or green. Define an appropriate action set that accounts for the time the light has been in the current state.
|
||||
|
||||
6. Represent the flowchart from problem 5 as pseudocode.
|
||||
|
||||
## Action Set
|
||||
| Action name | Description |
|
||||
| -- | -- |
|
||||
| Set \[north, east, south, west] light to \[red, green] | Set the specified light to either red or green |
|
||||
| Toggle lights | Change the color of all 4 lights to the color they were not |
|
||||
| Wait \[number of seconds] seconds | Pause for \[number of seconds] seconds before continuing to the next instruction |
|
||||
|
||||
## Flowchart
|
||||
```d2
|
||||
vars: {
|
||||
d2-config: {
|
||||
dark-theme-id: 200
|
||||
}
|
||||
}
|
||||
classes: {
|
||||
toggle-lights: {
|
||||
label: Toggle lights
|
||||
}
|
||||
}
|
||||
beginning: {
|
||||
shape: oval
|
||||
label: beginning
|
||||
}
|
||||
beginning -> initialize lights
|
||||
initialize lights {
|
||||
grid-columns: 1
|
||||
1.label: set the north light to red
|
||||
1 -> 2
|
||||
2.label: set the south light to red
|
||||
2 -> 3
|
||||
3.label: set the east light to green
|
||||
3 -> 4
|
||||
4.label: set the west light to green
|
||||
}
|
||||
initialize lights -> loop
|
||||
loop {
|
||||
near: center-right
|
||||
label: loop indefinitely
|
||||
begin-loop: {
|
||||
shape: step
|
||||
label: begin iteration
|
||||
}
|
||||
begin-loop -> 1
|
||||
1.label: wait 30 seconds
|
||||
1 -> 2
|
||||
2.label: toggle lights
|
||||
end-loop: {
|
||||
shape: step
|
||||
label: end iteration
|
||||
}
|
||||
2 -> end-loop
|
||||
end-loop -> begin-loop
|
||||
}
|
||||
loop -> end: the heat death of the universe
|
||||
end: {
|
||||
near: bottom-right
|
||||
shape: oval
|
||||
label: end
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Pseudocode
|
||||
```c
|
||||
/**************************************
|
||||
* Function Title: RunStopLights
|
||||
*
|
||||
* Summary: Operate stoplights for a 4 way intersection
|
||||
*
|
||||
* Inputs: none
|
||||
* Outputs: none
|
||||
**************************************
|
||||
* Pseudocode
|
||||
*
|
||||
* Begin
|
||||
* Set the north light to red
|
||||
* Set the south light to red
|
||||
* Set the east light to green
|
||||
* Set the west light to green
|
||||
* Loop indefinitely
|
||||
* Wait 30 seconds
|
||||
* Toggle lights
|
||||
* EndLoop
|
||||
* End
|
||||
**************************************/
|
||||
```
|
||||
|
@ -0,0 +1,2 @@
|
||||
- To find the magnitude of a negative twos compliment number, flip all of the bits and add one.
|
||||
-
|
15
education/computer engineering/ECE2700/Adders.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Half Adder
|
||||
|
||||
# Full Adder
|
||||
|
||||
# Ripple Carry Adder
|
||||
|
||||
# Carry-Select Adder
|
||||
A carry select adder is built using two ripple carry adders, and multiplexing them together based off of the value of $c_{in}$. This is done for performance reasons, because when adding two numbers $x$ and $y$, we know $x$ and $y$ *before* we know the value of $c_{in}$. This means we can compute what the output of $x + y + c_{in}$ would be for $c_{in} = 0$ and $c_{in} = 1$ at the same time, then just toggle between the two possible values given the *actual* value of $c_{in}$.
|
||||
|
||||
The delay is calculated like so:
|
||||
1. Given the delay of a full adder is $k$, and the delay of a 2 to 1 mux is $\frac{1}{m}k$,
|
||||
2. then the delay of a 4 bit ripple carry adder is $4k$, because it's 4 full adders chained together, running sequentially.
|
||||
3. This means that the delay of a 4 bit carry select adder is $4k + \frac{k}{m}$
|
||||
|
||||
# Carry-lookahead adder
|
148
education/computer engineering/ECE2700/Binary Logic.md
Normal file
@ -0,0 +1,148 @@
|
||||
# History of Boolean Algebra
|
||||
- In 1849, George Boole published a scheme for describing logical thought and reasoning
|
||||
- In the 1930s, Claude Shannon applied Boolean algebra to describe circuits built with switches
|
||||
- Boolean algebra provides the theoretical foundation for digital design
|
||||
|
||||
# Properties of Boolean Algebra
|
||||
| Number | Col. A | Col. A Description | Col. B | Col. B Description |
|
||||
| ---------------------- | --------------------------------------------------------------------------------- | ------------------ | ----------------------------------------------------------------------------------- | ------------------ |
|
||||
| 1. | $0 \cdot 0 = 0$ | | $1 + 1 = 1$ | |
|
||||
| 2. | $1 \cdot 1 = 1$ | | $0 + 0 = 0$ | |
|
||||
| 3. | $0 \cdot 1 = 1 \cdot 0 = 0$ | | $1 + 0 = 0 + 1 = 1$ | |
|
||||
| 4. | if $x = 0$ then $\overline{x} = 1$ | | if $x = 1$ then $\overline{x} = 0$ | |
|
||||
| 5. | $x \cdot 0 = 0$ | | $x + 1 = 1$ | |
|
||||
| 6. | $x \cdot 1 = x$ | | $x + 0 = x$ | |
|
||||
| 7. | $x \cdot x = x$ | | $x + x = x$ | |
|
||||
| 8. | $x \cdot \overline{x} = 0$ | | $$x + \overline{x} = 1$ | |
|
||||
| 9. | $\overline{\overline{x}} = x$ | | | |
|
||||
| 10. Commutative | $x \cdot y = y \cdot x$ | | $x + y = y + x$ | |
|
||||
| 11. Associative | $x \cdot (y \cdot z) = (x \cdot y) \cdot z$ | | $x + (y + z) = (x + y) +z$ | |
|
||||
| 12. Distributive | $x \cdot (y +z) = x \cdot y + x \cdot z$ | | $x + y \cdot z = (x + y) \cdot (x + z$ | |
|
||||
| 13. Absorption | $x + x \cdot y = x$ | | $x \cdot (x + y) = x$ | |
|
||||
| 14. Combining | $x \cdot y + x \cdot \overline{y} = x$ | | $(x + y) \cdot (x + \overline{y}) = x$ | |
|
||||
| 15. DeMorgan's Theorem | $\overline{x \cdot y} = \overline{x} + \overline{y}$ | | $x + y = \overline{x} \cdot \overline{y}$ | |
|
||||
| 16. | $x + \overline{x} \cdot y = x + y$ | | $x \cdot (\overline{x} + y) = x \cdot y$ | |
|
||||
| 17. Consensus | $x \cdot y + y \cdot z + \overline{x} \cdot z = x \cdot y + \overline{x} \cdot z$ | | $(x + y) \cdot (y + z) \cdot (\overline{x} + z) = (x + y) \cdot (\overline{x} + z)$ | |
|
||||
# Synthesis
|
||||
In the context of binary logic, synthesis refers to the act of creating a boolean expression that evaluates to match a given truth table.
|
||||
|
||||
This is done by creating a product term for each entry in the table that has an output of $1$, that also evaluates to $1$, then ORing each product term together and then simplifying.
|
||||
|
||||
Example:
|
||||
|
||||
Given the below truth table, synthesize a boolean expression that corresponds.
|
||||
|
||||
| $x_1$ | $x_2$ | $f(x_1, x_2)$ |
|
||||
| ----- | ----- | ------------- |
|
||||
| 0 | 0 | 1 |
|
||||
| 0 | 1 | 1 |
|
||||
| 1 | 0 | 0 |
|
||||
| 1 | 1 | 1 |
|
||||
- $f(0, 0)$ evaluates to true with the expression $\overline{x}_1 \cdot \overline{x}_2$
|
||||
- $f(0, 1)$ evaluates to true with the expression $\overline{x}_1\cdot x_2$
|
||||
- $f(1, 0)$ should provide an output of zero, so that can be ignored
|
||||
- $f(1, 1)$ evaluates to true with the expression $x_1 \cdot x_2$
|
||||
ORing all of the above expression together, we get:
|
||||
$$ f(x_1, x_2) = \overline{x}_1\overline{x}_2 + \overline{x}_1 x_2 + x_1x_2 $$
|
||||
$$
|
||||
\begin{multline}
|
||||
= x_1x_2 \\
|
||||
= x
|
||||
\end{multline}
|
||||
$$
|
||||
# Logic Gates
|
||||
|
||||

|
||||
# NOT Gate
|
||||
A binary NOT gate has a single input, and inverts that input (output is not the input).
|
||||
|
||||
## Truth Table
|
||||
| $x$ | $y$ |
|
||||
| --- | --- |
|
||||
| 0 | 1 |
|
||||
| 1 | 0 |
|
||||
## Mathematical Expression
|
||||
A NOT operation is mathematically expressed using a bar:
|
||||
$$ y = \bar{x} $$
|
||||
# AND Gate
|
||||
An AND gate will only output a 1 if *both* inputs are a one (input one *and* input two are enabled).
|
||||
|
||||
## Truth Table
|
||||
| $x_1$ | $x_2$ | $y$ |
|
||||
| ----- | ----- | --- |
|
||||
| 0 | 0 | 0 |
|
||||
| 0 | 1 | 0 |
|
||||
| 1 | 0 | 0 |
|
||||
| 1 | 1 | 1 |
|
||||
## Mathematical Expression
|
||||
An AND operation is mathematically expressed using a times symbol, or with no symbol at all:
|
||||
$$ y = x_1 \cdot x_2 = x_1x_2$$
|
||||
|
||||
# NAND Gate
|
||||
A NAND gate outputs a 1 *unless* both inputs are enabled (input one *and* input two are *not* enabled).
|
||||
|
||||
## Truth Table
|
||||
| $x_1$ | $x_2$ | $y$ |
|
||||
| ----- | ----- | --- |
|
||||
| 0 | 0 | 1 |
|
||||
| 0 | 1 | 1 |
|
||||
| 1 | 0 | 1 |
|
||||
| 1 | 1 | 0 |
|
||||
## Mathematical Expression
|
||||
A NAND operation is mathematically expressed using a bar over an AND operation:
|
||||
$$ y = \overline{x_1 \cdot x_2}$$
|
||||
|
||||
|
||||
# OR Gate
|
||||
An OR gate outputs a 1 if either or both inputs are enabled (if input one *or* input two is enabled).
|
||||
## Truth Table
|
||||
| $x_1$ | $x_2$ | $y$ |
|
||||
| ----- | ----- | --- |
|
||||
| 0 | 0 | 0 |
|
||||
| 0 | 1 | 1 |
|
||||
| 1 | 0 | 1 |
|
||||
| 1 | 1 | 1 |
|
||||
## Mathematical Expression
|
||||
A mathematical OR is notated with a $+$ symbol.
|
||||
|
||||
$$ y = x_1 + x_2 $$
|
||||
# NOR Gate
|
||||
A NOR gate outputs a one if neither gate is enabled.
|
||||
## Truth Table
|
||||
| $x_1$ | $x_2$ | $y_1$ |
|
||||
| ----- | ----- | ----- |
|
||||
| 0 | 0 | 1 |
|
||||
| 0 | 1 | 0 |
|
||||
| 1 | 0 | 0 |
|
||||
| 1 | 1 | 0 |
|
||||
## Mathematical Expression
|
||||
A NOR operation is expressed using a bar over an OR operation.
|
||||
$$ y = \overline{x_1 + x_2} $$
|
||||
# XOR Gate
|
||||
An XOR gate is on if one input is enabled, but *not* both (exclusively one or the other).
|
||||
|
||||
## Truth Table
|
||||
| $x_1$ | $x_2$ | $y$ |
|
||||
| ----- | ----- | --- |
|
||||
| 0 | 0 | 0 |
|
||||
| 0 | 1 | 1 |
|
||||
| 1 | 0 | 1 |
|
||||
| 1 | 1 | 0 |
|
||||
## Mathematical Expression
|
||||
An XOR operation is expressed using a circle around an addition symbol:
|
||||
$$ y = x_1 \oplus x_2 $$
|
||||
|
||||
## XNOR Gate
|
||||
An XNOR gate is on if neither input is enabled, or both inputs are enabled.
|
||||
|
||||
## Truth Table
|
||||
|
||||
| $x_1$ | $x_2$ | $y$ |
|
||||
| ----- | ----- | --- |
|
||||
| 0 | 0 | 1 |
|
||||
| 0 | 1 | 0 |
|
||||
| 1 | 0 | 0 |
|
||||
| 1 | 1 | 1 |
|
||||
## Mathematical Expression
|
||||
An XNOR operation is expressed using a bar over an XOR operation:
|
||||
$$ y = \overline{x_1 \oplus x_2} $$
|
56
education/computer engineering/ECE2700/Digital Hardware.md
Normal file
@ -0,0 +1,56 @@
|
||||
Any poduct that contains a logic circuit is classified as digital hardware.
|
||||
- Moore's Law states that the number of a transistors on a chip doubles every two years
|
||||
- The International Technology Roadmap for Semiconductors (ITRS) forecasts technology, including the number of transistors on a chip
|
||||
- Multiple integrated circuits can be connected using a printed circuit board, or PCB.
|
||||
- *Standard chips* conform to an agreed upon standard for functionality and physical configuration. They are usually less than 100 transistors in size, and provide basic building blocks for logic.
|
||||
- These chips are combined to form a larger logic circuit
|
||||
- They were popular until the 1980s
|
||||
- As ICs improved, it became inefficient space-wise to have separate chips for each logical building block
|
||||
- The functionality of these chips is fixed, and they do not change.
|
||||
# Programmable Logic Devices
|
||||
Programmable logic devices (PLDs) include a number of programmable switches that can configure the internal circuitry of a chip
|
||||
- The most common type of PLD is a Field Programmable Gate Array (FPGA)
|
||||
- FPGAs are widely available, but come with the drawback that they're limited in speed and performance
|
||||
|
||||
# Application Specific Integrated Circuits
|
||||
Application Specific Integrated Circuits (ASICs) have higher maximum performance and transistor density compared to FPGAs, but the cost of production is very high.
|
||||
- A logic circuit is made of connected logic gates
|
||||
|
||||
# Binary Numbers
|
||||
In base 10, a value is expressed by an n-tuple with n digits
|
||||
$$ D = d_{n-1}d_{n-2} \cdots d_1 d_0 $$
|
||||
This represents the value
|
||||
$$ V(D) = d_{n-1} * 10^{n-1} + d_{n - 2} * 10^{n-2} + \cdots + d_1 * 10^1 + d_0 * 10^0 $$
|
||||
In a binary or base 2 number system, each digit can be a zero or one, called a *bit*.
|
||||
$$ D = d_{n-1}d_{n-2} \cdots d_1 d_0 $$
|
||||
To determine the integer value, a very similar formula can be used.
|
||||
$$ V(B) = b_{n-1} * 2^{n-1} + b_{n-2} * 2^{n-2} \cdots b_{1} * 2^1 + b_0 * 2^0 $$This formula can be generalized as:
|
||||
*For radix $r$*:
|
||||
$$ k = k_{n-1} k_{n-2} \cdots k_1 k_0$$
|
||||
- The base of a number is often notated in the format of $(n)_b$, EG a base 10 number might be $(14)_{10}$, and a binary number might be $(10)_2$.
|
||||
- The *least significant bit* (LSB) is usually the right-most bit. The highest value bit, or the *most significant bit* (MSB).
|
||||
- A nibble is 4 bits, and a byte is 8 bits
|
||||
## Conversions
|
||||
### Base 10 to Binary
|
||||
Repeatedly divide by 2, and track the remainder.
|
||||
|
||||
As an example, the below table shows how one might convert from $(857)_{10}$ to base 2.
|
||||
|
||||
| Equation | Remainder | |
|
||||
| --------------- | --------- | --- |
|
||||
| $857 / 2 = 428$ | $1$ | |
|
||||
| $428 / 2 = 214$ | $0$ | |
|
||||
| $214 / 2 = 107$ | $0$ | |
|
||||
| $107 / 2 = 53$ | $1$ | |
|
||||
| $53 / 2 = 26$ | $1$ | |
|
||||
| $26 / 2 = 13$ | $0$ | |
|
||||
| $13 / 2 = 6$ | $1$ | |
|
||||
| $6 / 2 = 3$ | $0$ | |
|
||||
| $3 / 2 = 1$ | $1$ | |
|
||||
| $1 / 2 = 0$ | $1$ | |
|
||||
|
||||
The final answer is $1101011001$. The least significant bit is the remainder of the first division operation, and the most significant bit is the remainder of the last operation.
|
||||
# Definitions
|
||||
- **Xtor** is an abbreviation for *transistor*
|
||||
- **Moore's Law** states that the number of transistors on a chip doubles every two years.
|
||||
- A tuple is a finite and ordered list of things
|
37
education/computer engineering/ECE2700/Karnaugh Maps.md
Normal file
@ -0,0 +1,37 @@
|
||||
A Karnaugh map is an alternative to a truth table for representing a function in boolean algebra, and serve as a way to derive minimum cost circuits for a truth table.
|
||||
|
||||
![[karnaugh-maps.png]]
|
||||
|
||||
Given the above truth table, the columns are labelled with $x_1$, and the rows are labelled with $x_2$.
|
||||
|
||||
To find a minimal boolean expression with a Karnaugh map, we need to find the smallest number of product terms ($x_1$, $x_2$) that should produce a 1 for all instances where the cell in a table is $1$.
|
||||
|
||||
# Two Variable Maps
|
||||
|
||||
![[Pasted image 20250224104850.png]]
|
||||
|
||||
- Given the map described in the above image, the output is $1$ for the row where $x_2$ is equal to 1.
|
||||
- Similarly, the output is $1$ for the column where $x_1$ is equal to zero.
|
||||
- By ORing the condition where $x_1$ is zero ($\overline{x_1}$), and the condition where $x_2$ is one ($x_1$), we can find a minimal expression for the truth table.
|
||||
|
||||
# Three Variable Maps
|
||||
![[Pasted image 20250224105753.png]]
|
||||
|
||||
A three variable Karnaugh map is constructed by placing 2 two-variable maps side by side. The values of $x_1$ and $x_2$ distinguish columns in the map, and the value of $x_3$ distinguishes rows in the map.
|
||||
|
||||
To convert a 3 variable Karnaugh map to a minimal boolean expression, start by looking for places in the map that contain 1s next to each other (by row, or by column).
|
||||
|
||||
![[Pasted image 20250224110124.png]]
|
||||
|
||||
From there, describe the pair of 1s using boolean algebra.
|
||||
|
||||
In the above example, the top pair of 1s is in the column where $x_3$ is equal to zero ($\overline{x_3}$), and $x_1$ is equal to $1$ ($x_1$). This describes a single term in the resulting equation ($x_1\overline{x_3}$).
|
||||
|
||||
|
||||
![[Pasted image 20250224110632.png]]
|
||||
> Similar logic can be employed using more than just a *pair* of ones.
|
||||
|
||||
|
||||
# Four Variable Maps
|
||||
![[Pasted image 20250224111117.png]]
|
||||
![[Pasted image 20250224110819.png]]
|
@ -0,0 +1,50 @@
|
||||
- Output depends on input and past behavior
|
||||
- Requires use of storage elements
|
||||
|
||||
# Latches
|
||||
## SR Latch
|
||||
SR stands for *Set*/*Reset*, and functions like so:
|
||||
- When a signal comes into $S$, $Q_a$ is **set** on and stays on until a signal comes into $R$, at which point the output ($Q_a$) is **reset**, back to zero.
|
||||
- $S$ and $R$ are interchangeable, it just impacts whether $Q_a$ or $Q_b$ is set/reset.
|
||||
Truth table:
|
||||
|
||||
| $S$ | $R$ | $Q_a$ | $Q_b$ |
|
||||
| --- | --- | ----- | ----- |
|
||||
| 0 | 0 | 0/1 | 1/0 |
|
||||
| 0 | 1 | 0 | 1 |
|
||||
| 1 | 0 | 1 | 0 |
|
||||
| 1 | 1 | 0 | 0 |
|
||||
![[Pasted image 20250303095542.png]]
|
||||
|
||||
|
||||
## Gated Latch
|
||||
A gated latch is similar to a basic latch, but the output only changes when $clk = 1$.
|
||||
## D Latch
|
||||
A D latch has two inputs, $clk$ and $data$. When $clk$ is high, $data$ is stored.
|
||||
# Flip Flops
|
||||
A latch, but the output only changes on one of the clock edges
|
||||
- Can be a rising edge latch or a falling edge latch
|
||||
## JK Flip Flop
|
||||
Similar to an SR flip flop, a JK flip flop has set/reset inputs, but when *both* inputs are high, then the output is toggled.
|
||||
## T Flip Flop
|
||||
A T Flip Flip, or a toggle flip flop has two inputs:
|
||||
- $clk$ - Clock input
|
||||
- $T$ - Whenever $T$ goes from low to high, the output toggles its state
|
||||
|
||||
# Registers
|
||||
## Shift Register
|
||||
![[Pasted image 20250317101146.png]]
|
||||
Above is a simple shift register.
|
||||
|
||||
## Parallel Shift Register
|
||||
A parallel shift register has 4 inputs, 4 outputs, a serial input, and a shift/load input.
|
||||
|
||||
When the *load* input is high, the input is stored into the register. When the *shift* input is high, the registers are shifted and the serial input is read into the new space.
|
||||
|
||||
# Counters
|
||||
## A 3-bit Up-counter
|
||||
![[Pasted image 20250317102911.png]]
|
||||
|
||||
# Synchronous Sequential Circuits
|
||||
- A synchronous circuit is clock driven, while an asynchronous circuit is not.
|
||||
|
135
education/computer engineering/ECE2700/Verilog/Modules.md
Normal file
@ -0,0 +1,135 @@
|
||||
Modules are the building block through which Verilog is built.
|
||||
|
||||
Each module can be thought of as a black box with a series of inputs, and a series of outputs. Changing the input changes the outputs.
|
||||
|
||||
Module definitions are started with the `module` keyword, and closed with the `endmodule` keyword.
|
||||
|
||||
## Syntax
|
||||
The general syntax of a module is as follows:
|
||||
```verilog
|
||||
// This line is referred to as the *module header*
|
||||
module <name> ([port_list]);
|
||||
// Contents of the module
|
||||
endmodule
|
||||
|
||||
// The port list is optional
|
||||
module <name>;
|
||||
// Contents
|
||||
endmodule
|
||||
```
|
||||
|
||||
Below is an example of the structure of a half adder module:
|
||||
```verilog
|
||||
module half_adder(
|
||||
input a,
|
||||
input b,
|
||||
output sum_bit,
|
||||
output carry_bit
|
||||
);
|
||||
// ------- snip ------------
|
||||
endmodule
|
||||
```
|
||||
|
||||
## Ports
|
||||
Ports are a set of signals that act as input and outputs for a particular module.
|
||||
|
||||
There are 3 kinds of ports:
|
||||
- `input`: Input ports can only receive values from the outside. `input` ports cannot be written to.
|
||||
- `output`: Output ports can be written to, but not read from.
|
||||
- `inout`: Inout ports can send *and* receive values.
|
||||
|
||||
Ports can be declared in the port list, or in the module body. Ports declared in the port list can optionally omit their type and only declare a name, to be specified within the body of the module:
|
||||
```verilog
|
||||
module half_adder(
|
||||
a,
|
||||
b,
|
||||
sum_bit,
|
||||
carry_bit
|
||||
);
|
||||
input a;
|
||||
input b;
|
||||
output sum_bit;
|
||||
output carry_bit;
|
||||
// ----------- snip -----------
|
||||
endmodule
|
||||
```
|
||||
|
||||
The full type of a port can also be defined within the portlist:
|
||||
```verilog
|
||||
```verilog
|
||||
module half_adder(
|
||||
input wire a,
|
||||
input wire b,
|
||||
output wire sum_bit,
|
||||
output wire carry_bit
|
||||
);
|
||||
input a;
|
||||
input b;
|
||||
output sum_bit;
|
||||
output carry_bit;
|
||||
// ----------- snip -----------
|
||||
endmodule
|
||||
```
|
||||
|
||||
### Port types
|
||||
If no type is defined, ports are implicitly defined as *nets* of type `wire`.
|
||||
|
||||
> In verilog, the term *net* refers to network, and it refers to a connection that joins two or more devices together.
|
||||
|
||||
Ports can be a vector type:
|
||||
```verilog
|
||||
module test(a, b, c);
|
||||
input [7:0] a;
|
||||
input [7:0] b;
|
||||
output [7:0] c;
|
||||
// -------- snip ---------
|
||||
endmodule
|
||||
```
|
||||
|
||||
# Instantiation
|
||||
Larger designs can be built by using multiple smaller modules.
|
||||
|
||||
Modules can be *instantiated* within other modules and ports, and these *instances* can be connected with other signals.
|
||||
|
||||
These port connections can be defined by an *ordered list*, or by *name*.
|
||||
|
||||
### By Ordered List
|
||||
```verilog
|
||||
module submodule (input x, y, z, output o);
|
||||
// ------- snip -------
|
||||
endmodule
|
||||
|
||||
module parent;
|
||||
wire a, b, c;
|
||||
wire o;
|
||||
// Similar to C, the type of the module is first, followed by
|
||||
// the name of the module instance.
|
||||
submodule foo (a, b, c, o);
|
||||
endmodule
|
||||
```
|
||||
|
||||
### By Name
|
||||
Ports can also be joined by explicitly defining the name.
|
||||
|
||||
Syntactically, this is done with a dot (`.`), followed by the port name defined by the design, followed by the signal name to connect, wrapped in parenthesis (`.x(a)`).
|
||||
```verilog
|
||||
module submodule (input x, y, z, output o);
|
||||
// ------------snip-----------------
|
||||
endmodule
|
||||
|
||||
module parent;
|
||||
wire a, b, c;
|
||||
wire o;
|
||||
submodule foo (
|
||||
.x(a),
|
||||
.y(b),
|
||||
.z(c),
|
||||
.o(o)
|
||||
);
|
||||
```
|
||||
|
||||
Because association is done by name, the order of definition does not matter.
|
||||
|
||||
### Unconnected ports
|
||||
Ports that are not connected to any wire by the parent module will have a value of high impedance, and is considered unknown/undefined.
|
||||
|
88
education/computer engineering/ECE2700/Verilog/Types.md
Normal file
@ -0,0 +1,88 @@
|
||||
There are two main categories of data types in Verilog. These categories differ in the underlying hardware structure they represent, and they differ in the way they are assigned and retain values.
|
||||
# Nets
|
||||
A *net* refers to a *network* of connections that join two or more devices together.
|
||||
|
||||
Nets connect different hardware entities and *do not store values*.
|
||||
## Wire
|
||||
A `wire` is the most commonly used type of net. When a port is declared in Verilog, it is implicitly given a type of `wire`.
|
||||
|
||||
It is illegal to re-declare a name already in use by a net:
|
||||
```verilog
|
||||
module foo;
|
||||
wire abc;
|
||||
wire a;
|
||||
wire b;
|
||||
wire c;
|
||||
|
||||
wire abc; // ILLEGAL: The wire `abc` is already defined
|
||||
|
||||
```
|
||||
|
||||
# Variables
|
||||
A variable is a data storage element. They retain the last input given.
|
||||
```verilog
|
||||
```verilog
|
||||
module testbench;
|
||||
integer int_a; // Integer variable
|
||||
real real_b; // Real variable
|
||||
time time_c; // Time variable
|
||||
|
||||
initial begin
|
||||
int_a = 32'hfacd_1b34; // Assign an integer value
|
||||
real_b = 0.1234567; // Assign a floating point value
|
||||
|
||||
#20; // Advance simulation time by 20 units
|
||||
time_c = $time; // Assign current simulation time
|
||||
|
||||
// Now print all variables using $display system task
|
||||
$display ("int_a = 0x%0h", int_a);
|
||||
$display ("real_b = %0.5f", real_b);
|
||||
$display ("time_c = %0t", time_c);
|
||||
end
|
||||
endmodule
|
||||
```
|
||||
```
|
||||
## Registers
|
||||
A `reg` can be used to model hardware registers because it stores a value until the next assignment.
|
||||
|
||||
### Integer
|
||||
A Verilog `integer` type is a 32 bit wide storage value. It does not *need* to store integers, it can be used for other purposes.
|
||||
```verilog
|
||||
integer count;
|
||||
```
|
||||
### Time
|
||||
A `time` variable is unsigned, 64 bits wide, and can be used to store time duration for debugging purposes. `realtime` is similar, but time is stored as a floating bit value.
|
||||
|
||||
## Real
|
||||
The `real` type denotes a floating point value.
|
||||
|
||||
## Strings
|
||||
Strings are stored in a vector of `reg`s. The width of the `reg` *must* be large enough to hold the string.
|
||||
|
||||
Each character in a string represents a one byte ASCII value. If the size of the variable is smaller than the string, the string is truncated.
|
||||
# Scalar and Vector Types
|
||||
By default, declarations of a net or `reg` value is 1 bit wide, referred to as a *scalar* value (only a single value).
|
||||
|
||||
```verilog
|
||||
// Scalar declaration
|
||||
wire foo;
|
||||
// Vector declaration, with 8 bits.
|
||||
wire [7:0] bar;
|
||||
```
|
||||
|
||||
Individual bits in a vector can be accessed using array operators, eg `[i]`.
|
||||
|
||||
```verilog
|
||||
reg [7:0] foo;
|
||||
|
||||
// Write to bit 0
|
||||
foo [0] = 1;
|
||||
```
|
||||
|
||||
## Part selects
|
||||
A range of contiguous bits from within another vector can be selected, referred to as a part select. This range can then be treated as a vector.
|
||||
```verilog
|
||||
reg [31:0] foo;
|
||||
// Select bits 23 through 16 (inclusive), and assign the 8 bit hex value `0xff` to them.
|
||||
foo [23:16] = 8'hff;
|
||||
```
|
62
education/computer engineering/ECE2700/Verilog/Verilog.md
Normal file
@ -0,0 +1,62 @@
|
||||
## Boolean Engineering
|
||||
- Truth tables
|
||||
- Only practical for small circuits
|
||||
- Schematic capture
|
||||
- Using CAD to place logic gates on a virtual canvas
|
||||
- Facilitates *hierarchical design*
|
||||
- Good for larger circuits
|
||||
- Don't scale well for very large circuits
|
||||
- Hardware Description Languages
|
||||
- Enables hierarchical design
|
||||
- Standardized by IEEE
|
||||
- Design is more portable
|
||||
- Usable in combination with schematic design
|
||||
|
||||
# Verilog
|
||||
- Originally developed by Gateway Design Automation
|
||||
- Put in public domain in 1990
|
||||
- Standardized in 1995
|
||||
- Originally intended for simulation of logic networks, later adapted to synthesis
|
||||
- Structural Verilog describes how things are laid out at a logic level.
|
||||
|
||||
## Structural Verilog
|
||||
Structural Verilog describes things at a logic level.
|
||||
- The use of logic gates and continuous assignment are markers of structural Verilog.
|
||||
```verilog
|
||||
// V---V---v--v-----portlist (not ordered)
|
||||
module example1(x1, x2, s, f);
|
||||
// Defining the types of the various ports
|
||||
input x1, x2, s;
|
||||
output f;
|
||||
// The first argument is the output value.
|
||||
// In this example, `k`, `g`, `h`, `f` are implicitly declared.
|
||||
// They could also be declared manually with the syntax `wire foo`, alongside the `input` and `output` declarations
|
||||
not(k, s); // You can also NOT a variable using a tilde, eg `~s`
|
||||
and(g, k, x1);
|
||||
and(h, s, x2);
|
||||
or(f, g, h);
|
||||
// You can also do this
|
||||
assign f = (~s & x1) | (s & x2);
|
||||
endmodule
|
||||
```
|
||||
## Behavioral Verilog
|
||||
Behavioral Verilog describes broader behavior, at a higher level
|
||||
- The use of `reg`s, time delays, arithmetic expressions, procedural assignment, and other control flow constructs are markers of behavioral Verilog.
|
||||
```verilog
|
||||
// V---V---v--v-----portlist (not ordered)
|
||||
module example1(x1, x2, s, f);
|
||||
// Defining the types of the various ports
|
||||
input x1, x2, s;
|
||||
output f;
|
||||
always @(a, b)
|
||||
// always @(....) says "do this stuff whenever any of the values inside of @(...) change"
|
||||
{s1, s0} = a + b;
|
||||
endmodule
|
||||
```
|
||||
|
||||
## Testbench Layout
|
||||
- Define UUT module
|
||||
- Initialize Inputs
|
||||
- Wait
|
||||
- Test every possible combination of inputs and validate that the outputs are correct
|
||||
- Debug output can be displayed with `$display("Hello world");`
|
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 102 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 695 KiB |
After Width: | Height: | Size: 331 KiB |
BIN
education/computer engineering/ECE2700/assets/karnaugh-maps.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
education/computer engineering/ECE2700/assets/logic-gates.jpeg
Normal file
After Width: | Height: | Size: 64 KiB |
@ -0,0 +1,42 @@
|
||||
<https://www.vox.com/the-big-idea/2018/3/5/17080470/addiction-opioids-moral-blame-choices-medication-crutches-philosophy>
|
||||
|
||||
|
||||
|
||||
| Claim | Elaboration | Link to source |
|
||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Addiction treatment options aren't embraced by the public because treating addiction is seen as indulging in weakness rather than "curing" addiction | - The data shows that we could save many lives by expanding [medication-assisted treatments](https://www.vox.com/science-and-health/2017/7/20/15937896/medication-assisted-treatment-methadone-buprenorphine-naltrexone) and adopting harm reduction policies like [needle exchange programs](https://www.cdc.gov/policy/hst/hi5/cleansyringes/index.html).<br>-Methadone and buprenorphine, the most effective medication-assisted treatments, are [“crutches,”](https://www.nbcnewyork.com/news/local/Methadone-Judge-Rule-Father-Blame-Lepolszki-Son-Overdose-Heroin-Addict-Ruling-I-Team-Investigation-273213211.html) in the words of felony treatment court judge Frank Gulotta Jr.; they are [“just substituting one opioid for another,”](https://www.vox.com/policy-and-politics/2017/5/11/15613258/tom-price-opioid-epidemic) according to former Health and Human Services Secretary Tom Price<br>- | [link](https://www.vox.com/the-big-idea/2018/3/5/17080470/addiction-opioids-moral-blame-choices-medication-crutches-philosophy#:~:text=The%20data%20shows,than%20%E2%80%9Ccuring%E2%80%9D%20i) |
|
||||
| - people view addiction as a moral failure | - Most of us have been trained to use more forgiving language when talking about addiction. We call it a disease. We say that people with addiction should be helped, not blamed. But deep down, many of us still have trouble avoiding the thought that they could stop using if they just tried harder. | |
|
||||
- People view addiction as a moral failure
|
||||
- Addiction treatment options aren't embraced by the public because treating addiction is seen as indulging in weakness rather than "curing" addiction
|
||||
- "Most of us have been trained to use more forgiving language when talking about addiction. We call it a disease. We say that people with addiction should be helped, not blamed. But deep down, many of us still have trouble avoiding the thought that they could stop using if they just tried harder. "
|
||||
- "There’s a part of us that can’t help but see addiction as a symptom of weak character and bad judgment."
|
||||
- The view of addiction as a moral failure is causing real damage to the world
|
||||
- "The stigma against addiction is “the single biggest reason America is failing in its response to the opioid epidemic,” [Vox’s German Lopez concluded](https://www.vox.com/science-and-health/2017/12/18/16635910/opioid-epidemic-lessons) after a year of reporting on the crisis""
|
||||
- "Lives depend on where we come down. The stigma against addiction owes its stubborn tenacity to a specific, and flawed, philosophical view of the mind, a misconception so seductive that it ensnared Socrates in the fifth century BC."
|
||||
- People view addiction as a moral failure because of the subconscious societal belief that our actions always reflect our beliefs and values
|
||||
- "We tend to view addiction as a moral failure because we are in the grip of a simple but misleading answer to one of the oldest questions of philosophy: Do people always do what they think is best? In other words, do our actions always reflect our beliefs and values? When someone with addiction chooses to take drugs, does this show us what she truly cares about — or might something more complicated be going on?"
|
||||
- Plato describes acting against one's best judgement as "Akrasia"
|
||||
- "At one point their discussion turns to the topic of what the Greeks called akrasia: acting against one’s best judgment."
|
||||
- "Akrasia is a fancy name for an all-too-common experience. I know I should go to the gym, but I watch Netflix instead. You know you’ll enjoy dinner more if you stop eating the bottomless chips, but you keep munching nevertheless."
|
||||
- This makes the article more relatable
|
||||
- Socrates felt that this didn't make sense, arguing that actions always reveal true beliefs
|
||||
- "Socrates clearly never went to a restaurant with unlimited chips. But he has a point. To figure out what a person’s true priorities are, we usually look to the choices they make. (“Actions speak louder than words.”) When a person binges on TV, munches chips, or gets high despite the consequences, Socrates would infer that they must care more about indulging now than about avoiding those consequences — whatever they may _say_ to the contrary"
|
||||
- He argues that people simply have bad judgement, and that they aren't acting against their better judgement.
|
||||
- He also argues that bad decisions indicate bad priorities.
|
||||
- The idea that people need to hit "rock bottom" before they can hit true recovery reinforces that idea. It means that a person needs to truly understand the consequences of their "selfishness".
|
||||
- Socratic rationale for punishing drug possession with jail is another example of this idea.
|
||||
- Addiction intensifies the disconnect between judgement and action
|
||||
- "Here’s the testimony of one person with addiction, reported in Maia Szalavitz’s book [_Unbroken Brain_](https://books.google.com/books?id=4yJ3CgAAQBAJ&lpg=PP1&pg=PA114#v=onepage&q&f=false): “I can remember many, many times driving down to the projects telling myself, ‘You don’t want to do this! You don’t want to do this!’ But I’d do it anyway.”
|
||||
- Ethos
|
||||
- The "self" is not a single unitary thing
|
||||
- The concept of a "dual process" mind comes from Nobel laureate Daniel Kahneman, who divides the mind into a part that makes judgements quickly, intuitively, and unconsciously ("System 1") and a part that thinks more slowly, rationally, and consiously ("System 2").
|
||||
- Neuroscientist Kent Berridge notes a system in our brain he calls the "wanting system", which regulates our cravings for things like food, sex, and drugs, using signals based in the neutrotransmitter dopamine
|
||||
- "More pertinent for our purposes is research on what [University of Michigan neuroscientist Kent Berridge](http://www-personal.umich.edu/~berridge/) calls the “wanting system,” which regulates our cravings for things like food, sex, and drugs using signals based in the neurotransmitter dopamine. The wanting system has powerful control over behavior, and its cravings are insensitive to long-term consequences."
|
||||
- He notes that drugs hijack that system causing cravings that are far stronger than humans experience.
|
||||
- The boundaries of where "the self" is in the human brain aren't clearly defined, processes in the brain mesh together tightly, so there's no clean boundary.
|
||||
- From a philosophical sense, there are many different ways to approach the concept of the self.
|
||||
- Modern philosophers reject the socratic view on behavior, instead saying that the self is instead based on judgements about the kind of person one wants to be, and the life they want to lead.
|
||||
- Addiction lies somewhere between choice and compulsion. Addiction doesn't make the choice for you, but it makes you gravitate towards a particular options.
|
||||
- Addiction is not a moral failure because it's still the same person, they just face cravings that are far harder to resist.
|
||||
- Treatments like methadone and buprenorphine can help with addiction by reducing the power of those cravings.
|
||||
-
|
@ -0,0 +1,16 @@
|
||||
- What conversations are meaningful?
|
||||
- What conversations are intentionally emotionally charged?
|
||||
- Fake news is rising
|
||||
- More people get news from social media
|
||||
- The attention economy is extremely effective
|
||||
- Social media is intentionally habit forming
|
||||
- Hate speech is poorly moderated, if at all
|
||||
- Fake news is meant to drive emotion
|
||||
- Manipulating emotions through social media (fake news) should raise
|
||||
- Emotional analytics *can* benefit the user
|
||||
- Very small (1/250 sec) exposure to content still has an impact
|
||||
- News literacy curriculum rarely addresses emotional news literacy
|
||||
- Mindfulness is good
|
||||
- System 1 and 2 thinking
|
||||
- Schools should address larger societal issues in discussion surrounding news literacy
|
||||
-
|
@ -0,0 +1,130 @@
|
||||
- Chose something to genuinely research, because I don't know, rather than a topic I'm passionate about.
|
||||
- Write out my opinion on the topic *before* starting formal research
|
||||
|
||||
- An issue or topic I've always wanted to learn more about is the political system
|
||||
- An issue or topic I have a personal connection to is philosophy, technology
|
||||
- A conversation or debate I spend a lot of time thinking about is the art of improvement
|
||||
- Something I think needs to change in society is the existence of self propagating norms
|
||||
- An issue that affects my community negatively is political discourse.
|
||||
- Something I wish more people cared about was fixing the world
|
||||
- I worry that I see safe spaces being used in a negative way
|
||||
# Primary research
|
||||
- Interview prominent public figures or heads of clubs that have public stated feelings about safe spaces, asking about why they did it, how they did it, what impact they feel it's had.
|
||||
- https://www.usu.edu/safe-at-usu/
|
||||
# Secondary Research
|
||||
- https://qz.com/398723/slavoj-zizek-thinks-political-correctness-is-exactly-what-perpetuates-prejudice-and-racism
|
||||
- https://en.wikipedia.org/wiki/Jonathan_Haidt
|
||||
- https://www.insidehighered.com/node/7407
|
||||
- https://www.vox.com/2016/7/5/11949258/safe-spaces-explained
|
||||
- https://www.dochaspsych.com/blog-defining-your-safe-space-what-does-safe-space-mean/
|
||||
- https://dictionary.cambridge.org/us/dictionary/english/safe-space
|
||||
- https://www.merriam-webster.com/dictionary/safe%20space
|
||||
- https://chicagomaroon.com/2016/news/reg-honors-chicago-blood-bank-founder/
|
||||
# The Complex Case of Fear and Safe Space
|
||||
## Introduction
|
||||
- The Chicago School board considered a proposal for a magnet school intended to be a safe space for LGBT individuals
|
||||
- The only reliable way to prevent disrespectful treatment is through separation
|
||||
- The rational commonly used for safe spaces makes it difficult for an educator to effectively respond to actual harassment
|
||||
- The need for safe space for students who experience social exclusion and harassment is the result of a political economy that was *intended to create safe space for others*. (2) Students *who are able* to articulate a need for safe space often don’t need the kind of space separation offers; *students who need (if only temporarily) separation, often are unable to say so.* (3) ‘‘Safe space’’ does not always or only function to defuse fear and establish safety for students; safe space may also function to create emotional relief for adults
|
||||
- Safe spaces translate feelings of fear into separation, creating a divide
|
||||
- The desire for safe spaces comes from the inherent idea that being hurt is an uncomfortable emotion, and fearing being hurt is an uncomfortable emotion. These are generally perceived to impede students' abilities to learn and grow. As such, safety is the antidote for fear, but this safety creates separation
|
||||
- The creation of safe spaces relies on the assumption that the creators of safe spaces are able to effectively anticipate the fears of students across cultural, racial, and social divides.
|
||||
- In this context, fear is fear of harm and danger. By operating on the assumption that more harm will come, this establishes a power relationship that's rooted in *past histories*, where the disadvantaged group is harmed.
|
||||
- By implementing safe spaces, you create a dynamic where the response to harassment (assumed or real) is fear.
|
||||
- If safe spaces create a dynamic of fear, the effect of safe spaces is less than desirable, and it doesn't move towards the intended goal of making students feel safer, rather it moves them away.
|
||||
## Where do calls for safe spaces come from?
|
||||
- Many students do not want to be separated from their peers
|
||||
- Many students who have the luxury of asking for a safe space don't truly need one
|
||||
- Calls for safe spaces have typically come from parents or educators
|
||||
- Many of the dynamics that enable harassment are invisible to those who enjoy privilege, social or otherwise
|
||||
- A call for a safe space indicates acknowledgement that a student feels uncomfortable in the face of other peers' behavior. The call for a safe space as a solution places that uncomfortable feeling into the box of "fear"
|
||||
- As long as we assume that emotions are instinctual reactions of a person to external events (even if triggered by cognitive judgment) that prompt action, the only available analysis of emotion relies on an outmoded faculty psychology. This has the troubling effect of divorcing logic and affect in action
|
||||
## Fear
|
||||
- Emotions can be viewed through the lens of a cognitive device that can help create and form habits.
|
||||
### Fear as an evolutionary tool
|
||||
- As Dewey helps us to understand, *it is not that fear as emotion causes us to move away from persons perceived as somehow dangerous; rather, affect becomes ‘‘fear’’ by the interpreted action of separation.*
|
||||
- Therefore, neurologically, *fear stems from habit*, not the other way around
|
||||
- Affect arises unbidden in a reaction to a problematic circumstance in which habits of adjustment are inadequate
|
||||
- Basically: You feel fear when you are unable to resolve the perceived issue through typical means
|
||||
- This emotional response doesn't necessarily need to be fear, leading to separation
|
||||
- This emotional response can be redirected into a search for understanding, creating a productive output (Dewey)
|
||||
- The author disagrees with the above sentiment, arguing that fear and anger can be intelligent, productive, emotions.
|
||||
### Fear as a Sociocultural Practice
|
||||
- According to Ahmed, objects and rhetoric can become "sticky, or saturated with emotion"
|
||||
- The author then uses this to reinforce the idea that by propagating "past feelings" forward by proactively acting against them, we continue to let these ideas hold meaning, and power.
|
||||
- The author refers to this propagation of fear as "habituated fear"
|
||||
- This fear works in two ways, the discriminated group fears further discrimination, and the dominant group fears losing control, change, and that which it does not understand. "The more we don't know \[understand] what or who it is we fear, *the more the world becomes fearsome*"
|
||||
- You can change the narrative around an idea, thus changing the emotions associated with it
|
||||
- *By designating fears \[at a societal level], we divide the world into safe spaces and unsafe spaces \[for different groups of people]*
|
||||
- By creating a designated "zone" of safety, you're allowing fear to restrict the space in which "targeted groups" exist in, which in turn allows "attacking groups" to grow and occupy more space
|
||||
- Without the ability to attach fear to certain objects, the "world itself" becomes fearsome. Humans attach fear to certain objects, thus enabling them to view the world from a simpler perspective of "safe", and "unsafe
|
||||
- Those in the discriminated group are often led to mask discomfort because societally, especially in "dominant groups", showing fear is seen as a sign of weakness. They are not able to avoid interacting with the dominant group without facing significant socioeconomic consequences.
|
||||
- The effect of safe spaces is to restrict the movement of parties *least likely* to cause trouble. This includes examples like restricting females to dorms to keep them safe from roving males, to the creation of a LGBT school for the protection of those students
|
||||
- The creation of safe spaces places people into categories, categories built around fear. This is effectively actively *investing* in the set of societal norms, creating further discrimination and harm.
|
||||
### Understanding emotions
|
||||
- Emotions come to be with reference to relational, socially constructed, context oriented experience
|
||||
- Separation is one way in which responding to an event results in the event being recorded as "something to be afraid of" in the amygdala
|
||||
- In may ways, safe spaces enable the habituation of fear in this manner
|
||||
- Fear is an emotion that's more easily used to hurt or control others, by making targeted groups afraid, then you give the dominant group control over them
|
||||
- *Safe spaces are a simple solution for an inherently complicated problem*. They limit rich deconstruction and interpretation of a situation, leading to limited ability to act on a fitting response.
|
||||
- When fear becomes habitually associated with an object, it becomes resistant to rational control
|
||||
- **How does fear benefit the fearful one?**
|
||||
- As people put up defenses from each other, we grow farther apart, and it becomes easier to view a group of people as "the other"
|
||||
- These groups tend to
|
||||
- Harassment can be more effectively combatted by re-interpreting the treatment they receive.
|
||||
|
||||
# Dilemmas of political correctness
|
||||
<https://ora.ox.ac.uk/objects/uuid:40d31aed-1296-4dc6-b511-e7135b83ee8a>
|
||||
- Discussions around political correctness can often be simplified down into such:
|
||||
- Proponents see nothing to fear in erecting norms that inhibit expression on one side, and opponents see this as a misguided effort to silence political enemies.
|
||||
- The author defines political correctness as "the attempt to establish norms of speech (or sometimes behavior) that are thought to protect vulnerable, marginalized, or historically victimized groups, with the goal of shaping public discourse with the goal of avoiding insult or outrage, a lowered sense of self esteem, or otherwise offending sensibilities." By dubbing something politically incorrect, it implies that there is something worrisome or objectionable at work
|
||||
- The author places strong emphasis on the distinction between an idea being morally right or wrong, and being politically correct. He provides the examples that:
|
||||
- Criticizing someone for referring to an administrative assistant as a "secretary" constitutes political correctness, but advocating for higher wages is not
|
||||
- Insisting on trigger warnings or deleting offending material is a form of political correctness, but arguing for rape prevention security measures is not.
|
||||
- In the inverse, it's not politically incorrect to make a donation to fight gay marriage, but it is politically incorrect to speak publicly against gay marriage
|
||||
- Political correctness can be viewed as something to benefit marginalized groups, or as a societal movement towards restraint on public expression
|
||||
- Given the idea that political correctness is a societal movement, it culminates in a form of self censorship where there are consequences for those who violate communal norms
|
||||
- One practical example of this is when German politician Phillipp Jenninger fell into disgrace after a speech that engaged rhetorically with the perspective of Nazi Germany, even though the speech was devoid of Nazi sympathy or anti-semitism. The same speech was given in a jewish synagogue by a jewish leader, and it received no negative response, demonstrating that the worry was the *signal* sent by the speech being given by a german politician
|
||||
- Another practical example is when the mayor of Washington DC was forced to resign after making use of the word "niggardly"
|
||||
- The N word is derived from latin roots (*niger* - dark) and developed from french and spanish roots in the mid 18th century, whereas niggardly is derived from the old english word *nigon*, meaning stingy. The modern etymological root is niggle, meaning giving excessive attention to minor details
|
||||
- Self censorship is an ultimate victory for those seeking to eliminate a form of censorship
|
||||
- Political correctness stems from concern for the victimized groups, and is typically seen on the left end of the political spectrum, but it can also be seen on the right
|
||||
- Examples includes attempts to delegitimize opposition to war by suggesting dissenters are insulting "the brave men and women who fight on our behalf"
|
||||
- Those opposed to political correctness often dismiss it as a trivial insistence to redefine words, or an attempt to silence opposition.
|
||||
- It's easy to dismiss some cases, but it's harder to dismiss others (eg, the taboo on the N word or certain taboos around racial science, or the underlying worries around such ideas).
|
||||
- There are perfectly valid motivations for attempting to cultivate and enforce political norms, eg a record of violence and injustice directed towards African Americans being promoted through superficially respectable means
|
||||
- On a broader level, enlightened moral thinking has led society to converge on a *default norm against advancing ideas associated with oppression or marginalization*
|
||||
- The author agrees with the idea that political correctness has made “the casual infliction of humiliation...much less socially acceptable than it was,” and even that “encouraging students to be ‘politically correct’ has made our country a far better place.”
|
||||
- The author argues that political correctness has brought huge benefits, but there are limits of being politically correct
|
||||
- Where those limits should be located is subject to disagreement. On one end of the spectrum are minor conventions and taboos, at the other end are explicit laws prohibiting forms of expression (hate speech)
|
||||
- You can acknowledge the value of political correctness without endorsing all uses of political correctness as a barrier in public discourse
|
||||
- Potential drawbacks of political correctness are especially relevant when you note how individual applications of political correctness are applied at an extreme level.
|
||||
- Extreme political correctness can often revolve around morally superficial applications of reasonable norms, taken to an extreme
|
||||
- Political correctness concerns offense and sensibilities, not the objective interests of everyone involved.
|
||||
- There's an increasing tendency to reject government terms like "illegal alien" in favor of "undocumented immigrant" with the implication that refusing to do so implies reactionary or hateful views.
|
||||
- One example of political correctness backfiring is when "sensitive" material is removed from coursework to avoid upsetting students.
|
||||
- This is shown with affirmative action causing problems and not having the intended affect
|
||||
- We want to avoid "being gored on either horn"
|
||||
- Enforcing political correctness can lead to widespread "preference falsification", in which what people believe in private is detached from what is spoken in public
|
||||
- "preference falsification" can lead to polarization.
|
||||
- In the example of social justice, many attribute poor social outcomes to factors *external* to the person, because then you can avoid directly blaming the person, an inherently uncomfortable discussion. Regardless of how correct the end result is, this tendency is still present.
|
||||
- In promoting norms intended to benefit marginalized groups, we both help and hurt them.
|
||||
|
||||
# Safe spaces, explained
|
||||
- The author introduces the paper by showcasing some of the negative ways in which safe spaces are viewed and understood.
|
||||
- The author then explains that safe spaces are a place where marginalized groups can feel welcome and accepted
|
||||
- Distinction is made between psychological safety and physical safety
|
||||
- The first usages of the term "safe space" came from the 1960s, where same sex relationships were outlawed, so a safe space was a place where people were able to practice same sex relationships without being noticed by the cops.
|
||||
- Examples of situations where the classical term "safe space" still applies exist in areas where non-heteronormative behavior is outlawed or socially shamed.
|
||||
- The same idea applies to other groups, like women, and people of color.
|
||||
- One advocate for safe spaces states that they've found that being able to surround themselves with people of the same marginalized group makes it easier to be themselves
|
||||
- Some safe spaces are created explicitly, whereas others are created organically
|
||||
- Safe spaces create a place for marginalized groups to truly relax. The author makes the claim that stress caused by discrimination creates poor health outcomes among groups who experience systemic discrimination.
|
||||
- Opponents of safe spaces caution that safe spaces limit social change by preventing the "messy work" of fighting for social change from occurring.
|
||||
- Debate and conflict isn't always what people want or feel they need.
|
||||
- There's a fear that social justice issues are nearly impossible to effectively resolve
|
||||
- Groupthink is a real issue that can occur within safe spaces.
|
||||
- People in marginalized groups have to face the feeling that society wasn't really designed for them, whereas people in dominant groups don't face that experience.
|
||||
|
||||
# How Safe Spaces Contribute to Mental Health
|
||||
- The term safe space is broadly used to describe designated areas or communities
|
@ -0,0 +1,15 @@
|
||||
The author grew up in between American and Mexican cultures. In school, she got punished for speaking Spanish at recess, and in college, she had to attend classes that were taught on how to speak without an accent.
|
||||
|
||||
She proposes the idea that languages are living. They constantly evolve, and different dialects can form as a means of expression or through localization. Languages can mix and merge to form new dialects that contain ideas from both.
|
||||
|
||||
The author then goes on to explain that languages are often used as a means of discrimination, and segregation. However, the inverse is also true. Discriminated groups will often form a new dialect or culture as a result of that discrimination.
|
||||
|
||||
|
||||
- The idea was proposed that languages can form in a way that's predominantly a male discourse.
|
||||
- Languages are living, and dialects form as a means of expression.
|
||||
- Languages mix and merge.
|
||||
- Discrimination and segregation occur because of language, and vice versa.
|
||||
- The language someone speaks is a large part of their identity.
|
||||
- Art created with a culture specific dialect can hold immense significance for members of that culture, and can be a means of sharing that culture.
|
||||
- The culture you exist in becomes internalized in your identity.
|
||||
- Excluding groups from a culture can lead to new cultures forming.
|
@ -0,0 +1,3 @@
|
||||
- First sentence should have author, article name, and main claim the article makes
|
||||
- Summary should be ordered in the same way the ideas in the article are
|
||||
- Use signal phrases ("argues", "makes the claim")
|
@ -0,0 +1,5 @@
|
||||
- Writing is distinct from grammar and rhetoric, and most writing classes don't teach writing, they instead focus on grammar and rhetoric.
|
||||
- Core curriculums ensure essentials, but limit depth and advancement of thinking
|
||||
- Drilling students on grammar does not improve writing ability, students should instead be taught how to use grammar effectively
|
||||
|
||||
- I thought the writing was meandering, rambly, and overly abstract. They never provide a clear definition of what good writing entails
|
@ -0,0 +1,18 @@
|
||||
- Arguing is an essential part of what it means to be human
|
||||
- Humans are not naturally adept at arguments
|
||||
- Our beliefs guide and determine our behavior
|
||||
- Others care how we behave
|
||||
- If beliefs lead to behavior, then controlling beliefs means controlling behaviors
|
||||
- Argumentative skills are self defensive
|
||||
- Diverting attention away from reasons makes those reasons easier to accept
|
||||
- Making opponents of a belief "The Enemy" is another way to make a belief easier to accept
|
||||
- Manipulation of beliefs can generally be categorized as diverting manipulation and distorting manipulation
|
||||
- Everyone aims to be in possession of the truth
|
||||
- Knowing why you believe a certain way is important, perhaps more important than the beliefs themselves.
|
||||
- Cognitive success is being correct, cognitive command is understanding why
|
||||
- Cognitive command doesn't necessarily guarantee correctness, but it enables one to rationally correct themselves
|
||||
- Pushback helps develop more complete understanding
|
||||
- When you only interact with people that agree with you, your beliefs become more extreme.
|
||||
- Deliberative democracy is healthy
|
||||
- Democracy relies on the ability to undo change, ala "we make changes and learn from them as we approach the ideal"
|
||||
- Everyone believes that they haven't been duped.
|
@ -0,0 +1,27 @@
|
||||
# Aristotle
|
||||
Aristotle claimed:
|
||||
- Humans are naturally *political*.
|
||||
- Humans naturally seek to *know*.
|
||||
|
||||
He used the term *political* to describe *humanity's dependency and tendency towards social interaction*.
|
||||
# Society
|
||||
- Humans need to be needed by each other.
|
||||
- Interdependence introduces complexity in society.
|
||||
- A mark of civility is the objection to things that harm others.
|
||||
- People often fail to recognize when they're being exploited in relationships.
|
||||
- We rely on others to share and accumulate data
|
||||
|
||||
# Arguments
|
||||
- Humans don't like being wrong.
|
||||
- Behavior is frequently determined by an individual's beliefs.
|
||||
- People naturally object to info they believe is wrong, in the same way that people naturally object to things that harm others.
|
||||
- **An argument is a rational response to a disagreement**, through showing others *why* they should adopt your beliefs.
|
||||
- From an argument, you want others to rationally adopt your beliefs.
|
||||
- Humans are inherently uncomfortable with disagreement.
|
||||
- You can audit a personal belief while still holding it, and regular auditing of personal beliefs is healthy.
|
||||
- Non-hostile arguments are a good way to audit those beliefs, and as such are healthy.
|
||||
|
||||
# Definitions
|
||||
| Phrase | Definition |
|
||||
| ------------ | --------------------------------------- |
|
||||
| Epistemology | The philosophical analysis of knowledge |
|
@ -1,31 +0,0 @@
|
||||
# Thesis
|
||||
The school should support food trucks during lunch.
|
||||
|
||||
# Problem
|
||||
Many students want better lunch options (look at the ala cart line, interview students), and the school can always use more funding. If the school encourages food trucks to park in the bus parking area during lunch (possibly for a fee or % of income), than it benefits the school because they gain profit, it benefits the students because they get more food options
|
||||
|
||||
TODO: figure out what payment system the school uses, and whether or not they could offer support to food trucks
|
||||
TODO: maybe bring food on presentation day for them?
|
||||
## Pros
|
||||
- students get better lunch options
|
||||
- they can get back to school earlier (help with tardies after lunch)
|
||||
- school fundraisers could use the food trucks (like w/ noodles and co)
|
||||
- school can get money from the thing
|
||||
- supports local small businesses
|
||||
- encourage students to walk around outside
|
||||
|
||||
## Cost
|
||||
|
||||
## Advertising
|
||||
|
||||
# Feasibility
|
||||
- It is legally defensible to restrict the sale of competitive foods *on campus*
|
||||
- *States* can restrict the sale of competitive foods, Utah appears to restrict them based solely off of nutritional value
|
||||
-
|
||||
|
||||
# Links
|
||||
https://www.cdc.gov/healthyschools/mih/pdf/approach5.pdf
|
||||
https://www.govinfo.gov/content/pkg/PLAW-111publ296/pdf/PLAW-111publ296.pdf
|
||||
https://statepolicies.nasbe.org/health/categories/nutrition-environment-and-services/competitive-foods-es/utah
|
||||
https://schools.utah.gov/file/ee7be5e9-2d64-45a4-9a53-fa215fff07df
|
||||
https://gis.cachecounty.org/Websites/Parcel%20and%20Zoning%20Viewer/
|
@ -1,85 +0,0 @@
|
||||
## What is art?
|
||||
**Art**: the expression or application of human creative skill.
|
||||
art must:
|
||||
- be made with the intent to convey emotion
|
||||
- should "satisfy the senses"
|
||||
- be made with intent
|
||||
- have attention to feeling and emotion
|
||||
art may:
|
||||
- be a relay of experience or emotion from one person to another
|
||||
|
||||
## Medium
|
||||
A particular material, along with an accompanying technique (plural: media). Example include:
|
||||
- Acrylic, enamel, gesso, glaze, ink, oil
|
||||
|
||||
## History
|
||||
1. The branch of knowledge dealing with past events
|
||||
## How do you look at art?
|
||||
Purposes and functions of art include:
|
||||
- Communicating information:
|
||||
- In non-literate societies, art was used to teach.
|
||||
- Today, film and television are used to disseminate information.
|
||||
- Spirituality and Religion
|
||||
- All of the world's major religions have used art to inspire and instruct the faithful
|
||||
- Personal and cultural expression
|
||||
- Social and political ends
|
||||
- Artists have criticized or influenced values or public opinion
|
||||
- Often it is clear and direct
|
||||
- Other times, however, it is less obvious
|
||||
- Monarchs who commissioned projects to symbolize their strength and power
|
||||
|
||||
Generally, art can be broken down into two parts, *form*, and *content*.
|
||||
- Form relates to the "formal" aspects of art, composition or medium.
|
||||
- Content relates to the subject. What's being portrayed, how are they portraying it?
|
||||
- The distinction should be made between fact and opinion/guessing.
|
||||
|
||||
Parts of form:
|
||||
1. Line and Shape
|
||||
- Lines define space and may create an outline or contour, as style called "linear"
|
||||
- They can be *visible* or *implied*, and may be a part of composition
|
||||
- It may be 2 dimensional, 3 dimensional, suggested, or implied.
|
||||
- *Wherever there is an edge
|
||||
2. Color
|
||||
- Hue: The name of the color (red, blue, yellow)
|
||||
- Saturation: The quality or vibrancy of those values
|
||||
- Value: The addition of white, black, or grey to the value
|
||||
- Tint: pure hue + white
|
||||
- Tone: pure hue + grey
|
||||
- Shade: pure hue + black
|
||||
3. Texture
|
||||
- Texture is an element of art pertaining to the surface quality or "feel" of the work of art
|
||||
- Texture can be described as smooth, rough, soft, etc. Some textures are real, and others are simulated
|
||||
- Textures that can be *felt* are ones that fingers can actually touch.
|
||||
4. Space and Mass
|
||||
- Space references to what contains objects: may be 2D or 3D.
|
||||
- Mass refers to the effect and degree of the bulk, density, and weight of matter in space.
|
||||
- In architecture or sculpture, it is the area occupied by a form.
|
||||
- Perspective: Foreshortening is a way of representing an object so that it conveys the illusion of depth; an object appears to be thrust forward or backward in space.
|
||||
5. Composition
|
||||
- How are items arranged or organized in art
|
||||
- Symmetrical, asymmetrical
|
||||
- Static or dynamic
|
||||
- Picture space is comprised of foreground, middle ground, and background.
|
||||
6. Scale
|
||||
- As an art history term, scale refers to the size of an object or object represented
|
||||
- Size of things, conveyed or literal
|
||||
|
||||
Parts of style:
|
||||
- Cultural style
|
||||
- Societies develop their own beliefs and style of material forms
|
||||
- Artists are a product of their culture
|
||||
- Period style
|
||||
- Style changes over time
|
||||
- Art changes because of economic and political changes
|
||||
- Regional style
|
||||
- Geography leads to diverse styles
|
||||
- Personal style
|
||||
- Individual artists often have distinct styles
|
||||
|
||||
Two basic forms of style:
|
||||
- Representational: Seeks to create recognizable subject matter (this is a picture of a dog)
|
||||
- Abstract: Seeks to capture the essence of a form, not the literal representation (this picture captures the feeling of a dog)
|
||||
|
||||
| Phrase | Definition |
|
||||
| ---- | ---- |
|
||||
| | |
|
@ -1,37 +0,0 @@
|
||||
| Piece | Place | Artist | Medium | Stuff |
|
||||
| ------------------------------------------------ | ----------------------------- | ------------------------------------ | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Treasury Of Atreus | Ancient Greece: Helladic | Unknown | Limestone | Largest dome for over 1000 years<br>Largest monolithic lintel<br>Ashlar masonry and cyclopic masonry<br>Thought to be Atreus, he abdicated (possibly a tomb)<br>post and lintel and corbelled arch<br> |
|
||||
| Snake Goddess | Ancient Greece: Minoan | Unknown | Faience | Hierarchy of Scale; Exposed breasts - power<br>victory pose<br>rosettes<br>sideways dress - otherworldly<br>We don't know much about this work |
|
||||
| Bull-leaping, from the palace at Knossos | Ancient Greece: Minoan | Unknown | Fresco | Different people with different colors<br>Elongation of bull shows motion<br>Aquatic pattern on border<br>Connection to sea |
|
||||
| Doryphoros (Spear Bearer) or *Canon* | Classical Greece: Classical | Polykleitos | Marble copy after bronze original | Called Canon because it's the standard of beauty for sculptures<br>Used golden ratio<br>Polykleitos was in the cult of pythagoreans<br>Contraposto - counter posture<br>Well preserved because of Pompeii<br> |
|
||||
| Dying Gaul | Classical Greece: Hellenistic | Epigonos | Marble copy after bronze original | Representational hair<br>Objects on ground give sense of place<br>Shows blood and sweat<br>Doesn't portray a greek man (less jacked, less hot), shows a frenchman<br>Choker shows he's a gaul<br>Defeat: Broken sword, no attempt to call for help (horn), sitting on shield |
|
||||
| Aphrodite (Venus de Milo) | Classical Greece: Hellenstic | Alexandros of Antioch-on-the-Meander | Marble | Individualized<br>Lot of detail compared to aphrodite of knidos<br>Dry drapery<br>Contrasting textures<br>Contraposto<br>Has musculature and feminine form<br>More intimate, sensual |
|
||||
| Nike alighting on a warship (Nike of Samothrace) | Classical Greece: Hellenistic | Unknown | Marble | Rhodes probably had a successful naval victory<br>Where Nike got it's logo<br>Wet drapery, would have been in fountain<br>lot of contrasting texture<br>Dynamic<br> |
|
||||
| Pont-du-Gard | Rome: Empire | Unknown | Shelly Limestone | Arches create space<br>Aquaduct helped city<br>columns aligned vertically<br>Ashlar Masonry<br>Used as major bridge<br>Use of Roman arch |
|
||||
| Portrait of Augustus as General | Rome: Empire | Unknown | Marble Copy, Bronze Original | Three powers (ishtar gate):<br>- Curass - Military<br>- Toga - Wealth and political power<br>- Eros - Supernatural power<br>Harkening pose: asking for cooperation, contraposto<br>Idealized proportions<br> |
|
||||
| The Pantheon | Roman: Empire | Patron: Hadrean | Concrete | First pantheon built out of wood, burned down<br>Rebuilt out of concrete<br>Originally built on a hill, now sunk by detrius of time<br>Monolithic columns from egypt in portico(front porch)<br>Had rosettes in ceiling squares<br>Biggest dome in the world<br>Squares and circles everywhere |
|
||||
| Arch of Titus | Rome: Empire | Patron: Titus | Concrete faced with marble | Commemorates when Rome defeats Jerusalem<br>Triumphal Arch <br>Depicts jewish temple being raided, money used to fund colosseum<br>Original historian was jewish (Josephus) |
|
||||
| Portrait of a Husband and Wife | Rome: Empire | Unknown | Fresco | His skin is darker<br>Preserved because of Pompeii<br>She's holding beeswax tablet and stylus<br>They're flexing literacy<br>Literacy was only for the rich<br> |
|
||||
| | | | | |
|
||||
|
||||
| Term | Definition |
|
||||
| -------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||
| Faience | Metal Glaze, Colder |
|
||||
| Verism | Exaggerated age, wrinkles. Counterpart to hellenism but with emphasis on age instead of muscles |
|
||||
| Chryselephantine | Ivory veneer with gold |
|
||||
| Archaizing | Make something look older in content and style - Fonseca Bust |
|
||||
| Harkening Pose | Asking for cooperatinon |
|
||||
| Patron | Person that paid for it |
|
||||
| Incrustacean | Cut rock in half and flip to show vein - Pantheon |
|
||||
| Portico | Fancy front porch - Pantheon |
|
||||
| Trumphal Arch | Winning army walks through on return home |
|
||||
| Contraposto | The Italian word for counter posture, natural stance, more weight on one foot, body makes an S shape |
|
||||
| Ungrounded | No historical record |
|
||||
| Doric | Masculine, beefy, the simplest, oldest style |
|
||||
| Ionic | Feminine, slender, medium old |
|
||||
| Corinthian | Fancy top, planty shape around the base of the top, latest style |
|
||||
| Corbelled Arch | Rocks that go in gradually, like two wedges |
|
||||
| Post and Lintel | Two posts and a lintel across the top |
|
||||
| Roman arch (with keystone) | Normal vault |
|
||||
| Groin vault | 4 way intersection |
|
||||
| | |
|
@ -1,9 +1,10 @@
|
||||
| Term | Definition |
|
||||
| ---- | ---- |
|
||||
| Consistent | The system of equations has at least one solution |
|
||||
| Inconsistent | Parallel lines, no solution |
|
||||
| Independent | The lines only cross at one point. |
|
||||
| Dependant | The lines are identical, and there are infinitely many solutions. Both equations represent the same line when plotted. |
|
||||
| Term | Definition |
|
||||
| ------------ | ---------------------------------------------------------------------------------------------------------------------- |
|
||||
| Consistent | The system of equations has at least one solution |
|
||||
| Inconsistent | Parallel lines, no solution |
|
||||
| Independent | The lines only cross at one point. |
|
||||
| Dependant | The lines are identical, and there are infinitely many solutions. Both equations represent the same line when plotted. |
|
||||
|
||||
# Solving
|
||||
## Graphing
|
||||
Graph the two equations, and look for points where they intersect
|
23
education/math/MATH1060 (trig)/Addition and Subtraction.md
Normal file
@ -0,0 +1,23 @@
|
||||
Given the formula $\sin(\alpha + \beta)$:
|
||||
$$ \sin(\alpha + \beta) = \sin(\alpha)\cos(\beta) + \cos(\alpha)\sin(\beta) $$
|
||||
$$ \sin(\alpha - \beta) = \sin(\alpha)\cos(\beta) - \cos(\alpha)\sin(\beta) $$
|
||||
Given the formula $\cos(\alpha + \beta)$:
|
||||
$$ \cos(\alpha + \beta) = \cos(\alpha)\cos(\beta) - \sin(\alpha)\sin(\beta) $$
|
||||
$$ \cos(\alpha - \beta) = \cos(\alpha)\cos(\beta) + \sin(\alpha)\sin(\beta) $$
|
||||
Given the formula $\tan(\alpha + \beta)$:
|
||||
$$\tan(\alpha + \beta) = \dfrac{\tan\alpha + \tan\beta}{1 - \tan\alpha\tan\beta} $$
|
||||
$$\tan(\alpha - \beta) = \dfrac{\tan\alpha - \tan\beta}{1 + \tan\alpha\tan\beta} $$
|
||||
|
||||
## Cofunctions
|
||||
Given that cofunctions are two functions that add up to 90 degrees, you can use the trig identities for sum and difference to find cofunctions.
|
||||
|
||||
For a right triangle where $\alpha = \theta$, $\beta = \frac{\pi}{2} - \theta$.
|
||||
|
||||
This means that $\sin(\theta) = \cos(\frac{\pi}{2} - \theta)$
|
||||
|
||||
Using this information, you can derive various cofunction identities.
|
||||
|
||||
| $\sin\theta = \cos(\frac{\pi}{2} - \theta)$ | $\cos\theta = \sin(\frac{\pi}{2} - \theta)$ |
|
||||
| ------------------------------------------- | -------------------------------------------- |
|
||||
| $\tan\theta = \cot(\frac{\pi}{2} - \theta)$ | $\cot\theta = \tan(\frac{\pi}{2} - \theta))$ |
|
||||
| $\sec\theta = \csc(\frac{\pi}{2} - \theta)$ | $\csc\theta = \sec(\frac{\pi}{2} - \theta)$ |
|
58
education/math/MATH1060 (trig)/Angles.md
Normal file
@ -0,0 +1,58 @@
|
||||
Angles consist of two rays with the same endpoint and are typically measured in standard position. Standard position is when one of the rays, referred to as the initial side starts at the origin and extend outwards along the $x$ axis, with a second ray referred to as the terminal side.
|
||||
|
||||
If an angle is measured counterclockwise, it's a *positive angle*, and if an angle is measured clockwise, it's a *negative angle*.
|
||||
|
||||
## Degrees and Radians
|
||||
To convert **from radians to degrees**, multiply the radian value by $\frac{180\degree}{\pi}$.
|
||||
$$ x * \frac{180\degree}{\pi}$$
|
||||
To convert **from degrees to radians**, multiply the degree measure by $\frac{\pi}{180\degree}$.
|
||||
$$ x * \frac{\pi}{180\degree} $$
|
||||
|
||||
## Complementary and Supplementary Angles
|
||||
A **complimentary** angle is formed when two positive angles add up to $90\degree$ or $\frac{\pi}{2}$. One mnemonic device that you can use to remember this is:
|
||||
|
||||
> Complementary starts with C, and C stands for corner. $90\degree$ makes a corner.
|
||||
|
||||
A **supplementary** angle is formed when two positive angles add up to $180\degree$ or $\pi$. One mnemonic device that you can use to remember this is:
|
||||
|
||||
> Supplementary starts with S and S stands for straight. $180\degree$ makes a straight line.
|
||||
|
||||
Angles greater than $90\degree$ have no complement and angles greater than $180\degree$ have no supplement.
|
||||
|
||||
# Triangles
|
||||
Triangles are typically notated using $A$, $B$, and $C$ for the angles of a triangle, and $a$, $b$, and $c$ for the sides of a triangle. $C$ will always be the right angle, and $c$ will always refer to the hypotenuse, but $A$/$a$ and $B$/$b$ are used interchangeably.
|
||||
|
||||
For any valid triangle, all three angles will *always* add up to $180\degree$.
|
||||
|
||||
$$ \angle A + \angle B + \angle C = 180 $$
|
||||
|
||||
## Right Angle Triangle Trigonometry
|
||||
|
||||
| SohCahToa | Inverse |
|
||||
| --------------------------------------------- | --------------------------------------------- |
|
||||
| $$ sin\theta = \frac{opposite}{hypotenuse} $$ | $$ csc\theta = \frac{hypotenuse}{opposite}$$ |
|
||||
| $$ cos\theta = \frac{adjacent}{hypotenuse} $$ | $$ sec\theta = \frac{hypotenuse}{adjacent} $$ |
|
||||
| $$ tan\theta = \frac{opposite}{adjacent} $$ | $$ cot\theta = \frac{adjacent}{opposite} $$ |
|
||||
These rules apply regardless of the orientation of the triangle.
|
||||
|
||||
Cosecant, secant, and tangent are inverses of sine, cosine, and tangent respectively, and so they can be found by taking $\frac{1}{x}$, where $x$ is the function you'd like to find the inverse of.
|
||||
|
||||
## Angle of Elevation/Depression
|
||||
- The **angle of elevation** is the angle between the hypotenuse and the bottom line. As an example, if a ladder was leaning against a building, the angle of elevation would be the angle where the ladder intersects with the ground, and it would be the angle between the ladder and the ground.
|
||||
- The **angle of depression** is the angle between the top of the hypotenuse and an (often imaginary) horizontal line.
|
||||
# Definitions
|
||||
| Term | Description |
|
||||
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Ray | Directed line segment consisting of an endpoint and a direction. Notated as $\overrightarrow{EF}$, where $E$ denotes the endpoint and $F$ denotes a point along the ray. |
|
||||
| Angle | Union of two rays with a common endpoint. Notated as $\angle DEF$ or $\angle FED$, where $D$ and $F$ are along the points of each ray, and $E$ is the vertex. $\angle EFD$ is not valid notation, because the vertex must be the middle. |
|
||||
| $\theta$ | A lowercase theta is used to represent a (non right) angle in a triangle |
|
||||
| $\phi$ | A lowercase phi is used to represent another unknown angle in a triangle. As an example, in an algebraic equation, $x$ might be used to represent the first unknown and $y$ the second. In trig, $\theta$ would be used to represent the first unknown angle, and $\phi$ the second. |
|
||||
| Initial side | In standard position, the initial side is the ray that extends from the origin along the $x$ axis. |
|
||||
| Terminal side | In standard position, the terminal side is the ray that's being measured relative to the initial side. |
|
||||
| $s$ | The length of a curve along the radius. |
|
||||
| Radian | Denoted with $rad$, one radian is equal to the radius, but it's measured along the arc in a curve instead of from the center. |
|
||||
| Complementary Angles | Two positive angles that add up to $90\degree$ or $\frac{\pi}{2}$. One mnemonic device that you can use to remember this is: <br><br>Complementary starts with C, and C stands for corner. $90\degree$ makes a corner. |
|
||||
| Supplementary Angles | Two positive angles that add up to $180\degree$ or $\pi$. One mnemonic device that you can use to remember this is:<br><br>Supplementary starts with S and S stands for straight. $180\degree$ makes a straight line. |
|
||||
| Hypotenuse | The side opposite the right angle in a triangle. |
|
||||
| Opposite | For a given angle $\theta$ in a right triangle, this is the side that does not touch that angle. |
|
||||
| Adjacent | For a given angle $\theta$ in a right triangle, this side makes up the side of the intersection opposite the hypotenuse. |
|
@ -0,0 +1,33 @@
|
||||
To solve for a double or half angle identity:
|
||||
1. Draw a triangle
|
||||
2. Choose an identity to use
|
||||
3. Substitute into formula
|
||||
# Double Angle Identities
|
||||
Sine:
|
||||
$$ \sin(2\theta) = 2\sin\theta\cos\theta $$
|
||||
Cosine:
|
||||
$$
|
||||
\begin{matrix}
|
||||
\cos(2\theta) = \cos^2\theta - \sin^2\theta\\
|
||||
= 1 - 2sin^2\theta\\
|
||||
= 2cos^2\theta - 1\\
|
||||
\end{matrix}
|
||||
$$
|
||||
|
||||
Tan:
|
||||
$$ \tan(2\theta) = \dfrac{2\tan\theta}{1-\tan^2\theta}$$
|
||||
|
||||
## Half Angle Identities
|
||||
Whether the output is positive or negative depends on what quadrant the output is in.
|
||||
Sine:
|
||||
$$ \sin(\frac{\theta}{2}) = \pm\sqrt{\frac{1-\cos\theta}{2}} $$
|
||||
Cosine:
|
||||
$$ \cos(\frac{\theta}{2}) = \pm \sqrt{\frac{1 + \cos\theta}{2}} $$
|
||||
Tangent:
|
||||
$$
|
||||
\begin{matrix}
|
||||
\tan(\dfrac{\theta}{2}) = \pm\sqrt{\dfrac{1-\cos\theta}{1 + \cos\theta}}\\
|
||||
= \dfrac{\sin\theta}{1 + \cos\theta}\\
|
||||
= \dfrac{1 - cos\theta}{\sin\theta}
|
||||
\end{matrix}
|
||||
$$
|
154
education/math/MATH1060 (trig)/Graphing.md
Normal file
@ -0,0 +1,154 @@
|
||||
|
||||
# Sine/Cosine
|
||||

|
||||
|
||||
Given the above graph:
|
||||
- At the origin, $sin(x) = 0$ and $cos(x) = 1$
|
||||
- A full wavelength takes $2\pi$
|
||||
|
||||
# Manipulation
|
||||
| Formula | Movement |
|
||||
| ---------------- | ---------------------------------- |
|
||||
| $y = cos(x) - 1$ | Vertical shift down by 1 |
|
||||
| $y = 2cos(x)$ | Vertical stretch by a factor of 2 |
|
||||
| $y = -cos(x)$ | Flip over x axis |
|
||||
| $y = cos(2x)$ | Horizontal shrink by a factor of 2 |
|
||||
# Periodic Functions
|
||||
A function is considered periodic if it repeats itself at even intervals, where each interval is a complete cycle, referred to as a *period*.
|
||||
# Sinusoidal Functions
|
||||
A function that has the same shape as a sine or cosine wave is known as a sinusoidal function.
|
||||
|
||||
There are 4 general functions:
|
||||
|
||||
| $$A * sin(B*x - C) + D$$ | $$ y = A * cos(B*x -c) + D$$ |
|
||||
| ----------------------------------------- | -------------------------------------- |
|
||||
| $$ y = A * sin(B(x - \frac{C}{B})) + D $$ | $$ y = A*cos(B(x - \frac{C}{B})) + D$$ |
|
||||
|
||||
|
||||
How to find the:
|
||||
- Amplitude: $|A|$
|
||||
- Period: $\frac{2\pi}{B}$
|
||||
- Phase shift: $\frac{C}{|B|}$
|
||||
- Vertical shift: $D$
|
||||
|
||||
|
||||
$$ y = A * \sin(B(x-\frac{C}{B})) $$
|
||||
# Tangent
|
||||
$$ y = tan(x) $$
|
||||

|
||||
To find relative points to create the above graph, you can use the unit circle:
|
||||
|
||||
If $tan(x) = \frac{sin(x)}{cos(x})$, then:
|
||||
|
||||
| $sin(0) = 0$ | $cos(0) = 1$ | $tan(0) = \frac{cos(0)}{sin(0)} = \frac{0}{1} =0$ |
|
||||
| ----------------------------------------- | ----------------------------------------- | ---------------------------------------------------------------- |
|
||||
| $sin(\frac{\pi}{4}) = \frac{\sqrt{2}}{2}$ | $cos(\frac{\pi}{4}) = \frac{\sqrt{2}}{2}$ | $tan(\frac{\pi}{4}) = \frac{\sqrt{2}}{2}/\frac{\sqrt{2}}{2} = 1$ |
|
||||
| $sin(\frac{\pi}{2}) = 1$ | $cos(\frac{\pi}{2}) = 0$ | $tan(\frac{\pi}{2}) = \frac{1}{0} = DNF$ |
|
||||
Interpreting the above table:
|
||||
- When $x = 0$, $y = 0$
|
||||
- When $x = \frac{\pi}{4}$, $y = 1$
|
||||
- When $x = \frac{\pi}{2}$, there's an asymptote
|
||||
|
||||
Without any transformations applied, the period of $tan(x) = \pi$. Because $tan$ is an odd function, $tan(-x) = -tan(x)$.
|
||||
# Cotangent
|
||||
$$ y = cot(x) $$
|
||||

|
||||
|
||||
To find relative points to create the above graph, you can use the unit circle:
|
||||
|
||||
If $cot(x) = \frac{cos(x)}{sin(x)}$, then:
|
||||
|
||||
| $sin(0) = 0$ | $cos(0) = 1$ | $cot(0) = \frac{sin(0)}{cos(0)} = \frac{1}{0} = DNF$ |
|
||||
| ----------------------------------------- | ----------------------------------------- | ---------------------------------------------------------------- |
|
||||
| $sin(\frac{\pi}{4}) = \frac{\sqrt{2}}{2}$ | $cos(\frac{\pi}{4}) = \frac{\sqrt{2}}{2}$ | $cot(\frac{\pi}{4}) = \frac{\sqrt{2}}{2}/\frac{\sqrt{2}}{2} = 1$ |
|
||||
| $sin(\frac{\pi}{2}) = 1$ | $cos(\frac{\pi}{2}) = 0$ | $tan(\frac{\pi}{2}) = \frac{1}{0} = DNF$ |
|
||||
|
||||
Without any transformations applied, the period of $cot(x) = \pi$. Because $cot$ is an odd function, $cot(-x) = -cot(x)$.
|
||||
|
||||
# Features of Tangent and Cotangent
|
||||
Given the form $y = A\tan(Bx - C) + D$ (the same applies for $\cot$)
|
||||
- The stretching factor is $|A|$
|
||||
- The period is $\frac{\pi}{|B|}$
|
||||
- The domain of $tan$ is all of $x$, where $x \ne \frac{C}{B} + \frac{\pi}{2} + {\pi}{|B|}k$, where $k$ is an integer. (everywhere but the asymptotes)
|
||||
- The domain of $cot$ is all of $x$, where $x \ne \frac{C}{B} + \frac{\pi}{|B|}k$, where $k$ is an integer (everywhere but the asymptotes)
|
||||
- The range of both is $(-\infty, \infty)$
|
||||
- The phase shift is $\frac{C}{B}$
|
||||
- The vertical shift is $D$
|
||||
|
||||
# Secant
|
||||
$$ y = \sec(x) $$
|
||||

|
||||
|
||||
$$ sec(x) = \frac{1}{\cos{x}} $$
|
||||
Because secant is the reciprocal of cosine, when $\cos{x} = 0$, then secant is undefined. $|\cos$| is never *greater than* 1, so secant is never *less than* 1 in absolute value. When the graph of cosine crosses the x axis, an asymptote for a matching graph of secant will appear there.
|
||||
|
||||
The general form of secant is:
|
||||
$$ y = A\sec(B{x} - C) + D $$
|
||||
$A$, $B$, $C$, and $D$ will have similar meanings to the secant function as they did to the sine and cosine functions.
|
||||
|
||||
# Cosecant
|
||||
$$ y = \csc(x) $$
|
||||

|
||||
|
||||
$$ \csc(x) = \frac{1}{\sin(x)} $$
|
||||
|
||||
Because cosecant is the reciprocal of sine, when $\sin{x} = 0$, then cosecant is undefined. $|\sin$| is never *greater than* 1, so secant is never *less than* 1 in absolute value. When the graph of sine crosses the x axis, an asymptote for a matching graph of cosecant will appear there.
|
||||
|
||||
The general form of cosecant is:
|
||||
$$ y = A\csc(B{x} - C) + D $$
|
||||
$A$, $B$, $C$, and $D$ will have similar meanings to the cosecant function as they did to the sine and cosine functions.
|
||||
|
||||
# Features of Secant and Cosecant
|
||||
- The stretching factor is $|A|$
|
||||
- The period is $\frac{2\pi}{|B|}$
|
||||
- The domain of secant is all $x$, where $x \ne \frac{C}{B} + \frac{\pi}{2} + \frac{\pi}{|B|}k$, where $k$ is an integer. (Every half period + phase shift is where asymptotes appear)
|
||||
- The domain of cosecant is all $x$, where $x \ne \frac{C}{B} + \frac{\pi}{|B|}k$, where $k$ is an integer.
|
||||
- The range is $(\infty, -|A| +D]\cup [|A| + D], \infty)$
|
||||
- The vertical asymptotes of secant occur at $x = \frac{C}{B} + \frac{\pi}{2} + \frac{\pi}{2} + \frac{\pi}{|B|}k$, where $k$ is an integer.
|
||||
- The vertical asymptotes of cosecant occur at $x = \frac{C}{B} + \frac{\pi}{|B|}k$, where $k$ is an integer.
|
||||
- The vertical shift is $D$.
|
||||
# Inverse Functions
|
||||
For any one to one function $f(x) = y$, a function $f^{-1}(y) = x)$. A function is considered one-to-one if every input only has one output, and every output can only be created from a single input.
|
||||
|
||||
The inverse of a trig function is denoted as $sin^{-1}$, or $arcsin$ respectively.
|
||||
|
||||
The inverse of a trig function is **not** the same as the reciprocal of a trig function, $\frac{1}{sin}$ is not the same as $sin^{-1}$.
|
||||
|
||||
- The *domain* of $f$ is the *range* of $f^{-1}$.
|
||||
- The *range* of $f$ is the *domain* of $f^{-1}$.
|
||||
|
||||
| Trig functions | Inverse trig functions |
|
||||
| ----------------------------------- | ------------------------------------ |
|
||||
| Domain: Angle measures | Domain: Ratio of sides of a triangle |
|
||||
| Range: Ratio of sides of a triangle | Range: Angle Measure |
|
||||
- To find the inverse of sin, you need to restrict the domain to $[-\frac{\pi}{2}, \frac{\pi}{2}]$
|
||||
- To find the inverse of cos, you need to restrict the domain to $[0, \pi]$
|
||||
- To find the inverse of tangent, you need to restrict the domain to $(-\frac{\pi}{2}, \frac{\pi}{2})$.
|
||||
|
||||
The graphs of an inverse function can be found by taking the graph of $f$, and flipping it over the line $y=x$.
|
||||
|
||||
# Examples
|
||||
> Given $-2\tan(\pi*x + \pi) - 1$
|
||||
|
||||
$A = -2$, $B = \pi$, $C = -\pi$, $D = -1$
|
||||
|
||||
> Identify the vertical stretch/compress factor, period, phase shift, and vertical shift of the function $y = 4\sec(\frac{\pi}{3}x - \frac{\pi}{2}) + 1$
|
||||
|
||||
$A = 4$, $B = \frac{\pi}{3}$, $C = \frac{\pi}{2}$, $D = 4$
|
||||
|
||||
Vertical stretch: $|4| = 4$
|
||||
Period: $\frac{2\pi}{\frac{\pi}{3}} = \frac{2\pi}{1} * \frac{3}{\pi} = 6$
|
||||
Phase shift: $\dfrac{\frac{\pi}{2}}{\frac{\pi}{3}} = \frac{3}{2}$
|
||||
Vertical shift: $1$
|
||||
|
||||
| Transformation | Equation |
|
||||
| -------------- | ------------------------- |
|
||||
| Stretch | $\|-2\| = 2$ |
|
||||
| Period | $\frac{\pi}{\|\pi\|} = 1$ |
|
||||
| Phase shift | $\frac{-\pi}{\pi} = -1$ |
|
||||
| Vertical shift | $-1$ |
|
||||
> Evaluate $\arccos{\frac{1}{2}}$ using the unit circle.
|
||||
|
||||
Taking the inverse of the above function, we get this. Because the domain of $cos$ ranges from $0$ to $\pi$ inclusive, the answer is going to be in quadrant 1 or quadrant 2.
|
||||
$$ cos(a) = \frac{1}{2} $$
|
||||
When $x$ is equal to one half, the angle is equal to $\frac{\pi}{3}$.
|
79
education/math/MATH1060 (trig)/Identities.md
Normal file
@ -0,0 +1,79 @@
|
||||
An **identity** is an equation that is true for all values of the variable for which the expressions in the equation are defined.
|
||||
# Trigonometric Identities
|
||||
|
||||
All of the following only apply when the denominator is not equal to zero.
|
||||
|
||||
$$ tan \theta = \frac{y}{x} $$
|
||||
Because the following are inverses of their counterparts, you only need to remember the equivalents for $sin$, $cos$, and $tan$, then just find the inverse by taking $1/v$.
|
||||
|
||||
| Base Identity | Inverse Identity | Alternate Identities | Alternate Inverse Identities |
|
||||
| ----------------------------- | ------------------------------ | --------------------------------------------- | --------------------------------------------------------------------- |
|
||||
| $$ sin\theta = y $$ | $$ csc\theta = \frac{1}{y} $$ | | $$ csc\theta = \frac{1}{sin\theta} $$ |
|
||||
| $$ cos\theta = x $$ | $$ sec \theta = \frac{1}{x} $$ | | $$ sec\theta = \frac{1}{cos\theta} $$ |
|
||||
| $$ tan\theta = \frac{y}{x} $$ | $$ cot\theta = \frac{x}{y} $$ | $$ tan\theta = \frac{sin\theta}{cos\theta} $$ | $$ cot\theta = \frac{1}{tan\theta} = \frac{cos\theta}{sin{\theta}} $$ |
|
||||
# Pythagorean Identities
|
||||
The Pythagorean identity expresses the Pythagorean theorem in terms of trigonometric functions. It's a basic relation between the sine and cosine functions.
|
||||
$$ sin^2 \theta + cos^2 \theta = 1 $$
|
||||
There are more forms that are useful, but they can be derived from the above formula:
|
||||
$$ 1 + tan^2\theta = sec^2\theta $$
|
||||
$$ cot^2 \theta + 1 = csc^2\theta $$
|
||||
# Even and Odd Identities
|
||||
- A function is even if $f(-x) = f(x)$.
|
||||
- A function is odd if $f(-x) = -f(x)$
|
||||
- Cosine and secant are **even**
|
||||
- Sine, tangent, cosecant, and cotangent are **odd**.
|
||||
## Examples
|
||||
### Even and Odd Functions
|
||||
> If $cot\theta = -\sqrt{3}$, what is $cot(-\theta)$?
|
||||
|
||||
$cot$ is an odd function, and so $cot(-\theta) = \sqrt{3}$
|
||||
### Simplifying Using Identities
|
||||
> Simplify $\frac{sin\theta}{cos\theta}$
|
||||
|
||||
1. The above equation can be split into two components
|
||||
$$ \frac{sin\theta}{cos\theta} = \frac{sin\theta}{1} * \frac{1}{csc\theta} $$
|
||||
2. Referring to the list of trig identities, we know that $\frac{1}{csc\theta}$ is equal to $sin\theta$.
|
||||
$$ \frac{sin\theta}{1} * \frac{1}{csc\theta} = sin\theta * sin\theta $$
|
||||
3. Simplifying further, we get:
|
||||
$$ sin^2\theta $$
|
||||
### Finding all values using identities
|
||||
If $sec\theta = -\frac{25}{7}$ and $0 < \theta < \pi$, find the values of the other 5 trig functions:
|
||||
|
||||
1. To find $tan\theta$, we can use the trig identity $1 + tan^2\theta = sec^2\theta$:
|
||||
$$ 1 + tan^2\theta = (-\frac{25}{7})^2 $$
|
||||
Shuffling things around, we get this:
|
||||
$$ tan^2\theta = \frac{625}{49} - 1 $$
|
||||
|
||||
Performing that subtraction gives us this:
|
||||
$$ \frac{625}{49} - \frac{49}{49} = \frac{576}{49} = tan^2\theta $$
|
||||
You can get rid of the exponent:
|
||||
|
||||
$$ \sqrt{\frac{576}{49}} = tan\theta $$
|
||||
$\sqrt{576} = 24$ and $\sqrt{49} = 7$, so:
|
||||
$$ tan\theta = \frac{24}{7} $$
|
||||
2. To find $cos\theta$, because $sec$ is the inverse of $cos$, we can use the identity $sec\theta = \frac{1}{cos\theta}$:
|
||||
$cos\theta = -\frac{7}{25}$
|
||||
|
||||
3. To find $sin\theta$, we can use the trig identity $sin^2\theta + cos^2\theta = 1$:
|
||||
$$ sin^2\theta + (-\frac{7}{25}) = 1 $$
|
||||
Rearranging, we get:
|
||||
$$ 1 - (-\frac{7}{25})^2 = sin^2\theta $$
|
||||
Applying the exponent gives us $\frac{49}{625}$, so we can do this:
|
||||
$$ \frac{625}{625} - \frac{49}{625} = \frac{576}{625} = sin^2\theta $$
|
||||
|
||||
Getting rid of the exponent:
|
||||
$$ \sqrt{\frac{576}{625}} = \frac{24}{25} = sin\theta $$
|
||||
|
||||
From there, you can find the rest of the identities fairly easily.
|
||||
|
||||
# Simplifying trig expressions using identities
|
||||
Given the difference of square formula:
|
||||
$$ a^2 - b^2 = (a-b)(a+b) $$
|
||||
|
||||
## Examples
|
||||
Simplify $\tan\theta\sin\theta + \cos\theta$:
|
||||
1. $\dfrac{\sin\theta}{\cos\theta} * \sin\theta + \cos\theta$
|
||||
2. $\dfrac{\sin^2\theta}{cos\theta} + \cos\theta$
|
||||
3. $(\dfrac{\sin^2\theta}{cos\theta} + \cos\theta)\dfrac{\cos\theta}{\cos\theta} = \sin^2\theta*\cos^2\theta + \cos\theta$
|
||||
|
||||
Si\
|
6
education/math/MATH1060 (trig)/Law of Cosines.md
Normal file
@ -0,0 +1,6 @@
|
||||
The Law of Cosines is useful when solving for SAS or SSS triangles.
|
||||
$$ a^2 = b^2 + c^2 -2bc\cos(\alpha) $$
|
||||
$$ b^2 = a^2 + c^2 -2ac\cos(\beta) $$
|
||||
$$ c^2 = a^2 + b^2 -2ab\cos(\gamma) $$
|
||||
- When using the Law of Cosines to solve for SSS triangles, start solving for the largest angle.
|
||||
- When correctly solved, the smallest angle will be opposite the smallest side, and the largest angle will be opposite the largest side.
|
33
education/math/MATH1060 (trig)/Law of Sines.md
Normal file
@ -0,0 +1,33 @@
|
||||
# Intro
|
||||
Tl;dr, the law of sines is:
|
||||
$$ \frac{\sin(\alpha)}{a} = \frac{\sin(\beta)}{b} = \frac{\sin(\gamma)}{c} $$
|
||||
Under convention:
|
||||
- Angle $\alpha$ is opposite side $a$
|
||||
- Angle $\beta$ is opposite side $b$
|
||||
- Angle $\gamma$ is opposite side $c$
|
||||
|
||||
- Any triangle that is *not a right triangle* is called an oblique triangle. There are two types of oblique triangles:
|
||||
- **Acute triangles**: This is an oblique triangle where all three interior angles are less than $90\degree$ or $\dfrac{\pi}{2}$ radians.
|
||||
- **Obtuse Triangle**: This is an oblique triangle where one of the interior angles is greater than $90\degree$.
|
||||
## Different types of oblique triangles
|
||||
1. **ASA Triangle**: (Angle Side Angle) - We know the measurements of two angles and the side between them
|
||||
2. **AAS**: We know the measurements of two angles and a side that is not between the known angles.
|
||||
3. **SSA**: We know the measurements of two sides and an angle that is not between the known sides.
|
||||
These triangles can be solved by adding a line that goes from one vertex to intersect perpendicular to the opposite side, forming two right triangles ($h$).
|
||||
|
||||
## Solving for the law of sines
|
||||
We know that $\sin\alpha = \dfrac{h}{b}$ and $\sin\beta = \dfrac{h}{a}$. We can sole both equations for $h$ to get:
|
||||
- $h = b\sin\alpha$
|
||||
- $h = a\sin\beta$
|
||||
Setting both equations equal to each other gives us:
|
||||
$b\sin\alpha = a\sin\beta$
|
||||
|
||||
Multiply both sides by $\dfrac{1}{ab}$ gives yields $\dfrac{\sin\alpha}{a} = \dfrac{\sin\beta}{b}$
|
||||
|
||||
# SSA triangles
|
||||
Side side angle triangles may be solved to have one possible solution, two possible solutions, or no possible solutions.
|
||||
|
||||
- No triangle: $a < h$
|
||||
- One triangle: $a \ge b$
|
||||
- Two triangles: $h < a < b$
|
||||
- One right triangle: $a = h$
|
34
education/math/MATH1060 (trig)/The Unit Circle.md
Normal file
@ -0,0 +1,34 @@
|
||||
# Introduction
|
||||
The unit circle has a center a $(0, 0)$, and a radius of $1$ with no defined unit.
|
||||
|
||||
Sine and cosine can be used to find the coordinates of specific points on the unit circle.
|
||||
|
||||
**Sine likes $y$, and cosine likes $x$.**
|
||||

|
||||
When sine is positive, the $y$ value is positive. When $x$ is positive, the cosine is positive.
|
||||
|
||||
$$ cos(\theta) = x $$
|
||||
$$ sin(\theta) = y $$
|
||||
|
||||
## Sine and Cosine
|
||||
| Angle | $0$ | $\frac{\pi}{6}$ or $30 \degree$ | $\frac{\pi}{4}$ or $45\degree$ | $\frac{\pi}{2}$ or $90\degree$ |
|
||||
| ------ | --- | ------------------------------- | ------------------------------ | ------------------------------ |
|
||||
| Cosine | 1 | $\frac{\sqrt{3}}{2}$ | $\frac{\sqrt{2}}{2}$ | $0$ |
|
||||
| Sine | 0 | $\frac{1}{2}$ | $\frac{\sqrt{2}}{2}$ | <br>$1$ |
|
||||
|
||||

|
||||
|
||||
Finding a reference angle:
|
||||
|
||||
| Quadrant | Formula |
|
||||
| -------- | --------------------- |
|
||||
| 1 | $\theta$ |
|
||||
| 2 | $180\degree - \theta$ |
|
||||
| 3 | $\theta - 180\degree$ |
|
||||
| 4 | $360\degree - \theta$ |
|
||||
# Definitions
|
||||
|
||||
| Term | Description |
|
||||
| ---------------- | ----------------------------------------------------------------------------- |
|
||||
| $\theta$ (theta) | Theta refers to the angle measure in a unit circle. |
|
||||
| $s$ | $s$ is used to the length of the arc created by angle $\theta$ on the circle. |
|
57
education/math/MATH1060 (trig)/Vectors.md
Normal file
@ -0,0 +1,57 @@
|
||||
A vector is a mathematical concept that denotes direction and magnitude. They're often notated using an arrow ($\vec{v}$), or with a bold, lowercase letter. (**v**).
|
||||
|
||||
|
||||
Vectors are often denoted as a matrix with two rows: $\begin{bmatrix}1 \\2\end{bmatrix}$
|
||||
# Component Form
|
||||
If $\vec{v}$ is a vector with the initial point $(x_y,\ y_i)$, and a terminal point $(x_t,\ y_t)$, we can express $\vec{v}$ in component form as $\vec{v} = \langle x_t - x_i,\ y_t, -y_i \rangle$
|
||||
# Magnitude
|
||||
The magnitude of a vector is $|\vec{v}| = \sqrt{a^2 + b^2}$
|
||||
|
||||
# Direction
|
||||
The direction of a vector is $\theta = \tan^-1(\frac{b}{a})$.
|
||||
|
||||
# Addition
|
||||
To find $\vec{u} + \vec{v}$, we can put one vector on the end of another vector. The resulting vector will share the same tail as the first vector, and the same head as the second vector.
|
||||
|
||||
# Scalar Multiplication
|
||||
A **scalar** is just a real number. Scalar multiplication is multiplying a vector with a real number. This will scale or shrink a vector, but does not change the direction it points at.
|
||||
|
||||
We do not multiply two vectors together.
|
||||
# Unit Vector
|
||||
A vector with a magnitude of 1 is a **unit vector**.
|
||||
|
||||
If $\vec{v}$ is a nonzero vector, the unit vector can be found using the equation $\vec{u} = \dfrac{1}{|\vec{v}|}\vec{v}$ . In other words, to find a unit vector, divide the vector by its magnitude.
|
||||
|
||||
# $i$, $j$ Notation
|
||||
Every 2D vector has a horizontal component and a vertical component. The horizontal unit vector could be written as $i = \langle 1, 0 \rangle$, and the vertical unit vector could be written as $j = \langle 0, 1 \rangle$ Every vector can be made up using a combination of these standard unit vectors.
|
||||
|
||||
# Trigonometric Form
|
||||
Given a vector $\vec{v}$ with a magnitude $|\vec{v}|$ and direction $\theta$:
|
||||
|
||||
The component form is given as:
|
||||
|
||||
$$ \vec{v} = \langle |\vec{v}||\cos \theta,\ |\vec{v}|\sin\theta \rangle $$
|
||||
|
||||
# Standard position
|
||||
- A vector is in standard position if the initial point is at $(0, 0)$.
|
||||
|
||||
# The Dot Product
|
||||
The dot product of two vectors $\vec{u} = \langle a, b \rangle$ and $\vec{v} = \langle c, d \rangle$ is $\vec{u} * \vec{v} = ac + bd$.
|
||||
|
||||
- Given that $\vec{u} = \langle -7, 3 \rangle$, and $\vec{v} = \langle -3, 4 \rangle$, find $\vec{u} \cdot \vec{v}$.
|
||||
- $\vec{u} \cdot \vec{v} = -7 \cdot -4 + 3 \cdot 4$
|
||||
|
||||
The dot product can be used to find the angle between two vectors.
|
||||
|
||||
If $\theta (0\degree < \theta < 180\degree)$, is the angle between two nonzero vectors $\vec{u}$ and $\vec{v}$, then
|
||||
$$ \cos\theta = \dfrac{\vec{u}\cdot\vec{v}}{|\vec{u}||\vec{v}|} $$
|
||||
|
||||
# Work
|
||||
The dot product can be used to compute the work required to move an object a certain distance.
|
||||
|
||||
To compute work, you need a force and direction. If the force is applied in the same direction:
|
||||
|
||||
$$ W = Fd $$
|
||||
|
||||
The work $W$ is done by a constant force $\vec{F}$ in moving an object from a point $P$ to a point $Q$ is defined by:
|
||||
$$ W = \vec{F} \cdot\vec{PQ} = |\vec{F}||\vec{PQ}|\cos\theta $$Where $\theta$ is the angle between $\vec{F}$ and $\vec{PQ}$.
|
1
education/math/MATH1060 (trig)/assets/graphcot.svg
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
education/math/MATH1060 (trig)/assets/graphcsc.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
education/math/MATH1060 (trig)/assets/graphsec.jpg
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
education/math/MATH1060 (trig)/assets/graphsincos.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
education/math/MATH1060 (trig)/assets/graphtan.png
Normal file
After Width: | Height: | Size: 201 KiB |
BIN
education/math/MATH1060 (trig)/assets/sincoscirc.png
Normal file
After Width: | Height: | Size: 56 KiB |
BIN
education/math/MATH1060 (trig)/assets/unitcirc.png
Normal file
After Width: | Height: | Size: 154 KiB |
BIN
education/math/MATH1060 (trig)/cheatsheet.pdf
Normal file
213
education/math/MATH1210 (calc 1)/Derivatives.md
Normal file
@ -0,0 +1,213 @@
|
||||
SA derivative can be used to describe the rate of change at a single point, or the *instantaneous velocity*.
|
||||
|
||||
The formula used to calculate the average rate of change looks like this:
|
||||
$$ \dfrac{f(b) - f(a)}{b - a} $$
|
||||
Interpreting it, this can be described as the change in $y$ over the change in $x$.
|
||||
|
||||
- Speed is always positive
|
||||
- Velocity is directional
|
||||
|
||||
As the distance between the two points $a$ and $b$ grow smaller, we get closer and closer to the instantaneous velocity of a point. Limits are suited to describing the behavior of a function as it approaches a point.
|
||||
|
||||
If we have the coordinate pair $(a, f(a))$, and the value $h$ is the distance between $a$ and another $x$ value, the coordinates of that point can be described as ($(a + h, f(a + h))$. With this info:
|
||||
- The slope of the secant line can be described as $\dfrac{f(a + h) - f(a)}{a + h - a}$, which simplifies to $\dfrac{f(a + h) - f(a)}{h}$.
|
||||
- The slope of the *tangent line* or the *instantaneous velocity* can be found by taking the limit of the above function as the distance ($h$) approaches zero:
|
||||
$$\lim_{h \to 0}\dfrac{f(a + h) - f(a)}{h}$$
|
||||
The above formula can be used to find the *derivative*. This may also be referred to as the *instantaneous velocity*, or the *instantaneous rate of change*.
|
||||
|
||||
## Examples
|
||||
|
||||
> Differentiate $f(x) = 4\sqrt[3]{x} - \dfrac{1}{x^6}$
|
||||
|
||||
1. $f(x) = 4\sqrt[3]{x} = \dfrac{1}{x^6}$
|
||||
2. $= 4x^\frac{1}{3} - x^{-6}$
|
||||
3. $f'(x) = \dfrac{1}{3} * 4x^{-\frac{2}{3}} -(-6)(x^{-6-1})$
|
||||
4. $= 4x^{-2-\frac{2}{3}} + 6x^{-7}$
|
||||
5. $= \dfrac{4}{3\sqrt[3]{x^2}} + \dfrac{6}{x^7}$
|
||||
# Point Slope Formula (Review)
|
||||
$$ y - y_1 = m(x-x_1) $$
|
||||
Given that $m = f'(a)$ and that $(x_1, y_1) = (a, f(a))$, you get the equation:
|
||||
$$ y - f(a) = f'(a)(x - a) $$
|
||||
As a more practical example, given an equation with a slope of $6$ at the point $(-2, -4)$:
|
||||
$$ y - (-4) = 6(x - -2)$$
|
||||
Solving for $y$ looks like this:
|
||||
1. $y + 4 = 6(x + 2)$
|
||||
2. $y = 6(x + 2) - 4$
|
||||
3. $y = 6x + 12 - 4$
|
||||
4. $y = 6x + 8$
|
||||
# Line Types
|
||||
## Secant Line
|
||||
A **Secant Line** connects two points on a graph.
|
||||
|
||||
A **Tangent Line** represents the rate of change or slope at a single point on the graph.
|
||||
|
||||
# Notation
|
||||
Given the equation $y = f(x)$, the following are all notations used to represent the derivative of $f$ at $x$:
|
||||
- $f'(x)$
|
||||
- $\dfrac{d}{dx}f(x)$
|
||||
- $y'$
|
||||
- $\dfrac{dy}{dx}$
|
||||
- $\dfrac{df}{dx}$
|
||||
- "Derivative of $f$ with respect to $x$"
|
||||
|
||||
# Functions that are not differentiable at a given point
|
||||
- Where a function is not defined
|
||||
- Where a sharp turn takes place
|
||||
- If the slope of the tangent line is vertical
|
||||
|
||||
# Higher Order Derivatives
|
||||
- Take the derivative of a derivative
|
||||
|
||||
# Constant Rule
|
||||
The derivative of a constant is always zero.
|
||||
$$ \dfrac{d}{dx}[c] = 0$$
|
||||
For example, the derivative of the equation $f(x) = 3$ is $0$.
|
||||
# Derivative of $x$
|
||||
The derivative of $x$ is one.
|
||||
|
||||
For example, the derivative of the equation $f(x) = x$ is $1$, and the derivative of the equation $f(x) = 3x$ is $3$.
|
||||
|
||||
# Exponential Derivative Formula
|
||||
Using the definition of a derivative to determine the derivative of $f(x) = x^n$, where $n$ is any natural number.
|
||||
|
||||
$$ f'(x) = \lim_{h \to 0} \dfrac{(x + h)^n - x^n}{h} $$
|
||||
- Using pascal's triangle, we can approximate $(x + h)^n$
|
||||
```
|
||||
1
|
||||
1 1
|
||||
1 2 1
|
||||
1 3 3 1
|
||||
1 4 6 4 1
|
||||
```
|
||||
|
||||
- Where $n = 0$: $(x + h)^0 = 1$
|
||||
- Where $n = 1$: $(x +h)^1 = 1x + 1h$
|
||||
- Where $n = 2$: $(x +h)^2 = x^2 + 2xh + h^2$
|
||||
- Where $n = 3$: $(x + h)^3 = 1x^3h^0 + 3x^2h^1 + 3x^1h^2 + 1x^0h^3 = 1x^3 + 3x^2h + 3xh^2 + 1h^3$
|
||||
|
||||
Note that the coefficient follows the associated level of Pascal's Triangle (`1 3 3 1`), and $x$'s power decrements, while $h$'s power increments. The coefficients of each pair will always add up to $n$. Eg, $3 + 0$, $2 + 1$, $1 + 2$, and so on. The **second** term in the polynomial created will have a coefficient of $n$.
|
||||
|
||||
$$ \dfrac{(x + h)^n - x^n}{h} = \lim_{h \to 0} \dfrac{(x^n + nx^{n-1}h + P_{n3}x^{n-2}h^2 + \cdots + h^n)-x^n}{h} $$ $P$ denotes some coefficient found using Pascal's triangle.
|
||||
|
||||
$x^n$ cancels out, and then $h$ can be factored out of the binomial series.
|
||||
|
||||
This leaves us with:
|
||||
$$ \lim_{h \to 0} nx^{n-1} + P_{n3} x^{n-2}*0 \cdots v * 0 $$
|
||||
|
||||
The zeros leave us with:
|
||||
|
||||
$$ f(x) = n, \space f'(x) = nx^{n-1} $$
|
||||
# Sum and Difference Rules
|
||||
$$ \dfrac{d}{dx}(f(x) \pm g(x)) = f'(x) \pm g'(x) $$
|
||||
|
||||
# Product Rule
|
||||
$$ \dfrac{d}{dx} (f(x) * g(x)) = \lim_{h \to 0} \dfrac{f(x +h) * g(x + h) - f(x)g(x)}{h} $$
|
||||
This is done by adding a value equivalent to zero to the numerator ($f(x + h)g(x) - f(x + h)g(x)$):
|
||||
$$ \dfrac{d}{dx} (f(x) * g(x)) = \lim_{h \to 0} \dfrac{f(x +h) * g(x + h) + f(x + h)g(x) - f(x+h)g(x) - f(x)g(x)}{h} $$
|
||||
|
||||
From here you can factor out $f(x + h)$ from the first two terms, and a $g(x)$ from the next two terms.
|
||||
|
||||
Then break into two different fractions:
|
||||
|
||||
$$\lim_{h \to 0} \dfrac{f(x + h)}{1} * \dfrac{(g(x + h) - g(x))}{h)} + \dfrac{g(x)}{1} *\dfrac{f(x + h) - f(x)}{h} $$
|
||||
From here, you can take the limit of each fraction, therefore showing that to find the derivative of two values multiplied together, you can use the formula:
|
||||
$$ \dfrac{d}{dx}(f(x) * g(x)) = f(x) * g'(x) + f'(x)*g(x) $$
|
||||
|
||||
# Constant Multiple Rule
|
||||
$$ \dfrac{d}{dx}[c*f(x)] = c * f'(x) $$
|
||||
# Quotient Rule
|
||||
$$ \dfrac{d}{dx}(\dfrac{f(x)}{g(x)}) = \dfrac{f'(x)g(x) -f(x)g'(x)}{(g(x))^2} $$
|
||||
|
||||
# Exponential Rule
|
||||
$$ \dfrac{d}{dx} e^x = e^x $$
|
||||
$$ \dfrac{d}{dx}a^x = a^x*(\ln(a)) $$
|
||||
for all $a > 0$
|
||||
|
||||
|
||||
# Logarithms
|
||||
|
||||
For natural logarithms:
|
||||
$$ \dfrac{d}{dx} \ln |x| = \dfrac{1}{x} $$
|
||||
|
||||
For other logarithms:
|
||||
$$ \dfrac{d}{dx} \log_a x = \dfrac{1}{(\ln a) x}$$
|
||||
When solving problems that make use of logarithms, consider making use of logarithmic properties to make life easier:
|
||||
$$ \ln(\dfrac{x}{y}) = \ln(x) - \ln(y) $$
|
||||
$$ \ln(a^b) = b\ln(a) $$
|
||||
## Logarithmic Differentiation
|
||||
This is used when you want to take the derivative of a function raised to a function ($f(x)^{g(x)})$
|
||||
|
||||
1. $\dfrac{d}{dx} x^x$
|
||||
2. $y = x^x$
|
||||
3. Take the natural log of both sides: $\ln y = \ln x^x$
|
||||
4. $\ln(y) = x*\ln(x)$
|
||||
5. Use implicit differentiation: $\dfrac{d}{dx} \ln y = \dfrac{d}{dx} x \ln x$
|
||||
6. Solve for $\dfrac{dy}{dx}$: $\dfrac{1}{y} \dfrac{dy}{dx} = 1 * \ln x + x * \dfrac{1}{x}$
|
||||
7. $\dfrac{dy}{dx} = (\ln x + 1) * y$
|
||||
8. Referring back to step 2, $y = x^x$, so the final form is:
|
||||
9. $\dfrac{dy}{dx} = (\ln(x) + 1)x^x$
|
||||
|
||||
### Examples
|
||||
> Find the derivative of $(7x + 2)^x$
|
||||
|
||||
1. $\ln y = \ln((7x+2)^x)$
|
||||
2. $\ln y = x*\ln(7x + 2)$
|
||||
3. $\dfrac{dy}{dx} \dfrac{1}{y} = \dfrac{7x}{7x + 2} * \ln(7x+2)$
|
||||
4. $\dfrac{dy}{dx} = (\dfrac{7x}{7x+2} * \ln(7x+2))(7x+2)^x$
|
||||
|
||||
> Find the derivative of the function $y = (2x \sin x)^{3x}$
|
||||
|
||||
5. $\ln y = \ln (3x \sin x)^{3x}$
|
||||
6. $\ln y = 3x * \ln(2x \sin x)$
|
||||
7. $\dfrac{d}{dx} \ln(y) = \dfrac{d}{dx} 3x(\ln 2 + \ln x + \ln(sinx))$
|
||||
8. $\dfrac{1}{y} \dfrac{dy}{dx} = 3(\ln 2 + \ln x + \ln(\sin(x))) + 3x (0 + \dfrac{1}{x} + \dfrac{1}{\sin x} * \cos x)$
|
||||
9. $\dfrac{dy}{dx} = (3\ln 2 + 3 \ln x + 3\ln \sin(x) + 3\ln(\sin(x) + 3x\cot(x))(2x\sin x)^{3x}$
|
||||
# Chain Rule
|
||||
$$ \dfrac{d}{dx} f(g(x)) = f'(g(x))*g'(x) $$
|
||||
## Examples
|
||||
> Given the function $(x^2+3)^4$, find the derivative.
|
||||
|
||||
Using the chain rule, the above function might be described as $f(g(x))$, where $f(x) = x^4$, and $g(x) = x^2 + 3)$.
|
||||
10. First find the derivative of the outside function function ($f(x) = x^4$):
|
||||
$$ \dfrac{d}{dx} (x^2 +3)^4 = 4(g(x))^3 ...$$
|
||||
11. Multiply that by the derivative of the inside function, $g(x)$, or $x^2 + 3$.
|
||||
$$ \dfrac{d}{dx} (x^2 + 3)^4 = 4(x^2 + 3)^3 * (2x)$$
|
||||
> Apply the chain rule to $x^4$
|
||||
|
||||
If we treat the above as a function along the lines of $f(x) = (x)^4$, and $g(x) = x$, then the chain rule can be used like so:
|
||||
$$ 4(x)^3 * (1) $$
|
||||
# Trig Functions
|
||||
$$ \lim_{x \to 0} \dfrac{\sin x}{x} = 1 $$
|
||||
$$ \lim_{x \to 0} \dfrac{\cos x - 1}{x} = 0 $$
|
||||
## Sine
|
||||
$$ f'(x) = \lim_{h \to 0} \dfrac{\sin(x + h) - sin(x)}{h} $$
|
||||
Using the sum trig identity, $\sin(x + h)$ can be rewritten as $\sin x \cos h + \cos x \sin h$.
|
||||
|
||||
This allows us to simplify, ultimately leading to:
|
||||
$$ \dfrac{d}{dx} \sin x = \cos x$$
|
||||
## Cosine
|
||||
$$ \dfrac{d}{dx} \cos x = -\sin x $$
|
||||
|
||||
## Tangent
|
||||
$$ \dfrac{d}{dx} \tan x = \sec^2x $$
|
||||
## Secant
|
||||
$$ \dfrac{d}{dx} \sec x = \sec x * \tan x $$
|
||||
|
||||
## Cosecant
|
||||
$$ \dfrac{d}{dx} \csc x = -\csc x \cot x $$
|
||||
## Cotangent
|
||||
$$ \dfrac{d}{dx} \cot x = -\csc^2 x $$
|
||||
## Arcsin
|
||||
$$ \dfrac{d}{dx}(\arcsin(x) = \dfrac{1}{\sqrt{1-x^2}}$$
|
||||
# Implicit Differentiation
|
||||
- There's a reason differentials are written like a fraction
|
||||
- $\dfrac{d}{dx} x^2 = \dfrac{d(x^2)}{dx}$, or, "the derivative of $x^2$ with respect to $x$"
|
||||
- $\dfrac{d}{dx} x = \dfrac{dx}{dx} = 1$ : The derivative of $x$ with respect to $x$ is one
|
||||
- $\dfrac{d}{dx} y = \dfrac{dy}{dx} = y'$
|
||||
- Given the equation $y = x^2$, $\dfrac{d}{dx} y = \dfrac{dy}{dx} = 2x$.
|
||||
|
||||
Given these facts:
|
||||
12. Let $y$ be some function of $x$
|
||||
13. $\dfrac{d}{dx} x = 1$
|
||||
14. $\dfrac{d}{dx} y = \dfrac{dy}{dx}$
|
||||
|
229
education/math/MATH1210 (calc 1)/Integrals.md
Normal file
@ -0,0 +1,229 @@
|
||||
# Antiderivatives
|
||||
An antiderivative is useful when you know the rate of change, and you want to find a point from that rate of change
|
||||
|
||||
> A function $F$ is said to be an *antiderivative* of $f$ if $F'(x) = f(x)$
|
||||
## Notation
|
||||
The collection of all antiderivatives of a function $f$ is referred to as the *indefinite integral of $f$ with respect to $x$*, and is denoted by:
|
||||
$$ \int f(x) dx $$
|
||||
## Examples
|
||||
> Find the antiderivative of the function $y = x^2$
|
||||
|
||||
1. We know that to find the derivative of the above function, you'd multiply by the exponent ($2$), and subtract 1 from the exponent.
|
||||
2. To perform this operation in reverse:
|
||||
1. Add 1 to the exponent
|
||||
2. Multiply by $\dfrac{1}{n + 1}$
|
||||
3. This gives us an antiderivative of $\dfrac{1}{3}x^3$
|
||||
4. To check our work, work backwards.
|
||||
5. The derivative of $\dfrac{1}{3}x^3$ is $\dfrac{1}{3} (3x^2)$
|
||||
6. $= \dfrac{3}{3} x^2$
|
||||
|
||||
|
||||
## Formulas
|
||||
|
||||
| Differentiation Formula | Integration Formula |
|
||||
| ----------------------------------------------------- | -------------------------------------------------------- |
|
||||
| $\dfrac{d}{dx} x^n = nx^{x-1}$ | $\int x^n dx = \dfrac{1}{n+1}x^{n+1}+ C$ for $n \ne -1$ |
|
||||
| $\dfrac{d}{dx} kx = k$ | $\int k \space dx = kx + C$ |
|
||||
| $\dfrac{d}{dx} \ln \|x\| = \dfrac{1}{x}$ | <br>$\int \dfrac{1}{x}dx = \ln \|x\| + C$ |
|
||||
| $\dfrac{d}{dx} e^x = e^x$ | <br>$\int e^x dx = e^x + C$ |
|
||||
| $\dfrac{d}{dx} a^x = (\ln{a}) a^x$ | $\int a^xdx = \ln \|x\| + C$ |
|
||||
| $\dfrac{d}{dx} \sin x = \cos x$ | $\int \cos(x) dx = \sin (x) + C$ |
|
||||
| $\dfrac{d}{dx} \cos x = -\sin x$ | $\int \sin(x)dx = \sin x + C$ |
|
||||
| $\dfrac{d}{dx} \tan{x} = \sec^2 x$ | $\int \sec^2(x)dx = \tan(x) + C$ |
|
||||
| $\dfrac{d}{dx} \sec x = \sec x \tan x$ | $\int sec^2(x) dx = \sec(x) + C$ |
|
||||
| $\dfrac{d}{dx} \sin^{-1} x = \dfrac{1}{\sqrt{1-x^2}}$ | $\int \sec(x) \tan(x) dx = \sec x + C$ |
|
||||
| $\dfrac{d}{dx} \tan^{-1} x = \dfrac{1}{1+x^2}$ | $\int \dfrac{1}{\sqrt{1+x^2}}dx = \tan^{-1}x + C$ |
|
||||
| $\dfrac{d}{dx} k f(x) = k f'(x)$ | $\int k*f(x)dx = k\int f(x)dx$ |
|
||||
| $\dfrac{d}{dx} f(x) \pm g(x) = f'(x) \pm g'(x)$ | $\int (f(x) \pm g(x))dx = \int f(x) dx \pm \int g(x) dx$ |
|
||||
# Area Under a Curve
|
||||
The area under the curve $y = f(x)$ can be approximated by the equation $\sum_{i = 1}^n f(\hat{x_i})\Delta x$ where $\hat{x_i}$ is any point on the interval $[x_{i - 1}, x_i]$, and the curve is divided into $n$ equal parts of width $\Delta x$
|
||||
|
||||
Any sum of this form is referred to as a Reimann Sum.
|
||||
|
||||
To summarize:
|
||||
- The area under a curve is equal to the sum of the area of $n$ rectangular subdivisions where each rectangle has a width of $\Delta x$ and a height of $f(x)$.
|
||||
# Definite Integrals
|
||||
Let $f$ be a continuous function on the interval $[a, b]$. Divide $[a, b]$ into $n$ equal parts of width $\Delta x = \dfrac{b - a}{n}$ . Let $x_0, x_1, x_2, \cdots, x_3$ be the endpoints of the subdivision.
|
||||
|
||||
The definite integral of $f(x)$ with respect to $x$ from $x = a$ to $x = b$ can be denoted:
|
||||
$$ \int_{a}^b f(x) dx $$
|
||||
|
||||
And __can__ be defined as:
|
||||
$$ \int_a^b f(x) dx = \lim_{n \to \infty} \sum_{i = 1}^n f(x_i)\Delta x$$
|
||||
|
||||
$f(x_i)$ is the *height* of each sub-interval, and $\Delta x$ is the change in the *x* interval, so $f(x_i) \Delta x$ is solving for the area of each sub-interval.
|
||||
|
||||
- If your function is always positive, then the value of a definite integral is the area under the curve.
|
||||
- If the function is always negative, then the value of a definite integral is the area above the curve to zero.
|
||||
- If the function has both positive and negative values, the output is equal to the area above the curve minus the area below the curve.
|
||||
|
||||
## Examples
|
||||
> Find the exact value of the integral $\int_0^1 5x \space dx$
|
||||
|
||||
Relevant formulas:
|
||||
$$ \sum_{i = 1}^n = \dfrac{(n)(n + 1)}{2} $$
|
||||
$$ \Delta x = \dfrac{1 - 0}{n} = \dfrac{1}{n}$$$$ x_i = 0 + \Delta xi + \dfrac{1}{n} \cdot i$$
|
||||
1. $\int_0^1 5x \space dx = \lim_{n \to \infty} \sum_{i=1}^n 5(x_i) \cdot \Delta x$
|
||||
2. $= \lim_{n \to \infty} \sum_{i=1}^n 5(\frac{1}{n} \cdot i) \cdot \frac{1}{n}$
|
||||
3. $= \lim_{n \to \infty} \sum_{i = 1}^n \dfrac{5}{n^2}\cdot i$
|
||||
4. $= \lim_{n \to \infty} \dfrac{5}{n^2} \sum_{i = 1}^n i$
|
||||
5. $= \lim_{x \to \infty} \dfrac{5}{n^2} \cdot \dfrac{n(n + 1)}{2}$
|
||||
6. $= \lim_{n \to \infty} \dfrac{5n^2 + 5n}{2n^2}$
|
||||
7. $= \dfrac{5}{2}$
|
||||
|
||||
# Properties of Integrals
|
||||
1. $\int_a^a f(x)dx = 0$ - An integral with a domain of zero will always evaluate to zero.
|
||||
2. $\int_b^a f(x)dx = -\int_a^b f(x) dx$ - The integral from $a \to b$ is equal to the integral from $-(b\to a)$
|
||||
3. $\int_a^b cf(x) dx = c \int_a^b f(x) dx$ - A constant from inside of an integral can be moved outside of an integral
|
||||
4. $\int_a^b f(x) \pm g(x) dx = \int_a^b f(x) dx \pm \int_a^b g(x)dx$ - Integrals can be distributed
|
||||
5. $\int_a^c f(x)dx = \int_a^b f(x)dx + \int_b^c f(x)dx$ - An integral can be split into two smaller integrals covering the same domain, added together.
|
||||
|
||||
# Averages
|
||||
To find the average value of $f(x)$ on the interval $[a, b]$ is given by the formula:
|
||||
|
||||
Average = $\dfrac{1}{b-a} \int_a^b f(x)dx$
|
||||
|
||||
# The Fundamental Theorem of Calculus
|
||||
1. Let $f$ be a continuous function on the closed interval $[a, b]$ and let $F$ be any antiderivative of $f$, then:
|
||||
$$\int_a^b f(x) dx = F(b) - F(a)$$
|
||||
2. Let $f$ be a continuous function on $[a, b]$ and let $x$ be a point in $[a, b]$.
|
||||
$$ F(x) = \int_a^x f(t)dt \Rightarrow F'(x) = f(x) $$
|
||||
This basically says that cancelling out the derivative from $a$ to $x$ can be done by taking the derivative of that equation. with respect to $x$.
|
||||
$$ \dfrac{d}{dx} \int_a^{g(x)} f(t) dt = f(g(x)) * g'(x)* $$
|
||||
## Examples
|
||||
> Finding the derivative of an integral
|
||||
$$ \dfrac{d}{dx} \int_2^{7x} \cos(t^2) dt = cos((7x)^2) * 7 = 7\cos(49x^2)$$
|
||||
> Finding the derivative of an integral
|
||||
$$ \dfrac{d}{dx}\int_0^{\ln{x}}\tan(t) = \tan(\ln(x))*\dfrac{1}{x} $$
|
||||
> $x$ and $t$ notation *(note: the bar notation is referred to as "evaluated at")*
|
||||
$$ F(x) = \int_4^x 2t \space dt = t^2 \Big|_4^x = x^2 - 16$$
|
||||
> $x$ in top and bottom
|
||||
$$ \dfrac{d}{dx} \int_{2x}^{3x} \sin(t) dt = \dfrac{d}{dx} -\cos(t)\Big|_{2x}^{3x} = \dfrac{d}{dx} (-\cos(3x) + cos(2x) = 3\sin(3x) - 2\sin(2x) $$
|
||||
|
||||
# The Mean Value Theorem for Integrals
|
||||
If $f(x)$ is continuous over an interval $[a, b]$ then there is at least one point $c$ in the interval $[a, b]$ such that:
|
||||
$$f(c) = \dfrac{1}{b-a}\int_a^bf(x)dx $$
|
||||
This formula can also be stated as $\int_a^b f(x)dx = f(c)(b-a)$
|
||||
This theorem tells us that a continuous function on the closed interval will obtain its average for at least one point in the interval.
|
||||
|
||||
# U-Substitution
|
||||
When you see $dx$ or $du$ in a function, it can be thought of as roughly analogous to $\Delta x$, where the change in $x$ is infinitesimally small.
|
||||
|
||||
Thinking back to derivatives, when solving for $\dfrac{dy}{dx}$, you're solving for the rate of change of $y$ (across an infinitely small distance) over the rate of change of $x$ (across an infinitely small instance). Given that the *slope* of a line is described as $\dfrac{\text{rise}}{\text{run}}$, we know that $\dfrac{dy}{dx}$ describes the slope of a line at a particular point.
|
||||
## Formulas
|
||||
- $\int k {du} = ku + C$
|
||||
- $\int u^n du = \frac{1}{n+1}u^{n+1} + C$
|
||||
- $\int \frac{1}{u} du = \ln(|u|) + C$
|
||||
- $\int e^u du = e^u + C$
|
||||
- $\int \sin(u) du = -\cos(u) + C$
|
||||
- $\int \cos(u) du = \sin(u) + C$
|
||||
- $\int \dfrac{1}{\sqrt{a^2 - u^2}} du = \arcsin(\frac{u}{a}) +C$
|
||||
- $\int \dfrac{1}{a^2+u^2}du = \dfrac{1}{a} \arctan(\frac{u}{a}) + C$
|
||||
- $\int \dfrac{1}{u\sqrt{u^2 - a^2}} du = \dfrac{1}{a}arcsec(\dfrac{|u|}{a}) + C$
|
||||
|
||||
# Length of a Curve
|
||||
## Review of the Mean Value Theorem
|
||||
If $f$ is a continuous function on the interval $[a, b]$ and differentiable on $(a, b)$, then there exists a number $c$ in the interval $(a, b)$ such that:
|
||||
|
||||
$$ f'(c) = \dfrac{f(b) - f(a)}{b - a} $$
|
||||
|
||||
This also implies that for some $c$ in the interval $(a, b)$:
|
||||
$$ f(b) - f(a) = f'(c)(b-a) $$
|
||||
|
||||
## Intuitive Approach
|
||||
Given that we divide a curve into $n$ sub-intervals, and we can find the location of the right endpoint of each interval.
|
||||
|
||||
With a series of points on a curve we can find the distance between each point.
|
||||
|
||||
As we increase $n$, the precision of which the curve is estimated increases.
|
||||
|
||||
This means that:
|
||||
$$ \text{length of a curve} = \lim_{n \to \infty} \sum_{i=1}^{n}(\text{length of line segment)}$$
|
||||
Using the distance formula, we know that the length of the line segment can be found with:
|
||||
$$ \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} $$
|
||||
1. So the entire equation is:
|
||||
$$ \text{length of a curve} = \lim_{n \to \infty} \sum_{i=1}^{n}(\sqrt{(x_i - x_{i-1})^2 + (y_i - y_{i-1})^2}) $$
|
||||
This can also be described as:
|
||||
$$ \text{length of a curve} = \lim_{n \to \infty} \sum_{i=1}^{n}(\sqrt{(\Delta x)^2 +(\Delta y)^2}) $$
|
||||
2. Using the mean value theorem:
|
||||
$$ \lim_{n \to \infty} \sum_{i = 1}^n\sqrt{\Delta x^2 + (f(x_i) - f(x_{i-1}))i^2} $$l
|
||||
$$ \lim_{n \to \infty} \sum_{i=1}^n \sqrt{\Delta x ^2 + (f'(x_{\hat{i}}))(x_i - x_{i-1})^2}$$
|
||||
3. Factoring out $\Delta x$
|
||||
$$ \lim_{n \to \infty} \sum_{i=1}^n \sqrt{\Delta x^2(1 + f'(x_{\hat{i}}))}$$
|
||||
4. Moving $\Delta x$ out of the root
|
||||
|
||||
$$ \lim_{n \to \infty} \sum_{i=1}^n \sqrt{(1 + f'(x_{\hat{i}}))} \Delta x$$
|
||||
5. As an integral:
|
||||
$$ L =\int_a^b \sqrt{1 + f'(x)^2} dx$$
|
||||
## Examples
|
||||
> Find the length of the curve $y = -\frac{5}{12}x + \frac{7}{12}$ from the point $(-1, 1)$
|
||||
|
||||
1. $L = \int_{-1}^8 \sqrt{1 + (-\frac{5}{12})^2} dx$
|
||||
2. $= \int_{-1}^8 \sqrt{1 + \frac{25}{144}} dx$
|
||||
3. = $\int_{-1}^8 \sqrt{\frac{169}{144}}dx$
|
||||
4. $= \int_{-1}^8 \frac{13}{12} dx$
|
||||
5. $\frac{13}{12} x \Big| _{-1}^8$
|
||||
|
||||
> Find the distance from the point ${\frac{1}{2}, \frac{49}{48}}$ to the point $(5, \frac{314}{15})$ along the curve $y = \dfrac{x^4 - 3}{6x}$.
|
||||
> *note*: The complete evaluation of this problem is more work than typically required, and is only done for demonstration purposes.
|
||||
1. $y' = \dfrac{4x^3(6x) - (x^4 + 3)6}{36x^2}$: Find the derivative of the curve using the quotient rule
|
||||
2. $= \dfrac{18x^4 - 18}{36x^2}$: Simplify
|
||||
3. $= \dfrac{18(x^4 - 1)}{18(2x^2)}$: Factor out $18$
|
||||
4. $= \dfrac{x^4 - 1}{2x^2}$: Factor out $18$ again
|
||||
5. $L = \int_{1/2}^5 \sqrt{1 + (\dfrac{4x-1}{2x^2})^2}dx$ : Use the length formula
|
||||
6. $= \int_{1/2}^5 \sqrt{1 + \dfrac{x^8 - 2x^4 + 1}{x^4}} dx$: Apply the $^2$
|
||||
7. $= \int_{1/2}^5 \sqrt{\dfrac{4x^4 + x^8 -2x^4 + 1}{4x^4}}dx$: Set $1 = \dfrac{4x^4}{4x^4}$ and add
|
||||
8. $= \int_{1/2}^5 \sqrt{\dfrac{x^8 + 2x^4 + 1}{4x^4}}dx$: Factor the numerator
|
||||
9. $= \int_{1/2}^5 \sqrt{\dfrac{(4x+1)^2}{4x^4}}dx$ : Get rid of the square root
|
||||
10. = $\int_{1/2}^5 \dfrac{x^4 + 1}{2x^2}dx$: Move the constant $\frac{1}{2}$ outside of the integral
|
||||
11. $= \frac{1}{2}\int_{1/2}^5 \dfrac{x^4 + 1}{x^2}$: Rewrite to remove the fraction
|
||||
12. $= \frac{1}{2} \int_{1/2}^5 (x^4 + 1)(x^{-2})dx$: distribute
|
||||
13. $= \frac 1 2 \int_{1/2}^5 (x^2 - x^{-2})dx$: Find the indefinite integral
|
||||
14. $= \dfrac{1}{2} (\frac{1}{3}x^3 - x^-1)\Big|_{1/2}^5$ : Plug and chug
|
||||
15. $= (\frac{125}{6} - \frac{1}{10}) - (\frac{1}{48} - 1)$
|
||||
16. $=(\frac{5000}{240} - \frac{24}{240}) - (\frac{5}{240} - \frac{240}{240})$
|
||||
|
||||
> Find the length of the curve $y = \sqrt{1 - x^2}$
|
||||
1. $y$ has a domain of $[-1, 1]$
|
||||
2. $y' = \dfrac{1}{2}(1-x^2)^{-1/2}(-2x)$
|
||||
3. $= -\dfrac{x}{\sqrt{1 - x^2}}$
|
||||
4. $L = \int_{-1}^1 \sqrt{1 + (-\dfrac{x}{\sqrt{1-x^2}})^2}dx$
|
||||
5. $L = \int_{-1}^1 \sqrt{1 + \dfrac{x^2}{1-x^2}}dx$
|
||||
6. $L = \int_{-1}^1 \sqrt{\dfrac{1}{1-x^2}}dx$
|
||||
7. $L = \int_{-1}^1 \dfrac{1}{\sqrt{1-x^2}}dx$
|
||||
8. $L = \arcsin(x) \Big|_{-1}^1$
|
||||
|
||||
> Set up an integral to find the length of the curve $y = \sin(x)$ from the point $(0, 0)$ to the point $(2\pi, 0)$.
|
||||
|
||||
1. $L = \int_0^{2\pi} \sqrt{1 + \cos^2{x}}dx$ : The derivative of $\sin$ is $\cos$
|
||||
2. Plug into calculator
|
||||
|
||||
# Area Between Curves
|
||||
If the area under the curve is found by approximating the space between the curve and the $x$ intercept, then the area *between* two curves can be found by approximating the space between the top curve and the bottom curve.
|
||||
|
||||
Visualized as a set of rectangles, each rectangle would have a corner on the top curve, and a corner on the bottom curve, with a width of $\Delta x$.
|
||||
|
||||
The height of the rectangle, or the distance between the curves at a given point can be found with the formula $f(x) - g(x)$ where $f(x) \ge g(x)$
|
||||
|
||||
The Riemann Sum definition of the area between two curves is as follows:
|
||||
|
||||
$$ \lim_{n \to \infty} \sum_{i = 1}^n (f(x_i)-g(x_i)\cdot \Delta x)$$
|
||||
- $i$ is the sub-interval
|
||||
- $x_i$ is the $x$ coordinate at a given sub-interval
|
||||
- $\Delta x$ is the width of each sub-interval.
|
||||
|
||||
This sum can also be described as:
|
||||
$$ = \int_a^b(f(x)-g(x))dx $$
|
||||
|
||||
Where the two lines intersect each other, you'll need to split the solution into a sum of integrals to ensure that $f(x) \ge g(x)$, by swapping the two.
|
||||
|
||||
# Rotating a Solid Formed from a Rotation of a Plane Region
|
||||
Similar to finding the area between two curves, the volume can be found by approximating with rectangles.
|
||||
|
||||
The area of each slice can be found by taking the area of the inner circle ($\pi r^2$) and subtracting it from the bigger circle ($\pi R ^2$). The area of a washer (or cylinder) can be found with $\text{base} * \text{height}$, and the height of each subsection is $\Delta x$.
|
||||
|
||||
The Riemann Sum definition is defined as follows:
|
||||
$$ \lim_{x \to \infty} \sum_{i = 1}^n ((\pi\cdot(f(x_i))^2-\pi\cdot(g(x_i))^2)\Delta x$$
|
||||
- $\Delta x$: The width of each section
|
||||
- $\pi * (f(x_i))^2$: The area of larger circle formed by $f(x_i)$
|
||||
- $\pi * (f(x_i))^2$: The area of smaller circle formed by $f(x_i)$
|
112
education/math/MATH1210 (calc 1)/Limits.md
Normal file
@ -0,0 +1,112 @@
|
||||
# Introduction
|
||||
Every mathematical function can be thought of as a set of ordered pairs, or an input value and an output value.
|
||||
- Examples include $f(x) = x^2 + 2x + 1$, and $\{(1, 3), (2, 5), (4, 7)\}$.
|
||||
|
||||
**A limit describes how a function behaves *near* a point, rather than *at* that point.***
|
||||
- As an example, given a *well behaved function* $f(x)$ and the fact that:
|
||||
- $f(1.9) = 8.41$
|
||||
- $f(1.999) = 8.99401$
|
||||
- $f(2.1) = 9.61$
|
||||
- $f(2.01) = 9.061$
|
||||
- $f(2.0001) = 9.0006$
|
||||
We can note that the smaller the distance of the input value $x$ to $2$, the smaller the distance of the output to $9$. This is most commonly described in the terms "As $x$ approaches $2$, $f(x)$ approaches $9$", or "As $x \to 2$, $f(x) \to 9$."
|
||||
|
||||
Limits are valuable because they can be used to describe a point on a graph, even if that point is not present.
|
||||
# Standard Notation
|
||||
The standard notation for a limit is:
|
||||
$$ \lim_{x \to a} f(x) = L $$
|
||||
- As $x$ approaches $a$, the output of $f(x)$ draws closer to $L$. In the above notation, $x$ and $a$ are not necessarily equal.
|
||||
- When plotted, the hole is located at $(a, L)$.
|
||||
# Indeterminate Limits
|
||||
If they have a limit of the form $lim_{x \to a} \frac{f(x)}{g(x)}$ where both $f(x) \to 0$ and $g(x) \to 0$ as $x \to a$ then this limit **may or may not** exist and is said to be an indeterminate form of type $\dfrac{0}{0}$.
|
||||
To find this limit if it exists we must perform some mathematical manipulations on the quotient in order to change the form of the function. Some of the manipulations that can be tried are:
|
||||
- Factor or Foil polynomials and try dividing out a common factor.
|
||||
- Multiply numerator and denominator by the conjugate of a radical expression
|
||||
- Combine fractions in the numerator or denominator of a complex fraction
|
||||
|
||||
# Limits of the Form $\frac{k}{0}, k \ne 0$
|
||||
If we have a one sided limit of the form $\lim_{x \to a^*} \frac{f(x)}{g(x)}$ $f(x) \to k (k \ne 0)$ and $g(x) \to 0$ as $x \to a$ then:
|
||||
$$ \lim_{x \to a^*} \frac{f(x)}{g(x)} = \infty \space or \space \lim_{x \to a^*} \frac{f(x)}{g(x)} = -\infty $$
|
||||
# Limits of the Form $\frac{\infty}{\infty}$
|
||||
If we have a limit of the form $\lim_{x \to a} \frac{f(x)}{g(x)}$ where both $f(x) \to \infty$ and $g(x) \to \infty$ as $x \to a$ then the limit may or may not exist and is said to be an indeterminate form of type $\frac{\infty}{\infty}$.
|
||||
|
||||
To find the limit if it exists we must perform some algebraic manipulations on the quotient in order to change the form of the function.
|
||||
|
||||
If $f(x)$ and $g(x)$ are polynomials, then we can multiply the numerator and denominator by $\dfrac{1}{x^n}$, where $n$ is the degree of the polynomial in the denominator.
|
||||
# Continuity
|
||||
A function is continuous if their graph can be traced with a pencil without lifting the pencil from the page.
|
||||
|
||||
Formally, a function $f$ is continuous at a point $a$ if:
|
||||
- $f(a)$ is defined
|
||||
- $\lim_{x \to a} f(x)$ exists
|
||||
- $\lim_{x \to a} = f(a)$
|
||||
|
||||
- A function is continuous on the open interval $(a, b)$ if it is continuous at all points between $a$ and $b$
|
||||
- A function is continuous on the closed interval $[a, b]$ if it is continuous at all points between $a$ and $b$
|
||||
|
||||
# Elementary Functions
|
||||
An elementary function is any function that is defined using:
|
||||
- Polynomial functions
|
||||
- Rational functions
|
||||
- Root functions
|
||||
- Trig functions
|
||||
- Inverse trig functions
|
||||
- Exponential functions
|
||||
- Logarithmic functions
|
||||
- Operations of:
|
||||
- Addition
|
||||
- Subtraction
|
||||
- Multiplication
|
||||
- Division
|
||||
- Composition
|
||||
|
||||
A piece-wise function is *not* considered an elementary function
|
||||
|
||||
- If $f$ and $g$ are continuous at a point $x = a$ and $c$ is a constant then the following functions are also continuous at $x = a$
|
||||
- If $g$ is continuous at $a$ and $f$ is continuous at $g(a)$, then $f(g(a))$ is continuous at $a$
|
||||
- If $f$ is an elementary function and if $a$ is in the domain of $f$, then $f$ is continuous at $a$
|
||||
Together, the above theorems tell us that if $a$ is in the domain of an elementary function, then $\lim_{x \to a} f(x) = f(a)$.
|
||||
|
||||
# Intermediate Value Theorem
|
||||
Let $f$ be a continuous function on the interval $[a, b]$ and let $N$ be any number strictly between $f(a)$ and $f(b)$. Then there exists a number $c$ in $(a, b)$ such that $f(c) = N$.
|
||||
|
||||
# Definitions
|
||||
|
||||
| Term | Definition |
|
||||
| --------------------- | ----------------------------------------------------------------------------- |
|
||||
| Well behaved function | A function that is continuous, has a single value, and is defined everywhere. |
|
||||
|
||||
|
||||
# L'Hospital's Rule
|
||||
If you have a limit of the indeterminate form $\dfrac{0}{0}$, the limit can be found by taking the derivative of the numerator, divided by the derivative of the denominator.
|
||||
$$ \lim_{x \to 2} \dfrac{x-2}{x^2-4} = \lim_{x \to 2} \dfrac{1}{2x}$$
|
||||
|
||||
L'Hospital's Rule can also be used when both the numerator and denominator approach some form of infinity.
|
||||
$$ \lim_{x \to \infty} \dfrac{x^2-2}{3x^2-4} = \lim_{x \to \infty} \dfrac{2x}{6x}$$
|
||||
The above problem can be solved more easily *without* L'Hospital's rule, the leading coefficients are 1/3, so the limit as $x$ approaches $\infty$ is 1/3.
|
||||
|
||||
L'Hospital's rule **cannot** be used in any other circumstance.
|
||||
|
||||
## Examples
|
||||
1. $\lim_{x \to 0} \dfrac{7^x - 5^x}{2x}$
|
||||
2. $= \lim_{x \ to 0}\dfrac{7^x \ln(7) -5^x(\ln(5)}{2}$
|
||||
3. $= \dfrac{\ln(7) - \ln(5)}{2}$
|
||||
# Indeterminate form $(0 * \infty)$
|
||||
If the $\lim_{x \to a}f(x) = 0$ and $\lim_{x\to a} g(x) = \infty$ then $\lim_{x \to a}(f(x) * g(x)$ may or may not exist.
|
||||
|
||||
To evaluate an indeterminate product ($0 * \infty$), use algebra to convert the product to an equivalent quotient and then use L'Hopsital's Rule.
|
||||
|
||||
$$ \lim_{x \to 0^+} x\ln(x) = \lim_{x \to 0^+}\dfrac{\ln x}{\dfrac{1}{x}} = \lim_{x \to 0^+} \dfrac{1/x}{-1/(x^2)} = \lim_{x \to 0^+} -x = 0 $$
|
||||
# Indeterminate form $(\infty - \infty)$:
|
||||
If the $\lim_{x \to a}f(x) = \infty$ and $\lim_{x \to a} (g(x)) = \infty$ , then $\lim_{x \to a}(f(x) - g(x))$ may or may not exist.
|
||||
|
||||
# Indeterminate Powers
|
||||
When considering the $\lim_{x \to a} f(x)^{g(x)}$, the following are indeterminate:
|
||||
- $0^0$
|
||||
- $\infty^0$
|
||||
- $1^\infty$
|
||||
|
||||
1. $\lim_{x \to 0^+} x^x$
|
||||
2. $= \lim_{x \to 0} e^{\ln(x^x)}$ - wrap $e^{\ln{x}}$ around the function
|
||||
3. $= e^{\lim_{x \to 0} x \ln(x)}$ -use L'Hospital's rule
|
||||
|
45
education/math/MATH1210 (calc 1)/Max and Min.md
Normal file
@ -0,0 +1,45 @@
|
||||
z# Maximum/Minimum
|
||||
A function $f$ has an *absolute maximum* at $c$ if $f(c) >= f(x)$. We call $f(c)$ the maximum value of $f$.
|
||||
The absolute **maximum** is the largest possible output value for a function.
|
||||
|
||||
A function $f$ has an absolute minimum at $c$ if $f(c) <= f(x)$. $f(c)$ is the absolute minimum value of $f$.
|
||||
The absolute **minimum** is the smallest possible output value for a function.
|
||||
|
||||
- Where the derivative of a function is zero, there is either a peak or a trough.
|
||||
|
||||
# Critical Numbers
|
||||
A number is considered critical if the output of a function exists and $\dfrac{d}{dx}$ is zero or undefined.
|
||||
|
||||
# Local Max/Min
|
||||
A local max/min is a peak or trough at any point along the graph.
|
||||
|
||||
# Extreme Value Theorem
|
||||
If $f$ is a continuous function in a closed interval $[a, b]$, then $f$ achieves both an absolute maximum and an absolute minimum in $[a, b]$. Furthermore, the absolute extrema occur at $a$ or at $b$ or at a critical number between $a$ and $b$.
|
||||
|
||||
## Examples
|
||||
> Find the absolute maximum and absolute minimum of the function $f(x) = x^2 -3x + 2$ on the closed interval $[0, 2]$:
|
||||
|
||||
1. $x=0$ and $x=2$ are both critical numbers because they are endpoints. Endpoints are *always* critical numbers because $\dfrac{d}{dx}$ is undefined.
|
||||
2. $\dfrac{d}{dx} x^2 -3x + 2 = 2x -3$
|
||||
3. Setting the derivative to zero, $0 = 2x - 3$
|
||||
4. Solving for x, we get $x = \dfrac{3}{2}$. Three halves is a critical number because $f'(\dfrac{3}{2})$ is $0$.
|
||||
5. Now check the outputs for all critical numbers ($f(x)$ at $x = \{0, 2, \dfrac{3}{2}\}$)
|
||||
6. $f(0) = 0^2 -3(0) + 2 = 2$
|
||||
7. $f(2) = 2^2 - 3(2) + 2) = 0$
|
||||
8. $f(\dfrac{3}{2}) = (\dfrac{3}{2})^2 - 3(\dfrac{3}{2}) + 2 = -\dfrac{1}{4}$
|
||||
9. The minimum is the lowest of the three, so it's $-\dfrac{1}{4}$ and it occurs at $x = \dfrac{3}{2}$
|
||||
10. The maximum is the highest of the three, so it's $2$ at $x = 0$.
|
||||
|
||||
|
||||
> Find the absolute maximum and absolute minimum of the function $h(x) = x + 2cos(x)$ on the closed interval $[0, \pi]$.
|
||||
|
||||
1. $x = 0$ and $x = \pi$ are both critical numbers because they are endpoints. Endpoints are critical because $\dfrac{d}{dx}$ is undefined.
|
||||
2. $\dfrac{d}{dx} x + 2\cos(x) = 1 - 2sin(x)$
|
||||
3. Setting that to zero, we get $0 = 1 - 2\sin(x)$
|
||||
4. $\sin(x) = \dfrac{1}{2}$
|
||||
5. In the interval $[0, \pi]$, $\sin(x)$ has a value of $\dfrac{1}{2}$ in two places: $x = \dfrac{\pi}{6}$ and $x = \dfrac{5\pi}{6}$. These are both critical numbers because they are points where $\dfrac{d}{dx}$ is zero.
|
||||
6. Now we plug these values into the original function:
|
||||
7. $h(0) = 0 + 2\cos 0 = 2$
|
||||
8. $h(\pi) = \pi + 2\cos(\pi) = \pi - 2 \approx 1.14159$
|
||||
9. $h(\dfrac{\pi}{6}) = \dfrac{\pi}{6} + 2\cos(\dfrac{\pi}{6}) = \dfrac{\pi}{6} + 2(\dfrac{\sqrt{3}}{2} = \dfrac{\pi}{6} + \sqrt{3} \approx 2.2556$
|
||||
10. $h(\dfrac{5\pi}{6}) = \dfrac{5\pi}{6} + 2\cos(\dfrac{5\pi}{6}) = \dfrac{5\pi}{6} - \sqrt{3} \approx 0.88594$
|
@ -1,55 +0,0 @@
|
||||
# Work
|
||||
## Historical, Superficial
|
||||
Franz Liszt was a huge fan of Paganini because of his incredible skill, and the technicality of his music. This led him to set out and compose a set of etudes[^1] inspired from Paganini's works. He originally released them in 1838 as the "Études d'exécution transcendante d'après Paganini", then revised them in 1851, dedicating the later revision to Clara Schumann[^2]. He made this revision because the first versions were so absurdly difficult that they were considered impossible to play by many. Even after the revision, many consider these some of the most technically demanding works in piano literature.
|
||||
|
||||
[^1]: Literally translating to "study", an etude is a short song usually meant to help practice a particular technique
|
||||
[^2]: Wife of Robert Schumann, Clara Schumann was an accomplished pianist and composer.
|
||||
## Analysis
|
||||
|
||||
### Questions
|
||||
> What did the composer have in mind?
|
||||
|
||||
> What is the general mood?
|
||||
The music is generally pretty dramatic and intense, although there are some slower, gentler sections.
|
||||
|
||||
> What might it mean?
|
||||
|
||||
> What parts do you most like?
|
||||
I really like
|
||||
> What parts do you least like?
|
||||
|
||||
> What style is it?
|
||||
|
||||
> How do you know?
|
||||
|
||||
> What medium is it
|
||||
|
||||
> What texture
|
||||
|
||||
# Composer
|
||||
## History
|
||||
Liszt fell very ill, to the extent that an obituary notice was printed in a Paris newspaper, and he underwent a long period of religious doubts and pessimism.
|
||||
- guitar face for pianos
|
||||
## Last Name
|
||||
https://german.stackexchange.com/questions/67786/is-liszt-really-pronounced-like-the-english-word-list
|
||||
TODO
|
||||
|
||||
## Freakishly Large Hands
|
||||
His hands weren't as large as Rachmaninoff, but they had effectively no connective tissues at the base of each finger
|
||||
|
||||
# Notes during production
|
||||
- was going to include a pic of a cast of his hands, but it's pretty manky
|
||||
- can you imagine the crushing disappointment
|
||||
|
||||
# Links
|
||||
https://en.wikipedia.org/wiki/Franz_Liszt
|
||||
|
||||
https://en.wikipedia.org/wiki/Grandes_%C3%A9tudes_de_Paganini
|
||||
|
||||
https://imslp.org/wiki/Grandes_%C3%A9tudes_de_Paganini,_S.141_(Liszt,_Franz)
|
||||
|
||||
https://researchrepository.wvu.edu/cgi/viewcontent.cgi?article=6402&context=etd
|
||||
|
||||
https://lisztmuseum.hu/permanent_exhibition/dining-room-120755
|
||||
|
||||
https://www.pianostreet.com/smf/index.php?topic=65517.0
|
116
education/nutrition/Carbohydrates.md
Normal file
@ -0,0 +1,116 @@
|
||||
- Carbohydrates are a class of nutrients that is a major source of energy for the body
|
||||
- Can also server as a glue that holds cells together
|
||||
- Classified as simple or complex
|
||||
- Plants are rich sources of carbohydrates
|
||||
There are 3 categories of carbs.
|
||||
|
||||
# Sugars
|
||||
- A **monosaccharide** is a simple sugar that is the basic molecule of carbohydrates:
|
||||
- Glucose: Primary fuel for muscles, nerves, and other cells, the most common.
|
||||
- Fructose: In **fruits**, honey, and certain vegetables
|
||||
- Galactose: Component of lactose
|
||||
- A **disaccharide** is a simple sugar comprised of two monosaccharides.
|
||||
- Maltose: Disaccharide composed of two glucose molecules "malt sugar"
|
||||
- Sucrose: Disaccharide composed of a glucose and fructose molecule "table sugar"
|
||||
- Lactose: Disaccharide composed of a glucose and a galactose molecule "milk sugar"
|
||||
|
||||
- High fructose corn syrup is a syrup obtained from the processing of corn
|
||||
- No conclusive evidence that the use of HFCS causes poor health and disease
|
||||
- Excessive calories from beverages sweetened with HFCS contributes to increased risk for diabetes and heart disease
|
||||
- Nutritive sweeteners are substances that sweeten and contribute energy to foods
|
||||
- Each gram of mono or disaccharide supplies 4 kcal
|
||||
- Added sugars are sugars added to foods during processing or prep
|
||||
- The main source of added sugars in the American diet is sugar sweetened beverages.
|
||||
- Alternative sweeteners are substances that sweeten foods while providing few or no calories
|
||||
- Sugar alcohols are alternative sweeteners use to replace sucrose in some some sugar free foods:
|
||||
- Sorbitol, xylitol, mannitol
|
||||
- Not fully absorbed by the intestinal tract
|
||||
- Supply 2kcal/g
|
||||
- Can cause diarrhea when consumed
|
||||
- Non-nutritive sweeteners are a group of synthetic compounds that are intensely sweet tasting compared to sugar
|
||||
- Examples include Aspertame, Saccharin, Acesulfame-K, Neotame, and Sucralose
|
||||
|
||||
- Glycogen = storage form of glucose
|
||||
- A highly branched storage polysaccharide in animals
|
||||
- Muscles and liver are major storage sites
|
||||
# Starches
|
||||
Complex carbs have 3 or more monosaccharides bonded together
|
||||
- Starch is a storage polysaccharide in plants.
|
||||
- Composed of amylose and amylopectin
|
||||
- Rich sources include:
|
||||
- Bread and cereal products made from wheat, rice, barley, and oats
|
||||
|
||||
# Fiber
|
||||
- Plants also use complex carbohydrates to make supportive and protective structures
|
||||
- Dietary fiber is non-digestible plant material
|
||||
- Most types are polysaccharides
|
||||
- Soluble fiber
|
||||
- Forms of dietary fiber that dissolve or swell in water. includes pectins, gums, mucilages, and some hemicelluloses
|
||||
- Delays stomach emptying, slows glucose absorption and lowers blood cholesterol
|
||||
- Good sources of soluble fiber include oat bran and oatmeal, beans, apples, carrots, oranges, other citrus fruits, and psyllium seeds
|
||||
- Insoluble fiber
|
||||
- Forms of dietary fiber that generally do not dissolve in water: Includes cellulose, hemicelluloses, and lignin
|
||||
- Helps with bowel movements and fecal bulk
|
||||
- Good sources of insoluble fiber include whole grain products, including brown rice
|
||||
# Consumption
|
||||
- In developing nations, diets supply 70% or more of energy from unprocessed carbs
|
||||
- In industrialized nations, people tend to eat more highly refined starches and added sugars
|
||||
- Americans consume about 30% of energy from added sugars (600 kcal/day)
|
||||
- Regular soft drinks and energy drinks are major sources of added sugars in Americans' diets
|
||||
- According to the dietary guidelines, people should limit their added sugar to
|
||||
|
||||
# Digestion
|
||||
- Salivary amylase is an enzyme secreted by salivary glands that begins work in the mouth, stops working soon after food enters the stomach
|
||||
- The small intestine is the main site for carbohydrate digestion and absorption
|
||||
- Pancreatic amylase
|
||||
- Enzyme secreted by the pancreas that breaks down starch into maltose molecules
|
||||
- Maltase
|
||||
- Enzyme that splits maltose molecules
|
||||
- Sucrase
|
||||
- Enzyme that splits sucrose molecules
|
||||
- Lactase
|
||||
- Enzyme that splits lactose molecules
|
||||
- Only monosaccharides are absorbed
|
||||
1. Dietary carbohydrates from stomach are delivered to small intestine
|
||||
2. Glucose and other monosaccharides are transported to liver
|
||||
3. Blood levels of glucose maintained for brain and other body cells
|
||||
4. Glucose transported to muscle
|
||||
- Fructose and galactose are converted to **glucose** in the liver.
|
||||
- Absorption of monosaccharides mainly occurs in the small intestine
|
||||
- Galactose and glucose are absorbed by active transport
|
||||
- Fructose is absorbed by facilitated diffusion
|
||||
- Monosaccharides enter the capillary network
|
||||
- Transported to the lever by the hepatic portal vein
|
||||
- Simple sugars are:
|
||||
- Made into glycogen or fat by the liver
|
||||
- Released into bloodstream for energy use
|
||||
- Fiber is not digested
|
||||
- Eventually enters large intestine
|
||||
- Bacteria ferment soluble fiber (producing gas)
|
||||
- Used for energy
|
||||
- Insoluble fiber contributes to softer fees
|
||||
- Any fiber Present in food would delay rate at which chyme enters from the stomach
|
||||
- Promotes satiety
|
||||
- Refined grain products are generally low in fiber
|
||||
# Glucose
|
||||
- Insulin is the hormone secreted from the beta cells of the pancreas that helps regulate blood glucose levels by helping glucose enter cells
|
||||
- Released when blood glucose levels are **HIGH**
|
||||
- Glucagon is a hormone secreted from the alpha cells of the pancreas that helps regulate blood glucose levels
|
||||
- Released when blood glucose levels are **LOW**
|
||||
- Glyconeogenisis: Creates glucose
|
||||
- Glycogenolysis: Glycogen stores are broken down
|
||||
|
||||
- Cells need glucose to properly metabolize fat
|
||||
- When not enough glucose is available, ketone bodies form
|
||||
- Chemicals formed from the incomplete breakdown of fat
|
||||
- Ketosis is a condition in which ketone bodies accumulate in blood; can result in loss of....
|
||||
|
||||
# Hyper/Hypoglycemia
|
||||
- Hyperglycemia results in abnormally elevated blood glucose levels
|
||||
- Hypoglycemia results in abnormally low blood glucose levels
|
||||
|
||||
# Diabetes
|
||||
## Type 1
|
||||
An autoimmune disorder, type 1 diabetes prevents the body from releasing insulin.
|
||||
## Type 2
|
||||
The body is able to release insulin, but the cells don't respond to it
|
24
education/nutrition/Dietary Reference Intakes.md
Normal file
@ -0,0 +1,24 @@
|
||||
Dietary Reference Intake (DRIs) are a set of energy and nutrient intake standards that can be used as references when making dietary recommendations.
|
||||
|
||||
Dietary Guidelines for Americans are updated every 5 years.
|
||||
|
||||
DRIs include:
|
||||
## Estimated Average Requirements (EARs)
|
||||
The amount of nutrient that should meet the needs of 50% of healthy people who are in a particular life-stage/sex group.
|
||||
### Estimated Energy Requirements (EERs)
|
||||
The average daily energy intake that meets the needs of a healthy person maintaining their weight.
|
||||
EER takes into account:
|
||||
- Physical activity level
|
||||
- Height
|
||||
- Weight
|
||||
- Sex
|
||||
- Life stage
|
||||
- Health status
|
||||
## Recommended Dietary Allowances (RDAs)
|
||||
The standard for recommended daily intake of several nutrients.
|
||||
## Adequate Intakes (AIs)
|
||||
Recommendations that assume a population's average daily nutrient intakes are adequate because no deficiency diseases are present.
|
||||
|
||||
## Tolerable Upper Intake Levels (ULs)
|
||||
The highest average amount of a nutrient that is unlikely to harm most people.
|
||||
## Acceptable Macronutrient Distribution Range (AMDR)
|
77
education/nutrition/Digestive System.md
Normal file
@ -0,0 +1,77 @@
|
||||
The primary roles of the digestive system are:
|
||||
- breakdown of food into nutrients
|
||||
- absorption of nutrients
|
||||
- elimination of solid waste products
|
||||
Digestion is the process of breaking down large food molecules into nutrients that the body can use
|
||||
Absorption is the uptake and removal of nutrients from the digestive tract.
|
||||
- The digestive tract is also called the gastrointestinal tract (GI), alimentary canal, or gut
|
||||
# The GI tract
|
||||
## Order
|
||||
1. Mouth
|
||||
1. Digestion starts here for carbohydrates and fats (not proteins)
|
||||
2. Salivary glands are structures that produce saliva and secrete the fluid in the oral cavity
|
||||
3. Saliva is the watery fluid that contains mucus and enzymes
|
||||
1. Lysozyme - Destroys some bacteria that are in the food or mouth
|
||||
2. Salivary Amolase
|
||||
3. Lingual Lipase
|
||||
4. Taste buds have specialized cells that help distinguish five basic tastes
|
||||
5. You lose taste buds as we age. Older people have fewer taste buds than younger people.
|
||||
2. Esophagus*
|
||||
1. The esophagus is a flap of tough tissue that prevents the food from entering the larynx and the trachea
|
||||
2. **Peristalsis** is the wave of muscular contraction that helps move material through most of the digestive tract. It's an involuntary response to swallowing
|
||||
3. By relaxing and contracting, the muscles can mix substances, in the lumen and control movement through the tract
|
||||
3. Stomach*
|
||||
1. The stomach is a muscular sac that stores and mixes food
|
||||
2. Gastric glands located in the stomach synthesize and secrete gastric juice
|
||||
1. Gastric juice is a mix of mucus, hydrochloric acid, intrinsic factor, and digestive enzymes
|
||||
1. Mucus cells secrete mucus to protect the lining of the stomach from the acid
|
||||
2. Parietal cells secrete intrinsic factor and the components of hydrochloric acid into the lumen of the stomach
|
||||
1. Intrinsic factor is a substance necessary for absorbing vitamin B-12
|
||||
3. Chief cells secrete some chemically inactive digestive enzymes
|
||||
1. Pepsinogen
|
||||
2. Gastric lipase
|
||||
4. G cells secrete gastrin - A hormone that stimulates stomach motility and gastric gland secretions
|
||||
4. Small intestine (DJI)
|
||||
1. Duodenum
|
||||
2. Jejunum
|
||||
3. ileum*
|
||||
5. Large intestine
|
||||
6. Rectum
|
||||
7. Anus
|
||||
## Sphincters
|
||||
Sphincters are thickened regions of circular muscle that control the flow of contents at various points in the GI tract.
|
||||
- Contracted:
|
||||
- Passageway closed
|
||||
- Flow is restricted
|
||||
- Essential for normal digestion and absorption
|
||||
There are 3 main sphincters associated with digestion:
|
||||
1. Gastroesophageal/lower esophageal/cardiac - connects the esophagus to the stomach
|
||||
2. Pyloric - connects the stomach to the duodenum (small intestine) and regulates the flow of chyme
|
||||
3. ileocecal valve - Connects the small intestine to the large intestine
|
||||
The upper esophageal sphincter is at the top of the esophagus (not as important).
|
||||
|
||||
# Digestion
|
||||
**Mechanical digestion refers to the physical treatment that food undergoes** while it is in the intestinal tract
|
||||
|
||||
Chemical digestion refers to the breakdown of large molecules in food into smaller components, primarily by the action of **enzymes**.
|
||||
- Enzymes are a protein that speeds up the rate of a chemical reaction without being altered in the process.
|
||||
- Enzymes usually end in -ase and begin with the name of whatever they are working to digest:
|
||||
- Amylase digests amylose
|
||||
- Maltase digests maltose
|
||||
# Nutrient Absorption
|
||||
- **Simple Diffusion**: Occurs when the concentration of a particular nutrient is higher in one area than an other. This form of transport does not require energy input. Many water-soluble vitamins, lipids, and some minerals are absorbed in the digestive tract by simple diffusion.
|
||||
- **Facilitated Diffusion**: Enterocytes absorb some nutrients by facilitated diffusion, another process that does not require energy. Although the nutrient moves down its concentration gradient, it still needs to be carried by a special transport protein within the membrane of the enterocyte. Absorption of simple sugar fructose occurs by facilitated diffusion
|
||||
- **Active Transport**: Some nutrients move from the lumen of the intestine and into an enterocyte against the concentration gradient; that is, from low to high concentration. Absorption of these nutrients requires both a unique transport protein and energy. Enterocytes rely on active transport to absorb glucose and amino acids.
|
||||
- **Endocytosis**: In a few instances, a segment of a the cell membrane of an enterocyte surrounds and swallows relatively large substances, such as intact protein molecules. This process enables an infant's intestinal tract to absorb whole proteins in human milk that provide benefits to the immune system. However, endocytosis is not a common way for nutrients to enter enterocytes.
|
||||
|
||||
# Definitions
|
||||
| Phrase | Definition |
|
||||
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Lumen | The open space inside of the digestive system |
|
||||
| Chyme | A semiliquid mass that forms when food mixes with gastric juice. Occurs in the lower stomach |
|
||||
| Motility | The ability of an organism to move independently |
|
||||
| Gastrin | Secreted in response to food entering the stomach, it triggers parietal cells to release HCL and chief cells to release pepsinogen. *Stimulates stomach and small intestinal motility* |
|
||||
| Secretin | Secreted from the small intestine in response to acidic chyme entering the duodenum and the first part of the jejunum, secretin *stimulates the release of a bicarbonate-rich solution from the liver and pancreas.* |
|
||||
| Cholecystokinin | Secreted from the small intestine in response to fat and breakdown products of proteins (peptides) entering the small intestine, cholecystokinin *stimulates the release of bile from the gallbladder into the small intestine*. It also stimulates the release of pancreatic enzymes, decreases stomach secretions, and slows stomach motility. |
|
||||
| Pancreas | An accessory organ of the GI tract that produces and secretes many of the enzymes that break down carbs, protein, and fat. It also secretes bicarbonate ions to neutralize the highly acidic chyme coming from the stomach. |
|
||||
| Villi (singular villus) | Small finger like projections that line the inner surface of the small intestine. They help maximize the absorption of nutrients from food. They're covered in an outer layer of absorptive cells called enterocytes. |
|
19
education/nutrition/Eating Disorders.md
Normal file
@ -0,0 +1,19 @@
|
||||
# Orthorexia
|
||||
Orthorexia is a pattern of disordered eating characterized by a fixation on 'clean eating', or 'perfect eating'. It often begins as a desire to eat only healthy foods but spirals into an obsession.
|
||||
|
||||
Notes from https://www.youtube.com/watch?v=q_mUm8Ow-Dc:
|
||||
- Often an emphasis around organic foods.
|
||||
- Individuals with orthorexia can go to extreme lengths to prepare meals.
|
||||
- The individual in the video recognizes that he has an issue and is working to fix it.
|
||||
- One individual catalogued foods obsessively.
|
||||
- One individual noted that it was becoming a problem when his food choices started consuming so much of his life.
|
||||
- People want to feel like they can make choices that will keep them healthy.
|
||||
- Society encourages orthorexia because healthy eating is lauded.
|
||||
- Some individuals stop eating fruits and vegetables they deem to have too high of sugar content.
|
||||
- There becomes a fear that if you stop eating healthy, everything will unravel.
|
||||
- "Raw nutritionists" believe that cooking food destroys that food's nutritional value.
|
||||
- Deaths have occurred because of orthorexia.
|
||||
|
||||
Notes from https://www.youtube.com/watch?v=uPyqCmz8-JQ:
|
||||
- Some raw nutritionists meet and talk about how their diet has changed their life.
|
||||
-
|
111
education/nutrition/Energy Balance & Weight Management.md
Normal file
@ -0,0 +1,111 @@
|
||||
- An overweight person has extra weight from bones, fat, muscle, body fat, and/or body wader
|
||||
- Obesity is a condition characterized by excessive and unhealthy bodyfat
|
||||
|
||||
# Consequences
|
||||
## Obesity
|
||||
- Type II Diabetes (DM)
|
||||
- **Hypertension**
|
||||
- Cardiovascular disease
|
||||
- **Obstructive sleep apnea**
|
||||
- Osteoarthritis
|
||||
- Infertility
|
||||
- Certain cancers
|
||||
- Gallbladder disease
|
||||
- Respiratory problems
|
||||
- Surgical complications
|
||||
- Clinical depression
|
||||
- Metabolic syndrome
|
||||
- **Stroke**
|
||||
|
||||
# Underweight
|
||||
- Fatigue / Anemia
|
||||
- Nutrient deficiencies
|
||||
- Lack of energy
|
||||
- Poor concentration
|
||||
- Unhealthy hair, skin, nails
|
||||
- Osteoporosis
|
||||
- Illness/infection
|
||||
- Bone fractures
|
||||
- Amenorrhea
|
||||
- Infertility
|
||||
- High risk pregnancy
|
||||
- Clinical depression
|
||||
- Low body temperature
|
||||
|
||||
# BMI
|
||||
- A numerical value based on the ratio between a person's height and weight that is used to **classify a person's weight** and **measure risk for disease**
|
||||
- Can be calculated using:
|
||||
$$ \dfrac{Weight (kg)}{Height (m)^2} or \dfrac{Weight (lbs)}{Height (in)^2} * 703 $$
|
||||
Conversions:
|
||||
- Lbs -> Kg: Divide by 2.2
|
||||
- Feet -> Inches: Multiply by 12
|
||||
- Inches -> Meters: Multiply by 2.54 / 100
|
||||
|
||||
## Ranges
|
||||
- Underweight: BMI < 18.5
|
||||
- Healthy weight: BMI 18.5 - 24.9
|
||||
- Overweight: BMI 25.0 - 29.9
|
||||
- Obese: BMI >= Obses
|
||||
- Obese Class I: BMI 30-34.9
|
||||
- Obese Class II: BMI 35-39.9
|
||||
- Obese Class III: BMI >=40
|
||||
|
||||
## Limitations
|
||||
Not always accurate for:
|
||||
- Highly muscular individuals
|
||||
- Older adults
|
||||
- Chronically ill individuals
|
||||
- BMI does not take gender, age, race, or activity level into account
|
||||
|
||||
## NWO
|
||||
- Normal weight obesity refers to a normal body weight as measured by BMI, but they actually have higher body fat
|
||||
- Comes with an associated risk of insulin resistance
|
||||
- Diabetes
|
||||
- Coronary artery disease
|
||||
|
||||
# Body Composition and Fat Distribution
|
||||
- Body composition is the relative and absolute measurement of body tissues, usually expressed as a percent body fat
|
||||
- Adipose tissue refers to fat cells
|
||||
- Total body fat refers to to adipose tissue and essential fat
|
||||
- Essential fat is fat that is vital for survival; found in cell membranes, certain bones, and nervous tissue.
|
||||
- **Subcutaneous** is fat accumulation of adipose tissue cells in the tissue under the skin.
|
||||
- This layer helps to:
|
||||
- *Insulate the body against cold temps*
|
||||
- *Protect the body from bumps and bruises*
|
||||
- **Visceral fat** is the accumulation of adipose cells under the abdominal muscles and over the digestive organs to protect them
|
||||
|
||||
- Types of obesity
|
||||
- **Apple shaped (Central body)**: Central body obesity: Risk of heart diseases, stroke, diabetes, HTN, cancer. This is more common in men. This is symbolic of extra visceral fat stores
|
||||
- **Gynoid (Pear shaped)**: Not associated w/ Chronic Disease Risk
|
||||
|
||||
## Assessment
|
||||
- Hydrostatic weight (error of 2-3%)
|
||||
- Air displacement plethysmography- BODPOD (error of 3-5%)
|
||||
- Dual energy x-ray absorptiometry: DEXA (Error of 1-4%)
|
||||
- **Bio-electrical impedance** (Error: 3-4%) Sends a shock through your body and measures how long it takes. Body fat resists electricity more.
|
||||
- Skinfold calipers (Error 3-5%)
|
||||
- **Waist circumference -> 35 inches for a women** or **>40 inches for a man** is associated with central adiposity and increased health risk, specifically CVD risk
|
||||
|
||||
## Health
|
||||
- Losing as little as 5% of excess body fat
|
||||
- Can increase HDL cholesterol levels
|
||||
- Reduce high blood pressure
|
||||
- Improve glucose tolerance
|
||||
|
||||
# Energy Exchange
|
||||
## Energy In
|
||||
- Carbs
|
||||
- Lipids
|
||||
- Proteins
|
||||
- Alcohol
|
||||
|
||||
## Energy Out (Total Energy Expenditure )
|
||||
- Basal metabolic rate
|
||||
- The minimum number of kcals required to maintain normal body function after fasting and resting for 12 hours. **Accounts for ~60-75% of an individual's total energy use**
|
||||
- Factors that increase BMR include thyroid hormone levels and postexercise recovery
|
||||
- Factors that decrease BMR include starvation and aging.
|
||||
- Physical activity
|
||||
- Thermic effect of food (digestion, processing, et cetera)
|
||||
- Non-exercise activity
|
||||
|
||||
Ghrelin is a hormone secreted by the stomach that stimulates eating behavior. Grehlin
|
117
education/nutrition/Lipids.md
Normal file
@ -0,0 +1,117 @@
|
||||
- **Lipids** are a class of nutrients that do not dissolve in water.
|
||||
- They will dissolve in organic solvents
|
||||
- Oil is less dense than water, so it will rise to the top of a solution
|
||||
- Major functions of lipids in the body include
|
||||
- Providing and storing energy
|
||||
- forming and maintaining cell membranes
|
||||
- producing steroid hormones
|
||||
- insulating the body
|
||||
- cushioning the body against bumps and blows
|
||||
- forming body contours
|
||||
- **absorbing fat soluble vitamins and phytochemicals**
|
||||
## Fatty Acids
|
||||
A fatty acid is a hydrocarbon chain found in lipids; one end of the chain forms a carboxylic acid, and one end forms a methyl group.
|
||||
- Short chain fatty acids have 2 to 4 carbons
|
||||
- Medium chain fatty acids have 6 to 12 acids
|
||||
- Long chan acids have 14 to 24 carbons
|
||||
- Fatty acids are identified by:
|
||||
- The number of carbon atoms
|
||||
- The type of bond between carbon atoms
|
||||
|
||||
- An omega-3 fatty acid is a polyunsaturated fatty acid with its first double bond at the third carbon from the omega end of the chain.
|
||||
|
||||
- **Saturated fatty acid (SFA)** Every single carbon atom is filled with hydrogen atoms
|
||||
- **Unsaturated fatty acid** is a fatty acid that is missing hydrogen atoms and has one or more double bonds within the carbon chain
|
||||
- **Monounsaturated** (MUFA)
|
||||
- Has **one** double bond within the carbon chain
|
||||
- Sources include:
|
||||
- **Canola oil**
|
||||
- **Olive oil**
|
||||
- **Avocados**
|
||||
- Nuts
|
||||
- Seeds
|
||||
- Peanut butter
|
||||
- **Polyunsaturated** (PUFA)
|
||||
- Fatty acid that has **two or more bonds** within the carbon chain
|
||||
- Sources include:
|
||||
- **Soybean oil**
|
||||
- **Fatty fish**
|
||||
- **Flax seed**
|
||||
- **Walnuts**
|
||||
- Corn oil
|
||||
- Sunflower oil
|
||||
- Most naturally occurring fatty acids are cis fatty acids
|
||||
- Hydrogen atoms of the double bonded carbon are on the same side of the hydrocarbon atom
|
||||
- **Trans fats** are unsaturated fatty acids that have a trans double bond.
|
||||
- Hydrogen atoms of the double bonded carbons are on the opposite side of the hydrocarbon chain
|
||||
- **Hydrogenation** is the food manufacturing process that adds hydrogen atoms to liquid vegetable oil, forming trans fats.
|
||||
- Can be stored for longer periods because they are less likely to undergo oxidation
|
||||
- Raise "bad" cholesterol levels in the blood
|
||||
- Increases risk of heart disease
|
||||
- **Essential fatty acids** are fatty acids that must be supplied by the diet
|
||||
- **Linoleic acid** - 18 carbon omega-6 fatty acid found in vegetable oils
|
||||
- **Alpha-linolenic acid** - 18 carbon omega-3 unsaturated fatty acid, found in flaxseed, walnuts
|
||||
- Precursor for
|
||||
- Eicosapentaonoic acid (EPA) - 20 carbons
|
||||
- Docosahexaenoic acid (DHA): 22 carbons
|
||||
- Both acids are found mainly in fatty fish
|
||||
- Essential fatty acids are needed for growth and healthy cell membranes, especially in the brain.
|
||||
- Infants that have an essential fatty acid deficiency can experience developmental and nerve system issues.
|
||||
- Signs of essential fatty acid deficiency include:
|
||||
- Scaly skin
|
||||
- Hair loss
|
||||
- Poor wound healing
|
||||
# Triglycerides
|
||||
A lipid that has three fatty acids attached to a three-carbon compound called glycerol
|
||||
- Comprises 95% of lipids in food and body
|
||||
- **Glycerol** is a three carbon alcohol that forms the backbone of fatty acids
|
||||
-
|
||||
# Phospholipids
|
||||
A phospholipid is a type of lipid needed for the flexibility, structure, and makeup of the cell membranes and for proper functioning of nerve cells.
|
||||
- Partially water soluble
|
||||
- Hydrophilic
|
||||
- Part that attracts water
|
||||
- Hydrophobic
|
||||
- Part that repels water and attracts fat
|
||||
- Can serve as an emulsifier
|
||||
- Helps water soluble and water insoluble compounds mix with each other
|
||||
# Sterols
|
||||
Sterols are lipids that have a more chemically complex structure than a triglyceride or fatty acid
|
||||
- -ol suffix: Attached to an alcohol
|
||||
**Cholesterol** is a lipid found in animal foods: precursor for steroid hormones, **bile**, and vitamin D.
|
||||
- Found in:
|
||||
- Egg yolk
|
||||
- Liver
|
||||
- Meat
|
||||
- Poultry
|
||||
- Dairy products
|
||||
|
||||
| Cholesterol (mg/dl) | Classification |
|
||||
| --------------------------- | -------------------------- |
|
||||
| <200 | Desireable |
|
||||
| 200-239 | Borderline high |
|
||||
| >= 240 | High |
|
||||
| **LDL Cholesterol (mg/dl)** | **Classification** |
|
||||
| < 100 | Optimal |
|
||||
| 100 - 129 | Near optimal/above optimal |
|
||||
| 130-159 | Borderline high |
|
||||
| 160-189 | High |
|
||||
| >= 190 | Very high |
|
||||
| **HDL Cholesterol (mg/dl)** | **Triglycerides (mg/dl)** |
|
||||
| < 150 | Normal |
|
||||
| 150-199 | Borderline high |
|
||||
| >= 200 | High |
|
||||
|
||||
# Lipases
|
||||
Lipases are enzymes that break down lipids
|
||||
- **Cholecystokinin** is a hormone that stimulates the gallbladder to release bile and the pancreas to secrete digestive juices
|
||||
- Bile helps with the emulsification of and digestion of fat.
|
||||
- Secretin is a hormone that stimulates the liver to produce bile and the pancreas to secrete bicarbonate rich pancreatic juice
|
||||
|
||||
# Lipoproteins
|
||||
Lipoproteins are water-soluble structures that transport lipids through the bloodstream. Lipoproteins are needed because fat is hydrophobic.
|
||||
- **Chylomicron** mostly carries triglycerides
|
||||
- **High density lipoprotein** (HDL) carries the most protein (45-50%), and roughly 30% phospholipids. HDL carries lipids away from tissues and to the liver, where they can be processed and eliminated. It's considered "good" cholesterol
|
||||
- **Low density lipoprotein** (LDL) carries the most cholesterol, and it carries lipids from the liver out to other tissues in the body. It's considered "bad" cholesterol
|
||||
- **Very low density lipoprotein** (VLDL) carries triglycerides from the liver into the bloodstream, where cells that line capillaries break down the triglycerides into fatty acids and glycerol
|
||||
- **Oxidized LDL** is formed when chemically unstable substances damage LDL, transports cholesterol into the arterial lining
|
132
education/nutrition/Minerals.md
Normal file
@ -0,0 +1,132 @@
|
||||
Minerals are inorganic, and **NOT** susceptible to degradation. Like vitamins, they provide 0 kcals per per gram
|
||||
# Major Minerals
|
||||
- Major minerals are essential mineral elements required in amounts of **100mg or more per day**
|
||||
|
||||
# Trace Minerals
|
||||
- Trace minerals are essential mineral elements required in amounts that are **less than 100mg per day**
|
||||
- They still perform vital roles
|
||||
- Obtaining adequate amounts of them from food is difficult
|
||||
## Iron
|
||||
**Iron** is the most important trace mineral
|
||||
- Iron has 4 major roles:
|
||||
1. **Oxygen transport** - Needed for production of hemoglobin (red blood cells), myoglobin (muscle cells), and cytochromes (most body cells)
|
||||
2. Cell division - Required by an enzyme needed for DNA production
|
||||
3. Immune system - Needed for production of lymphocytes (a type of white blood cell). Enables neutrophils (another type of white blood cell) to destroy bacteria
|
||||
4. Nervous system - Needed to help maintain the myelin sheath that covers parts of certain nerve cells, needed for the production of neurotransmitters (eg, dopamine, epinephrine, and norepinephrine that regulate brain and muscle activity).
|
||||
- **Heme** is the iron-containing component of hemoglobin and myoglobin. Heme is a type of iron found in our food, food sources provide both heme iron and non-heme iron.
|
||||
- **Hemoglobin** is the iron-containing protein in red blood cells that transports oxygen **to** cells, and carbon dioxide **away** from tissues.
|
||||
- **Myoglobin** is the iron containing protein in red **muscle cells** that controls oxygen uptake from red blood cells
|
||||
- **Cytochromes** are a group of proteins necessary for certain chemical reactions involved in the release of energy from macronutrients
|
||||
- Heme iron is the form of iron **found in meat**, and it's absorbed efficiently
|
||||
- Non-heme iron is a form of iron that's not absorbed as efficiently as heme iron
|
||||
- Meat, vegetables, grains, supplements, and fortified or enriched foods
|
||||
- To increase bioavailability, cook veggies in a cast iron pan with tomatoes or lemon juice (acid)
|
||||
- Enriched foods are enriched with **non-heme** iron
|
||||
|
||||
| Improve | Harm |
|
||||
| ---------------------------------------------------------- | ------------------------------------------------ |
|
||||
| High intake of vitamin C with iron-containing food | High intake of calcium with iron-containing food |
|
||||
| Consuming more heme, as compared to nonheme, forms of iron | Medications that reduce stomach acidity |
|
||||
| Consuming bread that has been leavened | Oxalic acids from foods such as spinach |
|
||||
| Consuming iron-containing foods that are fermentted | Phytic acid from foods such as whole grains |
|
||||
| Soaking of beans or grains before consuming | Soy proteins from foods such as tofu |
|
||||
| | Polyphenols from food and beverages such as tea |
|
||||
The RDA for men and postmenopausal women is **8 mg/day**, and for premenopausal women, it's **18 mg/day**.
|
||||
|
||||
Iron intake for adolescent females is significantly higher because of increased iron needs to support growth, and iron losses due to menstruation. Iron deficiency in this demographic is exacerbated by poor dietary choices.
|
||||
|
||||
## Iron Toxicity
|
||||
- **Hereditary hemochromatosis (HH)** is an inherited genetic defect that causes people to absorb too much iron
|
||||
- Iron accumulates in tissues and can cause joint pain, abnormal bronze skin color, damage to the liver, heart, adrenal glands, and pancreas
|
||||
- Organ damage caused by hemochromatosis can lead to cirrhosis, liver cancer, diabetes, or *cardiac arrhythmias (irregular heartbeats)*
|
||||
- Common signs and symptoms include fatigue, lack of energy, abdominal pain, loss of sex drive, and heart problems
|
||||
- Can be deadly if untreated
|
||||
|
||||
### Iron Deficiency
|
||||
Anemia is the deficiency disorder caused by iron efficiency
|
||||
- After red blood cells die, the body breaks them down and conserves most of the iron that was in hemoglobin
|
||||
- Some iron is lost each day via the gastrointestinal tract, urine, skin, or any form of bleeding
|
||||
- **Iron deficiency** refers to low iron stores in the body, and **iron deficiency is the most common nutrient deficiency in the US**.
|
||||
- Anemic red blood cells can shrink, becoming pale, and misshapen
|
||||
- Negative effects of iron deficiency anemia include interference with
|
||||
- Growth
|
||||
- Behavior
|
||||
- Immune system function
|
||||
- Energy metabolism
|
||||
- Signs and symptoms of iron deficiency include:
|
||||
- Pale skin and pale mucous membranes
|
||||
- Fatigue and weakness
|
||||
- Irritability
|
||||
- Shortness of breath
|
||||
- Brittle, cupped nails
|
||||
- Decreased appetite
|
||||
- Headache
|
||||
- Over time, anemia can cause:
|
||||
- Chest pain
|
||||
- An enlarged heart
|
||||
- Irregular heartbeat
|
||||
|
||||
## Iodine
|
||||
- Iodide is the form of iodine that the boy absorbs and uses
|
||||
- Sources of iodine include:
|
||||
- Seaweed
|
||||
- Saltwater fish
|
||||
- Grains
|
||||
- Cow's milk
|
||||
- Eggs
|
||||
- Iodized salt
|
||||
- **Goiter** is the enlargement of the thyroid gland that is **not** the result of cancer
|
||||
- Often occurs among populations living in areas that lack iodine in locally produced foods
|
||||
- Iodine is required for **normal thyroid functions** and the production of thyroid hormone
|
||||
- Hyperthyroidism refers to abnormally high blood levels of thyroid hormone
|
||||
- Hypothyroidism refers to low levels of thyroid hormone
|
||||
- Signs and symptoms include:
|
||||
- Reduced metabolism
|
||||
- Elevated blood cholesterol levels
|
||||
- **Cretinism** is a condition in infants who are born to iodine-deficient women. The infants have permanent brain damage and growth retardation
|
||||
- The fetus of a female who is deficient in iodine is likely to be born with a condition called **congenital hypothyroidism**
|
||||
- Iodine deficiency is the most common cause of preventable intellectual disability worldwide
|
||||
|
||||
## Zinc
|
||||
Zinc is necessary for:
|
||||
- Growth and development
|
||||
- Wound healing
|
||||
- Sense of taste and smell
|
||||
- DNA synthesis
|
||||
- Cofactor for more than 50 enzymes
|
||||
- Proper functioning of the nervous and immune system
|
||||
- Oysters are one of the best sources of Zinc
|
||||
- Other sources include whole grains, baked beans, beef roast, crab, yogurt, turkey, and soybeans
|
||||
The bioavailability of zinc is enhanced when eaten with proteins, especially with sulfur containing amino acids
|
||||
|
||||
### Zinc Toxicity
|
||||
- Excess of the UL -> Decreases HDL levels
|
||||
- Even higher can cause:
|
||||
- Diarrhea
|
||||
- Cramps
|
||||
- Nausea
|
||||
- Vomiting
|
||||
- Decreased immune function
|
||||
- Interfere with copper absorption and metabolism
|
||||
### Zinc Deficiency
|
||||
- loss of appetite
|
||||
- Diarrhea
|
||||
- Hair loss
|
||||
- Skin rash
|
||||
- Poor wound healing
|
||||
- Impaired sense of taste
|
||||
- Mental slowness
|
||||
- Iron deficiency anemia
|
||||
- Poor growth and development
|
||||
|
||||
# Selenium
|
||||
- Antioxidant
|
||||
|
||||
# Fluoride
|
||||
Fluoride is not considered an essential nutrient
|
||||
- Regular fluoride intake helps:
|
||||
- Mineralize teeth and bones
|
||||
- Presents tooth decay
|
||||
|
||||
### Fluoride Toxicity
|
||||
- Dental fluorosis is an abnormal change in the appearance of tooth enamel due to chronically high fluoride exposure during tooth development
|
100
education/nutrition/Misc.md
Normal file
@ -0,0 +1,100 @@
|
||||
# Key Nutrition Concepts
|
||||
- Most foods are *mixtures* of nutrients.
|
||||
- Water is the major nutrient in most foods.
|
||||
- All foods have *some* nutritional value
|
||||
- Some food is healthier than others
|
||||
* **Nutrient dense** food supplies more vitamins and minerals in relation to total calories. Examples include:
|
||||
* Broccoli
|
||||
* Leafy greans
|
||||
* Fat free milk
|
||||
* Oranges
|
||||
* Lean Meats
|
||||
* Whole grain Cereals
|
||||
* **Energy Density** refers to the amount of energy a food provides per given weight of the food.
|
||||
* Energy dense food has a kcal to weight ratio of 4.0 or higher.
|
||||
* Fat supplies the most energy per gram
|
||||
* Water supplies no energy for the body
|
||||
* An empty calorie food supplies excessive calories from unhealthy types of fat, added sugar, and/or alcohol.
|
||||
* Not all energy dense foods are empty-calorie foods.
|
||||
* Examples of empty calorie foods include candy, snack chips, alcohol, or sugar sweetened drinks.
|
||||
* People can add variety to their diets by choosing different foods from each of the 5 food groups
|
||||
* Fruits
|
||||
* Vegetables
|
||||
* Grains
|
||||
* Protein
|
||||
* Dairy
|
||||
* Food is the best source of nutrients
|
||||
* Economical
|
||||
* Reliable
|
||||
* Contains Phytochemicals
|
||||
* It can be difficult to plan and eat nutritious foods daily; in these cases, take a supplement
|
||||
* Nutrition is a *dynamic science*. It's constantly changing.
|
||||
* The FDA *can* regulate nutrition and health related claims on product labels.
|
||||
* They *cannot* prevent the spread of health misinformation.
|
||||
# Dietary Supplements
|
||||
- A dietary supplement is a product that contains a vitamin, mineral, herb, or other plant product, an amino acid, or a dietary substance that *supplements* the diet by increasing total intake.
|
||||
- The **Dietary Supplement and Health Education Act of 1994** allows manufacturers to classify nutrient supplements and herbal products as foods.
|
||||
- They do not undergo rigorous testing before being marketed
|
||||
- Most foods *do not contain toxic levels of vitamins and minerals*.
|
||||
- A megadose is an amount of vitamin or mineral that is very high, generally at least 10 times the recommended amount of the nutrient.
|
||||
- When taken in high amounts, many vitamins have unpleasant side effects.
|
||||
# Malnutrition
|
||||
- Malnutrition is a state of health that occurs when the body is *improperly nourished*. This includes *both* **undernutrition** and **over nutrition**.
|
||||
- Nutritionally inadequate diets may be selected because of
|
||||
- Lack of knowledge
|
||||
- Low or fixed income
|
||||
- Eating disorders
|
||||
- Drug problems
|
||||
- Medical problems
|
||||
# Dr. Goldburger's Discovery
|
||||
- Dr. Goldberger discovered a hypothesis that pellagra resulted from something lacking in people's diets. He hypothesized that the missing dietary factor was in meat, milk, and other foods eaten by higher income people. The missing nutrient turned out to be niacin, or vitamin b.
|
||||
|
||||
# Science
|
||||
- Previously, nutrition facts were based on intuition or **anecdotes**.
|
||||
- Today, nutrition is based on scientific research.
|
||||
## The Scientific Method
|
||||
1. Make observations that generate questions
|
||||
2. Formulate hypothesis to explain events
|
||||
3. Review current scientific literature (published studies) that relate to the question.
|
||||
4. Design studies, perform tests, and collect data.
|
||||
5. Analyze data and draw conclusions.
|
||||
6. Share results.
|
||||
7. Conduct more research that may agree or disagree with previous findings.
|
||||
|
||||
## Types of Studies
|
||||
### Experimental
|
||||
- A *systematic way* of testing a hypothesis.
|
||||
- Animal vs human
|
||||
- Treatment vs control
|
||||
- There's a degree of *control* present.
|
||||
- Can be used to test causation.
|
||||
### Epidemiological
|
||||
- *Observations* of the occurrence, distribution, and associations between factors and health or disease in a population.
|
||||
- Observations at one point or over time.
|
||||
- **Case Control:**
|
||||
- Cases matched with controls and information is gathered
|
||||
- **Cohort** (2 types):
|
||||
- Retrospective: Collect info about a group's past exposures and identify current outcomes
|
||||
- Prospective: group of healthy people that are followed over time and the outcome noted.
|
||||
- Most common for use on humans.
|
||||
- **Never** used to determine *causation*, only correlation.
|
||||
|
||||
- Human experimental studies are usually **double blind**, meaning neither the investigators nor the subjects are aware of the group assignment.
|
||||
# Finding Accurate Nutrition Info
|
||||
- Look for red flags:
|
||||
- Promises of quick and easy remedies
|
||||
- Claims that sound too good to be true
|
||||
- **Scare tactics**
|
||||
- Attacks on conventional scientists and nutrition experts
|
||||
- Testimonials and anecdotes
|
||||
- Vague, meaningless, or scientific-sounding terms.
|
||||
- Vague sources
|
||||
- **Pseudoscience**
|
||||
- **Disclaimers**
|
||||
|
||||
# Definitions
|
||||
| Term | Description |
|
||||
| -------------- | ------------------------------------------------------------------------------------------ |
|
||||
| Nutrient-dense | Nutrient-dense food supplies more vitamins and minerals in relation to the total calories. |
|
||||
| In vivo | Experiments using entire living organisms |
|
||||
| In vitro | Experiments on cells and other components. |
|
82
education/nutrition/Nutrients.md
Normal file
@ -0,0 +1,82 @@
|
||||
Nutrients are the life sustaining substances found in food.
|
||||
- Necessary for growth, maintenance, and repair.
|
||||
- Source of raw elements the body uses to carry out activities (mostly oxygen, carbon, hydrogen, nitrogen, and calcium).
|
||||
|
||||
There are 6 nutrients:
|
||||
- Vitamins
|
||||
- Minerals
|
||||
- Carbs
|
||||
- Lipids
|
||||
- Proteins
|
||||
- Water
|
||||
Water is the most essential nutrient because the body can only survive for a few days without it.
|
||||
|
||||
A macronutrient is a nutrient the body requires in large quantities, whereas a micronutrient is a nutrient the body requires in small quantities. Macronutrients supply energy, whereas micronutrients are not sources of energy.
|
||||
|
||||
| Macronutrients | Micronutrients |
|
||||
| -------------- | -------------- |
|
||||
| Carbs | Vitamins |
|
||||
| Lipids | Minerals |
|
||||
| Proteins | |
|
||||
|
||||
Nutrients are used for:
|
||||
- Growth and development
|
||||
- Energy
|
||||
- Regulation of processes
|
||||
|
||||
Nutrients will typically have more than one role in the body.
|
||||
## Essential Nutrients
|
||||
A nutrient is classified as essential if:
|
||||
- It must be supplied by food, because the body cannot create it in sufficient quantities
|
||||
- If the nutrient is missing, it results in a deficiency disease
|
||||
- When added back to the diet, the disease corrects
|
||||
- Explanation exists as to why the abnormalities occurred when the substance was missing.
|
||||
|
||||
## Phytochemicals
|
||||
Phytochemicals are substances in plants that *may* have healthful benefits. Examples of phytochemicals include:
|
||||
- Caffeine
|
||||
- Beta-carotene
|
||||
- Nicotine
|
||||
|
||||
## Calories
|
||||
In nutrition, the term Calorie typically refers to a kilocalorie, or 1000 calories, where a calorie is the amount of energy needed to heat up one gram of water one degree Celsius.
|
||||
|
||||
Kilocalories are used to measure the amount of energy that can be gained from food.
|
||||
|
||||
| Food | Energy Gained |
|
||||
| ----------------- | ------------- |
|
||||
| 1 gram of carbs | 4 kcal |
|
||||
| 1 gram of protein | 4kcal |
|
||||
| 1 gram of fat | 9kcal |
|
||||
| 1 gram of alcohol | 7kcal |
|
||||
No other nutrients provide energy.
|
||||
|
||||
## Chronic Disease
|
||||
Chronic disease takes years to develop and typically have no discrete source. Examples of chronic disease include:
|
||||
- Heart disease
|
||||
- Diabetes
|
||||
- Cancer
|
||||
## Eating Habits
|
||||
Biological and physiological factors influence eating habits. Examples of factors include (but are not limited to):
|
||||
- Age
|
||||
- Taste, smell, texture
|
||||
- Internal sensations of hunger and thirst
|
||||
- Relationships
|
||||
- Income
|
||||
|
||||
## Physiological Composition
|
||||
The proportions present in males and females varies, but between 50 and 70% by weight of the body is composed of water. Women tend to have less water and protein, with more fat.
|
||||
|
||||
# Definitions
|
||||
| Term | Definition |
|
||||
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Nutrients | The life sustaining substances found in food. Necessary for growth, maintenance, and repair. |
|
||||
| Nutrition | The study of how nutrients affect our body. |
|
||||
| Diet | A person's usual pattern of food choices. Everyone has a diet, and you don't begin and end diets, you just make changes to your existing diet. |
|
||||
| Lipid | Fats and oils. |
|
||||
| Organic | An organic substance contains *carbon*, and can be degraded. |
|
||||
| Essential nutrient | A nutrient is considered *essential* if it *must* be supplied by food, because the body cannot create it in sufficient quantities. If an essential nutrient is missing, it results in a *deficiency disease*. |
|
||||
| Deficiency disease | A deficiency disease occurs when an essential nutrient is missing. Examples include anemia (iron) and scurvy (vitamin c) |
|
||||
| Lifestyle | A routine way of living |
|
||||
| Metabolism | Metabolism is the term for all chemical processes that occur in living cells. This includes:<br>- Breaking larger molecules down into smaller molecules (supplying energy)<br>- Building larger molecules (like protiens or long-chain fats)<br>- Eliminating waste products<br> |
|
||||
| | |
|
203
education/nutrition/Proteins.md
Normal file
@ -0,0 +1,203 @@
|
||||
Proteins are large, complex, organic molecules made up of **amino acids**.
|
||||
- Contain carbon, hydrogen, oxygen, and nitrogen
|
||||
- Found in plants, animals, bacteria, and viruses
|
||||
- Major functions of protein in the body:
|
||||
- To build new cells and many parts of cells
|
||||
- As a component in hardened structures like hair and nails
|
||||
- As enzymes to speed chemical reactions
|
||||
- As lubricants to ease movement
|
||||
- In clotting compounds in blood
|
||||
- To build antibodies that fight disease organisms
|
||||
- As compounds that help maintain fluid and pH balance
|
||||
- As transporters
|
||||
- To make certain hormones
|
||||
- As an energy source (as a last resort)
|
||||
# Introduction
|
||||
- By helping to maintain fluid balance, proteins prevent **edema** (accumulation of fluid in tissues
|
||||
- Proteins also help maintain **acid-base balance**.
|
||||
- Maintaining the proper pH of body fluids
|
||||
- Acts as a buffer
|
||||
|
||||
# Amino acids
|
||||
- Amino acids are nitrogen containing chemical units that comprise proteins
|
||||
- There are 20 different amino acids found in the proteins of the human body
|
||||
- Each amino acid has a carbon atom that anchors
|
||||
- Hydrogen atom
|
||||
- Amino or nitrogen containing group
|
||||
- R group (side chain)
|
||||
- carboxylic acid group
|
||||
- nonessential amino acids are a group of amino acids that the body can make
|
||||
- Essential amino acids are amino acids the body cannot make or cannot make enough of to meet its needs
|
||||
- Conditionally essential amino acids are the amino acids the body cannot make or cannot make enough of to meet its needs
|
||||
- There are 9 essential acids and 11 non-essential acids
|
||||
|
||||
| Essential | Nonessential |
|
||||
| ---------------------------- | ------------- |
|
||||
| Histidine | Alanine |
|
||||
| Isoleucine | Aspartic acid |
|
||||
| Leucine | Asparagine |
|
||||
| Lysine | Glutanic acid |
|
||||
| Methionine | Serine |
|
||||
| Phenylanaline | Argine |
|
||||
| Threonine | Cysteine |
|
||||
| Tryptophan (extra important) | GLutamine |
|
||||
| Valine | Glycine |
|
||||
| | Proline |
|
||||
| | Tyrosine |
|
||||
TT HILL MVP
|
||||
|
||||
# Synthesis
|
||||
A specific order of amino acids is needed to formulate a protein.
|
||||
|
||||
# DNA
|
||||
- DNA (deoxyribonucleic acid) provides instructions for making proteins.
|
||||
- **Genes** are a portion of DNA
|
||||
- To make proteins, cells assemble amino acids into specific sequences according to information from DNA
|
||||
- A **peptide bond** is a chemical attraction that connects two amino acids together
|
||||
|
||||
# DNA Process
|
||||
1. Protein synthesis begins when a section of DNA unwinds, exposing a single portion (a gene). The gene contains coded info about the order of amino acids that comprise a specific protein
|
||||
2. The gene undergoes **transcription**, that is, the sequence of amino acids copied is copied in a special manner, forming **messenger RNA** (mRNA) in the process.
|
||||
3. mRNA transforms the information concerning the amino acid sequence form the nucleus to **ribosomes**, protein manufacturing sites in cytoplasm.
|
||||
4. During the **translation** process, ribosomes "read" mRNA. The coded instructions indicate which amino acid to add to the polypeptide chain and its sequence.
|
||||
5. Each specific **transfer RNA** (tRNA) molecule conveys a particular amino acid to the ribosome.
|
||||
6. At the ribosome, the amino acid that has been delivered by the tRNA attaches to the peptide chain, lengthening it.
|
||||
7. When the translation process is complete, the ribosome release the polypeptide, and the new protein generally undergoes further processing at other sites within the cytoplasm.
|
||||
|
||||
Summary:
|
||||
- Transcription: DNA unwinds, gene gets copied forming mRNA, happens in the nucleus
|
||||
- DNA -> mRNA
|
||||
- Translation: mRNA give info to ribosomes and they "read" mRNA. trNA gets each amino acid and brings it to the ribosome to be attached to the peptide chain. Happens in **cytoplasm**.
|
||||
- mRNA -> ribosomes, ribosomes read mRNA -> tRNA grabs the amino acid needed -> ribosomes create peptide chain
|
||||
|
||||
# Protein Structure
|
||||
- The shape of protein is important because it influences the compound's function
|
||||
- Sickle cell anemia is an inherited form of anemia.
|
||||
- **Denaturation** alters a protein's natural shape and function by exposing it to conditions such as heat, acids, and physical agitation. This change is permanent.
|
||||
|
||||
# In Foods
|
||||
- Animal foods generally provide higher amounts of protein than similar quantities of plant foods.
|
||||
- Certain parts of plants provide more protein than other parts
|
||||
- Seeds, tree nuts, legumes supply more
|
||||
- Fruits or edible leaves, roots, flowers, and stems of vegetables provide less
|
||||
- Legumes are parts of plants that produce pods with a single row of seeds.
|
||||
- Peas
|
||||
- Peanuts
|
||||
- Lentils
|
||||
- Soybeans
|
||||
- High quality (complete) protein is a protein that contains all essential amino acids in amounts that support the deposition of protein in tissues and the growth of a young person.
|
||||
- Meat, fish, poultry, eggs, **milk**
|
||||
- Low quality (incomplete) protein is a protein that lacks or has inadequate amounts of one or more of the essential amino acids
|
||||
- A limiting amino acid is the essential amino acid found in the lowest concentration of a particular protein source\
|
||||
|
||||
- A healthy adult's RDA for protein is **0.8 g/kg** (apparently low)
|
||||
- Protein needs increase during
|
||||
- Pregnancy
|
||||
- Breastfeeding
|
||||
- Periods of rapid growth
|
||||
- Recovery
|
||||
- Serious illness
|
||||
- Blood losses
|
||||
- Burns
|
||||
|
||||
# Digestion
|
||||
- Protein digestion begins in the stomach
|
||||
- Hydrochloric acid denatures food proteins and activates pepsin
|
||||
- Gastric enzymes that break proteins down into smaller polypeptides
|
||||
- After polypeptides enter the small intestine, the pancreas secretes protein splitting enzymes.
|
||||
- Trypsin and chymotrypsin
|
||||
- Enzymes released by absorptive cells break down shortened peptides into dipeptides and tripeptides
|
||||
- Two and three amino acids respectively
|
||||
- Amino acids are carried to absorptive cells by carrier systems
|
||||
- After absorption, amino acids enter the capillary of villus
|
||||
- Travel to liver via hepatic portal vein
|
||||
- Liver keeps some amino acids
|
||||
- Release the rest into circulation
|
||||
- Protein turnover is the cellular process of breaking down proteins and recycling their amino acids.
|
||||
- Endogenous is a source of nitrogen from within the body
|
||||
- Exogenous is a source of nitrogen from outside the body
|
||||
- Dietary protein
|
||||
- **Deamination** is the removal of nitrogen-containing group from an amino acid.
|
||||
- A carbon skeleton is the remains of an animo acid following deanimation and removal of the nitrogen containing component of the amino acid. Can be used to create glucose, energy, or fatty acids.
|
||||
- Transamination is the transfer of the nitrogen containing group from an unneeded amino acid to a carbon skeleton to form an amino acid.
|
||||
- Blood urea nitrogen (BUN) is a measure of the concentration of urea in blood.
|
||||
- Assesses kidney function
|
||||
- Normal values are from 7-20 mg/dL
|
||||
- Urine urea nitrogen (UUN) is a measure of the concentration of urea in urine
|
||||
- Can be used as a marker of protein intake
|
||||
- Normal values are from 12 to 20 g in a 24 hour sample.
|
||||
- Nitrogen balance or nitrogen equilibrium is the balancing of nitrogen intake with nitrogen losses
|
||||
- Positive nitrogen balance is the state in which the body retains more nitrogen than it loses
|
||||
- Negative nitrogen balance is the state in which the body loses more nitrogen than it retains.
|
||||
|
||||
# Meeting needs
|
||||
- Protein comprises about 15% of the typical American's total energy intake
|
||||
- **AMDR is 10-35%**
|
||||
- Complementary combinations is the mixing of certain plant foods to provide all essential amino acids without adding animal products
|
||||
- Plant foods are poor sources of one or more essential amino acids
|
||||
|
||||
# Malnutrition
|
||||
- High amounts of animal proteins and saturated fat is associated with:
|
||||
- Heart disease
|
||||
- Colorectal cancer
|
||||
- Prostate cancer
|
||||
- Consumption of red and processed meats is associated with cancers of the:
|
||||
- Pancreas
|
||||
- Stomach
|
||||
- Esophagus
|
||||
- Breast
|
||||
- **High protein diets may lead to**
|
||||
- Urinary loss of calcium
|
||||
- Osteoporosis
|
||||
- Dehydration
|
||||
- Poor kidney health
|
||||
- **Undernutrition** is the lack of food
|
||||
- Widespread in poor nations
|
||||
- **Protein-eneregy malnutrition (PEM)** occurs where the diet lacks sufficient protein and energy
|
||||
- Edema is a sign of PEM
|
||||
- **Kwashiorkor** is a form of undernutrition that results from consuming adequate energy and insufficient high quality protein
|
||||
- Symptoms in children include:
|
||||
- Stunted growth
|
||||
- Blond, sparse, brittle, hair
|
||||
- Patches of skin that have lost normal coloration
|
||||
- Swollen cheeks, arms, legs, and belly
|
||||
- **Marasmic kwashiorkor** is a form of undernutrition that results in a child with kwashiorkor who then starts to not consume enough energy; characterized by edema and wasting
|
||||
- Marasmus is a form of undernutrition that results from starvation; diet lacks energy and nutrients
|
||||
- Loss of subcutaneous fat and deeper fat stores
|
||||
|
||||
# Food allergies
|
||||
- A food allergy is an inflammatory response that results when the immune system reacts inappropriately to an allergen in a food
|
||||
- Allergen is usually a protein
|
||||
- Some protein in food does not undergo complete digestion
|
||||
- Immune cells mount a defensive response
|
||||
- Signs and symptoms of a food allergy include:
|
||||
- Hives
|
||||
- Swollen, itchy lips
|
||||
- Eczema
|
||||
- Difficulty swallowing
|
||||
- Wheezing and difficulty breathing
|
||||
- Abdominal pain
|
||||
- Vomiting
|
||||
- Diarrhea
|
||||
- Top food allergens in the US include:
|
||||
- Cow's milk
|
||||
- Crustacean shellfish
|
||||
- Eggs
|
||||
- Fish
|
||||
- Peanuts
|
||||
- Sesame
|
||||
- Soybeans
|
||||
- Tree nuts
|
||||
- Wheat
|
||||
- Food intolerances are unpleasant physical reactions following consumption of certain foods, symptoms include:
|
||||
- Skin flushing
|
||||
- Hives
|
||||
- Difficulty swallowing
|
||||
- Vomiting
|
||||
- Diarrhea
|
||||
- Dizziness
|
||||
- Headache
|
||||
- Phenylketonuria is a genetic metabolic disorder characterized by the inability to convert the amino acid phenylalanine to tyrosine, resulting in an accumulation of phenylalanine.
|
||||
- Celiac disease and gluten sensitivity
|
||||
- Celiac disease is an inherited condition in which the protein gluten cannot be absorbed, resulting in damage to the small intestine and poor absorption of nutrients.
|
||||
- Gluten is a type of protein found in many grains, provides texture and shape to baked products
|
137
education/nutrition/Review.md
Normal file
@ -0,0 +1,137 @@
|
||||
# Macronutrients
|
||||
- We need a larger amount
|
||||
- Provides Calories
|
||||
## Carbohydrates
|
||||
- Provides 4 calories per gram
|
||||
- The storage form of carbohydrates in the body is as glycogen (very branched sugar). Stored in muscles and in liver
|
||||
- Only **monosaccharides** can be directly absorbed. Everything else must be broken down first.
|
||||
### Simple
|
||||
- Mono/Disaccharides
|
||||
Monosaccharides include:
|
||||
- Glucose
|
||||
- Fructose (fruit sugar)
|
||||
- Galactose
|
||||
Disaccharides include:
|
||||
- Sucrose (glucose + fructose)
|
||||
- Maltose (glucose + glucose)
|
||||
- Lactose (glucose + galactose)
|
||||
### Complex
|
||||
- Polysaccharides
|
||||
Polysaccharides include:
|
||||
- Starches
|
||||
- Amalose
|
||||
- Amalopectin (More branched)
|
||||
- Fiber
|
||||
- Photosynthesis +Sun + carbon + hydrogen + oxygen
|
||||
|
||||
## Protein
|
||||
- Provides 4 calories per gram
|
||||
- Protein is composed of amino acids
|
||||
- There are **9 essential** amino acids
|
||||
- There are **11 non-essential** amino acids
|
||||
- Donkey bridge: If it starts with the letter A, it's a non-essential amino acid
|
||||
- Protein has nitrogen alongside hydrogen, carbon, and
|
||||
- To use protein as energy, it must be **deanimated**.
|
||||
## Lipids/Fats
|
||||
- Provides 9 calories per gram
|
||||
- Fat is composed of hydrocarbon chains
|
||||
- Tryglicerine - 3 fatty acid chains, with glycerol backbone
|
||||
### Saturated Fats
|
||||
- Saturated fats have no double bonds
|
||||
### Unsaturated Fats
|
||||
- Unsaturated fats have one or more double bond
|
||||
|
||||
### HDL (High Density Lipoprotein)
|
||||
- We want high HDL levels
|
||||
- Takes cholesterol out of the cells to the liver to be excreted
|
||||
### LDL (Low Density Lipoprotein)
|
||||
- We want low LDL levels
|
||||
- Takes cholesterol into arteries
|
||||
### oLDL (Oxidized Low Density Lipoprotein)
|
||||
- Damaged LDL
|
||||
- Deposits plaque
|
||||
# Micronutrients
|
||||
- Smaller Amounts
|
||||
- Don't provide calories
|
||||
## Vitamins
|
||||
## Minerals
|
||||
|
||||
## Water
|
||||
- Not a macro or micronutrient, but still one of the 6 major nutrition groups
|
||||
## Alcohol
|
||||
- While not in a food group, provides 7 calories per gram
|
||||
|
||||
# Digestive System
|
||||
1. Mouth
|
||||
- Digestion of carbs/starches, and fats begin here.
|
||||
- Mechanical digestion (chewing)
|
||||
- Chemical digestion (amalayses (starch) and lipases (fat) in the mouth)
|
||||
2. Esophagus
|
||||
- Peristalsis is an involuntary relaxation and contraction of muscles to move food down
|
||||
1. Gastroesophageal/Lower Esophageal/Cardiac Sphincter
|
||||
- When this sphincter misfires, it can cause heartburn or gastroesphageal reflex disease (GERD)
|
||||
2. Stomach
|
||||
- Protein
|
||||
3. Pyloric Sphincter
|
||||
4. Small Intestine (DJI)
|
||||
1. Duodenum
|
||||
2. Jejunum
|
||||
3. Ilium
|
||||
5. Ilieocecal Valve
|
||||
|
||||
# DRI (Dietary Reference Intakes)
|
||||
## EAR (Estimated Average Requirement)
|
||||
- Meet the requirements of 50% of healthy individuals
|
||||
## RDA (Recommended Daily Allowance)
|
||||
- 97.5% of healthy people
|
||||
- EAR plus a margin of safety
|
||||
## AI (Adequate Intake)
|
||||
- The average amount of nutrients a healthy population needs to consume
|
||||
## UL (Upper Limit)
|
||||
- Prevents overconsumption
|
||||
## AMDR (Acceptable Macronutrient Distribution Range)
|
||||
- Carbs: 45-65% / kCal
|
||||
- Protein: 10-35% / kCal
|
||||
- Fats: 20-35% / kCal
|
||||
## EER (Estimated Energy Requirements)
|
||||
- Average estimated caloric needs
|
||||
- Actual needs vary
|
||||
|
||||
# Hormones
|
||||
## Insulin
|
||||
Insulin is made by the beta cells in the pancreas, and promotes absorption of glucose from the blood into liver, fat, and skeletal muscles.
|
||||
- Insulin is released when blood sugar levels are too high
|
||||
## Glucagon
|
||||
Glucagon is a peptide hormone, produced by the alpha cells of the pancreas. It's the opposite of insulin, and it increases blood sugar levels.
|
||||
- Glucagon is released when blood sugar levels are too low
|
||||
## Ghrelin
|
||||
Ghrellin is known as the "hunger hormone", and it increases the drive to eat. It increases gastric motility and stimulates the secretion of gastric acid.
|
||||
## Leptin
|
||||
Leptin's primary role is to regulate long-term energy balance. High leptin levels indicate to the brain that energy reserves are high.
|
||||
|
||||
# Study Types
|
||||
## Exprimental
|
||||
- A systematic way of testing a hypothesis
|
||||
## Epidemiological
|
||||
- Observations of the occurrence, distribution, and associations
|
||||
|
||||
# Practice Final
|
||||
- To reduce blood pressure, one should follow the DASH diet
|
||||
- Bleeding gums, easy bruising, and poor wound healing that characterize scurvey are all related to vitamin C's role in synthesis of collagen.
|
||||
- Vitamin K is a fat soluble vitamin that can be made in the GI tract
|
||||
- Parathyroid hormone enhances the body's ability to retain calcium.
|
||||
- Males have a higher basal metabolic rate than females
|
||||
- On the intuitive eating spectrum, awareness, balance, moderation, and variety would exist in the middle. Apathy is on the left and anxiety is on the right
|
||||
- The term appetite describes a biological need for food
|
||||
|
||||
- The 10 principals of intuitive eating are:
|
||||
1. Reject Diet Culture
|
||||
2. Honor Your Hunger
|
||||
3. Make Peace with Food
|
||||
4. Discover the Satisfaction Factor
|
||||
5. Feel Your Fullness
|
||||
6. Challenge the Food Police
|
||||
7. Cope with Your Emotions with Kindness
|
||||
8. Respect Your Body
|
||||
9. Movement -- Feel the Difference
|
||||
10. Honor Your Health with Gentle Nutrition
|
85
education/nutrition/Vitamins.md
Normal file
@ -0,0 +1,85 @@
|
||||
Vitamins were first discovered in 1921, and are an organic nutrient
|
||||
- Casamir Runk coined the term vitamin
|
||||
- Vita = life
|
||||
- Amine = a type of nitrogen containing substance
|
||||
- The first discovered vitamin was thiamin
|
||||
- There are 13 known vitamins, plus 5 vitamin like substances
|
||||
- It is unlikely that any new vitamins will be discovered - (babies and sick people can live on synthetic liquid diet?)
|
||||
- A vitamin is a complex organic compound that regulates certain metabolic processes
|
||||
- Cannot be synthesized in sufficient quantities by the body
|
||||
- Occurs naturally in foods
|
||||
- Deficiency disorder occurs if substance is missing from the body
|
||||
- They do not provide any energy
|
||||
- Vitamins are organic, but they differ from macronutrients:
|
||||
- **Not metabolized for energy**
|
||||
- Present in small amounts in foods
|
||||
- Required in milligram and microgram amounts
|
||||
- Because vitamins are organic
|
||||
- They are subject to heat degradation
|
||||
- Exposure to excessive heat, alkaline substances, light, and air can destroy certain vitamins
|
||||
- **Water soluble vitamins can leach out of food and dissolve in cooking water**
|
||||
# Fat Soluble Vitamins
|
||||
- Fat soluble vitamins are **K, A, D, E**
|
||||
- Found in lipid portions of the body
|
||||
- Associate with lipids in the body
|
||||
- **Digested and absorbed with fats
|
||||
- Stored in the body
|
||||
- Can cause toxicity
|
||||
|
||||
| Nutrient | Function | Deficiency | Toxicity | Sources | Other Info |
|
||||
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Vitamin A (Retinol) | - Vision (Retina + Cornea)<br>- Growth and Reproduction<br>- Immune Function<br>- Epithelial (Skin)<br>- Cells<br>- Bone<br>- Remodeling | - Night Blindness (Nycatlopia)<br>- Xerophthalmia<br>- Dry Eyes -> Blindness<br>- Poor Growth<br>- Dry Skin or Tissue<br>- ^ Causes increased risk of infection | - Carotenemia (Orange colored skin)<br>- Birth defects<br>- Bone fractures<br>- Liver damage<br>- Nausea / Vomiting | - Vegetables: Yellow, orange, or dark green (pumpkin, squash, carrots, spinach)<br>- Milk and Dairy Products | - Retinol's precursor is beta-carotene (antioxidant)<br>- Helps with wound healing |
|
||||
| Vitamin D (Calciferol) | - Calcium Absorption<br>- Bone Strength<br>- Blood Calcium Levels<br>- Supports Immune Function<br>- Reduces Inflammation | - Rickets (children)<br>- Osteomalacia (Adults)<br>- Osteoporosis (Elderly)<br>- Decreased immune function<br>- Decreased growth | - Hypercalcemia (Calcium deposits in soft tissue, Weakness, Nausea/Vomiting)<br>- Kidney Stones | - Milk and Dairy Products<br>- Fish (Salmon, Tuna)<br>- Breakfast Cereals<br>- Sunlight or UV Light | - Often referred to as the sunshine vitamin<br>- Acts as a hormone (interacts with para-thyroid hormone and calcitonin) |
|
||||
| Vitamin E (Tocopherol) | - Antioxidant<br>- Wound healing<br>- Cell Membranes<br>- Supports immune function | - Hemolysis of red blood cells<br>- Anemia<br>- Reduced muscular coordination | Supplements can interfere with vitamin K metabolism and cause uncontrolled bleeding | - Vegetable oils<br>- Nuts or Seeds<br>- Wheat germ<br>- Green leafy veggies<br>- Breakfast Cereals | - Doesn't increase sexual performance, prevent aging, or cure Parkinson's disease (despite claims) |
|
||||
| Vitamin K (Phylloquinone) | - Blood clotting<br>- Bone health | - Hemorrhaging or Hemorrhagic Disease (Excessive bleeding or internal bleeding)<br>- Increased risk of hip failure | Not common | - Green leafy veggies (spinach, kale, et cetera)<br>- Beans and soybeans<br>- Vegetable Oils<br>- Healthy GI tract | - 50% of needed amount can be synthesized in the GI tract<br>- Babies are given a shot at birth<br>- Interacts with blood clotting meds (coumadin or warfarin) |
|
||||
|
||||
Dairy products are typically fortified with vitamins A and D.
|
||||
# Water soluble vitamins
|
||||
- Water soluble vitamins are the **B-vitamins**: thiamin, riboflavin, niacin, vitamin B-6, pantothenic acid, folate, biotin, vitamin B-12, and **vitamin C**.
|
||||
- They dissolve in water
|
||||
- **Very limited amounts are stored** with the exception of B-12
|
||||
- **Kidneys will filter out excess water soluble vitamins**
|
||||
- Less likely to be toxic
|
||||
|
||||
# Oxidization
|
||||
- An *oxidizing agent* is a substance that removes electrons from atoms or molecules
|
||||
- A *free radical* is a substance (C, H, O) with an unpaired electron
|
||||
- Highly reactive, damages and destroys molecules
|
||||
- **Antioxidants (Vitamin E, C)** are substances that **give up electrons to free radicals to protect cells**
|
||||
|
||||
# Vitamin Intake
|
||||
**Bioavailability** is the amount of a vitamin available for use in the body
|
||||
- Factors that affect how available a vitamin is include:
|
||||
- How long it takes the vitamin to pass through the intestinal tract
|
||||
- Certain health conditions that affect the absorption of facts
|
||||
- By cooking with a little bit of fat, you better absorb fat soluble vitamins from that meal.
|
||||
- Natural sources of vitamins typically provide higher availability
|
||||
It's important to preserve the vitamin content of food, ways to do so include:
|
||||
- Avoid decaying, wilting, or bruised fruits or vegetables
|
||||
- Fresh produce should refrigerated at high humidity, away from the open air
|
||||
- Exposure to excessive heat, alkaline (salty) substances, light, and air can all reduce the vitamin content of food
|
||||
- **Vegetables should be cooked in small amounts of water, using quick cook methods**
|
||||
|
||||
# Water Soluble Vitamins
|
||||
Water soluble vitamins dissolve in watery components of food and the body. Most excess water soluble vitamins are filtered through the kidneys and eliminated in urine, whereas fat soluble vitamins are stored in large amounts.
|
||||
|
||||
| Vitamin | Major Functions in the body | Adult RDA/AI | Good Sources | Deficiency Signs and Symptoms | Major Toxicity Signs and Symptoms |
|
||||
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
||||
| Thiamin | Part of TPP, a coenzyme needed for carbohydrate metabolism and the metabolism of certain amino acids. May help with the production of neurotransmitters | 1.1-1.2 mg | Pork, wheat germ, enriched breads and cereals, legumes, nuts | Beriberi and Wenicke-Korsakoff syndrome; weakness, abnormal nervous system functioning. | None (UL not determined. |
|
||||
| Riboflavin | Part of FMN and FAD, coenzymes needed for carbohydrate, amino acid, and lipid metabolism. | 1.1-1.3mg | Cow's milk, yogurt, and other dairy products; spinach; enriched breads and cereals | Inflammation of the mouth and tongue, eye disorders | None (UL not determined) |
|
||||
| Niacin | Part of NAD and NADP, coenzymes needed for energy metabolism. | 14-16mg | Enriched breads and cereals, beef liver, tuna, salmon, poultry, pork, mushrooms | Pellegra<br>- Diarrhea<br>- Dermatitis<br>- Dementia<br>- Death | Adult UL = 35mg/day<br>Flushing of facial skin, itchy skin, nausea and vomiting, liver damage |
|
||||
| Pantothenic acid | Part of coenzyme A that is needed for synthesizing fat and that helps release energy from carbohydrates, fats, and protein | 5mg | Beef and chicken liver, sunflower seeds, mushrooms, yogurt, fortified cereals | Rarely occurs because it's so common in foods. | Unknown |
|
||||
| Biotin | Coenzyme needed for synthesizing glucose and fatty acids | 30 micrograms | Eggs, peanuts, salmon, pork, liver, mushrooms, sunflower seeds | Rarely occurs, skin rash, hair loss, convulsions, and other neurological disorders; developmental delays in infants | Unknown |
|
||||
| Vitamin B-6 | Part of PLP, coenzyme needed for animo acid metabolism, involved in neurotransmitter synthesis and hemoglobin synthesis | 1.3-1.7mg | Meat, fish, poultry, potatoes, bananas, spinach, sweet red peppers, broccoli | Dermatitis, anemia, depression, confusion, and neurological disorders such as convulsions | Adult UL = 100 mg per day<br><br>Nerve destruction |
|
||||
| Folate | Part of THFA, a coenzyme needed for DNA synthesis and conversion of cysteine to methionine, preventing homocysteine accumulation | 400 micrograms | Dark green, leafy vegetables; papayas; asparagus; broccoli; orange juice; enriched breads and cereals | Megaloblastic anemia, diarrhea, neural tube defects in embryos | Adult UL = 1000 micrograms per day |
|
||||
| Vitamin B-12 | Part of coenzymes needed for various cellular processes, including folate and metabolism; maintenance of myelin sheaths | 2.4 micrograms | Peppers, citrus fruits, cherries, broccoli, cabbage, and berries, shellfish, poultry, meat, milk, and eggs | Scurvy, poor wound healing, pinpoint hemorrhages, bleeding gums, bruises, depression | Adult UL = 2000 mg/day Diarrhea and GI tract discomfort |
|
||||
| Vitamin C (ascorbic acid) | Lots of things, collagen synthesis, antioxidant activity, and immune function. It can act as an antioxidant, and it can recycle vitamin E. | | Plant foods, peppers, citrus fruits | Scurvy | In high doses it has pro-oxidant effects |
|
||||
- Coenzymes are a water soluble vitamin that assists in the metabolism of macronutrients.
|
||||
- As people age, HCl production decreases, making it harder for the body to process vitamin b12
|
||||
- Vitamin b12 comes mostly from animals, so vegans need to supplement their intake
|
||||
- Choline, carnitine, inositol, taurine, and lipoic acid are vitamin-like compounds that necessary to maintain normal metabolism. Because the body can synthesize these compounds, they are not considered essential nutrients.
|
||||
- Biotin and vitamin K can be produced by intestinal bacteria
|
||||
- The 4 "D"s are signs of pellegra
|
||||
- Adequate folate status is critical in early pregnancy because the neural tube forms about 21 days after conception
|
||||
- Pregnant individuals should consume 400 ug of folate to prevent neural tube defects (eg spina bifida or anancephaly). It should reduce the rate of spinal defects by 50%
|
||||
- High doses of niacin can be taken to reduce LDL. This can cause facial flushing and liver damage
|
39
education/nutrition/Water.md
Normal file
@ -0,0 +1,39 @@
|
||||
- The body is composed of 50 to 75% water
|
||||
- Lean muscle contains more water (73$
|
||||
- Fat tissue contains less water (20%)
|
||||
- For a healthy person, water intake equals water outtake
|
||||
- For every pound of water weight lost, you should intake two cups of fluid.
|
||||
|
||||
# Functions
|
||||
- Is a solvent
|
||||
- Is a major component of blood, saliva, sweat, tears, mucus, and joint fluid
|
||||
- Removes waste
|
||||
- Helps transport substances
|
||||
- Lubricates tissues
|
||||
- Regulates body temperature
|
||||
- Helps digest foods
|
||||
- Participates in many chemical reactions
|
||||
- Helps maintain proper blood pH
|
||||
- **Doesn't play a major role in immune system function**
|
||||
|
||||
# Compartments
|
||||
- The body has two major fluid compartments:
|
||||
- **Intracellular water** is inside the cells - Managed by potassium and phosphorus
|
||||
- **Extracellular water** surrounds cells or is in the blood - managed by sodium and chloride
|
||||
- Water **follows** sodium
|
||||
|
||||
# Dehydration
|
||||
- Common signs of dehydration:
|
||||
- Rapid weight loss
|
||||
- Dry or sticky mouth
|
||||
- Low or no urine output
|
||||
- Dark urine
|
||||
- No tears
|
||||
- Sunken eyes
|
||||
- If not corrected, dehydration can lead to death
|
||||
# Water intoxication
|
||||
Water intoxication is a condition that occurs when too much water is consumed in a short period of time or kidneys can't filter water from blood
|
||||
- Excess water dilutes sodium concentration of blood
|
||||
- Results in **hyponatremia**
|
||||
- Low blood sodium
|
||||
- Symptoms: confusion, dizziness, headache, can lead to death
|
@ -1,25 +0,0 @@
|
||||
# Campaign Points
|
||||
https://www.donaldjtrump.com/issues
|
||||
## Economic
|
||||
### Data
|
||||
Trump's published economic policy points include reducing taxes for the middle class, increasing the child tax credit, and attempting to increase job opportunities by "slashing job-killing regulations". His campaign website argues that he increased "real wages" and household income, while poverty went down during his time in office. He promises to lower taxes, increase paychecks, and increase job opportunities.
|
||||
### Analysis
|
||||
## Budgetary
|
||||
## Social
|
||||
|
||||
## Foreign Policy
|
||||
Trump's campaign website argues that we cannot have free and open trade when some other countries are exploitative of it. He primarily focuses on changes he made during his time in office, including stopping the Trans-Pacific Partnership, replacing NAFTA with USMCA, and talks about fixing "unfair" foreign trade policies, and implementing tariffs. For his 2024 campaign, he promises to reduce reliance on China, specifically in the medical, security, and infrastructure industries.
|
||||
|
||||
Trump's campaign website also argues that he will secure the \[southern] border.
|
||||
|
||||
## Gun Control
|
||||
|
||||
## Energy/Environmental
|
||||
Trump's campaign website argues that during his time in office, the United States became the number one producer of oil and natural gas by approving the Keystone and Dakota Access pipelines, opening federal lands and offshore areas for production, and ending the Paris Climate Accord. For his future policies, he argues that he can bring energy independence, lower the prices of various energy sources, and eliminate the Green New Deal.
|
||||
|
||||
# Personal
|
||||
|
||||
# Arguments against Biden
|
||||
- Campaign website argues that Biden decreases job opportunities and increases inflation with government spending.
|
||||
- Campaign website argues that Biden ended the "Trump Energy Revolution" and is helping foreign adversaries.
|
||||
- Campaign website argues that Biden "turned our country into a giant sanctuary for dangerous alien criminals"
|
@ -1,8 +0,0 @@
|
||||
https://www.uscourts.gov/educational-resources/educational-activities/facts-and-case-summary-hazelwood-v-kuhlmeier
|
||||
https://www.oyez.org/cases/1987/86-836
|
||||
- The case was over the constitutional right to freedom of the press, and whether or not the school had a right to censor a school paper.
|
||||
- Students at hazelwood east high school wrote articles in the school newspaper about teen pregnancy, and the impact of divorce.
|
||||
- When the articles were published in a school sponsored newspaper, the principal deleted the pages that contained the stories prior to publication without telling the students.
|
||||
- The students took their case to a District Court in St. Louis, and the trial court ruled that the school had the authority to remove those articles.
|
||||
- The students then appealed the Court of Appeals for the Eighth Circuit, and it reversed the lower court, and found that the paper was a "public forum", and that school officials could only censor content under extreme circumstances.
|
||||
- In a 5-3 ruling, the Supreme Court held that the principal's actions did not volate the students' free speech. The Court noted that the paper was sponsored by the school, and that it had legitimate interest in preventing the publication of articles it deemed inappropriate. They ruled that the school paper was not a public forum, it was a limited forum that served as a learning exercise for journalism students.
|
@ -1,34 +0,0 @@
|
||||
Notes on Think Again, by Adam Grant.
|
||||
## Chapter 3
|
||||
### Main idea
|
||||
- People build more developed belief systems and improve if they are willing to challenge their beliefs.
|
||||
- It's unhealthy to hold beliefs and defend them so aggressively
|
||||
- Being wrong and recognizing that is healthy
|
||||
- Recognize when a reaction is emotional, and a defense of the ego, rather than intellectual, and a defense of the idea.
|
||||
- Do not base a personality around ideas, base it around broad, positive values. The material changes, but values can be applied to the material in infinite ways.
|
||||
### Personal reflection
|
||||
> Think about yourself personally, which group would you be more likely to identify with: the group who hated being challenged, or the group who thought that the abusive challenges were fun? Explain your POV.
|
||||
|
||||
I believe I do not fit into either group, and would react differently in many different ways, depending on the context at hand. For a long time, I would defend my beliefs aggressively, and was confident that my perspective was more correct. I made no attempt at attempting to understand the motivations behind the opposing viewpoint, and spent most of my time taking an axe to nuance, working to prove the opposing viewpoint wrong, rather than trying to understand it, and look for the flaws in my own viewpoint. I believe I am getting better at understanding opposing viewpoints, but would still find the experience unpleasant, and react poorly.
|
||||
|
||||
### Relation to poli sci
|
||||
The political system in the United States is composed primarily of a two party system. If a candidate wishes to have any chance of being elected, they must appeal to one of the two parties. If a candidate doesn't align closely enough to the beliefs of the party, then they have a significantly worse chance of winning. Anyone who attempts to question ideas, may be considered a 'fake' republican | democrat. Each party conforms to a stringent beliefs system, and many of the viewpoints are held, simply because they're the opposite of the other party. This whole system discourages reflection and improvement, holding on to ideas that stagnate and grow convoluted, holding bitterly onto one 'correct' viewpoint.
|
||||
|
||||
### Quotes
|
||||
"Values are your core principles in life - they might be excellence and generosity, freedom and fairness, or security and integrity. Basing your identity on these kinds of principles enables you to remain open minded about the best ways to advance them" (Grant 64).
|
||||
|
||||
"When they define themselves by values rather than opinions, they buy themselves the flexibility to update their practices in light of new evidence" (Grant 64).
|
||||
|
||||
"When I asked him about how he stays in that mode, he said he refuses to let his ideas become part of his identity" (Grant 62).
|
||||
|
||||
"Attachment. That's what keeps us from recognizing when our opinions are off the mark and rethinking them. To unlock the joy of being wrong, we need to detach" (Grant 62).
|
||||
|
||||
"When a core belief is questioned, though, we tend to shut down rather than open up" (Grant 59).
|
||||
|
||||
"If you want to be a better forecaster today, it helps to let go of your commitment to the opinions you held yesterday" (Grant 69).
|
||||
|
||||
### Reaction
|
||||
I belief Grant phrased a key issue really elegantly, and believe that more people should try to apply his advice in their life
|
||||
|
||||
### Was this info new?
|
||||
The idea isn't new to me.
|