Histogram list, 11 RANDOM NUMBERS & HISTOGRAMS. r : RandomReal. ri : RandomInteger. rd : RandomInteger 1, 6

Σχετικά έγγραφα
BarChart y 1, y 2, makes a bar chart with bar lengths y 1, y 2,.

ΕΙΣΑΓΩΓΗ ΣΤΗ ΣΤΑΤΙΣΤΙΚΗ ΑΝΑΛΥΣΗ

Δημιουργία Λογαριασμού Διαχείρισης Business Telephony Create a Management Account for Business Telephony

ST5224: Advanced Statistical Theory II

Section 9.2 Polar Equations and Graphs

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 24/3/2007

Homework 8 Model Solution Section

Matrices and Determinants

Mean bond enthalpy Standard enthalpy of formation Bond N H N N N N H O O O

SOLUTIONS TO MATH38181 EXTREME VALUES AND FINANCIAL RISK EXAM

Other Test Constructions: Likelihood Ratio & Bayes Tests

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007

Ομάδα Γ. Ο υπολογιστής ως επιστημονικό εργαλείο

Chap. 13. Exercise A few exercises from Chap. 13. n = 89; c = 2; OC B [p_] = CDF[BinomialDistribution[n, p], c];


Ομάδα Γ. Ο υπολογιστής ως επιστημονικό εργαλείο Εργασία η ιουργία γραφικών αραστάσεων ε την

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 11/3/2006


Practice Exam 2. Conceptual Questions. 1. State a Basic identity and then verify it. (a) Identity: Solution: One identity is csc(θ) = 1

Jesse Maassen and Mark Lundstrom Purdue University November 25, 2013

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006

Ηλεκτρονικοί Υπολογιστές IV

Probability and Random Processes (Part II)

Πρόβλημα 1: Αναζήτηση Ελάχιστης/Μέγιστης Τιμής

Math 6 SL Probability Distributions Practice Test Mark Scheme

w o = R 1 p. (1) R = p =. = 1

Living and Nonliving Created by: Maria Okraska

Instruction Execution Times

Solution Series 9. i=1 x i and i=1 x i.

The challenges of non-stable predicates

Partial Trace and Partial Transpose

Μηχανική Μάθηση Hypothesis Testing

b. Use the parametrization from (a) to compute the area of S a as S a ds. Be sure to substitute for ds!

DESIGN OF MACHINERY SOLUTION MANUAL h in h 4 0.

Λίστα. Το διάνυζμα (vector) στο Mathematica είναι μια λίστα που έχει τα στοιχεία. Ο πίνακας ( matrix ) είναι λίστα απο τις λίστες.

Problem Set 3: Solutions

derivation of the Laplacian from rectangular to spherical coordinates

Potential Dividers. 46 minutes. 46 marks. Page 1 of 11

Lecture 2. Soundness and completeness of propositional logic

Congruence Classes of Invertible Matrices of Order 3 over F 2

Numerical Analysis FMN011

Mock Exam 7. 1 Hong Kong Educational Publishing Company. Section A 1. Reference: HKDSE Math M Q2 (a) (1 + kx) n 1M + 1A = (1) =

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο

Overview. Transition Semantics. Configurations and the transition relation. Executions and computation

Example Sheet 3 Solutions

C.S. 430 Assignment 6, Sample Solutions

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS

η πιθανότητα επιτυχίας. Επομένως, η συνάρτηση πιθανοφάνειας είναι ίση με: ( ) 32 = p 18 1 p

Jordan Form of a Square Matrix

Answers - Worksheet A ALGEBRA PMT. 1 a = 7 b = 11 c = 1 3. e = 0.1 f = 0.3 g = 2 h = 10 i = 3 j = d = k = 3 1. = 1 or 0.5 l =

Calculating the propagation delay of coaxial cable

Solutions to Exercise Sheet 5

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:

( ) 2 and compare to M.

department listing department name αχχουντσ ϕανε βαλικτ δδσϕηασδδη σδηφγ ασκϕηλκ τεχηνιχαλ αλαν ϕουν διξ τεχηνιχαλ ϕοην µαριανι

