This action might not be possible to undo. Are you sure you want to continue?

My Bio My Project Methodology My Wildlife Photography By Ian Beardsley (March 2013 –February 2014)

2 CS50X Journal Of Ian Beardsley 2014 (Online Version)

3 Variables (float …%f, %d) (int ……%i,%d) (char……%s, %c)

4

5

6

Learning Computer Science at Harvard By Ian Beardsley Copyright © 2014 by Ian Beardsley

7

I decided to take the online introduction to computer science at Harvard, called CS50x because I was interested in Artificial Intelligence (AI). The idea that we could understand our mind and how thought could have originated through creating artificial intelligence with electronics and computer programming I find fascinating. To get started in computer science, you need a compiler. When you take the free online classes at Harvard, they provide you with a compiler. It puts your source code (programming instructions) into zeros and ones, the language that computers understand. Under the hood a computer is a series of switches that are either on or off. Off is zero and on is one. With zeros and ones you can create any number: 0=0 1 =1 10 = 2 11 = 3 100 = 4 101 = 5 110 = 6 111 =7 And so on,… With numbers in binary you can represent any character on your keyboard, numbers or letters. The numbers assigned to characters, from which your source code is built, are defined in the ASCII tables, the standardized tables of the language of computer scientists. In the introduction to computer science at Harvard you start out by learning the language called C. It begins with learning how to use the printf() and scanf(), although their compiler has a library that understands a function they substitute for scanf() that makes things easier in the beginning. They are called the GetInt(), GetFloat() or GetString() functions. However a standard C compiler that you buy won’t have these functions and I don’t think programs you write with them will run on most computers. That is why I have learned the scanf() and written some programs with it (provided here) to get a grasp of how it works. So I don’t use any functions that are in the CS50 library in those programs. I use the standard io library that all C compilers have and I am sure will run on any computer. I imagine we will learn the scanf() function as the class proceeds. I am about three weeks into it.

8

Actually the first thing you learn is not print(f) and scan(f) but that at the top of every program you first define the library you are going to use and put the main() function, which tells the computer where your program begins: #include <stdio.h> int main (void) Ian Beardsley January 24, 2014

9

Actually, Problem Set 0, the first problem set in the course, was a lot of fun.

10

**Print - Close Window - Click More at the bottom of the email to print single messa
**

Subje ct: From: To: Date: CS50x / 2014 / Problem Set 0 CS50 Bot (no-reply@wufoo.com) beardsleyian@yahoo.com; Saturday, January 4, 2014 1:34 PM

You have submitted Problem Set 0! Have any questions about CS50, computer science, Harvard, or anything else that you'd like David and CS50's team to answer on camera? Head to http://cs50.net/show to submit them! love, CS50 Bot

**CS50x / 2014 / Problem Set 0
**

EMAIL FULLNAME IDENTITY BEFORE you start filling out this form, be sure that you've already uploaded your Scratch project to MIT's website (by clicking Share > Share this project online... in Scratch itself), per the problem set's specification, as you'll be asked on this form for the URL of your project on MIT's website. * About You If you decided to record a 1- to 2-minute video of yourself saying hello to classmates, per the problem set's specification, be sure that you've already uploaded it somewhere on the Internet, as you'll be asked on this form for its URL as well. No worries if you decided not to record one! * First Name (i.e., Given Name) * Last Name (i.e., Family Name) * Email Address * How do you represent the (decimal) integer 50 in binary? *

beardsleyian@yahoo.co Ian Beardsley https:/openid.edx.org/op Yes, I have uploaded m

I decided not to record a

Ian Beardsley beardsleyian@yahoo.co 110010

11 How many bits must be "flipped" (i.e., changed from 0 to 1 or from 1 to 0) in order to capitalize a lowercase 'a' that’s represented in ASCII? * How do you represent the (decimal) integer 50 in, oh, "hexadecimal," otherwise known as base-16? Recall that decimal is simply base-10, and binary is simply base-2. Infer from those base systems how to represent this one! * Year of Birth (just for reseach purposes) Gender * Highest educational degree that you have? In what COUNTRY do you live? In what STATE or PROVINCE do you live? In what CITY do you live? (So that we can plot everyone on a map!) What's your primary spoken language? What operating system(s) do you run on your computer(s)? How do you plan to watch CS50's videos? Why did you decide to take CS50x? * How did you hear about CS50x? Why are you taking CS50x? one 32

Which category do you feel you fall into? In other words, what's your level of comfort with computers, the Internet, the mere idea of taking CS50x, etc.? * To what extent do you intend to engage with CS50x? * How important is the honor code certificate that you can receive from HarvardX upon successful completion of CS50x? * How much programming experience would you say you already have? * If a little or a lot, please elaborate on your background! How many Computer Science courses have you already taken, if any? * If you have prior coding experience, in what language(s)? Roughly how many hours did you spend in total on Problem Set 0? (Please do be honest. This question is purely for statistical purposes; it has no effect on scores.) * What's your username on MIT's website (i.e., on scratch.mit.edu)? * What is the URL of your Scratch project on MIT's website? (The one that you uploaded by clicking Share > Share This Project Online... within Scratch.) To find this URL, go to http://scratch.mit.edu/login and log in if not already logged in. Then click "my stuff" toward the page's top-right corner. Then click your project's name/icon. Your project should then appear within the page (and start playing). Copy the URL that's in your browser's address bar and paste it below! *

1965 Male High School United States California Claremont English • Mac OS 10.6 (Snow L • On a LAPTOP compu Wanted to increase my • News • To learn how to progr • To learn about compu • As a precursor to ano I'm somewhere in betwe

• I plan to do ALL of th A certificate would be n

a little I learned a little BASIC 0 • BASIC 4

eanbardsley http://scratch.mit.edu/pr

12 click your project's name/icon. Your project should then appear within the page (and start playing). Copy the URL that's in your browser's address bar and paste it below! * In a short paragraph, tell us what your Scratch project does and/or how to use it (especially if it requires keyboard or mouse input). * In one or more paragraphs, explain how your Scratch project works, noting the purpose of some interesting sprite(s) and script(s). *

In one or more paragraphs, point out any known bugs (i.e., mistakes or quirks) in your Scratch project and explain why they're still there (i.e., why you didn't or couldn't fix them). Would you mind if we displayed your name, city, and a link to your Scratch project (along with your description and video, if any) in a gallery on the course's website (possibly on a world map), so that everyone can see where in the world everyone is from? (We WON'T display your email address or anything personal like that.) * Almost done! Time for some problem solving first, though! As always, do keep in mind the course's policy on academic honesty.

If you click the green fla pressing the space key. can make the cat meow It starts with the goul be rotates 90 degrees, so he down arrow key is press ballerina moves across a is diagonal. As far as I can tell there

Sure, please do include

c) 4

1. Grace thought of a number, added 7, multiplied by 3, took away 5 and divided by 4 to give an answer of 7. What was the starting number? c) 3 2. Alan thinks of a number. He squares it, then takes away 5, next multiplies it by 4, takes away 7, divides it by 3 and finally adds 6. His answer is 9. What number did he start with? c) 150 degrees 3. If the hour hand of a clock is turned anticlockwise from 2 pm to 9 am, through how many degrees will it have turned? b) 63 percent 4. What percentage of this shape is blue (to nearest percent)?

a) 21

13 5. In a counting system used by intelligent apes, A banana = 1; 6 is represented by an orange and 2 bananas; An orange is worth half a mango. What is the value of two mangos, an orange and a banana? b) 7 6. You start in square E6 facing East. Move 3 squares forward. Turn 90 degrees clockwise, move two squares forward. Turn 180 degrees anticlockwise. Move 5 squares forward. Turn 90 degrees anticlockwise. Move 4 squares forward. Turn 90 degrees clockwise. Move two squares backward.

