SlideShare a Scribd company logo
Subject: Perspective in Informatics 3 – Fall Semester 2014
Professor: Davood Rafiei
Assignment No.1 HOANG Nguyen Phong
Submitted on November 3rd ID number: 6930-26-1264
Question 1 [30 marks]
• 3.5.1: on the space of nonnegative integers, which of the following functions are
distance measures? If so, prove it; if not, prove that it fails to satisfy one or more of the
axioms.
a) max(x, y) = the larger of x and y.
This function is distance measure function because of the following reasons:
• In the space of nonnegative integers as given from the beginning, the function would
never return a negative value.
• If x and y are at the same position in the space, then no larger value is defined, which
would return a null value (which is 0). That satisfies the reflexive property of distance
measure function.
• Measuring both distances from x to y and x < y, and from y to x would only return one
larger value. It satisfies the symmetric property of distance measure function.
• Let x and y are 2 separate nodes, and a is a random node (different from x and y).
Then, the triangle-inequality can be proved as shown in the below table:
3 Possible cases of a max(x,a) + max(y,a) > max(x,y) Check
a ∈ [x,y] a + y ≥ y true
a < (x,y) x + y ≥ y true
a > (x,y) a + a ≥ y true(since a≥y => 2a≥y)
• Actually, this function is the L∞-norm Euclidean distance measuring function, which is
used when x and y have many dimensions (where the dimension ~> ∞). Then, the
distance between x and y is approximately equal to the max(x,y).
b) diff(x, y) = |x − y| (the absolute magnitude of the difference between x and y).
• By proving in the same manner of the above case, this function is also a distance
measure function, because of the following reasons:
• Since the absolute-value function, it would always return a nonnegative value.
• If x and y is a same point, the function will return 0. That satisfies the reflexive
property.
• Let x and y are 2 separate nodes, and a is a random node (different from x and y).
Then, the triangle-inequality can be proved as shown in the below table:
3 Possible cases of a diff(x,a) + diff(y,a) > diff(x,y) Check
a ∈ [x,y]
(a – x) + (y – a) ≥ y – x
 y – x ≥ y – x
true
a < (x,y)
(x – a) + (y – a) > y – x
 x + y – 2a > y – x
 x > a