F19MC2 Solutions 9 Complex Analysis

Inverse trigonometric functions & General Solution of Trigonometric Equations

CHAPTER 12: PERIMETER, AREA, CIRCUMFERENCE, AND 12.1 INTRODUCTION TO GEOMETRIC 12.2 PERIMETER: SQUARES, RECTANGLES,

Quadratic Expressions

Εργαστήριο 4. Άóêçóç 1. Άóêçóç 2. Χημικοί. Plot Sec x, x, 2 π, 2π. p1 Plot Abs 1 Abs x, x, 3, 3. 1 In[3]:= f x_ : 2 π. p2 Plot f x, x, 3,

Finite Field Problems: Solutions

Απλός Προγραµµατισµός στην R

Modbus basic setup notes for IO-Link AL1xxx Master Block

2 Composition. Invertible Mappings

Διαδικαστικός Προγραμματισμός

MathCity.org Merging man and maths

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο

SOLUTIONS TO MATH38181 EXTREME VALUES AND FINANCIAL RISK EXAM

Αλγόριθμοι και πολυπλοκότητα NP-Completeness (2)

Solution to Review Problems for Midterm III

Statistical Inference I Locally most powerful tests

A Note on Intuitionistic Fuzzy. Equivalence Relation

ΚΥΠΡΙΑΚΟΣ ΣΥΝΔΕΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY 21 ος ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ Δεύτερος Γύρος - 30 Μαρτίου 2011

Appendix to On the stability of a compressible axisymmetric rotating flow in a pipe. By Z. Rusak & J. H. Lee

ECON 381 SC ASSIGNMENT 2

«ΑΝΑΠΣΤΞΖ ΓΠ ΚΑΗ ΥΩΡΗΚΖ ΑΝΑΛΤΖ ΜΔΣΔΩΡΟΛΟΓΗΚΩΝ ΓΔΓΟΜΔΝΩΝ ΣΟΝ ΔΛΛΑΓΗΚΟ ΥΩΡΟ»

Photometric Data of Lamp

Supplementary Materials for Evolutionary Multiobjective Optimization Based Multimodal Optimization: Fitness Landscape Approximation and Peak Detection

ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΕΙΡΑΙΩΣ ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ. Βάσεις Δεδομένων (4 ο εξάμηνο) Εργαστήριο MySQL #2

ANSWERSHEET (TOPIC = DIFFERENTIAL CALCULUS) COLLECTION #2. h 0 h h 0 h h 0 ( ) g k = g 0 + g 1 + g g 2009 =?

1) Abstract (To be organized as: background, aim, workpackages, expected results) (300 words max) Το όριο λέξεων θα είναι ελαστικό.

m4.3 Chris Parrish June 16, 2016

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β

Reminders: linear functions

9.09. # 1. Area inside the oval limaçon r = cos θ. To graph, start with θ = 0 so r = 6. Compute dr

Nowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in

Πανεπιστήμιο Κρήτης, Τμήμα Επιστήμης Υπολογιστών Άνοιξη HΥ463 - Συστήματα Ανάκτησης Πληροφοριών Information Retrieval (IR) Systems

1 String with massive end-points

Dynamic types, Lambda calculus machines Section and Practice Problems Apr 21 22, 2016

Διάλεξη 14: Δομές Δεδομένων ΙΙI (Λίστες και Παραδείγματα)

Math221: HW# 1 solutions