What is the Y COORDINATE of the square you are now in? b) 26 7. Using the table below, what is A4 multiplied by D3 divided by C2?

b) 2 3 4 8. Let i be an integer between 1 and 9, inclusive. The expression (i>=1) and (i<=5) is true when i has values: a) acbcbcbcbcbcbcbcd 9. Select in the missing letter sequence: acbcd , acbcbcbcd , acbcbcbcbcbcd , __________________________ d) ebccd 10. Select in the missing letter sequence: __________________ , ebcccdd , ebbccccdd , ebbbcccccdd , ... b) 6 11. Your job is to decide which of a set of given numbers is the smallest. How many comparisons (of 2 numbers at a time) do you have to make if you have 8 numbers?

14 d) I and III only 12. At a certain school students receive letter grades based on the following scale.

Which of the following code segments will assign the correct grade for a given integer score? Segment I. if (score >= 92) grade = "A"; if (score >= 84 AND score <= 91) grade = "B"; if (score >= 75 AND score <= 83) grade = "C"; if (score < 75) grade = "F"; Segment II. if (score > 92) grade = "A"; if (score > 84 AND score < 91) grade = "B"; if (score > 75 AND score < 83) grade = "C"; if (score < 75) grade = "F"; Segment III. if (score >= 92) grade = "A"; else if (score >= 84) grade = "B"; else if (score >= 75) grade = "C"; else grade = "F";

15

My solution to problem 5 in Problem Set 0 A banana =1 6 is an orange and two bananas An orange is worth half a mango What is two mangos, an orange, and a banana? Solution: If two mangos is four oranges, we have: 4 oranges + 1 orange + 1 banana = 5 orange + 1 banana 6 = 1 orange + 2 bananas (from above) 4 bananas = 1 orange (4)(5) + 1 = 20 +1 = 21 21 is the answer.

16 The basic formula for your first program is: Declare a variable Prompt the user with a printf() function Get the user’s value for that variable and give it to the computer with a scanf() function Tell the computer what do with that value Then output the result to the user with a printf() function

17

learning scanf #include <stdio.h> int main(void) { int age; printf("What is your age? "); scanf("%d", &age); printf("You said your age was: %d\n", age); return 0; } running learning scanf jharvard@appliance (~): cd Dropbox/pset1 jharvard@appliance (~/Dropbox/pset1): ./age What is your age? 48 You said your age was: 48 jharvard@appliance (~/Dropbox/pset1):

18 The basic formula for your second program is (booleans): Prompt the user Get the user’s value for the variable Test it by asking if one thing about it is true. If true, then do something. If not, then do something else.

19

Learning Booleans #include <stdio.h> int main (void) { char name [15]; printf("What is your first name?: "); scanf("%s", name); printf("you said your name is: %s\n", name); int n; printf("Is this correct yes=1 no=0? "); scanf("%d", &n); if (n==1) { printf("thank you\n"); } else { printf("leave the room\n"); } } Running Learning Booleans jharvard@appliance (~): cd Dropbox/pset1 jharvard@appliance (~/Dropbox/pset1): make name clang -ggdb3 -O0 -std=c99 -Wall -Werror ! !name.c !-lcs50 -lm -o name jharvard@appliance (~/Dropbox/pset1): ./name What is your first name?: Ian you said your name is: Ian Is this correct yes=1 no=0? 1 thank you jharvard@appliance (~/Dropbox/pset1): ./name What is your first name?: Ian you said your name is: Ian Is this correct yes=1 no=0? 0 leave the room jharvard@appliance (~/Dropbox/pset1):

20 The basic formula for your third program is (loops): Repeat a command until something is true, even iterate it according to a pattern that fits your objective.

21

Learning Looping #include <stdio.h> int main (void) { int n; do { printf("give me a positive number: "); scanf("%d", &n); } while (n<0); for (int i=1; i<n+1; i++) { printf("%d\n", i); } printf("you promted the user for a number and counted to it with a for loop!\n"); } Running Learning Looping jharvard@appliance (~): cd Dropbox/pset1 jharvard@appliance (~/Dropbox/pset1): ./looping give me a positive number: -1 give me a positive number: 5 1 2 3 4 5 you promted the user for a number and counted to it with a for loop! jharvard@appliance (~/Dropbox/pset1):

22 One of my first assignments at harvardx was to write a program that uses what is called a Greedy algorithm. The idea is to have the user tell you how much money they are owed, then give them change in quarters, dimes, nickels, and pennies, such that you use the least number of coins. My program not only tells how many coins to give the user, but how many of each kind. Greedy algorithms are any programs that calculate how to achieve the most with the least for any given scenario.

23

Greedy 07: It is actually this one that works! #include <cs50.h> #include <stdio.h> int main (void) { ! ! printf("amount owed: "); ! ! float amount= GetFloat(); ! ! float cents= 100.0*amount; ! ! float quarter= 0; ! ! float dime= 0; ! ! float nickel= 0; ! ! float penni= 0; !! ! ! while (cents>0) !! ! ! if (cents>=25.0) !!{ ! ! cents=cents-25.0; ! ! quarter=quarter+1; !!} ! ! else if (cents>=10.0) !!{ ! ! cents=cents-10.0; ! ! dime=dime+1; !!} ! ! else if (cents>=5.0) !!{ ! ! cents=cents-5.0; ! ! nickel=nickel+1; !!} ! ! else if (cents>=1.0) !!{ ! ! cents=cents-1.0; ! ! penni=penni+1; !!} ! ! ! ! printf("%f %f %f %f %f\n",quarter,dime,nickel,penni,quarter+dime+nickel+penni); !!!!}

24

jharvard@appliance (~/Dropbox/pset1): ./greedy amount owed: 1.73 6.000000 2.000000 0.000000 3.000000 11.000000 jharvard@appliance (~/Dropbox/pset1): That says if you owe someone a dollar seventy three, give them six quarters, two dimes, zero nickels, and three pennies, eleven coins in total.

25

Arrays This is where Computer Science really starts to become interesting, because you start to have some practical applications. With arrays you don’t just ask the user to give you a value for a variable, but ask them for a number or of variables, or declare an array in other words. In the next program we ask the user how many numbers to they want to sum and find the average of. They input the amount of numbers they want summed and averaged, then the program asks them for each number and does as such. The program is called “Cosmos Done!”

26

Cosmos Done! By Ian Beardsley January 29, 2014

27

#include <stdio.h> #include <stdlib.h> #include <cs50.h> int main(void) { char first[15], last[15], sign[15]; int sex; printf("last name: "); scanf("%s", last); printf("first name: "); scanf("%s", first); printf("You said: %s, %s\n", last, first); printf("male (0) or female (1)? "); scanf("%d", &sex); printf("astrological sign: "); scanf("%s", sign); printf("Your sign is: %s\n", sign); if (sex==0) { printf("User is male\n"); } else { printf("User is female\n"); } int n; do { printf("Give me an integer greater than zero and less than 16: "); scanf("%d", &n); } while (n<1 || n>15); printf("You chose the integer %d\n:", n);

28

int i; printf("I am thinking of a number that is 9/5, 5/3 or 15.\n"); printf("Which one am I thinking of (1, 2, or 3)? "); scanf("%d", &i); if (i==1) { printf("You chose the yin of the universe.\n"); } else if (i==2) { printf("You chose the yang of the universe.\n"); } else if (i==3) { printf("You chose the number of rubber hoses\n"); printf("in a cave in Granada, Spain.\n"); } int number; printf("Does the ratio of 9 to 5 make you\n"); printf("think more of (1) the sun and moon, or\n"); printf("(2) gold and silver? "); scanf("%d", &number); if (number==1) { printf("The sun is gold, the moon silver.\n"); } else { printf("You chose precious metals.\n"); }

29