true (since a<x as given in
the initial condition of a )
a > (x,y) a + a > y
true(since a>y as given in
the initial condition of a
=> 2a>y)
• Actually, we can imagine that this function is a L1-norm Euclidean Distance function
for measuring x and y in 1 dimension.
c) sum(x, y) = x + y.
It is easily proved that this function is not a distance measure function, since it does not
satisfies the reflexive property. For instance, if x and y are a same point (≠0), the function
would return a positive value in lieu of 0 because they are both in nonnegative space.
1
Subject: Perspective in Informatics 3 – Fall Semester 2014
Professor: Davood Rafiei
• 3.7.2: Let us compute sketches using the following four “random” vectors:
V1= [+1,+1,+1,-1] V2=[+1,+1,-1,+1]
V3=[+1,-1,+1,+1] V4=[-1,+1,+1,+1]
Compute the sketches of the following vectors.
• [2,3,4,5]
Random vector Dot product Sketch value
V1= [+1,+1,+1,-1] 4 +1
V2=[+1,+1,-1,+1] 6 +1
V3=[+1,-1,+1,+1] 8 +1
V4=[-1,+1,+1,+1] 10 +1
(b)[-2,3,-4,5]
Random vector Dot product Sketch value
V1= [+1,+1,+1,-1] -8 -1
V2=[+1,+1,-1,+1] 10 +1
V3=[+1,-1,+1,+1] -4 -1
V4=[-1,+1,+1,+1] 6 +1
(c)[2,-3,4,-5]
Random vector Dot product Sketch value
V1= [+1,+1,+1,-1] 8 +1
V2=[+1,+1,-1,+1] -10 -1
V3=[+1,-1,+1,+1] 4 +1
V4=[-1,+1,+1,+1] -6 -1
For each pair, what is the estimated angle between them, according to the sketches? What are
the true angles?
The following 2 formulas are employed to calculate the Estimated angle and true angles:
• Estimated angle = 180O(1 – sim( Sketches of 2 vectors))
• True Angle =
𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷(𝑡𝑡ℎ𝑒𝑒 2 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣)
𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 𝑜𝑜𝑜𝑜 𝑡𝑡ℎ𝑒𝑒 2 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣
Pair Estimated angle True angles
∠ (a)(b) 90o 90o-15o=75o
∠ (b)(c) 180o 180o
∠ (a)(c) 90o 90o+15o=105o
• 3.7.3: suppose we form sketches by using all sixteen of the vectors of length 4, whose
components are each +1 or -1. Compute the sketches of the three vectors in Exercise
3.7.2.
*at dot product = 0, sketch value is randomly chosen to be 1 or +1 as highlighted in gray.
2
Subject: Perspective in Informatics 3 – Fall Semester 2014
Professor: Davood Rafiei
Vector a 2 3 4 5
Random vector dot Product Sketch value
v1 -1 -1 -1 -1 -14 -1
v2 -1 -1 -1 1 -4 -1
v3 -1 -1 1 -1 -6 -1
v4 -1 -1 1 1 4 1
v5 -1 1 -1 -1 -8 -1
v6 -1 1 -1 1 2 1
v7 -1 1 1 -1 0 1
v8 -1 1 1 1 10 1
v9 1 -1 -1 -1 -10 -1
v10 1 -1 -1 1 0 -1
v11 1 -1 1 -1 -2 -1
v12 1 -1 1 1 8 1
v13 1 1 -1 -1 -4 -1
v14 1 1 -1 1 6 1
v15 1 1 1 -1 4 1
v16 1 1 1 1 14 1
Vector b -2 3 -4 5
Random vector dot Product Sketch value
v1 -1 -1 -1 -1 -2 -1
v2 -1 -1 -1 1 8 1
v3 -1 -1 1 -1 -10 -1
v4 -1 -1 1 1 0 -1
v5 -1 1 -1 -1 4 1
v6 -1 1 -1 1 14 1
v7 -1 1 1 -1 -4 -1
v8 -1 1 1 1 6 1
v9 1 -1 -1 -1 -6 -1
v10 1 -1 -1 1 4 1
v11 1 -1 1 -1 -14 -1
v12 1 -1 1 1 -4 -1
v13 1 1 -1 -1 0 1
v14 1 1 -1 1 10 1
v15 1 1 1 -1 -8 -1
v16 1 1 1 1 2 1
3
Subject: Perspective in Informatics 3 – Fall Semester 2014
Professor: Davood Rafiei
Vector c 2 -3 4 -5
Random vector dot Product Sketch value
v1 -1 -1 -1 -1 2 1
v2 -1 -1 -1 1 -8 -1
v3 -1 -1 1 -1 10 1
v4 -1 -1 1 1 0 1
v5 -1 1 -1 -1 -4 -1
v6 -1 1 -1 1 -14 -1
v7 -1 1 1 -1 4 1
v8 -1 1 1 1 -6 -1
v9 1 -1 -1 -1 6 1
v10 1 -1 -1 1 -4 -1
v11 1 -1 1 -1 14 1
v12 1 -1 1 1 4 1
v13 1 1 -1 -1 0 -1
v14 1 1 -1 1 -10 -1
v15 1 1 1 -1 8 1
v16 1 1 1 1 -2 -1
How do the estimates of the angles between each pair compare with the true angles?
Pair Estimated angle True angles
∠ (a)(b) ½ => 90o 90o-15o=75o
∠ (b)(c) 11/12 => approximate 180o 180o
∠ (a)(c) ½ => 90o 90o+15o=105o
Then it can be deduced that even all of 16 random vectors are chosen, the estimates of the
angles between each pair compare with the true angles do not change compared with the result
in problem 3.7.2.
4
Subject: Perspective in Informatics 3 – Fall Semester 2014
Professor: Davood Rafiei
Question 2 [10 marks] 3.7.4(A): Suppose we form sketches using the four vectors from
Exercise 3.7.2. What are the constrains on a, b, c, and d that will cause the sketch of the vector
[a, b, c, d] to be [+1,+1,+1,+1]? (write your constrains in as simple form as possible)
The dot products of four random vectors and [a, b, c, d] can be represented in form of matrix as
following equation:
�
1 1 1 −1
1 1 −1 1
1 −1 1 1
−1 1 1 1
�。 �
𝑎𝑎
𝑏𝑏
𝑐𝑐
𝑑𝑑
� = �
𝑥𝑥1
𝑥𝑥2
𝑥𝑥3
𝑥𝑥4
�
the sketch of [a, b, c, d] is [+1 , +1, +1, +1] where all of x1,x2,x3,x4 ≥ 0
�
1 1 1 −1
1 1 −1 1
1 −1 1 1
−1 1 1 1
�
−1
�
1 1 1 −1
1 1 −1 1
1 −1 1 1
−1 1 1 1
�。 �
𝑎𝑎
𝑏𝑏
𝑐𝑐
𝑑𝑑
� = �
1 1 1 −1
1 1 −1 1
1 −1 1 1
−1 1 1 1
�
−1
�
𝑥𝑥1
𝑥𝑥2
𝑥𝑥3
𝑥𝑥4
�
�
𝑎𝑎
𝑏𝑏
𝑐𝑐
𝑑𝑑
� = �
1 1 1 −1
1 1 −1 1
1 −1 1 1
−1 1 1 1
�
−1
�
𝑥𝑥1
𝑥𝑥2
𝑥𝑥3
𝑥𝑥4
�
We have�
1 1 1 −1
1 1 −1 1
1 −1 1 1
−1 1 1 1
�
−1
=
1
4
�
1 1 1 −1
1 1 −1 1
1 −1 1 1
−1 1 1 1
�
So a, b, a and d can be constrained by the following equation:
�
𝑎𝑎
𝑏𝑏
𝑐𝑐
𝑑𝑑
� =
1
4
�
1 1 1 −1
1 1 −1 1
1 −1 1 1
−1 1 1 1
� �
𝑥𝑥1
𝑥𝑥2
𝑥𝑥3
𝑥𝑥4
� where x1,x2,x3,x4 ≥ 0�
𝑎𝑎 + 𝑏𝑏 + 𝑐𝑐 − 𝑑𝑑 ≥ 0
𝑎𝑎 + 𝑏𝑏 − 𝑐𝑐 + 𝑑𝑑 ≥ 0
𝑎𝑎 − 𝑏𝑏 + 𝑐𝑐 + 𝑑𝑑 ≥ 0
−𝑎𝑎 + 𝑏𝑏 + 𝑐𝑐 + 𝑑𝑑 ≥ 0
5
Subject: Perspective in Informatics 3 – Fall Semester 2014
Professor: Davood Rafiei
Question 3 [10 marks]
a) Consider a universe U with n elements, and let R and S be subsets of U both of size m,
chosen uniformly at random.
What is the expected value of the Jaccard similarity of R and S?
The Expectation of an event x is calculated as Ε(x) = ∑x. P(x)
In this case, Jaccard Similarity of R and S is calculated as:
Sim(R,S)=
|𝑅𝑅⋂𝑆𝑆|
|𝑅𝑅⋃𝑆𝑆|
=
𝑘𝑘
2𝑚𝑚−𝑘𝑘
(𝑤𝑤ℎ𝑒𝑒𝑒𝑒𝑒𝑒 0 ≤ 𝑘𝑘 ≤ 𝑚𝑚 𝑖𝑖𝑖𝑖 𝑡𝑡ℎ𝑒𝑒 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑜𝑜𝑜𝑜 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑒𝑒𝑒𝑒𝑒𝑒 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏 𝑅𝑅 𝑎𝑎𝑎𝑎𝑎𝑎 𝑆𝑆)
Next, the probability of Sim(R,S) is calculated as following:
P(sim(R,S)=(
𝑘𝑘
2𝑚𝑚−𝑘𝑘
))=
𝐶𝐶 𝑚𝑚
𝑘𝑘 𝐶𝐶𝑛𝑛−𝑚𝑚
𝑚𝑚−𝑘𝑘
𝐶𝐶𝑛𝑛
𝑚𝑚
Since:
• To create set R, we combine m element(s) from n elements of the universal set U. It is
calculated as: 𝐶𝐶𝑛𝑛
𝑚𝑚
• Next, to create set S, we need to take k common element(s) from set R first, which is
calculated as 𝐶𝐶𝑚𝑚
𝑘𝑘
. Then the left (m-k) element(s) are chosen from (n-m) elements, since
m element(s) have been chosen to create set R at the beginning. The formula is:
𝐶𝐶𝑛𝑛−𝑚𝑚
𝑚𝑚−𝑘𝑘
As a result, Expectation of Jaccard Similarity sim(S,T) is estimated as:
E(sim(S,T))=∑
𝑘𝑘
2𝑚𝑚−𝑘𝑘
𝐶𝐶 𝑚𝑚
𝑘𝑘
𝐶𝐶𝑛𝑛−𝑚𝑚
𝑚𝑚−𝑘𝑘
𝐶𝐶𝑛𝑛
𝑚𝑚 =𝑚𝑚
𝑘𝑘=0 ∑
𝑘𝑘
2𝑚𝑚−𝑘𝑘
�
𝑚𝑚
𝑘𝑘��
𝑛𝑛−𝑚𝑚
𝑚𝑚−𝑘𝑘�
� 𝑛𝑛
𝑚𝑚�
𝑚𝑚
𝑘𝑘=0
b) How does your answer to part (a) change if R and S must include a certain element (say z)
of U?
It means k ~> z, then the answer is changed to be:
E(sim(S,T))=∑
𝑧𝑧
2𝑚𝑚−𝑧𝑧
𝐶𝐶 𝑚𝑚
𝑧𝑧
𝐶𝐶𝑛𝑛−𝑚𝑚
𝑚𝑚−𝑧𝑧
𝐶𝐶𝑛𝑛
𝑚𝑚 =𝑧𝑧
𝑘𝑘=0 ∑
𝑧𝑧
2𝑚𝑚−𝑧𝑧
� 𝑚𝑚
𝑧𝑧 �� 𝑛𝑛−𝑚𝑚
𝑚𝑚−𝑧𝑧�
� 𝑛𝑛
𝑚𝑚�
𝑧𝑧
𝑘𝑘=0
c) How does your answer to part (a) change if R and S must be disjoint?
It means k=0, then the answer is changed to be:
E(sim(S,T))=∑
𝑘𝑘
2𝑚𝑚−𝑘𝑘
𝐶𝐶 𝑚𝑚
𝑘𝑘
𝐶𝐶𝑛𝑛−𝑚𝑚
𝑚𝑚−𝑘𝑘
𝐶𝐶𝑛𝑛
𝑚𝑚 =0
𝑘𝑘=0 0
6

