beep boop

This commit is contained in:
left_adjoint 2023-12-07 16:18:49 -08:00
parent 459f3e86ab
commit 0498793354
2 changed files with 220 additions and 7 deletions

View File

@ -0,0 +1,140 @@
* Agenda
Here we go in reverse order from most recent to earliest material
+ Cybersecurity and Privacy
+ Personally Identifying Information
+ Threats
+ Keylogging
+ Phishing
+ Rogue access points
+ Encryption
+ Decryption
+ Substitution ciphers
+ Rotating the alphabet
+ How do you break it?
+ Repeated texts
+ All you need is "the"
+ Encryption and "keys"
+ sub cipher: the key is the rotation
+ Symmetric encryption
+ shared key
+ You and I both have the same key
+ one-time-pad
+ an amazing example of symmetric key encryption
+ *perfect* encryption, cannot be broken
+ downsides:
+ need a key as big as all the data you ever intend to send
+ how do you get it there?
+ if you have a way to send a ton of data securely then you already don't need encryption
+ if you *ever* re-use the key, it stops being unbreakable
+ All symmetric encryption gets easier to break the more times a key is re-used
+ Asymmetric encryption
+ I have a public key and a private key
+ You have a public key and a private key
+ I can encrypt data with my private key and you can unencrypt it with my public key
+ We layer encryption to communicate securely:
+ I encrypt my data first with my private key, *then* your public key
+ You encrypt first with your private key, then my public key
+ Really hard to break but not *perfect*
+ AI
+ AI is the branch of computer science that studies adaptive, problem solving, algorithms
+ A ton of things used to be a part of "AI" including optical character recognition and search engines
+ Machine learning is a *type* of AI, AI is the big umbrella term that is much bigger than ML
+ Machine learning has three main branches
+ Reinforcement
+ Unsupervised
+ Supervised
+ Neural networks are a tool of machine learning
+ Neural networks are curve fitting with millions and billions of parameters
+ Large language models are neural networks trained from a game of fill-in-the-blank
+ Large language models: are they "AGI"?
+ Okay what is AGI (Artificial General Intelligence):
+ People use the term several different ways:
+ AGI is when you have artificial intelligence that is able to be applied generally, to new situations it hasn't been trained on or seen before.
+ AGI is when you have artificial intelligence that is competitive---or better than---humans on different tasks
+ AGI is when you have an artificial intelligence that is alive
+ These are all very different from each other!
+ Data science
+ Charts!
+ Graphs!
+ The importance of data visualization!
+ Sorting and algorithmic efficiency
+ Linear search
+ Easy to implement, but potentially very very very slow
+ Binary search
+ Much faster but only works if you're sorted
+ Insertion sort
+ Selection sort
+ Main operations we count in a sort:
+ Copy
+ Swap
+ Compare
+ What grows faster?
+ log_2 n or n
+ n**2 or n
+ 2**n or n**10
+ n! or n**10
+ n! or n**n
+ Python programming
+ variables
+ Basic operators
+ operands
+ +
+ *
+ %
+ **
+ /
+ Types
+ int
+ str
+ list
+ bool
+ Strings
+ So many ways to write a string
+ ' '
+ " "
+ ' " " '
+ """ """
+ f" {aVariable} "
+ Concatenating strings with +
+ Lists
+ Making lists
+ accessing lists with []
+ Iteration/repetition
+ for _ in _ and range
+ range(x)
+ range(x,y)
+ range(x,y,z)
+ while
+ Choices
+ if
+ if else
+ Printing only even numbers
+ Printing only odd numbers
+ functions
+ defining
+ calling
+ The internet
+ Layers of the internet
+ Application
+ The things that aren't necessary for the network to work but are systems built on top
+ DNS
+ Domain Name System
+ HTTP
+ Transport
+ TCP/UDP
+ How you package up little chunks of data called packets
+ Internet layer
+ How routing happens to send packets where they need to go
+ Routing:
+ No single master router, routers act independently
+ Packets between two computers can take many paths
+ Packets can get dropped
+ Link layer
+ How a connection between computers is negotiated
+ Physical layer
+ The actual physical devices that make up the connections
+ Binary and representation
+ Converting decimal to binary
+ Converting binary to decimal
+ How many things can you represent with n-bits?

View File

