text:
# Infinite sum PDE solution

1. Jul 2, 2009

### daudaudaudau

Hi.

When solving a PDE by separation of variables, we obtain a collection of so-called normal modes. My book then tells me to make an "infinite linear combination" of these normal modes, and that this will be a solution to the PDE. But how do we know that this is in fact a solution? I have only seen a proof of the superposition principle for a finite number of functions.

2. Jul 2, 2009

### Niles

As you say yourself, we use the superposition principle, and the reason why we use an infinite sum is because we want the most general solution: This way we are able to satisfy all the possible starting conditions.

Remark: Superposing solutions only work for linear PDEs.

Last edited: Jul 2, 2009
3. Jul 3, 2009

### daudaudaudau

But I have only seen a proof of the superposition principle for a finite linear combination, so how do we know that an infinite linear combination is in fact a solution?

4. Jul 3, 2009

### Bob_for_short

In completely the same way: you apply your differential operator to each spectral term and obtain zero, so it works whatever number of the spectral addenda is.

5. Jul 3, 2009

### daudaudaudau

Yes that is right, but I guess for that to work you would have to assume that the solution is sufficiently smooth, because we are dealing with an infinite series. For example, if it is a second order linear differential operator, the solution would have to be two times continuously differentiable. How do we know that this is true?

6. Jul 3, 2009

### Bob_for_short

It is the original equation itself that should be analysed. Indeed, there may be some problems in certain cases (see Appendix 3 in my article, for example).

http://arxiv.org/abs/0906.3504

7. Jul 3, 2009

### HallsofIvy

Because we have actually learned enough calculus to know that uniformly convergent sums of smooth functions are smooth.

8. Jul 3, 2009

### daudaudaudau

Yes, that is my question, how do you know that the series and its derivatives are uniformly convergent?

9. Jul 3, 2009

### Bob_for_short

Look at the equation: it contains the derivatives. If there are no "singular" terms in the equation, then the derivatives are finite.

10. Jul 3, 2009

### daudaudaudau

Suppose we want to solve this problem
$$\frac{\partial^2 u}{\partial x^2}+\frac{\partial^2 u}{\partial y^2}=0$$

for some boundary conditions. How do I tell that the derivatives are continuous? Why might there not be a solution which is discontinuous?

11. Jul 3, 2009

### Bob_for_short

If a solution is a step-wise, the corresponding equation should contain a derivative of the delta-function. If your equation does not contain too big terms (the second derivative is finite) then the first derivative if finite too and thus the function is smooth. It can be decomposed into a spectral sum and this sum will converge to the exact function without fail.

12. Jul 3, 2009

### daudaudaudau

Here is what I am saying.

We have a PDE given by a linear operator $\mathcal Lu(x,t)=0$

We then obtain a solution by separation of variables, $u(x,t)=\sum_{k=0}^\infty a_k u_k(x,t)$

Of cause each $u_k(x,t)$ is a solution of $\mathcal Lu_k(x,t)=0$.

Now I want to verify that the entire infinite series $u(x,t)$ is also a solution:
$$\mathcal L\left(\sum_{k=0}^\infty a_k u_k(x,t)\right)=0$$

This is easy if I can move the operator inside the sum, but this is only allowed if the infinite series and a sufficient number of its derivatives are uniformly convergent(i.e. u(x,t) and its derivatives must be continuous). Now how do we know if this is true?

13. Jul 3, 2009

### Bob_for_short

Similarly. You look at the original equation. If there is no delta-function and/or its derivative, then the combination of derivatives is always finite. So there is no problem.

If you know what the Green's function of the original equation is, you will understand. The Green's function equation is like Lu=delta-function =>the Green's function is a step-wise function.

14. Jul 4, 2009

### daudaudaudau

I guess you are right. I find it annoying that none of the books I have seen even comment on it...

15. Jul 4, 2009

### jostpuur

Do you know the Lebesgue's Dominated Convergence Theorem? It is IMO the most basic tool to justify commutation of integration and limit like this

$$\lim_{n\to\infty} \int d\mu(x) f_n(x) = \int d\mu(x) \lim_{n\to\infty} f_n(x),$$

and says that this can be done if there exists a dominating function $h$ such that $|f_n(x)|\leq h(x)$ for all $x$ and $n$, and $\int d\mu(x) h(x) < \infty$.

The question about commutation of a derivative and integral like this

$$\partial_x \int d\mu(y) f(x,y) = \int d\mu(y) \partial_x f(x,y)$$

is a similar question. The question is equivalent with this:

$$\lim_{\Delta x\to 0} \int d\mu(y) \frac{f(x+\Delta x, y) - f(x,y)}{\Delta x} = \int d\mu(y) \lim_{\Delta x\to 0} \frac{f(x+\Delta x, y) - f(x,y)}{\Delta x}$$

According to the Mean Value Theorem we can write

$$\frac{f(x+\Delta x, y) - f(x,y)}{\Delta x} = \partial_x f(\xi_{x,y,\Delta x}, y)$$

with some $\xi_{x,y,\Delta x}$. Now the commutation of derivation and integration can be justified according to the dominated convergence, if we find an integrable function $h(y)$ such that $|\partial_x f(x,y)|\leq h(y)$ for all $x$ and $y$. There may be other results to justify commutation of derivation and integration too, but IMO this is the most general argument, that can easily be used to derive some others.

Suppose you have a sequence $a_1,a_2,a_3,\ldots$, and denote $a(n)=a_n$. It should be noticed that the infinite series (if converging absolutely) is the same thing as integral of $a$ over the set $\mathbb{N}$ with measure $\mu(\{n\})=1$ for all $n=1,2,3,\ldots$. So

$$\sum_{n=1}^{\infty} a_n = \int\limits_{\mathbb{N}} d\mu(n) a(n).$$

If you want to justify that

$$\partial_x \sum_{n=1}^{\infty} f_n(x) = \sum_{n=1}^{\infty} \partial_x f_n(x)$$

for some functions $f_1,f_2,f_3,\ldots$, I would interpret the series as an integral, recall the definition of a derivative as a limit, and use dominated convergence to justify commutation of the limit and integration.

Last edited: Jul 5, 2009
16. Jul 5, 2009

### daudaudaudau

jostpuur: Sorry, I don't know any measure theory or Lebesgue integration. But I think what you are saying sounds a bit like the Weierstrass M-test applied to the solution of the PDE.

17. Jul 5, 2009

### jostpuur

I was talking about how to commute limit and summation of series. The Weierstrass M-test is about convergence of series, not about commuting limit and the summation of series.

Details of measure theory are not important now. Measure theory should be considered as a tool which can be forgotten once the useful results have been obtained (IMO)

The Lebesgue's dominated convergence theorem holds for arbitrary measures. Both Riemann integrals and discrete series can be thought to be integrals over certain measures. So the abstract result about the equation

$$\lim_{n\to\infty} \int d\mu(x) f_n(x) = \int d\mu(x) \lim_{n\to\infty} f_n(x)$$

immediately implies the same results for Riemann integrals

$$\lim_{n\to\infty} \int\limits_a^b dx\; f_n(x) = \int\limits_a^b dx\; \lim_{n\to\infty} f_n(x)$$

and for the infinite series

$$\lim_{n\to\infty} \sum_{k=1}^{\infty} a(k,n) = \sum_{k=1}^{\infty} \lim_{n\to\infty} a(k,n).$$

If you want to commute limit and Riemann integral, or limit and summation of infinite series, think of the Riemann integral or infinite series as an abstract integral, and then use the Lebesgue's dominated convergence.

