Is it possible to Calculate This integral using fourier transform?

I am trying to calculate $$displaystyleintlimits^{cssId{upper-bound-mathjax}{infty}}_{cssId{lower-bound-mathjax}{-infty}} dfrac{x^2}{left(x^2+a^2right)left(x^2+b^2right)},cssId{int-var-mathjax}{mathrm{d}x}$$
for $a,b >0$

I recognize that I can split it to multiply of the derivative of $frac{ln(x^2+a^2)}{2}$ and $frac{ln(x^2+b^2)}{2}$ but I am stuck on calculate transform Fourier of the $ln$ function

How to calculate the largest eigenvalue and its eigenvector of a 20*20 matrix more quickly?

Actually, the matrix is an adjacency matrix of a network. The code is:

A1 = GridGraph({20, 20}, PlotLabel -> "20*20 nodes", 
VertexLabels -> "Name")
A = AdjacencyMatrix(A1);

I want to calculate the eigenvalue of A and its eigenvector.
I have tried the normal function such as Eigenvalues and Eigenvectors. But it need much time and may not get a result(my laptop have not complete the calculation yet.)
The code is:

(Lambda) = N(Eigenvalues(Normal(A), 1))((1));
uA = N(Eigenvectors(Normal(A), 1))((1));

I want to know whether there is a method or parameter to reduce the time.

Given a random variable whose density is given by a uniform distribution, can we use the expected value to calculate another expected value?

If given a random variable X whose density is given by the following uniform distribution, p(x)=

( begin{cases}
1 & if 0 <x < 40 \
0 & elsewise


the price of x is x^2. Say we wanted to find the expected cost would we integrate like this

$int_{0}^{40} x^2 * p(x) ,dx$

and take our final answer as the result of this or like this?

$int_{0}^{40} x * p(x) ,dx$

and then we would square the latter to get the cost?

They seem very similar yet they yield different results. Can anyone explain what the procedure is here and why?

probability – How to calculate expected value for a bid contract?

A company plans to open a bid of $3000 per tonne for a contract to supply 1000 tonnes of metal. Assume that 2 competitors A and B will place bids. The probability that A places a bid less than 3000$ per tonne is 0.3 and probability that B places a bid less than $3000 per tonne is 0.7. If the lowest bidder wins the contract, what is the Expected Value of the contract when it is assumed that the each competitor will bid independently.

I have no idea to do this problem. All I know is that if there’s a specific $ value for a known probability then I can get the expected value of it using the product of it. But in this question no such value is given but only a range. So your help is much needed. Thank you very much!

Also if anyone can provide with related tags you are most welcome.

How do I send Dogecoin to multiple different addresses and calculate the transaction fee for it?

I’m trying to build an application to send Doge from a single address to multiple addresses where each address will get a different amount of coins. I’m unsure of how to build the transaction to send from one address to many addresses while paying only one transaction fee for the entire transaction.

I know that the fee rate is 1 DOGE per KB but I am unsure of how exactly to calculate the transaction size.

How would I be able to first create a transaction for this requirement and then calculate the size and fee for that transaction?

Thanks in advance!

aperture – How to calculate the optimal pinhole size?

The earliest investigation of the right constant c that I am aware of is Petzval’s 1859 On the camera obscura. The paper is predominantly about a new lens design he has created but he begins with an investigation of the optimum radius of a pinhole for resolution of the image. Resolution is defined as the ability to discern the difference of two very close objects in the image. If we imagine the objects as point-sources of light then we will be able to resolve that there are two if the spots of light they cast in the image do not substantially overlap. Thus to determine the resolving power of a pinhole we need to determine the diameter of the image of a point-source of light. If the pinhole is big then classical optics say the size of the image is the same as the size of the pinhole. If the pinhole is small diffraction causes the image of a point-source of light through a pinhole to consist of a brighter central spot surrounded by a series of concentric dark and light rings. Petzval creates a equation for the diameter, D, of the largest, central spot of light in cast through a pinhole which attempts to take into account both the classical optics (“large” pinholes) and diffraction (“small” pinholes):

D = 2r + fλ/r

where r is radius of pinhole, f is focal length and λ is wavelength of light. Using elementary calculus he finds that the diameter of light is minimized when

r = sqrt{fλ/2}


D = sqrt{2} sqrt{fλ} = 1.414 sqrt{fλ}.

In 1891 Lord Rayleigh published his first On pin-hole photography(p. 493) where he proposes

D = sqrt{2} sqrt{fλ}

based on the computation that with such a pinhole size the maximum phase difference between any two rays of light is no more than λ/4 and thus cannot substantially interfere destructively. He posits this as a good rough criterion for the perceived diameter of the image of a point source of light through a pinhole. He discussed having demonstrated by experiment that this value is good in practice.

In 1891 Lord Rayleigh published his second On pin-hole photography In this paper he criticizes Petzval’s argument for being unsound but notes that it gives the same value that was determined by rough calculation and experimentally in his previous paper. Then, using Lemmel’s exact solution to the computation of the diffraction image of a point-source of light through small apertures, he computes the shape of the diffraction patterns formed by small circular pinholes. He then calculates the size of the central dot for c = 1, sqrt{2}, 2, sqrt{6} and 2 sqrt{2}. He notes that the two cases that have the smallest diameter of central image spot are c = sqrt{2} and c=2.

He then describes an experiment done with a range of actual pinholes and determines that the best was equivalent to c = 1.89 which falls in the zone he determined from theory. The sizes of pinholes he tried that were smaller and larger than his experimentally chosen best one were equivalent to c = 1.74 and 2.11 so his value of c should be considered good to within about 10%.
Before moving on let me recommend the web page Pinhole Design – what Lord Rayleigh really said for a discussion of Lord Rayleigh’s other results from this paper, in particular the fact that there is an f-stop number past which lenses are not better than pinholes. They also discuss the implications for what will be in focus for pinhole cameras (it is not the whole field).

In 1971 Young performed a series of experiments with very fine differences in constant c which he reported in Pinhole Optics. He determines that the value of c which optimizes resolution is c=2. These results are probably good to about 1% which is quite precise.

In a 2004 presentation The Pinhole Camera Revisited or The Revenge of the Simple-Minded Engineer Carlsson points out however that that resolution is not the only factor that affects how sharp we perceive an image to be. Another important factor is the Contrast. Optimum contrast is determined not by the smallest radius of the central spot in the diffraction patter through a pinhole, but how much of the total light is contained in the central bright spot, in other words, how concentrated the light it around the center. He provides some very good pictures demonstrating the difference between resolution vs. contrast and to my eye he is correct that sacrificing resolution for increased contrast improves the image. His value of c which optimizes contrast is c = 1.56. The closest other values of c that he reports are c=1 and c=2 so c=1.56 should be considered good to within about 20%.

I think the take away from all this is that c=2 seems to be well supported by experiment and theory for maximizing resolution (being able to discern the difference between two close objects) but for images which appear “sharp” to human eyes, contrast is important too and thus one should use a smaller value of c, perhaps as low as c=1.56.

unity – How to calculate High Score in game when there are two units in the game?

In my game I am solving a problem, and I am getting certain points for each problem.
Just like collecting numbers falling from the top.

Now I want to calculate a high score on the basis of two items i.e. solved points and time it took to solve until the user get it wrong.

How would I rank any player based on the two events?