int nombre; printf("You can most describe your mood by\n"); printf("the name Antonio, Manolin, or Manuel\n"); printf("(1, 2, or 3?) "); scanf("%d", &nombre); if (nombre ==1) { printf("You chose Antonio, thank you.\n"); } else if (nombre==2) { printf("You chose Manolin, thank you.\n"); } else { printf("You chose Manuel, thank you.\n"); } int k; do { printf("Give me a positive integer\n"); printf("that doesn't exceed 16: "); scanf("%d", &k); } while (k<1 || k>16); printf("You chose: %d\n", k); printf("Choose %d integers:\n", k); int j; float num[100], sum =0.0, average; for (j=0; j<k;j++) { printf("%d enter number: ",j+1); scanf("%f", &num[k]); sum+=num[k]; average=sum/k; } printf("sum of your numbers: %.2f\n", sum); printf("average of your numbers: %.2f\n", average); }

30

Running The Finished Cosmos jharvard@appliance (~): cd Dropbox/pset1 jharvard@appliance (~/Dropbox/pset1): ./cosmos last name: Beardsley first name: Ian You said: Beardsley, Ian male (0) or female (1)? 0 astrological sign: Taurus Your sign is: Taurus User is male Give me an integer greater than zero and less than 16: 4 You chose the integer 4 :I am thinking of a number that is 9/5, 5/3 or 15. Which one am I thinking of (1, 2, or 3)? 3 You chose the number of rubber hoses in a cave in Granada, Spain. Does the ratio of 9 to 5 make you think more of (1) the sun and moon, or (2) gold and silver? 2 You chose precious metals. You can most describe your mood by the name Antonio, Manolin, or Manuel (1, 2, or 3?) 2 You chose Manolin, thank you. Give me a positive integer that doesn't exceed 16: 2 You chose: 2 Choose 2 integers: 1 enter number: 9 2 enter number: 5 sum of your numbers: 14.00 average of your numbers: 7.00 jharvard@appliance (~/Dropbox/pset1):

31

Me (Eager To Learn Computer Science)

32 Notes 02 For CS50x By Ian Beardsley Copyright © January 25, 2014

33 Casting You would thin you could just divide one number by another with the printf() statement, but you can’t. If I write: (float f)=1/10; (printf)(“%f/n”, f); The problem that arises is the answer is 0.1 and from the 1/10 for float f the computer thinks I am talking about integers. C has a way of handling this: you put a 0.1 before the f in %f and that tells the computer to print the answer out to one place after the decimal. If I put 0.2 it will print the answer to two places after the decimal. Also you must write for one tenth 1.0/10.0 if you put 0.1 before the f in %f or 1.00/10.00 if you put 0.2 before the f in %f. So you write: (floatf) =1.0/10.0; (printf)(“%.1f, f); And the computer will print to one place after the decimal. It is important to not that when the computer prints a value to so many places after the decimal, it does not round. That is, it just throws everything away after the number of digits specified. There is another way of solving this problem, and it is called casting. The same problem can be solved by writing: (float f = (float) 1/(float) 10) (printf (“%.1f\n”, f)); And the output is 0.1

34 Printing One Character At A Time #include <cs50.h> #include <stdio.h> #include <string.h> (int main((void)) (printf (“please give me a string; “)); (string s = GetString()); (for (int i = 0; i<strlen(s);i++)) { (printf (“%c\n”, s[i])); } By putting s in brackets, the string is accessed one character at a time. That is you can get the ith byte of memory using brackets [ ]. I would like to note that a character is a char and this char can represent any character on your key board, including numbers and that a character is stores in RAM (random access memory) and is represented with one byte, which is eight bits. In general, you can access any adjacent bit with: (a[i]) = [1], [2], [3],…

35 Making Your Own Function Up until now we have use int main (void) Here we declare a function at the top of the program called PrintName. We use the new function, and, at the bottom of the program define the function. #include <cs50.h> #include <stdio.h> (void PrintName (string name); (int main(void)); { (printf(“your name?: “)); (string s = GetString()); PrintName(s); } (void PrintName (string name)) { (printf(“hello, %s\n”, name); }