@ -130,23 +130,66 @@ Well from above we know that the largest number that can be represented by n-bit
The same way that if I have the numbers 0,1,2,3,4,5,6,7,8,9 then you can count them and get "10", this means that if I count 0, 1, 2, ..., up to =2^n-1= then you're counting 2^n numbers.
So take a pragmatic example
**** How many bits do you need to represent an image?
So take a pragmatic example let's say you have ID numbers in your system that range from 000-00-0000 to 999-99-9999. How many bits do you need to represent this number? Well your max number is 999,999,999. So you need to figure out what's the *smallest* number n such that 2^n (or 2**n in Python!) is bigger than 999,999,999. You can do this by trial and error, plugging in things like 2^32 which gives us a little over 4 billion which is too *big* and then stepping down until we get 2^30 which is only a little bigger than 999,999,999. Or! We could take "log base 2" of our number then round up. If you use a calculator you should be able to do this and you'll get that the log base 2 of 999999999 gives us 29.9, which we round up to 30 because there are no fractional bits. Ta-da!
** Module 2: The Internet
*** Okay, but what *is* the internet?
The internet is a a very complicated, multi-layered, global system that sends data between machines. It does this using a series of /protocols/ to coordinate all these various layers.
*** What is a protocol?
A protocol is a simple system
*** What the layers to the internet?
*** What is DNS? How does DNS work?
*** What is the web?
*** What is a DDOS attack?
*** How does routing work?
** Module 3-6: Python and programming
*** What is a programming language?
*** What is computation?
*** Variables
In python variables are little boxes with names that you can store data in. You can make them by using them, like this!
#+begin_example
#+end_example
*** Arithmetic operations
*** Input and Output
#+begin_src python
# we read from the console like this
thing = input("Here is the prompt: ")
# and we write to the console like this:
print(thing)
#+end_src
*** So many kinds of strings!
Strings are just the data type for text
#+begin_src python
str1 = "this is a string"
str2 = 'this is a string'
print(str1 == str2) # will print true
# you can interleave different kinds of quotes, but they have to be different
str3 = "This is a string with a 'quote' in it"
str4 = """This is the really
wild
kind
of
string
try printing it"""
print(str4)
#+end_src
*** Types and how to see them
Every piece of data has a type, which is why if you type something like =10/"dog"= into the REPL you'll get an error back out. Specifically, you'll get this error:
#+begin_example
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for /: 'int' and 'str'
#+end_example
so what are those 'int' and 'str' there? Those are the types for "integers" and "strings"!
You can actually look at *any* type for a function just by
*** Iteration/repetition
**** for in
**** while
@ -154,8 +197,32 @@ So take a pragmatic example
** Module 7: Algorithms and efficiency
*** Searching through a list
**** Linear
You can always search through a list one by one to find a thing you want. Just start at the beginning and go until you either find the item you're looking for or hit the end of the list. It's easy! You can even encode it in Python like this
#+begin_src python :tangle linsearch.py
def linear_search(a,lst):
for l in lst:
if a == l:
return True
return False
print(linear_search(3, [1,2,5,4,3]))
#+end_src
Okay, what's the downside though? Well if you have, say, 4 billion things in the list then you might have to check /4 billion things/ in order to perform your search. That's unacceptably slow! Can you imagine a website where every time someone wanted to log in it took 30 seconds or a minute just to find *their* account? Before the server went on to find the account of the next person trying to log in? It'd be the computer equivalent of a traffic jam!
**** Binary
Binary search on the other hand is /much/ nicer, because it basically lets you cut the list you're searching through in half each time. To put it in really rough terms it goes something like "check the middle of the list, if the thing you're looking for is smaller than the item in the middle of the list then check the smaller half of the list and start again, otherwise check the upper half of the list and start again". You can actually calculate that the number of steps it takes to find a thing, by breaking the list in half over and over and over, is going to be *roughly* log-base-2 of the length of the list. So our hypothetical 4 billion item list suddenly only takes ~32 steps to find anything in it.
OKAY there's a downside, though, did you notice it?
The *list has to be sorted first* in order to use binary search.
So let's talk about sorting!
*** Sorting
**** What operations go into sorting
Okay so there are really "three operations" that go into sorting a list:
+ comparison
+ copy
+ swap
**** Insert sort
**** Selection sort
*** Counting how many operations an algorithm uses
@ -167,17 +234,23 @@ So take a pragmatic example
*** Graphing data
**** Bar graphs
**** Scatter plots
**** Crosstabs
** Module 9: AI and ML
*** What is AI?
AI is the branch of computer science that
AI is the branch of computer science that's about creating problems that can /adapt/ and /find solutions/ to problems. For example, everything from path-finding for NPCs in video games to how search engines work has been under the purview of "AI" as a discipline at some point in history.
There's even an old joke: what do you call AI that works? Computer science!
Because once a trick for adaptive, problem solving, programs becomes tried and true it stops being "AI" and just becomes another tool that programmers use.
*** What is machine learning?
*** What are the kinds of machine learning?
**** Supervised
**** Unsupervised
**** Reinforcement
*** What is a neural network?
*** What is AGI?
AGI, Artificial General Intelligence,
*** What is an LLM?
** Module 10: Cybersecurity
***
*** Substitution ciphers
*** Symmetric key encryption