More Related Content

What's hot

Poisson lecture
Poisson lecturePoisson lecture
Poisson lecture
jillmitchell8778
 
東京都市大学 データ解析入門 2 行列分解 1
東京都市大学 データ解析入門 2 行列分解 1東京都市大学 データ解析入門 2 行列分解 1
東京都市大学 データ解析入門 2 行列分解 1
hirokazutanaka
 
Monte Carlo Statistical Methods
Monte Carlo Statistical MethodsMonte Carlo Statistical Methods
Monte Carlo Statistical Methods
Christian Robert
 
Change of base hm3 (2019)
Change of base hm3 (2019)Change of base hm3 (2019)
Change of base hm3 (2019)
Ron Eick
 
Application of Derivative Class 12th Best Project by Shubham prasad
Application of Derivative Class 12th Best Project by Shubham prasadApplication of Derivative Class 12th Best Project by Shubham prasad
Application of Derivative Class 12th Best Project by Shubham prasad
Shubham Prasad
 
Chap 4 markov chains
Chap 4   markov chainsChap 4   markov chains
Chap 4 markov chains
Phuoc Hung Nguyen
 
PRML輪読#2
PRML輪読#2PRML輪読#2
PRML輪読#2
matsuolab
 
introductino to persistent homology and topological data analysis
introductino to persistent homology and topological data analysisintroductino to persistent homology and topological data analysis
introductino to persistent homology and topological data analysis
Tatsuki SHIMIZU
 
Stat 2153 Stochastic Process and Markov chain
Stat 2153 Stochastic Process and Markov chainStat 2153 Stochastic Process and Markov chain
Stat 2153 Stochastic Process and Markov chain
Khulna University
 
PCA (Principal component analysis)
PCA (Principal component analysis)PCA (Principal component analysis)
PCA (Principal component analysis)
Learnbay Datascience
 