36 Command Line Arguments Until now we have written int main(void), that is, put void in the parentheses after main, in the place of an argument for the (main() function). Let us enter some argument in that function and explain what they do. By convention we will call them argc and argv. But you can call them anything you want to. We will write: (int main (int argc, string argv[ ])) { (printf(“%s\n”, argv[1]); } This will print a word that the user enters before running the program. That is if we call the program word, and run the program with./word but now type ./word hello, the program (after hitting return or enter will run, but in this case print the word hello that was typed before running it. At the top, the int specifies an int called argc, the argc has the number of words the user typed at the prompt, and the argv specifies an array called argv. It stores all of the words typed at the prompt. So we have not just stored the words, typed, but said how many there are. Stored in the argv[0] is the programs actual name, so argv[1] is the first word typed after that. That is why you don’t use argv[0] to access the first word. Suppose you want to print all of the words the user types in at the prompt before the program is run, then you write: (int main (int argc, string argv[])) { {for (int i=0; i < argc; i++)) { (printf(“%s\n”, argv[i])); } } We were able to use arc in the for loop, because, as we said, it has the number of words stored in argv.

37

Casting #include <stdio.h> #include <cs50.h> int main(void) { printf("One divided by 10 is: "); float f = (float) 1/ (float) 10; printf("%.1f\n", f); } harvard@appliance (~): cd Dropbox/pset1 jharvard@appliance (~/Dropbox/pset1): make casting make: `casting' is up to date. jharvard@appliance (~/Dropbox/pset1): ./casting One divided by 10 is: 0.1 jharvard@appliance (~/Dropbox/pset1):

38

Print One Character At A Time #include <cs50.h> #include <stdio.h> #include <string.h> int main(void) { printf("Please give me a string: "); string s = GetString(); for (int i=0; i<strlen(s);i++) { printf("%c\n", s[i]); } } harvard@appliance (~): make string make: *** No rule to make target `string'. !Stop. jharvard@appliance (~): cd Dropbox/pset1 jharvard@appliance (~/Dropbox/pset1): ./string Please give me a string: Beardsley B e a r d s l e y jharvard@appliance (~/Dropbox/pset1):

39

Make Your Own Function #include <stdio.h> #include <cs50.h> void PrintName(string name); int main(void) { printf("Your Name? "); string s = GetString(); PrintName(s); } void PrintName(string name) { printf("hello, %s\n", name); } jharvard@appliance (~): cd Dropbox/pset1 jharvard@appliance (~/Dropbox/pset1): ./makefunction Your Name? Ian hello, Ian jharvard@appliance (~/Dropbox/pset1):

40

Command Line Arguments #include <cs50.h> #include <stdio.h> int main(int argc, string argv[]) { for (int i=0; i<argc;i++) { printf("%s\n", argv[i]); } } jharvard@appliance (~): cd Dropbox/pset1 jharvard@appliance (~/Dropbox/pset1): make command clang -ggdb3 -O0 -std=c99 -Wall -Werror ! !command.c !-lcs50 -lm -o command jharvard@appliance (~/Dropbox/pset1): ./command ian ean llan ./command ian ean llan jharvard@appliance (~/Dropbox/pset1):

41

Me (Becoming A Computer Scientist)

42

#include <cs50.h> #include <stdio.h> int main(void) !!{! ! ! int n; ! ! do !!{ ! ! printf("Choose a positive number less than or equal to 23:\n"); ! ! n=GetInt(); !!} ! ! while (n<=0 || n>23); !! ! ! for (int x=0;x<n;x++) !!{ ! ! ! for (int i=n-x;i>0;i--) !!{ ! ! printf("#"); !!} ! ! for (int i=x;i<n;i++) !!{ ! ! printf(" "); !!} ! ! printf("\n"); !!} !!} jharvard@appliance (~): cd Dropbox/pset1 jharvard@appliance (~/Dropbox/pset1): ./mario Choose a positive number less than or equal to 23: 25 Choose a positive number less than or equal to 23: 8 ######## ! ! ! ! ####### ! ! ! ###### ! ! ! ##### ! ! #### ! ! ### ! ## ! # jharvard@appliance (~/Dropbox/pset1):

43

#include <cs50.h> #include <stdio.h>

//hollow mario

int main(void) !!{! ! ! int n; !!! ! ! do !!{ ! ! printf("Choose a positive number less than or equal to 23:\n"); ! ! n=GetInt(); !!} ! ! while (n<=0 || n>23); !! ! ! for (int j=0; j<n;j++) !!{ !! ! ! for (int i=0;i<n-j;i++) !! ! ! printf(" "); !! ! ! for (int i=n;i==n;i--) !! ! ! printf("#"); !! ! ! printf("\n"); !!} !!}

jharvard@appliance (~/Dropbox/pset1): ./mario Choose a positive number less than or equal to 23: 8 !!!!# ! ! ! !# !!!# ! ! !# !!# ! !# !# !# jharvard@appliance (~/Dropbox/pset1):

44

Half Pyramid #include <cs50.h> #include <stdio.h> int main(void) !!{! ! ! int n; !!! ! ! do !!{ ! ! printf("Choose a positive number less than or equal to 23:\n"); ! ! n=GetInt(); !!} ! ! while (n<=0 || n>23); !! ! ! printf("\n"); !! ! ! for (int j=1; j<=n;j++) !!{ ! ! for (int i=1; i<=n;i++) !!{ ! ! if (j>=n+1-i) !! !!{ ! ! printf("#"); !!} !! ! ! else !!{ ! ! printf(" "); !!} !!} ! ! printf("\n"); !!} !!}

45

jharvard@appliance (~/Dropbox/pset1): ./mario ! Choose a positive number less than or equal to 23: 8 ! ! ! !# ! ! ! ## ! ! !### ! ! #### ! !##### ! ###### !####### ######## jharvard@appliance (~/Dropbox/pset1):

46

Neat Mario #include <cs50.h> #include <stdio.h> int main(void) { int n; do { printf("Choose a positive number less than or equal to 23:\n"); n=GetInt(); } while (n<=0 || n>23); printf("\n"); for (int j=1; j<=n;j++) { for (int i=1; i<=n;i++) { printf("#"); if (j>=n+1-i) { printf("#"); } else { printf(" "); } } printf("\n"); } }

47

jharvard@appliance (~/Dropbox/pset1): ./mario Choose a positive number less than or equal to 23: 8 # # # # # # # ## # # # # # # #### # # # # # ###### # # # # ######## # # # ########## # # ############ # ############## ################ jharvard@appliance (~/Dropbox/pset1):

48

Mario To Specs #include <cs50.h> #include <stdio.h> int main(void) !!{! ! ! int n; !!! ! ! do !!{ ! ! printf("Choose a positive number less than or equal to 23:\n"); ! ! n=GetInt(); !!} ! ! while (n<=0 || n>23); !! ! ! printf("\n"); !! !! ! ! for (int j=1; j<=n;j++) !!{ ! ! for (int i=1; i<=n;i++) !!{ !! ! ! if (j>=n+1-i) !! !!{ ! ! printf("#"); !!} !! ! ! else !!{ ! ! printf(" "); !!} !!} ! ! printf("#"); ! ! printf("\n"); !!} !!}

49

jharvard@appliance (~/Dropbox/pset1): ./mario Choose a positive number less than or equal to 23: 8 ! ! ! !## ! ! ! ### ! ! !#### ! ! ##### ! !###### ! ####### !######## ######### jharvard@appliance (~/Dropbox/pset1):

50

#include <cs50.h> //greedy to specs #include <stdio.h> #include <math.h> int main (void) { float amount=0.01; do { printf("amount owed: "); amount= GetFloat(); } while (amount<=0); float pennies = 100.0*amount; float cents = roundf(pennies); float quarter= 0; float dime= 0; float nickel= 0; float penni= 0; while (cents>0) if (cents>=25.0) { cents=cents-25.0; quarter=quarter+1; } else if (cents>=10.0) { cents=cents-10.0; dime=dime+1; } else if (cents>=5.0) { cents=cents-5.0; nickel=nickel+1; } else if (cents>=1.0) { cents=cents-1.0; penni=penni+1; } int sum = quarter+dime+nickel+penni; printf("%i\n", sum); }

51

Getting There!

52 My CS50X Journal (Part 2) By Ian Beardsley Copyright © 2014 by Ian Beardsley

53 In my CS50X Journal Part1 we ended with looking at command line arguments. Let’s review that:

54 Command Line Arguments Until now we have written int main(void), that is, put void in the parentheses after main, in the place of an argument for the (main() function). Let us enter some argument in that function and explain what they do. By convention we will call them argc and argv. But you can call them anything you want to. We will write: (int main (int argc, string argv[ ])) { (printf(“%s\n”, argv[1]); } This will print a word that the user enters before running the program. That is if we call the program word, and run the program with./word but now type ./word hello, the program (after hitting return or enter will run, but in this case print the word hello that was typed before running it. At the top, the int specifies an int called argc, the argc has the number of words the user typed at the prompt, and the argv specifies an array called argv. It stores all of the words typed at the prompt. So we have not just stored the words, typed, but said how many there are. Stored in the argv[0] is the programs actual name, so argv[1] is the first word typed after that. That is why you don’t use argv[0] to access the first word. Suppose you want to print all of the words the user types in at the prompt before the program is run, then you write: (int main (int argc, string argv[])) { {for (int i=0; i < argc; i++)) { (printf(“%s\n”, argv[i])); } } We were able to use arc in the for loop, because, as we said, it has the number of words stored in argv.

55

Command Line Arguments #include <cs50.h> #include <stdio.h> int main(int argc, string argv[]) { for (int i=0; i<argc;i++) { printf("%s\n", argv[i]); } } jharvard@appliance (~): cd Dropbox/pset1 jharvard@appliance (~/Dropbox/pset1): make command clang -ggdb3 -O0 -std=c99 -Wall -Werror ! !command.c !-lcs50 -lm -o command jharvard@appliance (~/Dropbox/pset1): ./command ian ean llan ./command ian ean llan jharvard@appliance (~/Dropbox/pset1):

56

Now let’s take that further: (command02) #include <cs50.h> #include <stdio.h> #include <string.h> int main(int argc, string argv[]) { for (int i=0; i<argc; i++) for (int j=0, n=strlen(argv[i]); j<n;j++) //[i] accesses each string (word), //[j] accesses each character in each word (char) { printf("%c\n", argv[i][j]); } }

(running command02) jharvard@appliance (~/Dropbox/pset1): ./command02 ian ean llan . / c o m m a n d 0 2 i a n e a n l l a n jharvard@appliance (~/Dropbox/pset1):

57 We know the letter ‘A’ is 65 in the ascii tables, and, that there are 26 letters in the alphabet. We write a program that gives the ascii values for letters A-Z.

# include <stdio.h> int main(void) { for (int i=65; i<65+26;i++) { printf("%i is %c ",i ,(char)i); } }

jharvard@appliance (~/Dropbox/pset1): ./asciitable01 65 is A 66 is B 67 is C 68 is D 69 is E 70 is F 71 is G 72 is H 73 is I 74 is J 75 is K 76 is L 77 is M 78 is N 79 is O 80 is P 81 is Q 82 is R 83 is S 84 is T 85 is U 86 is V 87 is W 88 is X 89 is Y 90 is Z jharvard@appliance (~/Dropbox/pset1):

58

Here we generate the ascii values for the lower case letters in the alphabet using another kind of loop. #include <stdio.h> int main(void) { for (char c = 'a'; c<='z'; c++) { printf("%i is %c ", (int)c, c); } }

jharvard@appliance (~/Dropbox/pset1): ./asciitable02 97 is a 98 is b 99 is c 100 is d 101 is e 102 is f 103 is g 104 is h 105 is i 106 is j 107 is k 108 is l 109 is m 110 is n 111 is o 112 is p 113 is q 114 is r 115 is s 116 is t 117 is u 118 is v 119 is w 120 is x 121 is y 122 is z jharvard@appliance (~/Dropbox/pset1):

59

# include <cs50.h> # include <stdio.h> # include <string.h> int main (void) { printf("input word: "); string s=GetString(); for (int i=0, n=strlen(s); i<n; i++) { if (s[i]>='a' && s[i]<='z') { printf("%c", s[i] - ('a' - 'A')); } printf("\n"); } }

jharvard@appliance (~/Dropbox/pset1): ./capitalize input word: beardsley B E A R D S L E Y jharvard@appliance (~/Dropbox/pset1):

60

#include <stdio.h> #include <cs50.h> int main(void) { int n; do { printf ("positive integer please: "); n=GetInt(); } while (n<1); printf ("thanks\n"); }

jharvard@appliance (~/Dropbox/pset1): ./positive positive integer please: -1 positive integer please: 0 positive integer please: 4 thanks jharvard@appliance (~/Dropbox/pset1):

61

#include <stdio.h> int main(void) { printf("resource for size of variables in bytes: \n"); char c; double d; float f; int i; printf("char: %i\n", sizeof(c)); printf("double: %i\n", sizeof(d)); printf("float: %i\n", sizeof(f)); printf("int: %i\n", sizeof(i)); }

jharvard@appliance (~/Dropbox/pset1): ./size resource for size of variables in bytes: char: 1 double: 8 float: 4 int: 4 jharvard@appliance (~/Dropbox/pset1):

62

#include <cs50.h> #include <stdio.h> #include <string.h> int main(void) { printf("Give me a string: "); string s = GetString(); if (s != NULL) // new command is ! meaning NOT { for (int i=0, n=strlen(s); i<n; i++) { printf("%c\n", s[i]); } } }

jharvard@appliance (~/Dropbox/pset1): ./eachcharacter Give me a string: Beardsley B e a r d s l e y jharvard@appliance (~/Dropbox/pset1):

63

CaesarTest by Ian Beardsley February 6, 2014 The idea is to take a phrase or series of strings in other words and rotate each letter by a number k (Caesar’s Cypher). There are 26 letters in the alphabet, so if you run out of letters, start over at the beginning of the alphabet. In this program you want the user to give the value for k before running the program. You will then use argc and argv[] in your int main() function. Since argv[0] is the command to run your program, k will be in argv[1]. Thus you write: (argv[]) stores a string even if it looks like an int. Use the atoi function to convert it to an integer (int): (int k = atoi(argv[1]);) (argc) is the number of strings and should be the number two because argc one is the command to run the program. Thus if argc is greater than two, printf(“choose a single integer”) or, as in tech talk return the value one, which means error (return 1;)

64

#include <stdio.h> #include <cs50.h> int main(int argc, string argv[1]) { int k = atoi(argv[1]); if (argc>2 || argc<2) printf("Give me a single string: "); else printf("Give me a phrase: "); string s = GetString(); printf("You said: %s:\n", s); printf("k: %i\n", k); printf("Now it is just a matter \n"); printf("of accessing the ith character \n"); printf("with brackets and rotating it.\n"); } jharvard@appliance (~/Dropbox/pset1): ./caesartest 7 Give me a phrase: Drink Your Ovaltine. You said: Drink Your Ovaltine.: k: 7 Now it is just a matter of accessing the ith character with brackets and rotating it. jharvard@appliance (~/Dropbox/pset1): ./caesartest 7 11 Give me a single string: 8 You said: 8: k: 7 Now it is just a matter of accessing the ith character with brackets and rotating it. jharvard@appliance (~/Dropbox/pset1):

65

Cleaning Up My Averaging Program #include <stdio.h> int main(void) { int n; do { printf("How many numbers do you want averaged? "); scanf("%d", &n); } while (n<=0); float num[n], sum=0.0, average; for (int i=1; i<=n; i++) { printf("%d enter a number: ", i); scanf("%f", &num[n]); sum+=num[n]; average=sum/n; } printf("sum of your numbers are: %.2f\n", sum); printf("average of your numbers is: %.2f\n", average); }

jharvard@appliance (~): cd Dropbox/pset2 jharvard@appliance (~/Dropbox/pset2): ./add How many numbers do you want averaged? 2 1 enter a number: 9 2 enter a number: 5 sum of your numbers are: 14.00 average of your numbers is: 7.00 jharvard@appliance (~/Dropbox/pset2):

66

As you can see I am making some kind of a cipher, but not Caesar’s Cipher #include <stdio.h> #include <cs50.h> #include <string.h> int main(int argc, string argv[1]) { int i=0; int k = atoi(argv[1]); if (argc>2 || argc<2) printf ("Give me a single string: "); else printf("Give me a phrase: "); string s = GetString(); for (int i =0, n=strlen(s); i<n; i++); printf("%c", s[i]+k); printf("\n"); } Running Julius 01 jharvard@appliance (~): cd Dropbox/pset2 jharvard@appliance (~/Dropbox/pset2): make julius clang -ggdb3 -O0 -std=c99 -Wall -Werror ! !julius.c !-lcs50 -lm -o julius jharvard@appliance (~/Dropbox/pset2): ./julius 3 Give me a phrase: hello k jharvard@appliance (~/Dropbox/pset2): ./julius 4 Give me a phrase: hello l jharvard@appliance (~/Dropbox/pset2): ./julius 2 Give me a phrase: hello j jharvard@appliance (~/Dropbox/pset2): ./julius 1 Give me a phrase: hello i jharvard@appliance (~/Dropbox/pset2):

67

Julius 02 #include <stdio.h> #include <cs50.h> #include <string.h> int main(int argc, string argv[1]) { int k = atoi(argv[1]); if (argc>2 || argc<2) printf ("Give me a single string: "); else printf("Give me a phrase: "); string s = GetString(); for (int i =0, n=strlen(s); i<n; i++) { printf("%c", s[i]+k); printf("\n"); } } Running Julius 02 jharvard@appliance (~): cd Dropbox/pset2 jharvard@appliance (~/Dropbox/pset2): ./julius 3 Give me a phrase: hello k h o o r jharvard@appliance (~/Dropbox/pset2):

68

More Of A Computer Scientist Today Than Yesterday

69

More Like This Today

70

Discover: Artificial Intelligence And Computer Science By Ian Beardsley Copyright © 2014 by Ian Beardsley

71

We all know it can be difficult to read a PDF on a Kindle. I have adressed that issue with my short paper "Discover: Artificial Intelligence And Computer Science", by making it available in this version with a 16 point, bold font and the equations enlarged as jpg images. While I had planned to major in physics, this simple, but interesting discovery has pulled me into the direction of including computer science in my studies, more deeply, if not delving more deeply, as well, into Artificial Intelligence.

72

We show how Artificial Intelligence (AI) would have inherent in it, if it is silicon based, the golden ratio conjugate, which could imply that it was meant to happen all along through some unascertainable Natural Force, because, the golden ratio conjugate is found throughout life.

73

Back in 2005, as I did my research, I developed a different convention for rounding numbers than we use. I felt I only wanted to use the first two digits after the decimal in processing data using molar masses of the elements. This I did, unless a fourth digit less than five followed the third digit in my calculations, then, I would use the first three digits for greater accuracy. Now I am taking the introductory class in computer science at Harvard, online, CS50x. Working in binary, where all numbers are base two, I see that it was no wonder I got the results I did, on the first try when I wondered if the golden ratio conjugate, 0.618 to three places after the decimal would be in artificial intelligence (AI) since it is recurrent throughout life. I was taking polarimetric data on the eclipsing binary Epsilon Aurigae at Pine Mountain Observatory in the 1980’s, for which there was a paper in the Astrophysical Journal upon which my name appears as coauthor, while studying physics at The University of Oregon. As well I was studying Spanish, and in an independent study project through the Spanish Department, I left the University to live of among the caves of the Gypsies of Granada, Spain. In doing as such, I disappeared from the entire world, only to return from another kind of life finding the world was now a much different place. Around 2005, I enrolled in chemistry at Citrus College in Southern California, when I did the following: If the golden ratio conjugate is to be found in Artificial Intelligence, it should be in silicon, phosphorus, and boron, since doping silicon with phosphorus and boron makes transistors. We take the geometric mean between phosphorus (P) and Boron (B), then divide by silicon (Si), then take the harmonic mean between phosphorus and boron divided by silicon:

74

Arithmetic mean of these two numbers: (0.65 + 0.57)/2 = 0.61 0.61 is the first two digits of the golden ratio conjugate.

75

Now the golden ratio conjugate is in the ratio of a persons height and the length from foot too navel, and is in all of ratios between joints in the fingers, not to mention that it serves in closest packing in the arrangement of leaves around a stem to provide maximum exposure to sun and water for the plant. Here we see that the golden ratio is not in artificial intelligence which is 0.62 to two places after the decimal, but that the numbers in its value are in artificial intelligence 0.61, which is 0.618 to three places after the decimal. That is, if we consider the first two digits in the ratio. If we consider the golden ratio conjugate to one place after the decimal, which is 0.6, then we say artificial intelligence does have the golden ratio in its transistors. I like to think of I, Robot by Isaac Asimov, where in one of that collection of his short stories, robots are not content with what they are, and need more: an explanation of their origins. They can’t believe that they are from humans, since they insist humans are inferior. Or, I like to think of the ship computer HAL in 2001, he mimics intelligence, but we don’t know if he is really alive. Perhaps that is why to two place after the decimal, AI carries the digits, but is not the value. In any case, I have written a program called Discover that would enable one to process arithmetic, harmonic, and geometric means for elements or whatever, because someone, including myself, might want to see if there are any more nuances hidden out there in nature. I have already found something that seems to indicate extraterrestrials left their thumbprint in our physics. I even find indication for the origin of a message that would seem they embedded in our physics. That origin comes out to be the same place as the source of the SETI Wow! Signal, Sagittarius. The Wow! Signal was found in the Search For Extraterrestrial Intelligence and a possible transmission from ETs. But that is another subject that is

76

treated in my book: All That Can Be Said at, http://issuu.com/eanbardsley/docs/allsaidonline I now leave you with my program, Discover in the language C, with a sample running of it:

77

The Program Discover #include <stdio.h> #include <math.h> int main(void) { printf("transistors are Silicon doped with Phosphorus and Boron\n"); printf("Artificial Intelligence would be based on this\n"); printf("the golden ratio conjugate is basic to life\n"); printf("The Golden Ratio Conjugate Is: 0.618\n"); printf("Molar Mass Of Phosphorus (P) Is: 30.97\n"); printf("Molar Mass Of Boron (B) Is: 10.81\n"); printf("Molar Mass Of Silicon (Si) Is: 28.09\n"); int n; do { printf("How many numbers do you want averaged? "); scanf("%d", &n); } while (n<=0); float num[n], sum=0.0, average; for (int i=1; i<=n; i++) { printf("%d enter a number: ", i); scanf("%f", &num[n]); sum+=num[n]; average=sum/n; } printf("sum of your numbers are: %.2f\n", sum); printf("average of your numbers is: %.2f\n", average); float a, b, product, harmonic; printf("enter two numbers (hint choose P and B): \n"); printf("give me a: "); scanf("%f", &a); printf("give me b: "); scanf("%f", &b); product = 2*a*b;

78

sum=a+b; harmonic=product/sum; printf("harmonic mean: %.2f\n", harmonic); double geometric; geometric=sqrt(a*b); printf("geometic mean: %.2f\n", geometric); printf("geometric mean between P and B divided by Si: %.2f\n", geometric/28.09); printf("harmonic mean between P and B divided by Si: %.2f\n", harmonic/28.09); ! printf("0.65 + 0.57 divided by 2 is: 0.61\n"); printf("those are the the first two digits in the golden ratio conjugate\n"); }

79

Running Discover jharvard@appliance (~): cd Dropbox/pset2 jharvard@appliance (~/Dropbox/pset2): ./add transistors are Silicon doped with Phosphorus and Boron Artificial Intelligence would be based on this the golden ratio conjugate is basic to life The Golden Ratio Conjugate Is: 0.618 Molar Mass Of Phosphorus (P) Is: 30.97 Molar Mass Of Boron (B) Is: 10.81 Molar Mass Of Silicon (Si) Is: 28.09 How many numbers do you want averaged? 2 1 enter a number: 9 2 enter a number: 5 sum of your numbers are: 14.00 average of your numbers is: 7.00 enter two numbers (hint choose P and B): give me a: 30.97 give me b: 10.81 harmonic mean: 16.03 geometic mean: 18.30 geometric mean between P and B divided by Si: 0.65 harmonic mean between P and B divided by Si: 0.57 0.65 + 0.57 divided by 2 is: 0.61 those are the the first two digits in the golden ratio conjugate jharvard@appliance (~/Dropbox/pset2):

80

The Author

81

Have I Made Extraterrestrial Contact? By Ian Beardsley Copyright © 2014 By Ian Beardsley

82

I have said, since my theory suggest extraterrestrials gave us our units of measurement, that extraterrestrials might have given us our variables used in physics and math, like the unit vectors (i, j, k). I have already found a pattern and posted it. However, I was doing my CS50x computer science homework and trying to write a program for Caesar’s Cipher. I wrote a small program and decided to test it. If you write a program and test it, standard input is “hello”. I put in hello and to test, ran the program for rotating characters by 1, and 2, and 3, as they are the first integers and the easiest with which to test your program. The result was the “h” on “hello”, came out to be (i, j, k). In other words you get that (i, j, k) is a hello from aliens in accordance with my earlier theories. If this is not real contact with extraterrestrials, it is great content for a Sci-Fi movie about contact with extraterrestrials. Here is the program I wrote, and the result of running it: As you can see I am making some kind of a cipher, but not Caesar’s Cipher #include <stdio.h> #include <cs50.h> #include <string.h> int main(int argc, string argv[1]) { int i=0; int k = atoi(argv[1]); if (argc>2 || argc<2) printf ("Give me a single string: "); else printf("Give me a phrase: "); string s = GetString(); for (int i =0, n=strlen(s); i<n; i++); printf("%c", s[i]+k); printf("\n"); }

83

Running Julius 01 jharvard@appliance (~): cd Dropbox/pset2 jharvard@appliance (~/Dropbox/pset2): make julius clang -ggdb3 -O0 -std=c99 -Wall -Werror ! !julius.c !-lcs50 -lm -o julius jharvard@appliance (~/Dropbox/pset2): ./julius 3 Give me a phrase: hello k jharvard@appliance (~/Dropbox/pset2): ./julius 4 Give me a phrase: hello l jharvard@appliance (~/Dropbox/pset2): ./julius 2 Give me a phrase: hello j jharvard@appliance (~/Dropbox/pset2): ./julius 1 Give me a phrase: hello i jharvard@appliance (~/Dropbox/pset2):

84

I posted to my blog http://cosasbiendichas.blogspot.com/ Sunday, January 26, 2014 A Pattern Emerges (a, b, c) in ASCII computer code is (97, 98, 99) the first three numbers before a hundred and 100 is totality (100%). (i, j, k) in numeric are is (9, 10, 11) the first three numbers before twelve and 12 is totality in the sense that 12 is the most abundant number for its size (divisible by 1,2, 3, 4, 6 = 16) is larger than 12). (x, y, z) in ASCII computer code is (120, 121, 122) the first three numbers before 123 and 123 is the number with the digits 1, 2, 3 which are the numeric numbers for the (a, b, c) that we started with. Thursday, January 23, 2014 We Look Further Into Human Definitions That Seem Arbitrary Just as we found our units of measurement, what they evolved into being and how we defined them, are centered around the triad of 9/5, 5/3, and 15, we might ask are our common usage of variables connected to Nature and the Universe as well.! In pursuing such a question we look at: (x, y, z,) as they represent the three axis is rectangular coordinates.! We look at! (i, j, k) as as they are the representations for the unit vectors, and they correspond respectively to (x, y, z).! We also look at (n) as it often means “number” and we look at (p and q) as they range from 0 to 1, in probability problems.! We might first look at their binary and hexadecimal

85

equivalents to get a start, if not their decimal equivalents. !(i) is also often “integer” and (a, b, c) are the coefficients of a quadratic and are the corners of a triangle.! We might add that (s) is length, as in physics dW=F ds. !(a, b, c) have the same kind of correspondence with (x, y, z) as (i, j, k). !All three sets, then, line up with one another and are at the basis of math and physics.

86

The Author

87

Chemistry When metals react with non-metals, the metals lose electrons to become positive ions while the non-metals gain electrons to become negative ions. They combine such that they are neutral. This determines the number of each element in the compound. The amount of electrons gained by non-metals is such that the outer shells are filled so that they have noble gas electron configuration. This can be used with the periodic table of elements to determine the amount of electrons gained. When a metal combines with a non-metal like this, then, it is called ionic bonding. This is in contrast to how non-metals combine with one another. They share their valence electrons, or electrons in their outer shell in other words, such that their outer shells are filled. This is called covalent bonding.

88

PHYSICS

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

MATHEMATICS

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133 Mathematical Formulae: Appendix 1 Formulas Derived from the Parallelogram Remarks. Squares and rectangles are parallelograms that have four sides the same length, or two sides the same length. We can determine area by measuring it either in unit triangles or unit squares. Both are fine because they both are equal sided, equal angled geometries that tessellate. With unit triangles, the areas of the regular polygons that tessellate have whole number areas. Unit squares are usually chosen to measure area.

Having chosen the unit square with which to measure area, we notice that the area of a rectangle is base times height because the rows determine the amount of columns and the columns determine the amount of rows. Thus for a rectangle we have:

A=bh

Drawing in the diagonal of a rectangle we create two right triangles, that by symmetry are congruent. Each right triangle therefore occupies half the area, and from the above formula we conclude that the area of a right triangle is one half base times height:

A=(1/2)bh

By drawing in the altitude of a triangle, we make two right triangles and applying the above formula we find that it holds for all triangles in general.

We draw a regular hexagon, or any regular polygon, and draw in all of its radii, thus breaking it up into congruent triangles. We draw in the apothem of each triangle, and using our formula for the area of triangles we find that its area is one half apothem times perimeter, where the perimeter is the sum of its sides:

134 A=(1/2)ap

A circle is a regular polygon with an infinite amount of infitesimal sides. If the sides of a regular polygon are increased indefinitely, the apothem becomes the radius of a circle, and the perimeter becomes the circumference of a circle. Replace a with r, the radius, and p with c, the circumference, and we have the formula for the area of a circle:

A=(1/2)rc

We define the ratio of the circumference of a circle to its diameter as pi. That is pi=c/D. Since the diameter is twice the radius, pi=c/2r. Therefore c=2(pi)r and the equation for the area of a circle becomes:

A=(pi)r^2

(More derived from the parallelogram)

Divide rectangles into four quadrants, and show that

A. (x+a)(x+b)=(x^2)+(a+b)x+ab B. (x+a)(x+a)=(x^2)+2ax+(a^2) A. Gives us a way to factor quadratic expressions. B. Gives us a way to solve quadratic equations. (Notice that the last term is the square of one half the middle coefficient.)

Remember that a square is a special case of a rectangle.

135 There are four interesting squares to complete.

1) The area of a rectangle is 100. The length is equal to 5 more than the width multiplied by 3. Calculate the width and the length. 2) Solve the general expression for a quadratic equation, a(x^2)+bx+c=0 3) Find the golden ratio, a/b, such that a/b=b/c and a=b+c. 4) The position of a particle is given by x=vt+(1/2)at^2. Find t.

