4.16 Tuesday, September 5, 2017

================================== 
Top new questions this week: 
==================================

[Finding \(n^{\text {th}}\) largest/smallest element] https://mathematica.stackexchange.com/questions/154944/finding-n-textth-largest-smallest-element

Ordering can quickly find the position of the largest/smallest element in a list, but finding the position of the \(n^{\text {th}}\) largest/smallest element is much slower:

data = RandomReal[10, 10^7];

...

- asked by Carl Woll (13 votes), answered by Carl Woll (12 votes)

—————————-

[Fast pairwise SameQ test of an ordered list] https://mathematica.stackexchange.com/questions/155017/fast-pairwise-sameq-test-of-an-ordered-list

I have an ordered list of \(N\) numbers, and I want to find out whether adjacent numbers are SameQ or not, returning a list of 0s and 1s of length \(N-1\). One approach is something like:

...

- asked by Carl Woll (11 votes), answered by jkuczm (8 votes)

—————————-

[Given an ordered set S, find the points in S corresponding to another list] https://mathematica.stackexchange.com/questions/154893/given-an-ordered-set-s-find-the-points-in-s-corresponding-to-another-list

Given a sorted list of numbers \(S\), I want to create a function that accepts a list of numbers \(L\) and for each number \(l \in L\) it returns the index of the largest number \(s \in S\) such that ...

- asked by Carl Woll (11 votes), answered by nikie (13 votes)

—————————-

[Geolocate multiple IP addresses] https://mathematica.stackexchange.com/questions/155076/geolocate-multiple-ip-addresses

I would like to geolocate a few hundred IP addresses (as part of analysing server logs). What is the best way to do this using Mathematica?

Does Mathematica have any builtin functionality for this?

...

- asked by Szabolcs (9 votes), answered by Szabolcs (9 votes)

—————————-

[How to connect two images] https://mathematica.stackexchange.com/questions/155093/how-to-connect-two-images

I have talk about how to catenate two images whose have same part totally in my this post.

But in this case two images have similar information, not totally same.

img1 = Import @  ...

- asked by yode (9 votes), answered by Kuba (8 votes)

—————————-

[Filter elements in descending order] https://mathematica.stackexchange.com/questions/154761/filter-elements-in-descending-order

I want to solve the following problem efficiently:

Given a list of pairs (value, data), I want to remove all the pairs so that the resulting list has the value property of its elements sorted. That ...

- asked by José D. (9 votes), answered by Mathe172 (9 votes)

—————————-

[Changing numbers inside list to a list] https://mathematica.stackexchange.com/questions/154911/changing-numbers-inside-list-to-a-list

I have a list wich contains numbers and other lists, and what I want is to change every number x to x,0.

So if the function I’m seeking is called f, then

a = {1,Pi,2+3I,{1,2},{3,4},-2} 
 
 
f[a]  ...

- asked by Garmekain (8 votes), answered by John Joseph M. Carrasco (10 votes)

================================== Greatest hits from previous weeks: ==================================

[Is it possible to draw this figure using Mathematica?] https://mathematica.stackexchange.com/questions/110848/is-it-possible-to-draw-this-figure-using-mathematica

The figure is

See the how-to video or a speeded-up GIF.

I believe it should be possible to draw this figure programmatically using some Random function, but I’m rather new to Mathematica, so I ...

- asked by AccidentalFourierTransform (62 votes), answered by M.R. (86 votes)

—————————-

[Can Mathematica do symbolic linear algebra?] https://mathematica.stackexchange.com/questions/3242/can-mathematica-do-symbolic-linear-algebra

For instance, is there some way I can say "let A and B be arbitrary real \(m\times n\) and \(k\times m\) matrices, Simplify[Transpose[Transpose[A].Transpose[B]]]" and Mathematica would simplify it to B.A? ...

- asked by nikie (47 votes), answered by helen (25 votes)

================================== Can you answer these? ==================================

[Strange result for an improper integral \(\int _{0}^{1}\frac {x^{-1/2}}{e^{x}-1} \sin \left (\frac {1}{x}\right )dx\)] https://mathematica.stackexchange.com/questions/155066/strange-result-for-an-improper-integral-int-01-fracx-1-2ex-1-s

The improper integral \[\int _{0}^{1}\frac {x^{-1/2}}{e^{x}-1} \sin \left (\frac {1}{x}\right )dx\] is convergent conditionally.

(Applying Dirichlet Test, \[\frac {x^{-1/2}}{e^{x}-1}\] ...

- asked by user250236 (1 vote)

—————————-

[Perplexing simplification of RotationMatrix] https://mathematica.stackexchange.com/questions/154793/perplexing-simplification-of-rotationmatrix

The result of

FullSimplify[RotationMatrix[, {Cos[], Sin[], 0}],  > 0].{0, 0, 1}

in Mathematica 11 is

{Sign[Sec[]]^2 Sin[] Sin[], -Cos[] Sin[], Cos[]}

instead of the nicer result ...

- asked by theindigamer (1 vote)

—————————-

[collecting terms with different order] https://mathematica.stackexchange.com/questions/154849/collecting-terms-with-different-order

I am using homotopy perturbation method to solve nonlinear ODE.

The first step is to introduce P parameter and collect different order of P.

The code is like this:

Collect[(1 - 
 p) ((((1 + 
        ...

- asked by sajad.sharhani (1 vote)