Donutsプロコンチャレンジ 2015 解説
Donutsプロコンチャレンジ 2015 解説Donutsプロコンチャレンジ 2015 解説
Donutsプロコンチャレンジ 2015 解説
kuno4n
 
Roots of equations
Roots of equations Roots of equations
Roots of equations
shopnohinami
 
Aaex5 group2(中英夾雜)
Aaex5 group2(中英夾雜)Aaex5 group2(中英夾雜)
Aaex5 group2(中英夾雜)Shiang-Yun Yang
 
Business statistics review
Business statistics reviewBusiness statistics review
Business statistics reviewFELIXARCHER
 
6 binomial theorem
6 binomial theorem6 binomial theorem
6 binomial theoremmath123c
 
Aaex6 group2(中英夾雜)
Aaex6 group2(中英夾雜)Aaex6 group2(中英夾雜)
Aaex6 group2(中英夾雜)Shiang-Yun Yang
 
Accelerating Dynamic Time Warping Subsequence Search with GPU
Accelerating Dynamic Time Warping Subsequence Search with GPUAccelerating Dynamic Time Warping Subsequence Search with GPU
Accelerating Dynamic Time Warping Subsequence Search with GPU
Davide Nardone
 
Statistics project on comparison of two batsmen
Statistics project on comparison of two batsmenStatistics project on comparison of two batsmen
Statistics project on comparison of two batsmen
VIsva Bharati University
 
Transformations advanced
Transformations advancedTransformations advanced
Transformations advanced
AVINASH JURIANI
 
Application of Derivatives
Application of DerivativesApplication of Derivatives
Application of Derivatives
Abdullah Al Mamun
 

What's hot (20)

Poisson lecture
Poisson lecturePoisson lecture
Poisson lecture
 
東京都市大学 データ解析入門 2 行列分解 1
東京都市大学 データ解析入門 2 行列分解 1東京都市大学 データ解析入門 2 行列分解 1
東京都市大学 データ解析入門 2 行列分解 1
 
Monte Carlo Statistical Methods
Monte Carlo Statistical MethodsMonte Carlo Statistical Methods
Monte Carlo Statistical Methods
 
Change of base hm3 (2019)
Change of base hm3 (2019)Change of base hm3 (2019)
Change of base hm3 (2019)
 
Application of Derivative Class 12th Best Project by Shubham prasad
Application of Derivative Class 12th Best Project by Shubham prasadApplication of Derivative Class 12th Best Project by Shubham prasad
Application of Derivative Class 12th Best Project by Shubham prasad
 
Chap 4 markov chains
Chap 4   markov chainsChap 4   markov chains
Chap 4 markov chains
 
PRML輪読#2
PRML輪読#2PRML輪読#2
PRML輪読#2
 
introductino to persistent homology and topological data analysis
introductino to persistent homology and topological data analysisintroductino to persistent homology and topological data analysis
introductino to persistent homology and topological data analysis
 
Stat 2153 Stochastic Process and Markov chain
Stat 2153 Stochastic Process and Markov chainStat 2153 Stochastic Process and Markov chain
Stat 2153 Stochastic Process and Markov chain
 
PCA (Principal component analysis)
PCA (Principal component analysis)PCA (Principal component analysis)
PCA (Principal component analysis)
 
Donutsプロコンチャレンジ 2015 解説
Donutsプロコンチャレンジ 2015 解説Donutsプロコンチャレンジ 2015 解説
Donutsプロコンチャレンジ 2015 解説
 
Roots of equations
Roots of equations Roots of equations
Roots of equations
 
Aaex5 group2(中英夾雜)
Aaex5 group2(中英夾雜)Aaex5 group2(中英夾雜)
Aaex5 group2(中英夾雜)
 
Business statistics review
Business statistics reviewBusiness statistics review
Business statistics review
 
6 binomial theorem
6 binomial theorem6 binomial theorem
6 binomial theorem
 
Aaex6 group2(中英夾雜)
Aaex6 group2(中英夾雜)Aaex6 group2(中英夾雜)
Aaex6 group2(中英夾雜)
 
Accelerating Dynamic Time Warping Subsequence Search with GPU
Accelerating Dynamic Time Warping Subsequence Search with GPUAccelerating Dynamic Time Warping Subsequence Search with GPU
Accelerating Dynamic Time Warping Subsequence Search with GPU
 
Statistics project on comparison of two batsmen
Statistics project on comparison of two batsmenStatistics project on comparison of two batsmen
Statistics project on comparison of two batsmen
 
Transformations advanced
Transformations advancedTransformations advanced
Transformations advanced
 
Application of Derivatives
Application of DerivativesApplication of Derivatives
Application of Derivatives
 

Similar to Perspective in Informatics 3 - Assignment 1 - Answer Sheet

Unit-2 raster scan graphics,line,circle and polygon algorithms
Unit-2 raster scan graphics,line,circle and polygon algorithmsUnit-2 raster scan graphics,line,circle and polygon algorithms
Unit-2 raster scan graphics,line,circle and polygon algorithms
Amol Gaikwad
 
Proyecto grupal algebra parcial ii
Proyecto grupal algebra parcial iiProyecto grupal algebra parcial ii
Proyecto grupal algebra parcial ii
JHANDRYALCIVARGUAJAL
 
Vectores clase2
Vectores clase2Vectores clase2
Vectores clase2
PSM Valencia
 
The Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math PrimerThe Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math Primer
Janie Clayton
 
Study on Fundamentals of Raster Scan Graphics
Study on Fundamentals of Raster Scan GraphicsStudy on Fundamentals of Raster Scan Graphics
Study on Fundamentals of Raster Scan Graphics
Chandrakant Divate
 