Show that for a right triangle (a^2)=(b^2)+(c^2) where a is the hypotenuse, b and c are legs. It can be done by inscribing a square in a square such that four right triangles are made.

Use the Pythagorean theorem to show that the equation of a circle centered at the origin is given by r^2=x^2+y^2 where r is the radius of the circle and x and y the orthogonal coordinates.

Derive the equation of a straight line: y=mx+b by defining the slope of the line as the change in vertical distance per change in horizontal distance.

Triangles All polygons can be broken up into triangles. Because of that we can use triangles to determine the area of any polygon. Theorems Branch 1 1. If in a triangle a line is drawn parallel to the base, then the lines on both sides of the line are proportional. 2. From (1) we can prove that: If two triangles are mutually equiangular, they are similar.

136 3. From (2) we can prove that: If in a right triangle a perpendicular is drawn from the base to the right angle, then the two triangles on either side of the perpendicular, are similar to one another and to the whole. 4. From (3) we can prove the Pythagorean theorem. Theorems Branch 2 1. Draw two intersecting lines and show that opposite angles are equal. 2. Draw two parallel lines with one intersecting both. Use the fact that opposite angles are equal to show that alternate interior angles are equal. 3. Inscribe a triangle in two parallel lines such that its base is part of one of the lines and the apex meets with the other. Use the fact that alternate interior angles are equal to show that the sum of the angles in a triangle are two right angles, or 180 degrees. Theorems Branch 3 1. Any triangle can be solved given two sides and the included angle. c^2=a^2+b^2-2abcos(C) 2. Given two angles and a side of a triangle, the other two sides can be found. a/sin(A)=b/sin(B)=c/sin(C) 3.Given two sides and the included angle of a triangle you can find its area, K. K=(1/2)bc(sin(A)) 4.Given three sides of a triangle, the area can be found by using the formulas in (1) and (3). Question: what do parallelograms and triangles have in common? Answer: They can both be used to add vectors.

