In this session, we will discuss, how to calculate Spearman's correlation when two or more ranks are the same.
We have considered multiple situations, various permutations and combinations to clarify the concept.
Discrete Mathematics - Relations. ... Relations may exist between objects of the same set or between objects of two or more sets. Definition and Properties. A binary relation R from set x to y (written as x R y o r R ( x , y ) ) is a subset of the Cartesian product x × y .
Eigen values and eigen vectors engineeringshubham211
mathematics...for engineering mathematics.....learn maths...............................The individual items in a matrix are called its elements or entries.[4] Provided that they are the same size (have the same number of rows and the same number of columns), two matrices can be added or subtracted element by element. The rule for matrix multiplication, however, is that two matrices can be multiplied only when the number of columns in the first equals the number of rows in the second. Any matrix can be multiplied element-wise by a scalar from its associated field. A major application of matrices is to represent linear transformations, that is, generalizations of linear functions such as f(x) = 4x. For example, the rotation of vectors in three dimensional space is a linear transformation which can be represented by a rotation matrix R: if v is a column vector (a matrix with only one column) describing the position of a point in space, the product Rv is a column vector describing the position of that point after a rotation. The product of two transformation matrices is a matrix that represents the composition of two linear transformations. Another application of matrices is in the solution of systems of linear equations. If the matrix is square, it is possible to deduce some of its properties by computing its determinant. For example, a square matrix has an inverse if and only if its determinant is not zero. Insight into the geometry of a linear transformation is obtainable (along with other information) from the matrix's eigenvalues and eigenvectors.
Applications of matrices are found in most scientific fields. In every branch of physics, including classical mechanics, optics, electromagnetism, quantum mechanics, and quantum electrodynamics, they are used to study physical phenomena, such as the motion of rigid bodies. In computer graphics, they are used to project a 3-dimensional image onto a 2-dimensional screen. In probability theory and statistics, stochastic matrices are used to describe sets of probabilities; for instance, they are used within the PageRank algorithm that ranks the pages in a Google search.[5] Matrix calculus generalizes classical analytical notions such as derivatives and exponentials to higher dimensions.
A major branch of numerical analysis is devoted to the development of efficient algorithms for matrix computations, a subject that is centuries old and is today an expanding area of research. Matrix decomposition methods simplify computations, both theoretically and practically. Algorithms that are tailored to particular matrix structures, such as sparse matrices and near-diagonal matrices, expedite computations in finite element method and other computations. Infinite matrices occur in planetary theory and in atomic theory. A simple example of an infinite matrix is the matrix representing the derivative operator, which acts on the Taylor series of a function
...
In this session, we will discuss, how to calculate Spearman's correlation when two or more ranks are the same.
We have considered multiple situations, various permutations and combinations to clarify the concept.
Discrete Mathematics - Relations. ... Relations may exist between objects of the same set or between objects of two or more sets. Definition and Properties. A binary relation R from set x to y (written as x R y o r R ( x , y ) ) is a subset of the Cartesian product x × y .
Eigen values and eigen vectors engineeringshubham211
mathematics...for engineering mathematics.....learn maths...............................The individual items in a matrix are called its elements or entries.[4] Provided that they are the same size (have the same number of rows and the same number of columns), two matrices can be added or subtracted element by element. The rule for matrix multiplication, however, is that two matrices can be multiplied only when the number of columns in the first equals the number of rows in the second. Any matrix can be multiplied element-wise by a scalar from its associated field. A major application of matrices is to represent linear transformations, that is, generalizations of linear functions such as f(x) = 4x. For example, the rotation of vectors in three dimensional space is a linear transformation which can be represented by a rotation matrix R: if v is a column vector (a matrix with only one column) describing the position of a point in space, the product Rv is a column vector describing the position of that point after a rotation. The product of two transformation matrices is a matrix that represents the composition of two linear transformations. Another application of matrices is in the solution of systems of linear equations. If the matrix is square, it is possible to deduce some of its properties by computing its determinant. For example, a square matrix has an inverse if and only if its determinant is not zero. Insight into the geometry of a linear transformation is obtainable (along with other information) from the matrix's eigenvalues and eigenvectors.
Applications of matrices are found in most scientific fields. In every branch of physics, including classical mechanics, optics, electromagnetism, quantum mechanics, and quantum electrodynamics, they are used to study physical phenomena, such as the motion of rigid bodies. In computer graphics, they are used to project a 3-dimensional image onto a 2-dimensional screen. In probability theory and statistics, stochastic matrices are used to describe sets of probabilities; for instance, they are used within the PageRank algorithm that ranks the pages in a Google search.[5] Matrix calculus generalizes classical analytical notions such as derivatives and exponentials to higher dimensions.
A major branch of numerical analysis is devoted to the development of efficient algorithms for matrix computations, a subject that is centuries old and is today an expanding area of research. Matrix decomposition methods simplify computations, both theoretically and practically. Algorithms that are tailored to particular matrix structures, such as sparse matrices and near-diagonal matrices, expedite computations in finite element method and other computations. Infinite matrices occur in planetary theory and in atomic theory. A simple example of an infinite matrix is the matrix representing the derivative operator, which acts on the Taylor series of a function
...
Introduction to Relational algebra in DBMS - The relational algebra is explained with all the operations. Some of the examples from the textbook is also solved and explained.
DBMS Architecture
Query Executor
Buffer Manager
Storage Manager
Storage
Transaction Manager
Logging &
Recovery
Lock Manager
Buffers Lock Tables
Main Memory
User/Web Forms/Applications/DBA
query transaction
Query Optimizer
Query Rewriter
Query Parser
Files & Access Methods
Past lectures
Today’s
lecture
Many query plans to execute a SQL query
3
S UTR
SR
T
U
SR
T
U
• Even more plans: multiple algorithms to execute each operation
SR
T
U
Sort-merge
Sort-merge
hash join
Table-scan
index-scan
Table-scanindex-scan
• Compute the join of R(A,B) S(B,C) T(C,D) U(D,E)
Explain command in PostgreSQL
4
SELECT C.STATE, SUM(O.NETAMOUNT), SUM(O.TOTALAMOUNT)
FROM CUSTOMERS C
JOIN CUST_HIST CH ON C.CUSTOMERID = CH.CUSTOMERID
JOIN ORDERS O ON CH.ORDERID = O.ORDERID
GROUP BY C.STATE
Communication between operators:
iterator model
• Each physical operator implements three functions:
– Open: initializes the data structures.
– GetNext: returns the next tuple in the result.
– Close: ends the operation and frees the resources.
• It enables pipelining
• Other option: compute the result of the operator in full
and store it in disk or memory:
– inefficient.
5
Query optimization: picking the fastest plan
• Optimal approach plan
– enumerate each possible plan
– measure its performance by running it
– pick the fastest one
– What’s wrong?
• Rule-based optimization
– Use a set of pre-defined rules to generate a fast plan
• e.g., If there is an index over a table, use it for scan and join.
6
Review Definitions
• Statistics on table R:
– T(R): Number of tuples in R
– B(R): Number of blocks in R
• B(R) = T(R ) / block size
– V(R,A): Number of distinct values of attribute A in R
7
Plans to select tuples from R: σA=a(R)
• We have an unclustered index on R
• Plans:
– (Unclustered) indexed-based scan
– Table-scan (sequential access)
• Statistics on R
– B(R)=5000, T(R)=200,000
– V(R,A) = 2, one value appears in 95% of tuples.
• Unclustered indexed scan vs. table-scan ?
8
Presenter
Presentation Notes
Unclustered indexed scan vs. table-scan ?
table-scan is the winner!
Query optimization methods
• Rule-based optimizer fails
– It uses static rules
– The rules do not consider the distribution of the data.
• Cost-based optimization
– predict the cost of each plan
– search the plan space to find the fastest one
– do it efficiently
• Optimization itself should be fast!
9
Cost-based optimization
• Plan space
– which plans to consider?
– it is time consuming to explore all alternatives.
• Cost estimator
– how to estimate the cost of each plan without executing it?
– we would like to have accurate estimation
• Search algorithm
– how to search the plan space fast?
– we would like to avoid checking inefficient plans
10
Space of query plans: basic operators
• Selection
– algorithms: sequential, index-based
– Ordering
• Projection
– Ordering
• Join
– algorithms: nested loop, sort-merge, hash
– orderi ...
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
1. CS143 Notes: Relational Algebra
Book Chapters
(4th) Chapters 3.2
(5th) Chapters 2.2-3
(6th) Chapter 2.6
Things to Learn
• Relational algebra
– Select, Project, Join, . . .
Steps in Database Construction
1. Domain Analysis
2. Database design
3. Table creation: DDL
4. Load: bulk-load
5. Query and update: DML
Database query language
What is a query?
• Database jargon for question (complex word for simple concept)
• Questions to get answers from a database
– Example: Get the students who are taking all CS classes but no Physics class
• Some queries are easy to pose, some are not
• Some queries are easy for DBMS to answer, some are not
1
2. Relational query languages
• Formal: Relational algebra, relational calculus, datalog
• Practical: SQL (← relational algebra), Quel (← relational calculus), QBE (← datalog)
• Relational Query:
– Data sits in a disk
– Submit a query
– Get an answer
Input relations −→ query −→ Output relation
Excecuted against a set of relations and produces a relation
∗ Important to know
∗ Very useful: “Piping” is possible
Relational Algebra
Input relations (set) −→ query −→ Output relation (set)
• Set semantics. no duplicate tuples. duplicates are eliminated
• In contrast, multiset semantics for SQL (performance reason)
Examples to Use
• School information
– Student(sid, name, addr, age, GPA)
sid name addr age GPA
301 John 183 Westwood 19 2.1
303 Elaine 301 Wilshire 17 3.9
401 James 183 Westwood 17 3.5
208 Esther 421 Wilshire 20 3.1
– Class(dept, cnum, sec, unit, title, instructor)
dept cnum sec unit title instructor
CS 112 01 03 Modeling Dick Muntz
CS 143 01 04 DB Systems Carlo Zaniolo
EE 143 01 03 Signal Dick Muntz
ME 183 02 05 Mechanics Susan Tracey
– Enroll(sid, dept, cnum, sec)
2
3. sid dept cnum sec
301 CS 112 01
301 CS 143 01
303 EE 143 01
303 CS 112 01
401 CS 112 01
Simplest query: relation name
• Query 1: All students
SELECT operator
Select all tuples satisfying a condition
• Query 2: Students with age < 18
• Query 3: Students with GPA > 3.7 and age < 18
• Notation: σC (R)
– Filters out rows in a relation
– C: A boolean expression with attribute names, constants, comparisons (>, ≤, =, . . . )
and connectives (∧, ∨, ¬)
– R can be either a relation or a result from another operator
PROJECT operator
• Query 4: sid and GPA of all students
• Query 5: All departments offering classes
– Relational algebra removes duplicates (set semantics)
3
4. – SQL does not (multiset or bag semantics)
• Notation: πA (R)
– Filters out columns in a relation
– A: a set of attributes to keep
• Query 6: sid and GPA of all students with age < 18
– We can “compose” multiple operators
• Q: Is it ever useful to compose two projection operators next to each other?
• Q: Is it ever useful to compose two selection operators next to each other?
CROSS PRODUCT (CARTESIAN PRODUCT) operator
• Example: R × S
A B
B a1 b1
A a1 b2
a1 × b1 = a1 b3
b2
a2 a2 b1
b3
a2 b2
a2 b3
– Concatenation of tuples from both relations
– One result tuple for each pair of tuples in R and S
– If column names conflict, prefix with the table name
• Notation: R1 × R2
– R1 × R2 = {t | t = t1 , t2 for t1 ∈ R1 and t2 ∈ R2 }
• Q: Looks odd to concatenate unrelated tuples. Why use ×?
• Query 7: Names and addresses of students who take CS courses with GPA < 3
4
5. • Q: Can we write it differently?
– Benefit of RDBMS. It figures out the best way to compute.
• Q: If |R| = r and |S| = s, what is |R × S|?
NATURAL JOIN operator
• Example: Student Enroll
– Shorthand for σStudent.sid=Enroll.sid (Student × Enroll)
• Notation: R1 R2
– Concatenate tuples horizontally
– Enforce equality on common attributes
– We may assume only one copy of the common attributes are kept
• Query 8: Names of students taking CS classes
– Explanation: start with the query requiring sid, not name
• Query 9: Names of students taking classes offered by “Carlo Zaniolo”
• Natural join: The most natural way to join two tables
THETA JOIN operator
• Example: Student Student.sid=Enroll.sid∧GP A>3.7 Enroll
• Notation: R1 C R2 = σC (R1 × R2 )
• Generalization of natural join
5
6. • Often implemented as the basic operation in DBMS
RENAME operator
• Query 10: Find the pairs of student names who live in the same address.
• What about πname,name (σaddr=addr (Student × Student))?
• Notation: ρS (R) – rename R to S
• Notation: ρS(A1 ,A2 ) (R) for R(A1, A2) – rename R(A1, A2) to S(A1 , A2 )
• Q: Is πStudent.name,S.name (σStudent.addr=S.addr (Student × ρS (Student))) really correct?
– How many times (John, James) returned?
UNION operator
• Query 11: Find all student and instructor names.
– Q: Can we do it with cross product or join?
• Notation: R ∪ S
– Union of tuples from R and S
– The schemas of R and S should be the same
– No duplicate tuples in the result
DIFFERENCE operator
• Query 12: Find the courses (dept, cnum, sec) that no student is taking
– How can we find the courses that at least one student is taking?
• Notation: R − S
– Schemas of R and S must match exactly
6
7. • Query 13: What if we want to get the titles of the courses?
– Very common. To match schemas, we lose information. We have to join back.
INTERSECT operator
• Query 14: Find the instructors who teach both CS and EE courses
– Q: Can we answer this using only selection and projection?
• Notation: R ∩ S = R − (R − S)
– Draw Venn Diagram to verify
DIVISION operator
Use the boards very carefully keeping all examples.
• Division operator is not used directly by any one
• But how we compute the answer for division is very important to learn
• Learn how we computed the answer, not the operator
• Query 15: Find the student sids who take every CS class available
– Q: What will be the answer?
– Q: How can we compute it?
Give time to think about
∗ Step 1: We need to know which student is taking which class. Where do we get
the student sid and the courses they take(sid, dept, cnum, sec)?
7
8. ∗ Step 2: We also need to know all CS classes. How do we get the set of all CS
courses (dept, cnum, sec)?
∗ Step 3: What does the relation from Step 1 look like if all students take all CS
courses?
How can we compute this? Let us call this relation R
∗ Step 4: What does (R - Enroll) look like? What’s its meaning?
∗ Step 5: What is the meaning of the projection of Step 4?
∗ Step 6: How can we get the student sids who take all CS courses?
• Notation: R/S.
– Query 16: Find All A values in R such that the values appear with all B values in S.
R S
A B B
a1 b1 b1
a1 b2 b2
a2 b1
a3 b2
R ≈ students and classes they take
S ≈ all CS classes R/S ≈ All students who take all CS classes
– Formal definition:
∗ We assume R(A, B) and S(B)
∗ The set of all a ∈ R.A such that a, b ∈ R for every b ∈ S
∗ R/S = {a | a ∈ R.A and a, b ∈ R for all b ∈ S}
– Result for the example:
A
a1
– Q: How to compute it?
8
9. Ans: R/S = πA (R) − πA ((πA (R) × S) − R)
All (R.A, S.B) pairs
∗ πA (R): All A’s
∗ S: All B’s
∗ πA (R) × S: all R.A and S.B pairs
πA (R) × S − R: A, B pairs that are missing in R
πA (πA (R) × S − R): All R.A’s that do not have some S.B
– Analogy with interger division
∗ In integer: R/S is the largest integer T such that T × S ≤ R
∗ In relational algebra: R/S is the largest relation T such that T × S ⊆ R
• The division operator is not used often, but how to compute it is important
More questions
• Q: sids of students who did not take any CS courses?
– Q: Is πsid (σtitle= CS (Enroll)) correct?
– Q: What is its complement?
• General advice: When a query is difficult to write, think in terms of its comple-
ment.
Relational algebra: things to remember
• Data manipulation language (query language)
– Relation → algebra → relation
• Relational algebra: set semantics, SQL: bag semantics
• Operators: σ, ×, , ρ, ∪, −, ∩, /
• General suggestion: If difficult to write, consider its complement
9