# How to write a function-generating code in Python/MATLAB?

I want to write a code that generates a function I(t) that satisfies the following condition:

$\frac{\big<I(t)^2\big>}{\big<I(t)\big>^2} > 2$

In other words,

$\frac{\lim_{T \to \infty}\int_0^T I(t)^2dt}{(\lim_{T \to \infty}\int_0^T I(t)dt)^2} > 2$

Is it even possible to do that? If not, please tell me what am I missing?

P.S.- The function should have a non-Gaussian distribution.

• Any function in $L^1$ that is not in $L^2$ will satisfy this condition (e.g., $I(t)=1/sqrt(t)$ for $t\leq 1$ and $0$ else). – Christian Clason Nov 4 '14 at 13:23
• I don't think there is currently a way to program those rules into Python or MATLAB and have it return a valid function. – Geoff Oxberry Nov 4 '14 at 20:26
• You need to specify what distribution over these functions you want. – Memming Nov 4 '14 at 23:00
• @Memming A Gaussian distribution. Thank you for reminding me to add that detail in the question. – AKSHIT KUMAR Nov 5 '14 at 9:49

If the function is known to have a Gaussian form then

$$\int\limits^{\infty}_0 \left( A \exp{\left(-\alpha\, t^2\right)} \right)^2 dt > 2 \int\limits^{\infty}_0 A \exp{\left(-\alpha\, t^2\right)} dt$$

is true for any choice of the pair ${ \alpha, A } \in \Re$ where $\alpha > 0$. If

$$A > 2 \sqrt{2}$$

then your equality is satisfied for any $\alpha$. You could generate arbitrary pairs of $A$ and $\alpha$ in Python quite easily with

import numpy as np
A_vec = np.linspace(A1,A2,ALength)


and similarly for $\alpha$

• How did you get a limit on A? What I did was use $$\int_0^\infty exp(at^2)dt = \frac{\sqrt{\pi}}{2\sqrt{-a}}$$ in $$\int_{0}^{\infty}\big(A\enspace exp \big(-\alpha t^2\big)\big)^2dt > 2\int_{0}^{\infty}A\enspace exp \big(-\alpha t^2\big)dt$$ With that, I get $\alpha > 2 \pi$ but $A^2$ gets cancelled on both sides. – AKSHIT KUMAR Nov 10 '14 at 8:53
• If I start with what you have $$A^2 \frac{\sqrt{\pi}}{2\sqrt{2} \sqrt{\alpha}} > A \frac{\sqrt{\pi}}{\sqrt{\alpha}} \,\,\Rightarrow A > 2 \sqrt{2}$$ also note that your first integral has some issues if $a > 0$. – John M Nov 10 '14 at 16:24
• Can you suggest an answer for a non-Gaussian function that satisfies the same condition of: $\frac{\big<I(t)^2\big>}{\big<I(t)\big>^2} > 2$ ,i.e, $\frac{\lim_{T \to \infty}\int_0^T I(t)^2dt}{(\lim_{T \to \infty}\int_0^T I(t)dt)^2} > 2$ – AKSHIT KUMAR Nov 22 '14 at 11:53
• Please note that it is a SQUARE of the integral in the denominator/RHS. You and I missed it in the previous comments. – AKSHIT KUMAR Nov 22 '14 at 11:56
• Not sure what happened, but $\alpha > 2 \pi$ in this case. Just use the identity of the gaussian integral, and square it. For non-gaussian functions it is tricky. I'll think about it more. – John M Nov 22 '14 at 17:44