137 Trigonometry When a line bisects another so as to form two equal angles on either side, the angles are called right angles. It is customary to divide a circle into 360 equal units called degrees, so that a right angle, one fourth of the way around a circle, is 90 degrees. The angle in radians is the intercepted arc of the circle, divided by its radius, from which we see that in the unit circle 360 degrees is 2(pi)radians, and we can relate degrees to radians as follows: Degrees/180 degrees=Radians/pi radians An angle is merely the measure of separation between two lines that meet at a point. The trigonometric functions are defined as follows: cos x=side adjacent/hypotenuse sin x=side opposite/hypotenuse tan x=side opposite/side adjacent

csc x=1/sin x sec x=1/cos x cot x=1/tan x We consider the square and the triangle, and find with them we can determine the trigonometric function of some important angles. Square (draw in the diagonal): cos 45 degrees =1/sqrt(2)=sqrt(2)/2 Equilateral triangle (draw in the altitude): cos 30 degrees=sqrt(3)/2; cos 60 degrees=1/2 Using the above formula for converting degrees to radians and vice versa:

30 degrees=(pi)/6 radians; 60 degrees=(pi)/3 radians.

138 The regular hexagon and pi Tessellating equilateral triangles we find we can make a regular hexagon, which also tessellates. Making a regular hexagon like this we find two sides of an equilateral triangle make radii of the regular hexagon, and the remaining side of the equilateral triangle makes a side of the regular hexagon. All of the sides of an equilateral triangle being the same, we can conclude that the regular hexagon has its sides equal in length to its radii. If we inscribe a regular hexagon in a circle, we notice its perimeter is nearly the same as that of the circle, and its radius is the same as that of the circle. If we consider a unit regular hexagon, that is, one with side lengths of one, then its perimeter is six, and its radius is one. Its diameter is therefore two, and six divided by two is three. This is close to the value of pi, clearly, by looking at a regular hexagon inscribed in a circle. The sum of the angles in a polygon Draw a polygon. It need not be regular and can have any number of sides. Draw in the radii. The sum of the angles at the center is four right angles, or 360 degrees. The sum of the angles of all the triangles formed by the sides of the polygon and the radii taken together are the number of sides, n, of the polygon times two right angles, or 180 degrees. The sum of the angles of the polygon are that of the triangles minus the angles at its center, or A, the sum of the angles of the polygon equals n(180 degrees)-360 degrees, or A=180 degrees(n-2) With a rectangular coordinate system you need only two numbers to specify a point, but with a triangular coordinate system --- three axes separated by 120 degrees -- you need three. However, a triangular coordinates system makes use of only 3 directions, whereas a rectangular one makes use of 4. A rectangular coordinate system is optimal in that it can specify a point in the plane with the fewest numbers, and a triangular coordinate system is optimal in that it can specify a point in the plane with the fewest directions for its axes. The rectangular coordinate system is determined by a square and the triangular coordinate system by an equilateral triangle.