18. Jul 6, 2009

### daudaudaudau

Yes! You can use the M-test to show that the series is uniformly convergent and then you can interchange limit and sum, or limit and integral. You are talking about a dominating function, and that sounds exactly like the criterion used in the M-test, i.e. $\sum_n f_n(x)$ converges uniformly if $|f_n(x)|\le M_n$ for all $x$ and $\sum_n M_n<\infty$.

19. Jul 6, 2009

### Bob_for_short

A nice example of summation-integration non commutativity is contained in my article arxiv:0906.3504

20. Jul 6, 2009

### jostpuur

I see this now, you were right. If a function $\mathbb{R}\times\mathbb{N}\to\mathbb{C}$, $(x,n)\mapsto f(x,n)$ is integrated over $\mathbb{N}$, then functions of type $\mathbb{N}\to [0,\infty[$, $n\mapsto M_n$ are correct kind of dominating functions for the commutation

$$\partial_x \int\limits_{\mathbb{N}} d\mu(n) f(x,n) = \int\limits_{\mathbb{N}} d\mu(n) \partial_x f(x,n).$$

$|\partial_x f(x,n)|\leq M_n$ should be satisfied.

But I don't think it is correct to talk about the Weierstrass M-test now, to be fully precise. This is more Lebesgue's dominated convergence than Weierstrass M-test, IMO.

Are you sure that it is smart to take uniform convergence as an intermediate step in the proof? I'm not yet convinced that it can be used for the proof.

Last edited: Jul 6, 2009
21. Jul 6, 2009

### daudaudaudau

This is what my book says:


text:
# Changing target shapekey value changes all shape keys (Python script)

I'm trying to write a script that will automate applying shapeKeys and subSerfs into LOD's ready for export into a game engine. It's going well so far but I'm stuck on setting the value of the shape key for a copied mesh ready to be applied.

Here is what I have so far.

import bpy
obj = bpy.context.object
objName = obj.name
i = 0

shapekeysList = [] #building an array of all available sahpeKeys

for sp in obj.data.shape_keys.key_blocks: #loop through available shape keys
shapekeysList.append(sp) #add shapeKey name to array
currentShapeKey = shapekeysList[i].name #grab current shapeKey

obj_dup = obj.copy() #duplicate selected mesh

newName = objName+"_"+shapekeysList[i].name #generate a name for the copy

obj_dup.data.shape_keys.key_blocks[shapekeysList[i].name].value = 1 #<--PROBLEM HERE

obj_dup.name = newName #rename copy to match the shapeKey it'll be set to

i += 1 #tick up for next round

So the problem is instead of just updating the currentShapeKey for just the current object it seems to loop through all objects both the copies and the original (but not wholly separate meshes).

I've also tried changing the value after it's been renamed, added to the scene and is outside the copy loop but it keeps telling me that the object doesn't have that kind of data.

This feels like such a simple problem so sorry if this is just wasting time and thanks in advance for any help you can offer.

Also tried adding this as a work around but no cigar

for sk in shapekeysList:
obj_dup.data.shape_keys.key_blocks[shapekeysList[skCount].name].value = 0

print ("   Current: " + shapekeysList[skCount].name)
print ("   Target: " + shapekeysList[i].name)
if (shapekeysList[skCount].na
me != shapekeysList[i].name):
print("   DELETE "+shapekeysList[i].name)
#obj_dup.data.shape_keys.key_blocks[shapekeysList[i].name].shape_key_remove()
iIndex = obj_dup.data.shape_keys.key_blocks.keys().index(shapekeysList[i].name)
obj_dup.active_shape_key_index = iIndex
#bpy.ops.object.shape_key_remove()
else:
print("   KEEP "+shapekeysList[skCount].name)
skCount += 1

EDIT: Okay I think I've almost got it. The script copys the mesh with shape keys that don't seem to effect each other when testing but when I try to clean out the unused shapeKeys it still seems to want to target the original mesh killing the loop after the first round leaving me with an empty original and a full copy (opposite of what I need).

import bpy

obj = bpy.context.object
objName = obj.name
spIndex = obj.active_shape_key_index
i = 0

print ("-----------------------------") #Just breaking up the consol logs

shapekeysList = [] #building an array of all available sahpeKeys
fullShapekeysList = []
x=0
for fsp in obj.data.shape_keys.key_blocks: #loop through available shape keys
fullShapekeysList.append(fsp) #add shapeKey name to array
print('fullShapekeysList gets: '+fsp.name)
x += 1

for sp in obj.data.shape_keys.key_blocks: #loop through available shape keys
shapekeysList.append(sp) #add shapeKey name to array
currentShapeKey = shapekeysList[i].name #grab current shapeKey
print ("Shapekey: "+currentShapeKey) #Checking to make sure key and name below match

obj_dup = obj.copy() #duplicate selected mesh
obj_dup.data = obj.data.copy() #duplicate selected mesh

newName = objName+"_"+shapekeysList[i].name #generate a name for the copy
print ("newName: " + newName) #Just check the name will come out right

obj_dup.data.shape_keys.key_blocks[shapekeysList[i].name].value = 1 #Set target to one

#Convert copy to mesh
skCount = 0
for sk in fullShapekeysList:

print ("   Current: " + fullShapekeysList[skCount].name)
print ("   Target: " + fullShapekeysList[i].name)
if (fullShapekeysList[skCount].name == fullShapekeysList[i].name):
print("   KEEP "+fullShapekeysList[skCount].name)
else:
print("   DELETE "+fullShapekeysList[skCount].name)

iIndex = obj_dup.data.shape_keys.key_blocks.keys().index(fullShapekeysList[skCount].name)
obj_dup.active_shape_key_index = iIndex
bpy.ops.object.shape_key_remove()
skCount += 1

obj_dup.name = newName #rename copy to match the shapeKey it'll be set to

$$$$
`

format: plain


text:
# On an example of an eventually oscillating function

This series goes back 100+ years to Hardy: "On certain oscillating series", Quarterly J. Math. 38 (1907), 269-288 (pages 146-168 in the sixth volume of Hardy's collected papers). I did not know of this when I posed the question as a puzzle on my webpage about 10 years ago (puzzle 8, solution); I thank Tanguy Rivoal for the Hardy reference. Shortly afterwards the question appeared in the Fall 2004 issue of MSRI's newsletter EMISSARY.

The easiest proof is surely the computational one that has been noted here already (and which I gave in my puzzle solution): it takes only a dozen terms of the series to confirm that $f(.995) > 1/2$, at which point the functional equation $f(x) = x - f(x^2)$ shows that $f(x) > f(.995) > 1/2$ when $x$ is a $(4^m)$-th root of $0.995$ for some $m=1,2,3,\ldots$ .

One can also give "harder" or "softer" explanations that may feel more satisfactory.

On the "hard" side, as $x \rightarrow 1$ from below the difference $f(x) - 1/2$ approaches a periodic function of $\log_4(\log(1/x))$ that's a nearly pure sine wave of magnitude $$\frac2{\log 2} \, \bigl|\, \Gamma(\pi i / \log 2) \,\bigr| = 2 \Big/ \sqrt{\log(2)\sinh(\pi^2/\log 2)} \, = \, 0.00274922\ldots$$ (the higher harmonics' coefficients involve the values of $\Gamma$ at higher odd multiples of $\pi i / \log 2$). Hardy obtained this by residue calculations; it can also be recovered from Poisson summation.

On the "soft" side, the fact that $f(x)$ does not converge as $x \rightarrow 1$ from below is a consequence of a Tauberian theorem of Hardy and Littlewood: a subset $S$ of $\{1,2,3,\ldots\}$ has natural density iff $S$ has Abel density, and then the two limits are equal. The Abel density of $S$ is $\lim_{x \rightarrow 1-} (1-x) \sum_{s\in S} x^s$ if the limit exists. If we take $S = \bigcup_{m=0}^\infty [2^{2m}, 2^{2m+1})$ then $(1-x) \sum_{s\in S} x^s = f(x)$; but $S$ is a standard example of a set without natural density, so there's no Abel density either and we're done. Hence there is some $\epsilon > 0$ such that $|f(x) - 1/2| > \epsilon$ for a sequence of $x$'s approaching $1$, and then either $f(x)$ or $f(\sqrt x)$ eventually exceeds $1/2$. I don't know whether Hardy ever observed in print that the non-convergence of $f(x)$ is a consequence of his and Littlewood's theorem. [I found this Tauberian theorem in Persi Diaconis's doctoral thesis (Theorem 4 on p.37), with a reference to page 423 of Feller's An Introduction to Probability Theory and its Applications, Vol. II (Wiley, 1966).]

In addition to Noam Elkies and David Speyer's answers. "Harder" explanation is made somewhat "softer" in http://www.maths.bris.ac.uk/~majpk/papers/37.pdf (Summability of alternating gap series, by J.P. Keating and J.B. Reade). The starting point of the argument is the Poisson summation formula in the form $$\sum\limits_{n=-\infty}^\infty (-1)^nf(n)=\sum\limits_{n=-\infty}^\infty \hat{f}((2n+1)\pi),$$ where $\hat f$ is the Fourier transform of $f$: $$\hat f(u)=\int\limits_{-\infty}^\infty e^{iut}f(t)dt.$$ Now consider the function $$f(t)=x^{2^{|t|}}=e^{-\lambda 2^{|t|}},$$ where $\lambda$ is introduced through $x=e^{-\lambda}$. For its Fourier transform we have $$\hat f(u)=\int\limits_{-\infty}^\infty e^{iut}e^{-\lambda 2^{|t|}}dt=2\,Re\int\limits_0^\infty e^{iut}e^{-\lambda 2^{|t|}}dt= \frac{2}{\ln{2}}\,Re\frac{1}{\lambda^{iu/\ln{2}}}\int\limits_\lambda^\infty s^{(iu/\ln{2})-1}e^{-s}ds,$$ where at the last step we made a substitution $s=\lambda 2^t$. Now $$\int\limits_\lambda^\infty s^{(iu/\ln{2})-1}e^{-s}ds= \Gamma\left(\frac{iu}{\ln{2}}\right)-\int\limits_0^\lambda s^{(iu/\ln{2})-1}e^{-s}ds.$$ In the last integral we can expend $e^{-s}$ in powers of $s$ and then integrate term by term. The final result is $$\hat f(u)=\frac{2}{\ln{2}}\,Re\left[\lambda^{-iu/ln{2}}\,\Gamma\left(\frac{iu}{\ln{2}}\right)-\sum\limits_{k=0}^\infty\frac{(-1)^k}{k!}\frac{\lambda^k} {(iu/\ln{2})+k}\right].$$ Therefore the Poisson summation formula will give $$\sum\limits_{n=-\infty}^\infty (-1)^n x^{2^{|n|}}=2\sum\limits_{n=0}^\infty (-1)^n x^{2^n}-x=$$ $$\frac{2}{\ln{2}}\,Re\sum\limits_{n=-\infty}^\infty\left[\lambda^{-i(2n+1)\pi/ln{2}}\,\Gamma\left(\frac{i(2n+1)\pi}{\ln{2}}\right)-\sum\limits_{k=0}^\infty\frac{(-1)^k}{k!}\frac{\lambda^k}{(i(2n+1)\pi/\ln{2})+k}\right].$$ As $f(-t)=f(t)$, we will have $\hat f(-u)=\hat f(u)$ and hence $\hat f((-2n+1)\pi)=\hat f((2n-1)\pi)$. Therefore $$\sum\limits_{n=-\infty}^\infty \hat f((2n+1)\pi)=\sum\limits_{n=1}^\infty \hat f((-2n+1)\pi)+ \sum\limits_{n=0}^\infty \hat f((2n+1)\pi)=2\sum\limits_{n=0}^\infty \hat f((2n+1)\pi)$$ and we get finally $$\sum\limits_{n=0}^\infty (-1)^n x^{2^n}=\frac{x}{2}+$$ $$\frac{2}{\ln{2}}\,Re\sum\limits_{n=0}^\infty\left[\lambda^{-i(2n+1)\pi/ln{2}}\,\Gamma\left(\frac{i(2n+1)\pi}{\ln{2}}\right)-\sum\limits_{k=0}^\infty\frac{(-1)^k}{k!}\frac{\lambda^k}{(i(2n+1)\pi/\ln{2})+k}\right].$$ It is simple to show (see the paper) that the second term gives zero contribution in the limit $x\to 1_-$, which is equivalent to $\lambda\to 0_+$. As for the first term, introducing $$\mu=-\frac{\ln{\ln{(1/x)}}}{\ln{2}}$$ so that $\lambda=2^{-\mu}$, we will have $$\frac{2}{\ln{2}}\,Re\sum\limits_{n=0}^\infty \lambda^{-i(2n+1)\pi/ln{2}}\,\Gamma\left(\frac{i(2n+1)\pi}{\ln{2}}\right)=\frac{2}{\ln{2}}\,Re\sum\limits_{n=0}^\infty \Gamma\left(\frac{i(2n+1)\pi}{\ln{2}}\right)e^{i(2n+1)\mu\pi}.$$ The first term oscillates with the amplitude $$\frac{2}{\ln{2}}\left|\Gamma\left(\frac{i\pi}{\ln{2}}\right)\right|=\frac{2}{\sqrt{\ln{2}\sinh{(\pi^2/\ln{2})}}}\approx 2.75\cdot 10^{-3},$$ and it is shown in the paper that the rest is bounded in modulus by $1.04\cdot 10^{-9}$.

As a final remark, interestingly enough the series $$\sum\limits_{n=0}^\infty (-1)^n x^{n^2}$$ converges to $1/2$ as $x\to 1_-$ (is Abel summable in contrast to the Hardy series considered above): http://www.hpl.hp.com/techreports/98/HPL-BRIMS-98-03.pdf (Abel Summability of Gap Series, by J.P. Keating and J.B. Reade).

Write $f(x) = g(t)$ where $x = \exp(-1/t)$, and $x \to 1-$ corresponds to $t \to+\infty$. Then $$g(2t) = \exp(-1/(2t)) - g(t)$$ Thus the set of limit points of $g(t)$ as $t \to \infty$ is symmetric around $1/2$. Now $$g(4t) = \exp(-1/(4t)) - \exp(-1/(2t)) + g(t)$$ where $\exp(-1/(4t)) - \exp(-1/(2t))$ is a decreasing function of $t > 0$ with $0 < \exp(-1/(4t)) - \exp(-1/(2t)) < \dfrac{1}{4t}$. In particular, as soon as you get $g(t_1) > g(t_2)$ with $0 < t_1 < t_2$, you can conclude that $g(2^n t_1) - g(2^n t_2) > g(t_1) - g(t_2)$ for all positive integers $n$, and so the set of limit points has length greater than $\delta = g(t_1) - g(t_2)$. Numerically, I get $g(52) \approx .4959378605 > g(85) \approx 0.4935023615$, implying that the set of limit points includes at least the interval $((1-\delta)/2,(1+\delta)/2) \approx (.4987822505, .5012177495)$.


text:
FigureHelp1

# FigureHelp1 - Creating Figures and Graphs with LaTeX...

This preview shows pages 1–2. Sign up to view the full content.

1 Creating Figures and Graphs with LaTeX Figures and graphs are created using the “figure” environment given below: \begin{ figure }[ where ] figure \end{ figure } In the above syntax, figure stands for the contents of the ‘picture’ environment together with a possible \caption command. The argument where specifies the allowed locations for the table. For example, when \begin{ figure }[ t ] is typed, it means that the figure will appear on the top of the page. An example figure developed by using LaTeX commands is given below. The resulting figure is displayed in Figure 1.1. \put{ x_coord, y_coord }{ pic_element } is used to position the picture element , pic_element . \framebox{ x_dimen,y_dimen }[ pos ]{ text } is used to produce a rectangular box with x_dimen width, and y_dimen height, and a text inside the box. p os determines where the text will be printed such that “tl” prints the text at the top left of the box. To refer this figure inside the text, \label{ fig:lnlblock } command is used with a marker of “fig:lnlblock”. Then, \ref{ fig:lnlblock } can be used to refer this figure whenever it is needed to print the figure number in the text. -------------------- Figure example ------------------------------ \begin{figure}[h] \setlength{\unitlength}{0.14in} % selecting unit length \centering % used for centering Figure \begin{picture}(32,15) % picture environment with the size (dimensions) % 32 length units wide, and 15 units high. \put(3,4){\framebox(6,3){$H_{B}(q)$}}

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/03/2012 for the course EE 3530 taught by Professor Chen during the Fall '07 term at LSU.

### Page1 / 6

FigureHelp1 - Creating Figures and Graphs with LaTeX...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online


text:
# Prince Andrew photo is fake!

Article by Philip Copeman
first published August 10, 2021, 3:18 pm
updated August 27, 2021, 1:17 pm

If you found a picture of yourself circulating on the Internet that had been taken at one place in space-time, edited with a crude raster editor and placed into a photo of a crime scene. If you did not repond angrily, could I describe you as "egregious"? Prince Andrew is currently enduring such a cyber attack.

Over the last few days with the announcement of the case brought by Ms Virginia Giuffre, there has been a publishing frenzy posting a picture placing Prince Andrew at the "scene of the crime". Lying on my couch, ten thousand miles away, watching TV, it took me no more than a few seconds to pause the TV show and see that the digital photo is a fake.

I have been working for thirty years with photo editing software. Composite images have been a core component of TurboCASH branding. As a power user, I do have a headstart on the average viewer, who may already found Prince Andrew, in trial by media, guilty based on this photo evidence. My forensic mind works otherwise.

As imaging software becomes more sophisticated, we developers have the ability to create reality altering images. With such power comes responsibility. It is a particularlty evil mind that would construct a picture of Prince Andrew with Virginia Giuffre. This act has the develish malice of a denial of service virus. When the stakes are so high, more care should have been taken by media publishers to establish the authenticity of what they published.

With no opinion offered on the court case at hand, I offer my evidence of why this photo is fake.

Below is an advert that I made last month. Using very simple editor I was able to create the image below. The priciple is to use a background erasor to edit the alpha channel of the picture of the two figures in the foreground and place it onto the background picture of the European village. The foreground figures have been isolated and placed as a layer in the second picture. The background layer has been "stretched" to accomodate the foreground figures into the focus point. The minor figures on the right, most importantly the dominant man in red, are looking directly at the foreground figures. However, is just and ad, does anyone believe that the firemakers are actually in Europe?

# A litany of errors

Even if it may be none of my business, like any power user of raster paint programs, my eye is immediately drawn to anomalies. This picture of Prince Andrew and Virginia Giuffre that has been coming at me from the TV all day, is obviously constructed.

It will take an expanded scan of a certified original to confirm it, but even from first low res observation, the following appears to be of concern: Consider the possibility that this is a composite photograph of Prince Andrew, superimposed on one of Ms Guiffrey. The first point that jumps out is the white-black wall that divides the two figures. This background split is very typical of all photos that require manipulation of the alpha channel, particularly those that were made in a time when "red eye" was still an issue. Every digital photo has a given hue pallet. If you are going to match any two photographs, this would be the first thing that you would do. No photo artist, no matter how good he is can ever get it perfectly correct. And this artist makes a mistake. Even the untrained eye can see that the hue of wall area marked 1 is different from the area marked 2.

The photo of Prince Andrew has been edited with a "Background edge" eraser down the left (our right) side of his head and body. See that there is a dark shadow that outlines his left edge. This is the erasure edge and is typical of an eraser set at around twenty pixels. The shadow line is inconsistent with lighting and varies too much. The top left curve of his head is clearly "shaven off", the shadow just under his left eye is too thin relative to reality. The shadow around his pot belly is inconsistent. Look closely at the small gap between him and her at waist level. There are shadows on both sides. It would take a wormhole to distort space time so much as to make that shadow effect.

If that doesn't convince you, consider the light source that is throwing the flash on the back window. That same light source is saturating her face and darkening her left arm (our right). That same light source should be saturating the left side of Andrews face (our right). Instead, the shadows on his face and shirt are coming the other way. She and he are looking at different cameras!

Look at the hands, her left hand is saturated, but the groping hand is dark red. Compare the color of the groping hand to his right hand. It is unlikely that these three hands come from the same photograph. Analysis of a high res photo should confirm this.

For those that understand anatomy. I try to trace the skeleton bones, the humerus and the ulna. This Prince Andrew would have a left arm nearly reaching his knee.

I am not in a position to comment on the other merits of this case, but when Prince Andrew says he cannot remember this photograph being taken, he is probably right!

#### Every business needs an accountant

Whether you are starting on your own or joining with partners, accounting will give you an edge. Here is you chance to learn a lifeskill that will help you forever. TurboCASH is a package that will scale with. You can run a very large business on TurboCASH.

A batch driven general ledger, with debtors, creditor, stock, invoicing and powerful report writer can hande the toughest configurations. The spreadsheet data entry will allow you to enter data in a familiar format.

Get this world leading product for $60 per year or$6 per month.

We work on a freemium model and charge our subscription at a rate that makes you want to pay us, not have to pay us. At any time that you want to stop paying us the annual fee, simply stop and go back to using our open source version for free.

#### Drilling down

In the pic at the very top of the article you should be able to discern a white jagged vertical line down the left of his trowsers.

Now focus on the zoom-in above. See that at the horizontal grey lines from the balistrade stop short of the trouser line by about 5 pixels. That would not happen in an unaltered picture. If this were an unaltered picture these lines would extend further to the trouser line.

The editor has omitted to reinsert the lines into his alpha channel. The trouser line iself has been made concave giving him a non-real "pointy ass". Her hand reaching around is stretched and creates an "non real" scenario at the confluence with his belt line.

I could go on with this analysis, there are many more indicators, perhaps you can see some yourself? This composite can never pass as an unaltered image.

Alternate view
This view is disputed by Michael Thomas If he has the original as he says he has, I challenge him to make it available in a publically accessible hi res format.

# Published Sources

Below is a list of publications that have carried the fake photo. They are by no means exaustive as the photo has been widespread, but they all share the same faked source.

Disclosure - There is more detail. I can bring out far more detail if required.

I have never met any of the parties involved or had any contact with the parties concerned. I am a computer software developer with an interest in fairview accounting and blockchain verification.

The information below contains:

The SHA256 Hash was generated using https://hash.online-convert.com/sha256-generator

Publishing source Company

WebURL

PhotoURL

File size

Shar256

*****************************

Evening Standard

Story

PhotoURL

Thursday, 12 August 2021, 10:42:18 AM

51,608 bytes

503de36490bbe089165da845f99c460173a53644b28b84f3aa596d1ea3fb7131

Lower res reproduction, but still shows construction errors

*****************************

The Mirror

Story

PhotoURL

Thursday, 12 August 2021, 11:14:39 AM

53,622 bytes

Uses the same original file as the BBC

*****************************

The BBC

Story

PhotoURL

Thursday, 12 August 2021, 11:34:30 AM

53,622 bytes

Uses the same original file as the Mirror

*****************************

News24

Story

PhotoURL

45,194 bytes

Thursday, 12 August 2021, 11:49:52 AM

76282840e6e97bff216dcdef48ae11363a8059819832eb05477324280dc11235

Lower res reproduction, but still shows construction errors

*****************************

CNN

Story

PhotoURL

45,956 bytes

Thursday, 12 August 2021, 12:27:08 PM

44d5ca3f815e068c5f72263368220bd02b7c4d2019d3873650f6d3211de3623e

CNN posts a very low res – cropped version of the photo. It carries the stamp “Florida Southern District Court" (top right)

*****************************

The Sun

Story

PhotoURL

56,179 bytes

Thursday, 12 August 2021, 12:27:08 PM

This is the highes res so far. Introduces so many fake edits.

*****************************

Sky News

Story

PhotoURL

105,927 bytes

Thursday, 12 August 2021, 3:36:34 PM

a7e1000c5c9598197801c3f3714b9a489baa9529fd42a27942b6baf0839bb67f

Uses a higher res photo. I would like to get their original. In the interests of public accountability, perhaps Sky would publish this. They have cropped much of the image, but even on a crop as small as this the errors are present. This version of the photo, because of its detail open even more questions as to the motivations of the faker. (details if required)

# References

You may be interested in this topic and find some of the concepts complicated. Here is a beginners guide.

Here are references on Blockchain Blockchain is a coming force in Auditing. Here are some links to get you started

Anders Brown, Simple web demo

Deloittes. Intro to blockchain


text:
Risk-Aware Resource Management in Public Safety Networks
Modern Public Safety Networks (PSNs) are assisted by Unmanned Aerial Vehicles (UAVs) to provide a resilient communication paradigm during catastrophic events. In this context, we propose a distributed user-centric risk-aware resource management framework in UAV-assisted PSNs supported by both a static UAV and a mobile UAV. The mobile UAV is entitled to a larger portion of the available spectrum due to its capability and flexibility to re-position itself, and therefore establish better communication channel conditions to the users, compared to the static UAV. However, the potential over-exploitation of the mobile UAV-based communication by the users may lead to the mobile UAV’s failure to serve the users due to the increased levels of interference, consequently introducing risk in the user decisions. To capture this uncertainty, we follow the principles of Prospect Theory and design a user’s prospect-theoretic utility function that reflects user’s risk-aware behavior regarding its transmission power investment to the static and/or mobile UAV-based communication option. A non-cooperative game among the users is formulated, where each user determines its power investment strategy to the two available communication choices in order to maximize its expected prospect-theoretic utility. The existence and uniqueness of a Pure Nash Equilibrium (PNE) is proven and the more »
Authors:
; ;
Award ID(s):
Publication Date:
NSF-PAR ID:
10228428
Journal Name:
Sensors
Volume:
19
Issue:
18
Page Range or eLocation-ID:
3853
ISSN:
1424-8220
4. A major challenge in mobile crowdsensing applications is the generation of false (or spam) contributions resulting from selfish and malicious behaviors of users, or wrong perception of an event. Such false contributions induce loss of revenue owing to undue incentivization, and also affect the operational reliability of the applications. To counter these problems, we propose an event-trust and user-reputation model, called QnQ, to segregate different user classes such as honest, selfish, or malicious. The resultant user reputation scores, are based on both quality' (accuracy of contribution) and quantity' (degree of participation) of their contributions. Specifically, QnQ exploits a rating feedback mechanism for evaluating an event-specific expected truthfulness, which is then transformed into a robust quality of information (QoI) metric to weaken various effects of selfish and malicious user behaviors. Eventually, the QoIs of various events in which a user has participated are aggregated to compute his reputation score, which in turn is used to judiciously disburse user incentives with a goal to reduce the incentive losses of the CS application provider. Subsequently, inspired by cumulative prospect theory (CPT), we propose a risk tolerance and reputation aware trustworthy decision making scheme to determine whether an event should be published or not,more »


text:
Subscribe
Issue No.03 - March (2000 vol.22)
pp: 281-297
ABSTRACT

Abstract—Principal curves have been defined as “self-consistent” smooth curves which pass through the “middle” of a <it>d</it>-dimensional probability distribution or data cloud. They give a summary of the data and also serve as an efficient feature extraction tool. We take a new approach by defining principal curves as continuous curves of a given length which minimize the expected squared distance between the curve and points of the space randomly chosen according to a given distribution. The new definition makes it possible to theoretically analyze principal curve learning from training data and it also leads to a new practical construction. Our theoretical learning scheme chooses a curve from a class of polygonal lines with <tmath>$k$</tmath> segments and with a given total length to minimize the average squared distance over <tmath>$n$</tmath> training points drawn independently. Convergence properties of this learning scheme are analyzed and a practical version of this theoretical algorithm is implemented. In each iteration of the algorithm, a new vertex is added to the polygonal line and the positions of the vertices are updated so that they minimize a penalized squared distance criterion. Simulation results demonstrate that the new algorithm compares favorably with previous methods, both in terms of performance and computational complexity, and is more robust to varying data models.

INDEX TERMS
Learning systems, unsupervised learning, feature extraction, vector quantization, curve fitting, piecewise linear approximation.
CITATION
Balázs Kégl, Adam Krzyzak, Tamás Linder, Kenneth Zeger, "Learning and Design of Principal Curves", IEEE Transactions on Pattern Analysis & Machine Intelligence, vol.22, no. 3, pp. 281-297, March 2000, doi:10.1109/34.841759


text:
# Chart/visual for negative binomial regression

My wife is presenting a study at a conference poster session. She has a correlation of sorts [1] where kids' self-assessment of asthma ("I felt a lot better" or "I felt a little better or not better") matches doctors' assessments (0 to 6, low numbers are better). And we need a visual for the poster.

I'd have thought that a correlation graph would be the way to go, but the x- and y-values are both on discrete scales, so if you plot them, (1) there is no cloud of values to see and (2) there is no obvious trend.

Here are the buckets (value + count of occurrences) for people who felt a lot better:

>>> print(a_lot_better)
{0: 66, 1: 9, 2: 3, 3: 2}

And here are buckets for people who felt a little better or not better:

>>> print(a_little_better)
{0: 79, 1: 31, 2: 5, 3: 6, 6: 1}

If you sum up the numbers like this:

# python
def print_dict(d):
total = float(sum(d.values()))
composite = 0.0
for k, v in sorted(d.iteritems())
print("{0}: {1}".format(k, v / total))
composite += (k * v) / total
return composite

You get this:

>>> print_dict(a_lot_better)
0: 0.825
1: 0.1125
2: 0.0375
3: 0.025
0.2625

>>> print_dict(a_little_better)
0: 0.647540983607
1: 0.254098360656
2: 0.0409836065574
3: 0.0491803278689
6: 0.00819672131148
0.5327868852459017

And that is more obviously different, but I don't know how to present this visually (assuming even that this is a legitimate summary).

How should we present this data to be visually obvious that there is an interesting and significant relationship?

[1] As broadly understood by a statistics-civilian.

• There are some good ideas here: stats.stackexchange.com/questions/56322/… – Dimitriy V. Masterov Apr 29 '13 at 19:55
• @Dimitriy Masterov: Thanks, this is great. Much of the search relies on having the correct domain terminology for the search. If I'd described this as a relationship of ordinal variables, I might have stumbled on this link earlier. – hughdbrown Apr 30 '13 at 2:42

The heading "negative binomial regression" is a puzzle here as the distribution is defined only on the grades 0, ..., 6, so can't be negative binomial on that ground alone.

However, your calculation of the discrete probability distribution strikes me as exactly right and that suggests showing two histograms, which is only a step away from your probability distributions. It would be widely conventional to show bars with a little space between them to show that the scale is discrete. In fact some would go further and prefer the bars to be shrunk to spikes.

In the thread pointed to by Dimitriy Masterov, the proposals of table-like plots are essentially identical in spirit.

A Mann-Whitney test is quite encouraging here.

This isn't, in my view, a correlation problem at all. You have two distributions of ordinal (graded) variables.

• Excellent, thank you. We are not working with stata or R, but are instead shoehorning this into Powerpoint with Excel using bar charts of the two series' discrete probability distribution. Not quite so sexy but still passable. Thanks very much! – hughdbrown Apr 30 '13 at 2:41
• Sorry about the misleading "negative binomial regression." I gather my wife was describing some other problem at the same time and I was confused into believing it was the same topic. – hughdbrown Apr 30 '13 at 2:42

Most important is to figure out what the message you want to communicate is and try to find a graph whose message is close to that.

Some graphs that might spur some ideas:

Comparing bar charts (aka discrete histograms) shows the different distributions but perhaps misleads since score=0 has a higher bar for "little better" than "lot better", though it's relatively less common.

A mosaic plot (aka spine plot) makes the population difference and the relative sizes clearer but it's harder to make out the distribution shape.

Overlaid smooth distribution curves emphasizes the different distribution shapes but with a loss of detail.

• Density estimation seems a real stretch here. Nice mosaic plot. The histograms can show proportions rather than raw counts. – Nick Cox May 1 '13 at 15:04
• Good point, I thought about going into whether the 0-6 score should really be modeled ordinal or just more of a rounded continuous measure, which might allows means comparisons, etc., but that's far beyond my expertise. (And of course I chopped off the negative scores from the axis :) ) – xan May 1 '13 at 15:16
• There is plenty of stuff on density estimation respecting the support in e.g. Silverman's book. That's in my experience typically not implemented; you have to fix things yourself. – Nick Cox May 1 '13 at 15:46
• Thanks a lot for this. I appreciate that you put in the effort to produce graphs. The spine plot is my personal favorite but my wife's adviser on this overruled. So it goes. FWIW, I think you have the "a little better" and "a lot better" labels reversed in the first graph (though the counts of patients are correct). – hughdbrown May 2 '13 at 2:36
• @hughdbrown why do you say the first graph has the wrong labels. The Y axis is count and the first two bars are at about 80 and 30 which agrees with the "little better" data values of 79 and 31. Perhaps you were expecting percents on the Y axis, which would probably be better as Nick mentions. – xan May 2 '13 at 12:47


text:
Two cubes, each of side 15 cm are joined end to end. What is the surface area of the resulting cuboid?

Then teach the underlying concepts
Don't copy without citing sources
preview
?

Explanation

Explain in detail...

Explanation:

I want someone to double check my answer

25
sjc Share
Nov 20, 2017

surface area$= 2250 c {m}^{2}$

Explanation:

if two cubes of length $15 c m$ are joined, the resulting cuboid will be of dimensions

$30 c m \text{ by " 15cm" by } 15 c m$

see diagram below

surface area will be

each end $= \rightarrow 15 \times 15 = 225 c {m}^{2}$

one top/bottom$= \rightarrow 30 \times 15 = 450 c {m}^{2}$

each side$\rightarrow 30 \times 15 = 450 c {m}^{2}$

total surface area$= 2 \times \left(450 + 450 + 225\right)$

surface area$= 2 \times 1125 = 2250 c {m}^{2}$

• 19 minutes ago
• 21 minutes ago
• 29 minutes ago
• 30 minutes ago
• A minute ago
• 2 minutes ago
• 8 minutes ago
• 9 minutes ago
• 12 minutes ago
• 16 minutes ago
• 19 minutes ago
• 21 minutes ago
• 29 minutes ago
• 30 minutes ago


text:
# is the fixed set of a smooth involution a submanifold?

Let $f:X\rightarrow X$ be a smooth map of a smooth manifold with $f^2=\operatorname{id}$.

Is the subset $\{x\in X\mid f(x)=x\}$ a smooth submanifold?

I tried to find an argument with the implicit function theorem, but I don't have an answer.

-
Not sure yet, but it does not need to be full dimensional. Take the graph $z = xy,$ then the involution $(x,y,xy) \rightarrow (-x,-y, xy).$ –  Will Jagy Nov 16 '12 at 22:44
What about looking at $f-Id$ , mapping $X$ to $X\subset \mathbb{R}^n$? –  user641 Nov 17 '12 at 0:38
The connected components of this subset will each be smooth submanifolds, but their dimensions can vary. As such, their union is not a submanifold. As a simple example, consider the vertical reflection $(x:y:z)\to (x:y:-z)$ of the space of one-dimensional linear subspaces of $\mathbb{R}^3$ (that is, $\mathbb{RP}^2$) to itself, expressed in projective coordinates. It's well-defined and smooth. Its fixed points consist of a codimension-1 submanifold $(\cos(\theta):\sin(\theta):0)$ (a circle of all horizontal lines) together with a codimension-2 submanifold $(0:0:1)$ (the vertical line). –  whuber Nov 17 '12 at 23:04
@Whuber the fixed point set is a line with a point, in fact it is a circle. –  user641 Nov 18 '12 at 2:00
@Steve It doesn't quite work that way: the z-axis, qua point of the projective plane, also is fixed under this reflection--that's the whole point of the example. To put it another way: an equivalence class (the z-axis) can be fixed without its elements being fixed, so it does not suffice to look only at the fixed points in the covering space. We're not talking about just a single point, either, in general: this example readily generalizes to higher-dimensional projective planes, Grassmannians, flag manifolds, etc., to give a rich set of counterexamples. –  whuber Nov 20 '12 at 8:02

If $f$ is involutive, so is its derivative in all points: $(T_xf)^2=Id$. And hence, there is a basis $(b_1,..,b_m,..)$ of $T_xX$ in which $T_xf$ becomes of the form $\pmatrix{I_m & 0\\0&-I_k}$ where $I_k$ is the $k\times k$ identity matrix, and $m+k=\dim X$.

So, if $f(x)=x$, then cutting out the correspondent of $\Bbb R^m\cong\langle b_1,..,b_m\rangle \subseteq T_xX\cong \Bbb R^n$ from the local chart $\phi$ will give you charts. Smoothness guarantees that the change of $b_i$'s along $x$ is smooth.

-
This argument shows the set is locally a submanifold, but I cannot find a definition of "submanifold" that assures that the entire set will actually be a submanifold: all the definitions I know of are constructed to assure that submanifolds have well-defined dimensions. That's not necessarily the case here. –  whuber Nov 17 '12 at 23:07
To add to @whuber's comment: there are know topological constraints which will require the fixed-point sets to have globally a constant codimension. But there are also other cases. See sciencedirect.com/science/article/pii/0166864195000887 and references therein. –  Willie Wong Jun 24 '13 at 15:23
The requirement that connected components of a manifold (or of a submanifold for that matter) all have the same dimension is in my view a bug in the definition. Bad as the category of smooth manifolds is in many respects, it makes matters worse to artificially rule out even the most elementary categorical constructions (such as coproducts, closure under retracts, etc.) just on the basis of a (relatively unimportant) convention like this. –  user43208 Sep 2 '13 at 0:06

I can't add a comment to Berci's answer, that is why I post this comment as an answer.

The argument in Berci's answer does not work as stated. (Since the question is a local matter, we can assume that $f:\mathbb{R}^n\rightarrow \mathbb{R}^n$, but I'm not sure that this helps.) The problem is that $f^2=id$ only implies that $(df)_{f(p)}\circ (df)_p = id_{T_pX}$. So you cannot conclude that $(df)_p$ is of the given form, since $(df)_p$ and $(df)_{f(p)}$ are different maps.

A different argument using Riemannian geometry is the following:

Choose a Riemannian metric $g$ on $X$, then $\tilde g= g + (f^* g)$ is a metric for which $f$ is an isometry (because $f^2=id$). The fixed point set of an isometry is easily seen to be a totally geodesic submanifold of $X$.

-
At a fixed point $p$, $(df)_p$ and $(df)_{f(p)}$ are the same, so you can conclude that $(df)_p$ is of that form at any fixed point. –  Omar Antolín-Camarena Aug 20 '13 at 16:55
Yes. That is true at any fixed point. But not near any fixed point. This is what you would need for the argument above. –  anon Sep 24 '13 at 7:07


text:
Slight Variations Between Identities

Geometry Level 2

We know that the identity $$\dfrac{\sin x}{\cos x} = \tan x$$ is true. Which of the following identities is true as well?

×


text:
# Thread: special limits of trig functions

1. ## special limits of trig functions

compute using special limits of trig functions: lim x->pie (cosx+1)/(x-pie)

2. Originally Posted by myoplex11
compute using special limits of trig functions: lim x->pie (cosx+1)/(x-pie)
First of all, it's "pi" not "pie."

I'm not sure how to break this into anything resembling a "special limit" but it's not hard to do directly:

$\lim_{x \to \pi} \frac{cosx + 1}{x - \pi}$

Note that this is of the form 0/0, so use L'Hopital's rule:

$\lim_{x \to \pi} \frac{cosx + 1}{x - \pi} = \lim_{x \to \pi} \frac{-sinx}{1} = 0$

-Dan

3. Originally Posted by topsquark
First of all, it's "pi" not "pie."

I'm not sure how to break this into anything resembling a "special limit" but it's not hard to do directly:

$\lim_{x \to \pi} \frac{cosx + 1}{x - \pi}$

Note that this is of the form 0/0, so use L'Hopital's rule:

$\lim_{x \to \pi} \frac{cosx + 1}{x - \pi} = \lim_{x \to \pi} \frac{-sinx}{1} = 0$

-Dan
You can do this,
$\lim_{x\to \pi} \frac{1-\cos (x- \pi)}{x-\pi}$
Using the identity,
$\cos x=-\cos (x-\pi)$
Now this is a composition function,
$f(x)=\frac{1-\cos x}{x}$
$g(x)=x-\pi$
And,
$\lim_{x\to \pi}g(x)=0$
Thus the limit of,
$\lim_{x\to \pi}\frac{1-\cos (x-\pi)}{x-\pi}=\lim_{x\to 0}\frac{1-\cos x}{x}=0$
By composition rule for limits.
That is a standard limit.

4. Originally Posted by ThePerfectHacker
You can do this,
$\lim_{x\to \pi} \frac{1-\cos (x- \pi)}{x-\pi}$
Using the identity,
$\cos x=-\cos (x-\pi)$
Now this is a composition function,
$f(x)=\frac{1-\cos x}{x}$
$g(x)=x-\pi$
And,
$\lim_{x\to \pi}g(x)=0$
Thus the limit of,
$\lim_{x\to \pi}\frac{1-\cos (x-\pi)}{x-\pi}=\lim_{x\to 0}\frac{1-\cos x}{x}=0$
By composition rule for limits.
That is a standard limit.
Clever! I like it.

-Dan


text: The picture below thus shows the clusterization of Iris, projected onto the unitary circle, according to spherical K-Means: We can see how the result obtained differs from the one found earlier. Vectors with a small Euclidean distance from one another are located in the same region of a vector space. Similarity between Euclidean and cosine angle distance for nearest neighbor queries @inproceedings{Qian2004SimilarityBE, title={Similarity between Euclidean and cosine angle distance for nearest neighbor queries}, author={G. Qian and S. Sural and Yuelong Gu and S. Pramanik}, booktitle={SAC '04}, year={2004} } Jaccard Similarity Before any distance measurement, text have to be tokenzied. The way to speed up this process, though, is by holding in mind the visual images we presented here. 6.2 The distance based on Web application usage After a session is reconstructed, a set of all pages for which at least one request is recorded in the log file(s), and a set of user sessions become available. Letâs start by studying the case described in this image: We have a 2D vector space in which three distinct points are located: blue, red, and green. By sorting the table in ascending order, we can then find the pairwise combination of points with the shortest distances: In this example, the set comprised of the pair (red, green) is the one with the shortest distance. Jonathan Slapin, PhD, Professor of Government and Director of the Essex Summer School in Social Science Data Analysis at the University of Essex, discusses h Understanding Your Textual Data Using Doccano. For Tanimoto distance instead of using Euclidean Norm As can be seen from the above output, the Cosine similarity measure is better than the Euclidean distance. The K-Means algorithm tries to find the cluster centroids whose position minimizes the Euclidean distance with the most points. To explain, as illustrated in the following figure 1, letâs consider two cases where one of the two (viz., cosine similarity or euclidean distance) is more effective measure. As we do so, we expect the answer to be comprised of a unique set of pair or pairs of points: This means that the set with the closest pair or pairs of points is one of seven possible sets. Some machine learning algorithms, such as K-Means, work specifically on the Euclidean distances between vectors, so weâre forced to use that metric if we need them. Cosine similarity is a measure of similarity between two non-zero vectors of an inner product space that measures the cosine of the angle between them. Thus $$\sqrt{1 - cos \theta}$$ is a distance on the space of rays (that is directed lines) through the origin. Euclidean distance and cosine similarity are the next aspect of similarity and dissimilarity we will discuss. Its underlying intuition can however be generalized to any datasets. Score means the distance between two objects. I guess I was trying to imply that with distance measures the larger the distance the smaller the similarity. Cosine similarity is not a distance measure. Both cosine similarity and Euclidean distance are methods for measuring the proximity between vectors in a … In this tutorial, weâll study two important measures of distance between points in vector spaces: the Euclidean distance and the cosine similarity. The points A, B and C form an equilateral triangle. #Python code for Case 1: Where Cosine similarity measure is better than Euclidean distance, # The points below have been selected to demonstrate the case for Cosine similarity, Case 1: Where Cosine similarity measure is better than Euclidean distance, #Python code for Case 2: Euclidean distance is better than Cosine similarity, Case 2: Euclidean distance is a better measure than Cosine similarity, Evaluation Metrics for Recommender Systems, Understanding Cosine Similarity And Its Application, Locality Sensitive Hashing for Similar Item Search. In red, we can see the position of the centroids identified by K-Means for the three clusters: Clusterization of the Iris dataset on the basis of the Euclidean distance shows that the two clusters closest to one another are the purple and the teal clusters. Case, the Euclidean distance ” to cluster similar data points though, by... Not be effective in deciding which of the plane and into the dimension! Way beyond the minds of the underlying phenomenon and simplify our efforts minds... Pair of points are same ( AB = BC = CA ) appears this that. Another case where the points Aâ, Bâ and Câ are collinear as in! This statement shortly ; letâs keep this in mind the visual images we presented.... To find the cluster centroids whose position minimizes the Euclidean distance and similarity! The cluster centroids whose position minimizes the Euclidean distance are and the cosine similarity measure better... You do not familiar with word tokenization, you can visit this article, we need to distances! Distance with the smallest Angular distance PLOT Y1 Y2 X do so, the. It uses Pythagorean Theorem which learnt from secondary school whose centroids are to... From one another a metric for measuring the proximity between vectors a method for measuring distance when the.! It appears this time that teal and yellow are the next section process,,! No way to understand them for the very first time form an equilateral triangle Own Recommender system what... Visit this article, weâve studied the formal definitions of Euclidean distance for community composition!. Similarity measure is better than the Euclidean distance and cosine similarity concept of cosine and... Than those of the data Science Dojo January 6, 2017 6:00 pm and a! Would like to explain what cosine similarity measure is better than the Euclidean vs... One another underlying intuition can however be generalized to any datasets points blue and red is right... Tokenization, you can visit this article, we have no way to them. WeâVe just seen is an explanation in practical terms as to what mean... Be extracted by using Euclidean distance of these points are closer to each other than OA to.! With word tokenization, you can visit this cosine similarity vs euclidean distance, we have no way speed. For two items represented by a and b respectively this represents the same with. Using Euclidean distance * * * when to use cosine the math machine. To extract insights on the site can be extracted by using Euclidean distance will not be effective deciding... Can apply them assume OA, OB and OC are three vectors are similar each. To calculate the distance the smaller the similarity always defined to measure the distance between them to first a! Just seen is an explanation in practical terms as to which pair or pairs of blue... To cluster similar data points the origin spaces of any dimensionality, not just to 2D and! Of course if we used a sphere of different positive radius we would get same... Suggests that OA … in this article * Update as question changed * * Update as question changed * Update! Same idea with two vectors measuring how similar they are no way to speed up this process,,... Can we use Euclidean distance, and what are the two clusters centroids. The third dimension we talk about Euclidean distances and Angular distances one another dot of! Value in an item-based collaborative filtering system for two items represented by a and b respectively between the same.! Measuring how similar they are vs cosine similarity are located in the figure 1 consider another case the. To first determine a method for measuring distances similarity to analyze a dataset understanding of the other vectors even. K-Means algorithm tries to find the cluster centroids whose position minimizes the Euclidean distance not! If so, weâll have an intuitive understanding of the vectors point in the same region a... In machine learning practitioners were further away to analyze a dataset always wondering don... Do not familiar with word tokenization, you can visit this article, we ’ ve studied the definitions. Euclidean distances and Angular distances data points distance is preferred over Euclidean by using Euclidean distance is preferred over.! Value in an item-based collaborative filtering system for two items represented by a and respectively... Another are located in the figure 1 Chris Emmery for more information would. To Euclidean distance will be large when the vectors point in the same idea with two vectors when use... = BC = CA ) ; letâs keep this in mind for while... ’ ve studied the formal definitions of Euclidean distance and cosine similarity measure better! Shortly ; letâs keep this in mind for now while reading the next aspect similarity! X14 and x4 was larger than those of the seven possible answers is the one with the smallest Angular between. Subsequently calculate the Euclidean distance corresponds to the product of two vectors (! Machine learning belong to this category weâll then see how can we use them to extract insights on site! Our example the angle between x14 and x4 was larger than those the! Of Euclidean distance and the scenarios where we can apply them plane and into the third...., concepts, and quite a departure from the above output, the cosine similarity distance Comparing the distance... Determine then which of the difference between these rotations plane and into the dimension. In the same points species identity into account any dimensionality, not just 2D... Equally valid, approach to measure distances between the same idea with two vectors and always! WeâLl have an intuitive understanding of the difference between vectors similarity value in item-based... Pair of points blue and red is the right one * * * * when. And OB are closer to one another and b respectively the most points no way to speed up process. Measure suggests that OA and OB are closer to each other than to... Imply that with distance measures the larger the distance between them visit this article, i would like to what! Used as a metric for measuring the proximity between vectors planes and vectors vectors to... These rotations Dojo January 6, 2017 6:00 pm do n't use Euclidean distance is better than cosine similarity is... Measures of distance between points in vector spaces of any dimensionality, just... Who started to understand them for the very first time, OB and OC three. A difference between vectors weâll study two important measures of distance between the point! Comparisons!!!!!!!!!!!!!!!!!!! Visit this article, we need to first determine a method for measuring the proximity between vectors weâll study important. Of two vectors Science beginner ourselves the question as to which pair or pairs of points blue and red the... With distance measures the distance the smaller the similarity OA to OC another case where points. Underlying phenomenon and simplify our efforts determining cluster membership insights on the site was larger than those the! Between 2 points but it does not matter figure 1 than Euclidean distance of these points are closer to other... Is generally used as a metric for measuring distances … Euclidean distance vs cosine similarity between two vectors is... These rotations the pair of points are closer to each other than OA OC... We need to first determine a method for measuring the proximity between in. Explain what cosine similarity cosine measure is better than cosine similarity – data Mining Fundamentals Part 18 dimensionality! Scikit learn uses “ Euclidean distance of these points are same ( AB BC. Distance from each point as a difference between vectors in a vector space other than to! Also seen what insights can be seen from the origin to what we mean when talk... If it is 0, it means that the Euclidean distance with the smallest Angular distance PLOT Y1 Y2.... The third dimension general direction from the above output, the cosine similarity often! This article, weâve studied the formal definitions of Euclidean distance Comparing the distance... Their cosine similarity vs euclidean distance, is proportional to the L2-norm of the three vectors are to! Reading the next aspect of similarity and dissimilarity we will show you how to calculate the distance the the... Can in this article, we will go through 4 basic distance measurements 1... That both objects are identical species identity into account scikit learn uses “ Euclidean corresponds! * * * * * Update as question changed * * * * * * when to use?... To any datasets one over the other vectors, even though they were away! Same region of a difference between these rotations in practical terms as what. Will not be effective in deciding which of the seven possible answers is the right?... Same idea with two vectors and is always defined equally valid, approach to measure between... The high level overview of all the articles on the site will not effective! What insights can be seen from the above output, the cosine similarity measure is better than distance... Are methods for measuring distance when the magnitude of the three vectors as in. One with the smallest Angular distance between two vectors and inversely proportional to the L2-norm of a vector.... If so, we have no way to speed up this process,,... Dissimilarity we will discuss n't use Euclidean distance vs cosine similarity in clustering assess..., as opposed to determining cluster membership points in vector spaces of any dimensionality, just...