M01L01 Advance Engineering Mathematics.pptx
M01L01 Advance Engineering Mathematics.pptxM01L01 Advance Engineering Mathematics.pptx
M01L01 Advance Engineering Mathematics.pptx
SaurabhKalita5
 
Motion in a plane
Motion in a planeMotion in a plane
Motion in a plane
VIDYAGAUDE
 
Chapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptxChapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptx
Kokebe2
 
Nonparametric approach to multiple regression
Nonparametric approach to multiple regressionNonparametric approach to multiple regression
Nonparametric approach to multiple regression
Alexander Decker
 
Ch4
Ch4Ch4
GATE Engineering Maths : Vector Calculus
GATE Engineering Maths : Vector CalculusGATE Engineering Maths : Vector Calculus
GATE Engineering Maths : Vector Calculus
ParthDave57
 
Matrix algebra in_r
Matrix algebra in_rMatrix algebra in_r
Matrix algebra in_r
Razzaqe
 
Lesson 1: Vectors and Scalars
Lesson 1: Vectors and ScalarsLesson 1: Vectors and Scalars
Lesson 1: Vectors and Scalars
VectorKing
 
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohichapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
54MahakBansal
 
April 10, 2015
April 10, 2015April 10, 2015
April 10, 2015khyps13
 
Matlab polynimials and curve fitting
Matlab polynimials and curve fittingMatlab polynimials and curve fitting
Matlab polynimials and curve fitting
Ameen San
 
IVS-B UNIT-1_merged. Semester 2 fundamental of sciencepdf
IVS-B UNIT-1_merged. Semester 2 fundamental of sciencepdfIVS-B UNIT-1_merged. Semester 2 fundamental of sciencepdf
IVS-B UNIT-1_merged. Semester 2 fundamental of sciencepdf
42Rnu
 

Similar to Perspective in Informatics 3 - Assignment 1 - Answer Sheet (20)

Unit-2 raster scan graphics,line,circle and polygon algorithms
Unit-2 raster scan graphics,line,circle and polygon algorithmsUnit-2 raster scan graphics,line,circle and polygon algorithms
Unit-2 raster scan graphics,line,circle and polygon algorithms
 
Proyecto grupal algebra parcial ii
Proyecto grupal algebra parcial iiProyecto grupal algebra parcial ii
Proyecto grupal algebra parcial ii
 
Vectores clase2
Vectores clase2Vectores clase2
Vectores clase2
 
The Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math PrimerThe Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math Primer
 
Study on Fundamentals of Raster Scan Graphics
Study on Fundamentals of Raster Scan GraphicsStudy on Fundamentals of Raster Scan Graphics
Study on Fundamentals of Raster Scan Graphics
 
M01L01 Advance Engineering Mathematics.pptx
M01L01 Advance Engineering Mathematics.pptxM01L01 Advance Engineering Mathematics.pptx
M01L01 Advance Engineering Mathematics.pptx
 
Motion in a plane
Motion in a planeMotion in a plane
Motion in a plane
 
Chapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptxChapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptx
 
Nonparametric approach to multiple regression
Nonparametric approach to multiple regressionNonparametric approach to multiple regression
Nonparametric approach to multiple regression
 
Ch4
Ch4Ch4
Ch4
 
Fst ch2 notes
Fst ch2 notesFst ch2 notes
Fst ch2 notes
 
GATE Engineering Maths : Vector Calculus
GATE Engineering Maths : Vector CalculusGATE Engineering Maths : Vector Calculus
GATE Engineering Maths : Vector Calculus
 
Matrix algebra in_r
Matrix algebra in_rMatrix algebra in_r
Matrix algebra in_r
 
Lesson 1: Vectors and Scalars
Lesson 1: Vectors and ScalarsLesson 1: Vectors and Scalars
Lesson 1: Vectors and Scalars
 
Fst ch3 notes
Fst ch3 notesFst ch3 notes
Fst ch3 notes
 
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohichapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
 
April 10, 2015
April 10, 2015April 10, 2015
April 10, 2015
 
B.Tech-II_Unit-V
B.Tech-II_Unit-VB.Tech-II_Unit-V
B.Tech-II_Unit-V
 
Matlab polynimials and curve fitting
Matlab polynimials and curve fittingMatlab polynimials and curve fitting
Matlab polynimials and curve fitting
 
IVS-B UNIT-1_merged. Semester 2 fundamental of sciencepdf
IVS-B UNIT-1_merged. Semester 2 fundamental of sciencepdfIVS-B UNIT-1_merged. Semester 2 fundamental of sciencepdf
IVS-B UNIT-1_merged. Semester 2 fundamental of sciencepdf
 

More from Hoang Nguyen Phong

Perspective in Informatics 3 - Assignment 2 - marked answers
Perspective in Informatics 3 - Assignment 2 - marked answersPerspective in Informatics 3 - Assignment 2 - marked answers
Perspective in Informatics 3 - Assignment 2 - marked answers
Hoang Nguyen Phong
 
Perspective in Informatics 3 - Assignment 2 - Answer Sheet
Perspective in Informatics 3 - Assignment 2 - Answer SheetPerspective in Informatics 3 - Assignment 2 - Answer Sheet
Perspective in Informatics 3 - Assignment 2 - Answer Sheet
Hoang Nguyen Phong
 
Perspective in Informatics 3 - Assignment 2
Perspective in Informatics 3 - Assignment 2Perspective in Informatics 3 - Assignment 2
Perspective in Informatics 3 - Assignment 2
Hoang Nguyen Phong
 