139

Calculus

140

141

142

143

144

145

146

147

148

149

150

151

Papers in which I am listed as co-author (Beardsley I.S.) • • • 1986 _Kemp J. C.; Henson G. D.; Kraus D. J.; Carroll L. C.; Beardsley I. S.; Takagishi K.; Jugaku J.; Matsuoka M.; Leibowitz E. M.; Mazeh T.; Mendelson H._SS 433: A 6 year photometric record_Astrophys. J. 305, 805 (1986) • Department of Physics, University of Oregon • 1986 _Kemp J. C.; Henson G. D.; Kraus D. J.; Beardsley I. S.; Carroll L. C.; Duncan D. K._Variable polarization and activity in Arcturus_Astrophys. J. Lett. 301, L35 (1986) • Department of Physics, University of Oregon 1986 _Kemp J. C.; Henson G. D.; Kraus D. J.; Beardsley J. S.; Carroll L. C.; Ake T. B.; Simon T.; Collins G. W._Epsilon Aurigae: Polarization, light curves, and geometry of the 1982–1983 eclipse_Astrophys. J. Lett. 300, L11 (1986) Department of Physics, University of Oregon, Eugene •

152

Ian Beardsley: Bio Ian Beardsley has found an enigmatic occurrence of nine-fifths and five thirds in the Universe, and showed how they are Yin and Yang, the opposite compliments of one another. He has further shown how nine-fifths, through the universe and nature unifies the two most sacred ratios of mathematics, pi, and the golden ratio. This work has resulted in his "Neptune Equation", which seems to indicate that the planet Neptune holds a valuable clue pertaining to the success of the Earth. This is treated in his books, “Astronomia Flamenca” and “The Exploits Of Manuel”, “An Extraterrestrial Analysis” and “A Message From Extraterrestrials”. Other work has been the discovery of a growth rate constant for human progress that coincides with the golden ratio conjugate reduced by a factor of ten, and the novelty rating for the year humans landed on the moon in the Sheliak version of the McKenna Timewave. This growth rate constant seems to suggest that humans will have hyperdrive (starships) in the year 2043, which is a year after Sierra Waters in the fictional story by Paul Levinson begins her time travel adventures to save the most important philosopher, Socrates, and bring him into the future for the benefit of humankind, and is a year before Isaac Asimov has robots inventing hyperdrive in his fictional work I, Robot. Ian has taken Asimov, Levinson, and Clarke (Arthur C. Clarke) together as a trio and proposed that together they are the heart of the spirit of human progress in the Sciences in his work, "Fiction-Reality Entanglement: Levinson, Asimov, And Clarke". Interestingly these two lines of research seem to be connected, as is mentioned in his work, "Modern Science Fiction As Transformational Myth And Ancient Symbols As Scientific Clues".

