ios – How to change the background image of the home screen at random

How can I set the background image of my iPhone to change automatically?
I have an album called Wallpaper. I want these wallpapers to be randomly displayed as wallpapers on my home screen

I use ios 13

I'm looking for some improvements with shortcuts more than for third-party apps.
If there is a third-party app for this, they are also welcome

Numerics – How to generate random waves

I want to generate a bunch of $ N $ Random waves, where the wave vector and the phase are random numbers, that's my code

 `Nwaves = 3;   
theta := 2*Pi*RandomReal[];  
phi := ArcCos@RandomReal[{-1, 1}] ;
alpha :=  RandomReal[{0, 1}];
u = Sum[ Sin[ Cos[theta] Sin[phi]  x +  Sin[theta] Sin[phi]  y  +   
    Cos[theta] z + alpha], {Nwaves}]
v = Sum[-Cos[ Cos[theta] Sin[phi]  x +  Sin[theta] Sin[phi]  y  +  
     Cos[theta] z + alpha], {Nwaves}]` 

This code changes the parameters for each N. And the problem must have the same cosine, sine, and alpha values. And after every iteration, they have to change as N varies.

Probability – Which random walk can produce a gamma distribution in the border area?

Symmetrical random walk, its probability distribution is the binomial coefficient, in the continuous boundary the Gaussian distribution:

$ displaystyle e ^ {- x ^ {2}} $

What kind of random walk is the probability distribution in the limit of the gamma distribution:

$ displaystyle xe ^ {- x} $ to the $ x geqslant 0 $ ?

or simpler, an exponential distribution:

$ displaystyle e ^ {- x} $ to the $ x geqslant 0 $ ?

We are looking for something as simple as a random walk at a certain time, in the steady limit, exponential factor $ e ^ {- x} $ Factor shows up. At each step, the rules for casual walking should be as simple as possible. If possible, we want each step of the random walk to be an iid random variable (independent and identically distributed). Is that possible ?


Traffic – Random increase of 700% for a site hit

I have a website with a domain registered for about 10 years
In the past, the site had a daily traffic of approximately 400 to 500 hits per day. In the last 4 weeks, the number of visitors to the website increased from 400 to 500 to 6-8,000 per day

The current average session duration is ~ 17 seconds – bounce rate ~ 42%
Compare with an average session duration of ~ 30 seconds and a bounce rate of 80%

I have no doubt that traffic is generated from bots – and think it comes from the competition

Should I be worried about that?

Every advice is greatly appreciated

django orm – Selection / update of 10 million random entries

Here is more or less my model:

class Foo(Model):
    bar = ForeignKey(Bar)

I used Model Mommy to create 10 million Foos. Unfortunately, it also meant creating 10 million BarI accidentally, so I want to keep 10000 Bars and assign each one Foo to them randomly, and then delete the rest. The end result should be 10 million Foos and 10000 Bars.

Here is the code I have that works and the fastest version so far:

# Randomly select Bars and assign them to each Foo in memory
from django_bulk_update.helper import bulk_update
bars = list(Bar.objects.values_list('id', flat=True))
bars = bars(:10000)
count = 0
foos = ()
for foo in Foo.objects.only('bar_id').iterator():
    if foo.bar_id not in bars:
        foo.bar_id = random.choice(bars)
        count += 1
    if count and (count % 5000 == 0):
        x = bulk_update(foos)
        foos = ()

# Then delete Bars with no Foos

Despite batch processing and in-memory randomness, performance is poor. What is the right solution?

Linear Algebra – Not empty random polyhedron construction

I know every sentence (polyhedron)

mathbb {S} = {x in mathbb {R} ^ n | A x leq b }

Where $ A in mathbb {R} ^ {q times n} $. $ q in mathbb {R} ^ q $ is convex, but there is no guarantee that it is not empty. Is there a convenient way to construct a nonempty (random!) Polyhedron?

At the moment I am building a matrix with full rank $ B = e ^ C $ through the use $ e ^ C e ^ {- C} = I $ is always invertible (hence full rank) and $ C = rand (m) $ MATLAB edge with $ m> n, q $ and reduce $ B $ to the desired dimensions of $ A $, It works, but with this method you have to check for non-emptiness and solve a linear feasibility problem.

Later I would like to build a set

mathbb {Q} = {x in mathbb {R} ^ n | A x leq b, C x = d }

it also has to be random and not empty. Thanks for your help. Please be nice, engineers are not mathematicians.

Probability theory – approximation for the sum of random variables

I have an exact CDF ($ F_ {X_i} (x) $) and PDF ($ f_ {X_i} (x) $) of a random variable $ X_i geq 0 $ which contains special functions. I needed an approach around that $ x = 0 $I have therefore derived an approximation as
$$ F_ {X_i} (x) approximately one x log (a x) $$
$$ f_ {X_i} (x) approx-a ( log (a x) +1) $$
Where $ a> 0 $and this CDF is tight.

However, I now need the CDF from
$$ Y = sum_ {i = 1} ^ {N} X_i $$
Where $ X_i $s are i.i.d.

I tried to tie this $ left (F_ {X_i} (x) right) ^ N $ or $ left (F_ {X_i} (x / N) right) ^ N $, I found that these are too loose for little ones $ N $,

If someone has a good idea, deduce $ F_Y (y) $ more precisely with small ones $ x $, please share with me.

Statistics – Why is this inequality of truncated random variables correct?

Given an order $ X_k $ from $ k $ independent random variables reading book says I can form "truncated" random variables, i.

$ X_k (n) = X_k cdot textbf {1} _ { { omega: | X_k ( omega) | leq n }} $

Where $ omega $ means a result from the sample space. Define $ S_n $ and $ has {S} _n $ as:

S_n = X_1 + X_2 + … + X_n

has {S} _n = X_1 (n) + X_2 (n) + … X_n (n)

So that means that $ has {S} _n $ is the sum of $ n $ truncated random variables. We also define $ m_n $ as:

m_n = mathbb {E} (X_1 (n))

Since the variable distributions (of $ X_k $) are the same ones we have $ m_n = mathbb {E} (X_k (n)) $ for all $ k geq 1 $,

The book reads that the following inequality is "evident" where given $ epsilon> 0 $, we have:

P bigg ( big | frac {S_n} {n} – m_n big | geq epsilon bigg) leq P bigg ( big | frac { has {S} _n} {n} – m_n big | geq epsilon bigg) + P bigg ( has {S} _n neq S_n bigg)

But I'm not clear at all and I got lost. How can we have the above inequality? (ie we could get some big ones $ X_k $ in the $ S_n $so that the left term is much larger than the truncated right term).