S3 T2 ICT - Excel Algor AI Py
Excel
=sum(range)
range (array)
=sum(number1, [number2], ...)
numberX (cell ref)
=count(range)
range (array)
=count(number1, [number2], ...)
numberX (cell ref)
=sumif(range, criteria, [sum_range])
range (cell ref)
where it matches criteria
criteria (string)
what to expect in range
sum_range (cell ref array)
relative to range, actual cells to use
=countif(range, criteria)
range (cell ref)
where it matches criteria
criteria (string)
what to expect in range
=rank(number, ref, [order])
number (integer)
ref (array)
order (boolean)
0: Descending
1: Ascending
=xlookup(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
lookup_value (string/number)
lookup_array (array)
where lookup_value is in
return_array (array)
where the value corresponds to lookup_value
if_not_found (string/number)
what to echo when lookup_value does not exist
match_mode (integer)
0: Exact match DEFAULT
-1: Exact match or next smaller item (sorting required)
1: Exact match or next larger item (sorting required)
2: Wildcard character match (*?~)
search mode (integer)
1: Perform a search starting at the first item. DEFAULT
-1: Perform a reverse search starting at the last item.
2: Perform a binary search that relies on lookup_array being sorted in ascending order. If not sorted, invalid results will be returned.
-2: Perform a binary search that relies on lookup_array being sorted in descending order. If not sorted, invalid results will be returned.
Calculator Programming
*** Pythagorean Theorem, area of X
? -> A2: ? -> B : πA2B
^ Calculate the volume of a circular cylinder
Procedural/Sequential Structure
The very basic
Selection Structure
If something, do something, else, do something
### Iteration Structure Loop somethingAI Book
5Vs that serves no purpose
- Volume (amount of data)
- Velocity (speed of data created, transmitted, collected)
- Variety (different types/forms of data)
- Veracity (quality, accuracy, reliability of data)
- Value (usefulness of data)
Classification Errors
Model classified image as X to be Y
The volume and variety in training data may not have modeled this kind of image sufficiently well.
The variety of data is limited to X and Y
AI Ethics Principles
- Transparency
AI decisions should be clear and understandable to users
- Justice and fairness
AI should be developed and used fairly, avoiding bias and discrimination - Beneficence
AI should be designed to minimize harm and prioritize safety and well-being - Responsibility
Developers and users of AI should be accountable for its impact. - Privacy
AI development and use should protect user privacy and data security.
Self Driving Car Moral Responsibility
Moral Machine
Stakeholder responsibility taker
- depends on country law
- according to local law
- list all responsible parties
car owner, tech dev team, driver, manufacturer, stakeholder
Social Values, Gender, Avoid intervention, age preference, protecting passengers
Python
Variable Swapping
x=1
y=2
z=x
x=y
y=z
Conditionals
if (x==y):
print("Equal")
elif (x>y):
print("X bigger")
else:
print("Y bigger")
Pythagorean Theorem
a**2 + b**2 == c**2
For Loop
Diamond Shape
for i in range(n):
print(" "*(n-i) + "A "*i)
for i in range(n):
print(" "*(i) + "A "*(n-i))