Perspective in Informatics 3 - Assignment 1 - marked answers
Perspective in Informatics 3 - Assignment 1 - marked answersPerspective in Informatics 3 - Assignment 1 - marked answers
Perspective in Informatics 3 - Assignment 1 - marked answers
Hoang Nguyen Phong
 
Perspective in Informatics 3 - Assignment 1
Perspective in Informatics 3 - Assignment 1Perspective in Informatics 3 - Assignment 1
Perspective in Informatics 3 - Assignment 1
Hoang Nguyen Phong
 

More from Hoang Nguyen Phong (6)

Perspective in Informatics 3 - Assignment 2 - marked answers
Perspective in Informatics 3 - Assignment 2 - marked answersPerspective in Informatics 3 - Assignment 2 - marked answers
Perspective in Informatics 3 - Assignment 2 - marked answers
 
Perspective in Informatics 3 - Assignment 2 - Answer Sheet
Perspective in Informatics 3 - Assignment 2 - Answer SheetPerspective in Informatics 3 - Assignment 2 - Answer Sheet
Perspective in Informatics 3 - Assignment 2 - Answer Sheet
 
Perspective in Informatics 3 - Assignment 2
Perspective in Informatics 3 - Assignment 2Perspective in Informatics 3 - Assignment 2
Perspective in Informatics 3 - Assignment 2
 
Perspective in Informatics 3 - Assignment 1 - marked answers
Perspective in Informatics 3 - Assignment 1 - marked answersPerspective in Informatics 3 - Assignment 1 - marked answers
Perspective in Informatics 3 - Assignment 1 - marked answers
 
Perspective in Informatics 3 - Assignment 1
Perspective in Informatics 3 - Assignment 1Perspective in Informatics 3 - Assignment 1
Perspective in Informatics 3 - Assignment 1
 
Outline
OutlineOutline
Outline
 

Recently uploaded

Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 

Recently uploaded (20)

Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 

