Simple Statistics on Arrays

Slides:



Advertisements
Similar presentations
Iteration: WHILE Loop Damian Gordon. WHILE Loop Consider the problem of searching for an entry in a phone book with only SELECTION:
Advertisements

Searching Damian Gordon. Google PageRank Damian Gordon.
Sorting: Optimising Bubblesort Damian Gordon. Sorting: Bubble Sort If we look at the bubble sort algorithm again:
Python: Arrays Damian Gordon. Arrays In Python arrays are sometimes called “lists” or “tuple” but we’ll stick to the more commonly used term “array”.
Python: Sorting - Bubblesort Damian Gordon. Sorting: Bubblesort The simplest algorithm for sort an array is called BUBBLE SORT. It works as follows for.
Sorting: Selection Sort Damian Gordon. Sorting: Selection Sort OK, so we’ve seen a way of sorting that easy for the computer, now let’s look at a ways.
Prime Numbers Damian Gordon. Prime Numbers So let’s say we want to express the following algorithm: – Read in a number and check if it’s a prime number.
Python: Iteration Damian Gordon. Python: Iteration We’ll consider four ways to do iteration: – The WHILE loop – The FOR loop – The DO loop – The LOOP.
SpringerLink Training Kit
Luminosity measurements at Hadron Colliders
From Word Embeddings To Document Distances
Virtual Environments and Computer Graphics
THỰC TIỄN KINH DOANH TRONG CỘNG ĐỒNG KINH TẾ ASEAN –
NHỮNG VẤN ĐỀ NỔI BẬT CỦA NỀN KINH TẾ VIỆT NAM GIAI ĐOẠN
Điều trị chống huyết khối trong tai biến mạch máu não
BÖnh Parkinson PGS.TS.BS NGUYỄN TRỌNG HƯNG BỆNH VIỆN LÃO KHOA TRUNG ƯƠNG TRƯỜNG ĐẠI HỌC Y HÀ NỘI Bác Ninh 2013.
Nasal Cannula X particulate mask
Parameterization of Tabulated BRDFs Ian Mallett (me), Cem Yuksel
L-Systems and Affine Transformations
实习总结 (Internship Summary)
Current State of Japanese Economy under Negative Interest Rate and Proposed Remedies Naoyuki Yoshino Dean Asian Development Bank Institute Professor Emeritus,
Face Recognition Monday, February 1, 2016.
Solving Rubik's Cube By: Etai Nativ.
انتقال حرارت 2 خانم خسرویار.
Summer Student Program First results
MOCLA02 Design of a Compact L-­band Transverse Deflecting Cavity with Arbitrary Polarizations for the SACLA Injector Sep. 14th, 2015 H. Maesaka, T. Asaka,
Hui Wang†*, Canturk Isci‡, Lavanya Subramanian*,
Fuel cell development program for electric vehicle
Optomechanics with atoms
داده کاوی سئوالات نمونه
Inter-system biases estimation in multi-GNSS relative positioning with GPS and Galileo Cecile Deprez and Rene Warnant University of Liege, Belgium  
10. predavanje Novac i financijski sustav
Wissenschaftliche Aussprache zur Dissertation
FLUORECENCE MICROSCOPY SUPERRESOLUTION BLINK MICROSCOPY ON THE BASIS OF ENGINEERED DARK STATES* *Christian Steinhauer, Carsten Forthmann, Jan Vogelsang,
Widow Rockfish Assessment
On Robust Neighbor Discovery in Mobile Wireless Networks
Y V =0 a V =V0 x b b V =0 z
Climate-Energy-Policy Interaction
Hui Wang†*, Canturk Isci‡, Lavanya Subramanian*,
The ABCD matrix for parabolic reflectors and its application to astigmatism free four-mirror cavities.
Measure Twice and Cut Once: Robust Dynamic Voltage Scaling for FPGAs
Factor Based Index of Systemic Stress (FISS)
THE BERRY PHASE OF A BOGOLIUBOV QUASIPARTICLE IN AN ABRIKOSOV VORTEX*
Quantum-classical transition in optical twin beams and experimental applications to quantum metrology Ivano Ruo-Berchera Frascati.
ارائه یک روش حل مبتنی بر استراتژی های تکاملی گروه بندی برای حل مسئله بسته بندی اقلام در ظروف
Online Social Networks and Media
NV centers in diamond: from quantum coherence to nanoscale MRI
פרויקט מסכם לתואר בוגר במדעים (B.Sc.) במתמטיקה שימושית
Solar Astronomy with LOFAR - First Steps
Topic 5: Sequences and Series
Limits on Anomalous WWγ and WWZ Couplings from DØ
Plan for Day 4 Skip ahead to Lesson 5, about Mechanism Construction
Free Cooling Application for Energy Savings at Purdue
Calibration: more background
Introduction to Scientific Computing
Multidimensional Poverty Measurement
The Seven Deadly Diseases
Chp9: ODE’s Numerical Solns
Liang Shang, Henan Normal University IHEP
Gil Kalai Einstein Institute of Mathematics
Hodgkin-Huxley David Wallace Croft, M.Sc. Atzori Lab, U.T. Dallas
Gravitation and Cosmology I Introduction to Cosmology
Richard Anantua (UC Berkeley)
Boolean Logic Damian Gordon.
Algorithmic Complexity
Simple Statistics on Arrays
Sorting Damian Gordon.
Python: Sorting – Selection Sort
Grade 12 Essential Math Measurement and Statistics
PseudoCode Damian Gordon.
Presentation transcript:

Simple Statistics on Arrays Damian Gordon

Minimum Value in Array So let’s say we want to express the following algorithm: Find the minimum value in an array

# PROGRAM MinVal: Age = [44, 23, 42, 33, 18, 54, 34, 16] MinVal = Age[0] for index in range(0,len(Age)): # DO if MinVal > Age[index]: # THEN MinVal = Age[index] # ENDIF; # ENDFOR; print(MinVal) # END.

Maximum Value in Array So let’s say we want to express the following algorithm: Find the maximum value in an array

# PROGRAM MaxVal: Age = [44, 23, 42, 33, 18, 54, 34, 16] MaxVal = Age[0] for index in range(0,len(Age)): # DO if MaxVal < Age[index]: # THEN MaxVal = Age[index] # ENDIF; # ENDFOR; print(MaxVal) # END.

Average Value in Array So let’s say we want to express the following algorithm: Find the average value of an array

# PROGRAM AvgVal: Age = [44, 23, 42, 33, 18, 54, 34, 16] Total = 0 for index in range(0,len(Age)): # DO Total = Total + Age[index] # ENDFOR; print(Total/len(Age)) # END.

Standard Deviation of Array So let’s say we want to express the following algorithm: Find the standard deviation of an array

# PROGRAM StdDevVal: import math #### Calculate Average ### Age = [44, 23, 42, 33, 18, 54, 34, 16] TotalAvg = 0 for index in range(0,len(Age)): # DO TotalAvg = TotalAvg + Age[index] # ENDFOR; AverageVal = TotalAvg/len(Age) #### Calculate Standard Deviation ### TotalStdDevNum = 0 StdDevNum = (Age[index] - AverageVal) * (Age[index] - AverageVal) TotalStdDevNum = TotalStdDevNum + StdDevNum print(math.sqrt(TotalStdDevNum/len(Age)-1)) # END.

etc.