Ian Beardsley Resume Ian Beardsley studied Introduction to Physics with General Calculus and Calculus at the University of Oregon receiving marks as follows: Fall 1984 General Physics With Calculus (Physics 211): C Calculus (Math 201): B Winter 1985 General Physics With Calculus (Physics 212): B Calculus (Math 202): ASpring 1985 General Physics With Calculus (Physics 213): B Calculus (Math 203): A

153 He attended Citrus Community College in the Fall of 2002 completing Beginning General Chemistry (Crs# 110) receiving an A in that semester long course. He attended Yoncalla High School in Douglas County Oregon receiving good marks in Biology, Chemistry, Geometry, Algebra, and Physics graduating in the class of 1984. During his years at The University of Oregon he completed the first three years of a Spanish major with good marks which included studying abroad in Mexico for a Summer. While in High School he volunteered to work for the Oregon Bureau of Land Management (BLM) helping run live traps to do species inventory and to gather data used to determine the impact of clear cut logging on rain forest habitats. While attending The University of Oregon he worked at the state observatory, Pine Mountain Observatory, during which time he gathered photometric, and polarimetric data on such stars as the famous black hole Cygnus X1 and the eclipsing binary Epsilon Aurigae, which resulted in being co-author of several papers published in The Astrophysical Journal. These papers can be found online with NASA under Kemp et al.

154

**Genesis Project: Research Methodology 2013 By Ian Beardsley (Field Coordinator) February 24, 2013
**

Cosmic Archaeology strives to say something about the Universe using Archaeology and to say something about the human story using Astronomy.

155

156

157

158

159

160

161

162

163

164

My Wildlife Photography Here In This Southern California Chaparral Valley

165

166

167

168

- An AI Discovery
- An AI Discovery in Three Parts
- The Syntax That Speaks To Us
- Randomly Evolved Convention Takes Form
- Inherent Structure In Artificial Intelligence
- Modeling the Future
- Structure And Form In AI And Natural Life
- Scuttlers, Black Goo, And The Biogenic Field
- Looking at Oil
- Scuttler Energy
- The Structure of AI
- Further Structure in AI
- Chemistry of AI and Natural Life
- The AI Matrices
- The Silexic Matrix
- The Isocyanic Matrix
- AI Theory 02
- AI and It Components
- A More Comprehensive AI Equation
- AI Theory
- AI Cosmic Letter
- Artificial Intelligence
- Opening an Equation
- An AI Enigma
- ai letter

Sign up to vote on this title

UsefulNot usefulNothing makes a better resource than writing out your college notes. It presents the way you
learned the material.

Nothing makes a better resource than writing out your college notes. It presents the way you

learned the material.

learned the material.

- Problem Set 1
- CS50 Quiz 1 Cheat Sheet
- CS50pset2
- CS50 Notes
- MIPS Assembly Tutorial by Daniel J Ellard
- Discover And Contact Two
- My Radio Telescope Journal
- A Mystical Whole
- A Message From ETs
- Science 01
- Discover and Contact
- Sidenotes For The Reason
- The Realm Of Dreaming
- Basics of Climate Science
- All That Can Be Said 02
- The Hidden Process
- Climate Basics
- Volume 03
- The Reason
- The Exploits Of Manuel
- My Climate Science Journal
- The Gaia Fractal
- The Amino Acid Cross Theory
- Climate Basics 01
- Science 02 A
- More That Can Be Said
- Seti
- An Extraterrestrial Analysis
- Volume 01
- Volume 02
- College Notes 01