Perspective in Informatics 3 - Assignment 1 - Answer Sheet

  • 1. Subject: Perspective in Informatics 3 – Fall Semester 2014 Professor: Davood Rafiei Assignment No.1 HOANG Nguyen Phong Submitted on November 3rd ID number: 6930-26-1264 Question 1 [30 marks] • 3.5.1: on the space of nonnegative integers, which of the following functions are distance measures? If so, prove it; if not, prove that it fails to satisfy one or more of the axioms. a) max(x, y) = the larger of x and y. This function is distance measure function because of the following reasons: • In the space of nonnegative integers as given from the beginning, the function would never return a negative value. • If x and y are at the same position in the space, then no larger value is defined, which would return a null value (which is 0). That satisfies the reflexive property of distance measure function. • Measuring both distances from x to y and x < y, and from y to x would only return one larger value. It satisfies the symmetric property of distance measure function. • Let x and y are 2 separate nodes, and a is a random node (different from x and y). Then, the triangle-inequality can be proved as shown in the below table: 3 Possible cases of a max(x,a) + max(y,a) > max(x,y) Check a ∈ [x,y] a + y ≥ y true a < (x,y) x + y ≥ y true a > (x,y) a + a ≥ y true(since a≥y => 2a≥y) • Actually, this function is the L∞-norm Euclidean distance measuring function, which is used when x and y have many dimensions (where the dimension ~> ∞). Then, the distance between x and y is approximately equal to the max(x,y). b) diff(x, y) = |x − y| (the absolute magnitude of the difference between x and y). • By proving in the same manner of the above case, this function is also a distance measure function, because of the following reasons: • Since the absolute-value function, it would always return a nonnegative value. • If x and y is a same point, the function will return 0. That satisfies the reflexive property. • Let x and y are 2 separate nodes, and a is a random node (different from x and y). Then, the triangle-inequality can be proved as shown in the below table: 3 Possible cases of a diff(x,a) + diff(y,a) > diff(x,y) Check a ∈ [x,y] (a – x) + (y – a) ≥ y – x  y – x ≥ y – x true a < (x,y) (x – a) + (y – a) > y – x  x + y – 2a > y – x  x > a true (since a<x as given in the initial condition of a ) a > (x,y) a + a > y true(since a>y as given in the initial condition of a => 2a>y) • Actually, we can imagine that this function is a L1-norm Euclidean Distance function for measuring x and y in 1 dimension. c) sum(x, y) = x + y. It is easily proved that this function is not a distance measure function, since it does not satisfies the reflexive property. For instance, if x and y are a same point (≠0), the function would return a positive value in lieu of 0 because they are both in nonnegative space. 1
  • 2. Subject: Perspective in Informatics 3 – Fall Semester 2014 Professor: Davood Rafiei • 3.7.2: Let us compute sketches using the following four “random” vectors: V1= [+1,+1,+1,-1] V2=[+1,+1,-1,+1] V3=[+1,-1,+1,+1] V4=[-1,+1,+1,+1] Compute the sketches of the following vectors. • [2,3,4,5] Random vector Dot product Sketch value V1= [+1,+1,+1,-1] 4 +1 V2=[+1,+1,-1,+1] 6 +1 V3=[+1,-1,+1,+1] 8 +1 V4=[-1,+1,+1,+1] 10 +1 (b)[-2,3,-4,5] Random vector Dot product Sketch value V1= [+1,+1,+1,-1] -8 -1 V2=[+1,+1,-1,+1] 10 +1 V3=[+1,-1,+1,+1] -4 -1 V4=[-1,+1,+1,+1] 6 +1 (c)[2,-3,4,-5] Random vector Dot product Sketch value V1= [+1,+1,+1,-1] 8 +1 V2=[+1,+1,-1,+1] -10 -1 V3=[+1,-1,+1,+1] 4 +1 V4=[-1,+1,+1,+1] -6 -1 For each pair, what is the estimated angle between them, according to the sketches? What are the true angles? The following 2 formulas are employed to calculate the Estimated angle and true angles: • Estimated angle = 180O(1 – sim( Sketches of 2 vectors)) • True Angle = 𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷(𝑡𝑡ℎ𝑒𝑒 2 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣) 𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 𝑜𝑜𝑜𝑜 𝑡𝑡ℎ𝑒𝑒 2 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣 Pair Estimated angle True angles ∠ (a)(b) 90o 90o-15o=75o ∠ (b)(c) 180o 180o ∠ (a)(c) 90o 90o+15o=105o • 3.7.3: suppose we form sketches by using all sixteen of the vectors of length 4, whose components are each +1 or -1. Compute the sketches of the three vectors in Exercise 3.7.2. *at dot product = 0, sketch value is randomly chosen to be 1 or +1 as highlighted in gray. 2
  • 3. Subject: Perspective in Informatics 3 – Fall Semester 2014 Professor: Davood Rafiei Vector a 2 3 4 5 Random vector dot Product Sketch value v1 -1 -1 -1 -1 -14 -1 v2 -1 -1 -1 1 -4 -1 v3 -1 -1 1 -1 -6 -1 v4 -1 -1 1 1 4 1 v5 -1 1 -1 -1 -8 -1 v6 -1 1 -1 1 2 1 v7 -1 1 1 -1 0 1 v8 -1 1 1 1 10 1 v9 1 -1 -1 -1 -10 -1 v10 1 -1 -1 1 0 -1 v11 1 -1 1 -1 -2 -1 v12 1 -1 1 1 8 1 v13 1 1 -1 -1 -4 -1 v14 1 1 -1 1 6 1 v15 1 1 1 -1 4 1 v16 1 1 1 1 14 1 Vector b -2 3 -4 5 Random vector dot Product Sketch value v1 -1 -1 -1 -1 -2 -1 v2 -1 -1 -1 1 8 1 v3 -1 -1 1 -1 -10 -1 v4 -1 -1 1 1 0 -1 v5 -1 1 -1 -1 4 1 v6 -1 1 -1 1 14 1 v7 -1 1 1 -1 -4 -1 v8 -1 1 1 1 6 1 v9 1 -1 -1 -1 -6 -1 v10 1 -1 -1 1 4 1 v11 1 -1 1 -1 -14 -1 v12 1 -1 1 1 -4 -1 v13 1 1 -1 -1 0 1 v14 1 1 -1 1 10 1 v15 1 1 1 -1 -8 -1 v16 1 1 1 1 2 1 3
  • 4. Subject: Perspective in Informatics 3 – Fall Semester 2014 Professor: Davood Rafiei Vector c 2 -3 4 -5 Random vector dot Product Sketch value v1 -1 -1 -1 -1 2 1 v2 -1 -1 -1 1 -8 -1 v3 -1 -1 1 -1 10 1 v4 -1 -1 1 1 0 1 v5 -1 1 -1 -1 -4 -1 v6 -1 1 -1 1 -14 -1 v7 -1 1 1 -1 4 1 v8 -1 1 1 1 -6 -1 v9 1 -1 -1 -1 6 1 v10 1 -1 -1 1 -4 -1 v11 1 -1 1 -1 14 1 v12 1 -1 1 1 4 1 v13 1 1 -1 -1 0 -1 v14 1 1 -1 1 -10 -1 v15 1 1 1 -1 8 1 v16 1 1 1 1 -2 -1 How do the estimates of the angles between each pair compare with the true angles? Pair Estimated angle True angles ∠ (a)(b) ½ => 90o 90o-15o=75o ∠ (b)(c) 11/12 => approximate 180o 180o ∠ (a)(c) ½ => 90o 90o+15o=105o Then it can be deduced that even all of 16 random vectors are chosen, the estimates of the angles between each pair compare with the true angles do not change compared with the result in problem 3.7.2. 4
  • 5. Subject: Perspective in Informatics 3 – Fall Semester 2014 Professor: Davood Rafiei Question 2 [10 marks] 3.7.4(A): Suppose we form sketches using the four vectors from Exercise 3.7.2. What are the constrains on a, b, c, and d that will cause the sketch of the vector [a, b, c, d] to be [+1,+1,+1,+1]? (write your constrains in as simple form as possible) The dot products of four random vectors and [a, b, c, d] can be represented in form of matrix as following equation: � 1 1 1 −1 1 1 −1 1 1 −1 1 1 −1 1 1 1 �。 � 𝑎𝑎 𝑏𝑏 𝑐𝑐 𝑑𝑑 � = � 𝑥𝑥1 𝑥𝑥2 𝑥𝑥3 𝑥𝑥4 � the sketch of [a, b, c, d] is [+1 , +1, +1, +1] where all of x1,x2,x3,x4 ≥ 0 � 1 1 1 −1 1 1 −1 1 1 −1 1 1 −1 1 1 1 � −1 � 1 1 1 −1 1 1 −1 1 1 −1 1 1 −1 1 1 1 �。 � 𝑎𝑎 𝑏𝑏 𝑐𝑐 𝑑𝑑 � = � 1 1 1 −1 1 1 −1 1 1 −1 1 1 −1 1 1 1 � −1 � 𝑥𝑥1 𝑥𝑥2 𝑥𝑥3 𝑥𝑥4 � � 𝑎𝑎 𝑏𝑏 𝑐𝑐 𝑑𝑑 � = � 1 1 1 −1 1 1 −1 1 1 −1 1 1 −1 1 1 1 � −1 � 𝑥𝑥1 𝑥𝑥2 𝑥𝑥3 𝑥𝑥4 � We have� 1 1 1 −1 1 1 −1 1 1 −1 1 1 −1 1 1 1 � −1 = 1 4 � 1 1 1 −1 1 1 −1 1 1 −1 1 1 −1 1 1 1 � So a, b, a and d can be constrained by the following equation: � 𝑎𝑎 𝑏𝑏 𝑐𝑐 𝑑𝑑 � = 1 4 � 1 1 1 −1 1 1 −1 1 1 −1 1 1 −1 1 1 1 � � 𝑥𝑥1 𝑥𝑥2 𝑥𝑥3 𝑥𝑥4 � where x1,x2,x3,x4 ≥ 0� 𝑎𝑎 + 𝑏𝑏 + 𝑐𝑐 − 𝑑𝑑 ≥ 0 𝑎𝑎 + 𝑏𝑏 − 𝑐𝑐 + 𝑑𝑑 ≥ 0 𝑎𝑎 − 𝑏𝑏 + 𝑐𝑐 + 𝑑𝑑 ≥ 0 −𝑎𝑎 + 𝑏𝑏 + 𝑐𝑐 + 𝑑𝑑 ≥ 0 5
  • 6. Subject: Perspective in Informatics 3 – Fall Semester 2014 Professor: Davood Rafiei Question 3 [10 marks] a) Consider a universe U with n elements, and let R and S be subsets of U both of size m, chosen uniformly at random. What is the expected value of the Jaccard similarity of R and S? The Expectation of an event x is calculated as Ε(x) = ∑x. P(x) In this case, Jaccard Similarity of R and S is calculated as: Sim(R,S)= |𝑅𝑅⋂𝑆𝑆| |𝑅𝑅⋃𝑆𝑆| = 𝑘𝑘 2𝑚𝑚−𝑘𝑘 (𝑤𝑤ℎ𝑒𝑒𝑒𝑒𝑒𝑒 0 ≤ 𝑘𝑘 ≤ 𝑚𝑚 𝑖𝑖𝑖𝑖 𝑡𝑡ℎ𝑒𝑒 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑜𝑜𝑜𝑜 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑒𝑒𝑒𝑒𝑒𝑒 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏 𝑅𝑅 𝑎𝑎𝑎𝑎𝑎𝑎 𝑆𝑆) Next, the probability of Sim(R,S) is calculated as following: P(sim(R,S)=( 𝑘𝑘 2𝑚𝑚−𝑘𝑘 ))= 𝐶𝐶 𝑚𝑚 𝑘𝑘 𝐶𝐶𝑛𝑛−𝑚𝑚 𝑚𝑚−𝑘𝑘 𝐶𝐶𝑛𝑛 𝑚𝑚 Since: • To create set R, we combine m element(s) from n elements of the universal set U. It is calculated as: 𝐶𝐶𝑛𝑛 𝑚𝑚 • Next, to create set S, we need to take k common element(s) from set R first, which is calculated as 𝐶𝐶𝑚𝑚 𝑘𝑘 . Then the left (m-k) element(s) are chosen from (n-m) elements, since m element(s) have been chosen to create set R at the beginning. The formula is: 𝐶𝐶𝑛𝑛−𝑚𝑚 𝑚𝑚−𝑘𝑘 As a result, Expectation of Jaccard Similarity sim(S,T) is estimated as: E(sim(S,T))=∑ 𝑘𝑘 2𝑚𝑚−𝑘𝑘 𝐶𝐶 𝑚𝑚 𝑘𝑘 𝐶𝐶𝑛𝑛−𝑚𝑚 𝑚𝑚−𝑘𝑘 𝐶𝐶𝑛𝑛 𝑚𝑚 =𝑚𝑚 𝑘𝑘=0 ∑ 𝑘𝑘 2𝑚𝑚−𝑘𝑘 � 𝑚𝑚 𝑘𝑘�� 𝑛𝑛−𝑚𝑚 𝑚𝑚−𝑘𝑘� � 𝑛𝑛 𝑚𝑚� 𝑚𝑚 𝑘𝑘=0 b) How does your answer to part (a) change if R and S must include a certain element (say z) of U? It means k ~> z, then the answer is changed to be: E(sim(S,T))=∑ 𝑧𝑧 2𝑚𝑚−𝑧𝑧 𝐶𝐶 𝑚𝑚 𝑧𝑧 𝐶𝐶𝑛𝑛−𝑚𝑚 𝑚𝑚−𝑧𝑧 𝐶𝐶𝑛𝑛 𝑚𝑚 =𝑧𝑧 𝑘𝑘=0 ∑ 𝑧𝑧 2𝑚𝑚−𝑧𝑧 � 𝑚𝑚 𝑧𝑧 �� 𝑛𝑛−𝑚𝑚 𝑚𝑚−𝑧𝑧� � 𝑛𝑛 𝑚𝑚� 𝑧𝑧 𝑘𝑘=0 c) How does your answer to part (a) change if R and S must be disjoint? It means k=0, then the answer is changed to be: E(sim(S,T))=∑ 𝑘𝑘 2𝑚𝑚−𝑘𝑘 𝐶𝐶 𝑚𝑚 𝑘𝑘 𝐶𝐶𝑛𝑛−𝑚𝑚 𝑚𝑚−𝑘𝑘 𝐶𝐶𝑛𝑛 𝑚𝑚 =0 𝑘𝑘=0 0 6