= λ 1 1 e. = λ 1 =12. has the properties e 1. e 3,V(Y

Fractional Colorings and Zykov Products of graphs

ω ω ω ω ω ω+2 ω ω+2 + ω ω ω ω+2 + ω ω+1 ω ω+2 2 ω ω ω ω ω ω ω ω+1 ω ω2 ω ω2 + ω ω ω2 + ω ω ω ω2 + ω ω+1 ω ω2 + ω ω+1 + ω ω ω ω2 + ω

Comparison of Evapotranspiration between Indigenous Vegetation and Invading Vegetation in a Bog

ΗΥ-100: Εισαγωγή στην Επιστήμη Υπολογιστών 3η σειρά ασκήσεων

Uniform Convergence of Fourier Series Michael Taylor

Λογισμικά για Στατιστική Ανάλυση. Minitab, R (ελεύθερο λογισμικό), Sas, S-Plus, Stata, StatGraphics, Mathematica (εξειδικευμένο λογισμικό για

PARTIAL NOTES for 6.1 Trigonometric Identities

Srednicki Chapter 55

Transcript:

In[1]:= In[2]:= RANDOM NUMBERS & HISTOGRAMS r : RandomReal In[3]:= In[4]:= In[5]:= ri : RandomInteger In[6]:= rd : RandomInteger 1, 6 In[7]:= list Table rd rd, 100 2 dice Out[7]= 7, 11, 7, 10, 7, 8, 3, 2, 3, 5, 8, 6, 7, 11, 7, 8, 9, 5, 5, 4, 9, 10, 10, 5, 4, 5, 9, 3, 10, 4, 7, 3, 10, 6, 7, 5, 6, 5, 3, 10, 4, 4, 10, 6, 8, 9, 10, 6, 10, 5, 12, 11, 4, 9, 9, 6, 8, 3, 6, 7, 9, 10, 6, 7, 7, 10, 7, 7, 7, 4, 3, 6, 3, 6, 7, 10, 10, 10, 5, 8, 3, 9, 11, 3, 8, 8, 9, 7, 8, 5, 8, 9, 7, 7, 6, 3, 7, 8, 9, 8 In[8]:= Histogram list, 11 20 15 Out[8]= 10 5 4 6 8 10 12

2 114_histogram.nb In[9]:= Histogram list, Automatic,"Probability" 0.30 0.25 0.20 Out[9]= 0.15 0.10 0.05 In[10]:= In[11]:= 4 6 8 10 12 14 data1 RandomVariate NormalDistribution 0, 1, 500 ; Histogram data1 100 80 Out[11]= 60 40 20 In[12]:= 3 2 1 0 1 2 3 now try do it yourself bin counts and histogram In[13]:= Out[13]= 500 list data1; ll Length list In[14]:= binsize.2; del 3 2; In[15]:=

114_histogram.nb 3 In[16]:= xmin Min list ; xmax Max list ;imin Floor xmin binsize del ;imax Floor xmax binsize del ; initb : Clear b, i ; Do b i 0, i, imin, imax In[18]:= In[19]:= initb; Do ix Floor list i binsize ; b ix b ix 1;, i, Length list In[20]:= Plot b Floor x binsize, x, xmin del binsize, xmax del binsize 40 30 Out[20]= 20 10 4 3 2 1 1 2 3 In[21]:= once it worked step by step, let us try a single command

4 114_histogram.nb In[22]:= mybins data_, binsize_ : Clear i, b ; list data; del 3 2; xmin Min list ; xmax Max list ; imin Floor xmin binsize del ; imax Floor xmax binsize del ; Do b i 0, i, imin, imax ; Do ix Floor list i binsize ; b ix b ix 1;, i, Length list ; In[23]:= binsize.2; mybins data1, binsize ; Plot b Floor x binsize, x, xmin del binsize, xmax del binsize 40 30 Out[23]= 20 10 4 3 2 1 1 2 3 In[24]:= below is normalized to 1, "pdf"

114_histogram.nb 5 In[25]:= binsize.2; mybins data1, binsize ; Plot b Floor x binsize Length data1 binsize, x, xmin del binsize, xmax del binsize 0.4 0.3 Out[25]= 0.2 0.1 4 3 2 1 1 2 3 In[26]:= In[27]:= fig ; now compare with "parent" distribution In[28]:= pdf Evaluate PDF NormalDistribution 0, 1, x Out[28]= In[29]:= x2 2 2Π Show fig, Plot pdf, x, 3, 3 0.4 0.3 Out[29]= 0.2 0.1 4 3 2 1 1 2 3 In[30]:= In[31]:= In[32]:=

6 114_histogram.nb In[33]:= In[34]:= Mean and SD In[35]:= Evaluate PDF NormalDistribution 4, 1, x Out[35]= 1 2 4 x 2 2Π In[36]:= In[37]:= data3 RandomVariate NormalDistribution 4, 1, 500 ; In[38]:= In[39]:= Out[39]= Mean data3 4.02718 In[40]:= StandardDeviation data3 Out[40]= 1.0081 In[41]:= Mean data3^2 Mean data3 ^2 Out[41]= 1.01424 In[42]:= Sqrt Out[42]= 1.00709 In[43]:= almost same as SD In[44]:= In[45]:= PLOTTING WITH ERROR BARS In[46]:= take a multicolumn list "data" and cut out 3 columns: m for x, n for y, k for errors;then create yp for y error, ym for y error and blist a table of vertical lines that connect them

114_histogram.nb 7 In[47]:= mybars data_, m_, n_, k_ : xx data m ; yy data n ; ss data k ; yp yy ss; ym yy ss; blist Table xx i, ym i, xx i, yp i, i, Length xx ; Graphics Line blist 1 In[48]:= Out[48]= data 1, 2, 3, 1, 4, 9,.5,.4,.6 1, 2, 3, 1, 4, 9, 0.5, 0.4, 0.6 In[49]:= data MatrixForm Out[49]//MatrixForm= 1 2 3 1 4 9 0.5 0.4 0.6 In[50]:= Transpose data MatrixForm Out[50]//MatrixForm= 1 1 0.5 2 4 0.4 3 9 0.6

8 114_histogram.nb In[51]:= mybars data, 1, 2, 3 Out[51]= In[52]:= In[53]:= Show ListPlot Transpose xx, yy, mybars data, 1, 2, 3, AxesOrigin 0, 0, PlotRange 0, 3, 0, 10 10 8 6 Out[53]= 4 2 0.5 1.0 1.5 2.0 2.5 3.0

114_histogram.nb 9 In[54]:= Show ListPlot Transpose xx, yy, Joined True, mybars data, 1, 2, 3, AxesOrigin 0, 0, PlotRange 0, 3, 0, 10 10 8 6 Out[54]= 4 2 In[55]:= OR 0.5 1.0 1.5 2.0 2.5 3.0 In[56]:= Needs "ErrorBarPlots`" In[57]:= In[58]:= ErrorListPlot Transpose yy, ss, Joined True 8 6 Out[58]= 4 2 In[59]:= "REAL EXPERIMENT" 1.5 2.0 2.5 3.0 note Timing

10 114_histogram.nb In[60]:= Timing list Table rd rd, 100 000 ; Out[60]= 0.078001, Null In[61]:= Out[61]= Commonest list lucky 7 7 In[62]:= Histogram list 15 000 Out[62]= 10 000 5000 4 6 8 10 12 In[63]:= In[64]:= binsize 1; mybins list, binsize ; Plot b Floor x binsize, x, xmin del binsize, xmax del binsize 15 000 10 000 Out[64]= 5000 4 6 8 10 12

114_histogram.nb 11 In[65]:= Plot b Floor x binsize Length list, x, xmin del binsize, xmax del binsize 0.15 0.10 Out[65]= 0.05 4 6 8 10 12 In[66]:= In[67]:= now compare with true values i 36 for i 7 and 13 i 36 for i 7 In[68]:= In[69]:= In[70]:= In[71]:= Out[71]= In[72]:= Out[72]= Table b i Length list If i 7, i 1 36, 13 i 36, i, 12 0, 193 180 000, 931 900 000, 419 300 000, 143 900 000, 161 900 000, 11 7500, 29 180 000, 29 18 000, 11 37 500, 617 900 000, 371 900 000 N 0., 0.00107222, 0.00103444, 0.00139667, 0.000158889, 0.000178889, 0.00146667, 0.000161111, 0.00161111, 0.000293333, 0.000685556, 0.000412222 In[73]:= In[74]:= READING EXTERNAL FILES, 1st from a local directoory, then from Internet In[75]:= Out[75]= list Import "ExampleData elements.xls" 1 AtomicNumber, Abbreviation, Name, AtomicWeight, 1., H, Hydrogen, 1.00793, 2., He, Helium, 4.00259, 3., Li, Lithium, 6.94141, 4., Be, Beryllium, 9.01218, 5., B, Boron, 10.8086, 6., C, Carbon, 12.0107, 7., N, Nitrogen, 14.0067, 8., O, Oxygen, 15.9961, 9., F, Fluorine, 18.9984

12 114_histogram.nb In[76]:= list TableForm Out[76]//TableForm= AtomicNumber Abbreviation Name AtomicWeight 1. H Hydrogen 1.00793 2. He Helium 4.00259 3. Li Lithium 6.94141 4. Be Beryllium 9.01218 5. B Boron 10.8086 6. C Carbon 12.0107 7. N Nitrogen 14.0067 8. O Oxygen 15.9961 9. F Fluorine 18.9984 In[77]:= list1 Drop list, 1 Out[77]= In[78]:= Out[78]= In[79]:= 1., H, Hydrogen, 1.00793, 2., He, Helium, 4.00259, 3., Li, Lithium, 6.94141, 4., Be, Beryllium, 9.01218, 5., B, Boron, 10.8086, 6., C, Carbon, 12.0107, 7., N, Nitrogen, 14.0067, 8., O, Oxygen, 15.9961, 9., F, Fluorine, 18.9984 list1 Transpose list1 1., 2., 3., 4., 5., 6., 7., 8., 9., H, He, Li, Be, B, C, N, O, F, Hydrogen, Helium, Lithium, Beryllium, Boron, Carbon, Nitrogen, Oxygen, Fluorine, 1.00793, 4.00259, 6.94141, 9.01218, 10.8086, 12.0107, 14.0067, 15.9961, 18.9984 list1 Drop list1, 2, 3 Out[79]= In[80]:= Out[80]= 1., 2., 3., 4., 5., 6., 7., 8., 9., 1.00793, 4.00259, 6.94141, 9.01218, 10.8086, 12.0107, 14.0067, 15.9961, 18.9984 list1 Transpose list1 1., 1.00793, 2., 4.00259, 3., 6.94141, 4., 9.01218, 5., 10.8086, 6., 12.0107, 7., 14.0067, 8., 15.9961, 9., 18.9984

114_histogram.nb 13 In[81]:= ListPlot list1, AxesLabel list 1, 1, list 1, 4, LabelStyle Medium AtomicWeight 15 Out[81]= 10 5 2 4 6 8 AtomicNumber In[82]:= Out[82]= In[83]:= Out[83]= Import "http: web.njit.edu vitaly 114 114_mockdata.xlsx" 1 x, y, sig, 1., 1., 0.5, 1.5, 2.25, 0.4, 2., 4., 0.6, 2.5, 6.25, 0.5, 3., 9., 0.5 list1 Drop, 1 1., 1., 0.5, 1.5, 2.25, 0.4, 2., 4., 0.6, 2.5, 6.25, 0.5, 3., 9., 0.5 In[84]:= In[85]:= Out[85]= list1 Transpose list1 1., 1.5, 2., 2.5, 3., 1., 2.25, 4., 6.25, 9., 0.5, 0.4, 0.6, 0.5, 0.5 In[86]:= Out[86]= list2 Drop list1, 1 1., 1.5, 2., 2.5, 3., 1., 2.25, 4., 6.25, 9. In[87]:= Out[87]= list2 Transpose list2 1., 1., 1.5, 2.25, 2., 4., 2.5, 6.25, 3., 9. In[88]:= Show Plot x^2, x, 0, 3, ListPlot list2 8 6 Out[88]= 4 2 0.5 1.0 1.5 2.0 2.5 3.0 In[89]:= HW: try to add errorbars

14 114_histogram.nb In[90]:= Out[90]= Import "http: web.njit.edu vitaly 114 114_mockdata.txt", "Table" x, y, sig, 1, 1, 0.5, 1.5, 2.25, 0.4, 2, 4, 0.6, 2.5, 6.25, 0.5, 3, 9, 0.5 "Table", no 1 ; keeps integers In[91]:= Note: needs In[92]:= In[93]:=