Create a randomised list of element using a vector with 4 words in R

I have a vector with 4 words :
v -> c(“pevilo”, “tufimi”, “patoji”, “nasola”)

I would like to create a list that repeats 24 times each element, but with 2 conditions :

  • cond 1 : none of the element can be repeated twice a row (Example : Cha , Cha)
  • cond 2 : The same pair of element cannot be repeated twice in a row (Example : Cha, Adri, Cha, Adri)

I have tried with this code in r :

V <- c (“pevilo”,”tufimi”,”patoji”,”nasola”)
list2 <- replicate (32, sample(V, 4, replace = FALSE))

But then I have 32 different vectors and the 2 conditions are sometimes violated.
Any ideas on how I could get this done using r ? Or has anyone a similar code ?

Thanks a lot !

How to assign the entire 2d or 1d vector a particular value?

For ex:

I want to assign the entire char a(n)(m) (or a 2d vector) ‘=’ .

The for loop way is kind of place taking. I wonder a function that can do it in a line.
Just like we are able to assign 0 to the entire array :int a(n)(m)={0}.

Plotting translated vector fields from user-defined functions

I have two time- and space-dependent vector fields, one which is:

$mathbf A(x,y,t) = -y , t , hat{mathbf x} + x , t , hat{mathbf y}, tag 1$

and another $mathbf B(x,y,t)$ which is $mathbf A$ translated $3/2$ units in the positive $hat{mathbf x}$ direction and $3/2$ units in the positive $hat{mathbf y}$ direction, so:

$mathbf B(x,y,t) = – left( y – dfrac{3}{2} right) , t , hat{mathbf x} + left( x – dfrac{3}{2} right) , t , hat{mathbf y}. tag 2$

I want to plot $mathbf B$ evaluated at $t = 1$ in Mathematica. I tried two different ways but only one worked. The first one is directly from the expression (2):

$mathbf B(x,y,1) = – left( y – dfrac{3}{2} right) , hat{mathbf x} + left( x – dfrac{3}{2} right) , hat{mathbf y}. tag 3$

The resulting plot correctly shows the translation in both axes:

StreamPlot({3/2 - y, -(3/2) + x}, {x, -5, 5}, {y, -5, 5})

Figure 1

The second way I plot $mathbf B(x,y,1)$ is by first defining $mathbf A$ and then translating it. However, the resulting plot only shows $mathbf A$ translated in the $hat{mathbf x}$ direction, even though B(1) gives the same expression as (3):

Clear(A, B);
A(t_) := {-y*t, x*t};
B(t_) := ReplaceAll(ReplaceAll(A(t), x -> x - 3/2), y -> y - 3/2);
StreamPlot(B(1), {x, -5, 5}, {y, -5, 5})

Figure 2

Note that if you use the function VectorPlot instead of StreamPlot, the error is still present in the second method.

Why the second method didn’t work? I want to fix it because I’m also using Mathematica to automatically translate the field $mathbf A$.

Given that B(1) is the same expression as (3), I think the problem is related with user-defining B.

I will do cool vector illustration for t shirt, jaket, etc. for $50

I will do cool vector illustration for t shirt, jaket, etc.

Basic Pack:

1 Figure

Only Black and White (Line Art/simple)

HD JPEG and PNG Transparent background

Standard Pack:

1 Figure

Medium detail with many colors (Stander Qualities)

HD Jpeg and Png Transparent background

Source file Editable (Ai, Eps)

Premium Pack:

1 Figure

High detail with many colors

Premium look

HD Jpeg and Png Transparent background

Source file Editable (Ai, Eps)

Why choose me.


> 100% customer satisfaction guaranteed

> Delivery Within 3 Days

> Reliable Communication

> Ready your product like as premium

> Full Editable

> 24 hours support

>Quick Response & Friendly Communication

>VIP customer support.

>Quick response.


if there are questions please contact me first, and if in doubt to order, confirm first so that there is no order cancellation.


linear algebra – How to eliminate « a priori » all vectors in a list of vectors whose scalar product with a given vector is zero without calculating the product

How to eliminate « a priori » all vectors in a list of vectors, whose scalar product with a given vector is zero, without actually calculating the product ?

One solution would be to store the components (as rows) in a relational database table and the to discard all vectors (with a SELECT statement) whose components are NULL in the columns where the components of the given vector are not NULL.

However that’s probably overkill.

I was thinking of associating with each array a second array of bits to make a sort of mask, in order to be able to quickly compare the vector’s « masks » to implement a kind of pre-selection.

Is there a known straightforward solution to this problem?

Probablity of Gaussian vector belonging to the instersection of two half-spaces

Define $xsimmathcal{N}(0,Sigma)$ be $n$-dimensional Gaussian vector and two half-spaces $Q_1:={xinRe^n:a^top xge 0}, Q_2:={xinRe^n: b^top xge 0}$, where $a,b$ are unit vectors. What is the probability that $x$ falls into both half-spaces $P_x(xin Q_1cap Q_2)$?

Due to symmetry $P(xin Q_1)=P(xin Q_2)=1/2$. This can also be formally proven explained by using the special case of $mu=0$ from here. In case of the intersection, the answer must clearly depend on the vectors $a,b$, as it is the case for the two extreme cases where $a=b$ and $a=-b$ leading to $P_x(xin Q_1cap Q_2)=1/2$ and $P_x(xin Q_1cap Q_2)=0$ respectively. My main question is, is it possible to state the probability in terms of $a,b$ only, and regardless of the covariance structure $Sigma$?

linear algebra – Is there an efficient algorithm to project a vector onto the eigenbasis of a symmetric matrix?

Let $H$ be a symmetric matrix over $mathbb R^n$. Given some vector $u$, I would like to express $u$ in the eigenbasis for $H$. Can this be done efficiently, perhaps using some kind of iterative method? I know there are iterative methods for computing the eigenbasis itself, but computing the entire eigenbasis would represent quadratically more data than I actually need ($n^2$ reals rather than only $n$), so I was hoping I might be able to get a speed up by using a more targeted method.

I only have implicit access to $H$ – i.e. I can compute matrix-vector products $Hx$. I would like to avoid having to actually compute $H$ if possible, although I would be happy with anything faster than computing $H$ and then diagonalizing it directly.

ag.algebraic geometry – Unsplitting sequence of vector bundles

Let $V$ be a $n$-dimensional complex vector space. Using Grothendieck’s notation, we define the Grassmannian $G(k,V)$ as the space of $k$-quotients of $V$ or, equivalently, as
G(k,V)={ mathbb P W subset mathbb P V: dim W=k}.

On $G(k,V)$ we have the tautological bundle sequence:
0 to mathcal S^vee to V otimes mathcal O_{G(k,V)} to mathcal Q to 0.

We suppose that the following short exact sequence holds:
0 to mathcal Q otimes mathcal S^vee to N to wedge^2 mathcal Q to 0,

where $N$ is another vector bundle on $G(k,V)$. I know that in the case $k=2$
Ext^1(wedge^2 mathcal Q, mathcal Q otimes mathcal S^vee)=H^1(G(k,V), mathcal Q otimes mathcal S^vee otimes (wedge^2 mathcal Q)^vee)

become, using $wedge^2 mathcal Q=mathcal O(1)$ and $mathcal Q(-1)=mathcal Q^vee$,
Ext^1(mathcal O(1), mathcal Q otimes mathcal S^vee)=H^1(G(k,V),mathcal Q^vee otimes mathcal S^vee)=H^1(G(k,V), Omega^1)=mathbb C,

hence the short exact sequence do not split. I expect that this happens also in the general case, but I cannot prove it. How can I proceed?

linear algebra – $x,y$ are vectors and $Lambda$ is a symmetric square matrix, $y = frac{x}{sqrt{x^T Lambda x}}$ solve for vector $x$

$x,y$ are vectors and $Lambda$ is a symmetric square matrix, $y = frac{x}{sqrt{x^T Lambda x}}$. $y$ is known, solve for vector $x$

This would be trivial for scalar cases, but somehow I struggle to wrap my head around for vectors and matrixes. We can get $y^Ty = frac{x^Tx}{x^T Lambda x}$, but how do we isolate $x$ out?

bluetooth – Are Fake AirPods Pro a risk vector for malware?

Has anybody heard of this? I have a pair of fake AirPods the use of which has led to some odd behavior. I suspect them as a malware vector. I wonder if once paired, they are trusted the way, say, firewire-connected devices and USB devices before them have been found to be, and often still are, IIRC, trusted. over FireWire, Thunderbolt, USB 4.0, etc is documented.

AirPod Pros support much more functionality than standard Bluetooth so the capabilities are such that “can Bluetooth paired devices infect an iPhone” is a narrower question. I did look at such answers, which we do have, but still, not a dupe. Because there is a lot of proprietary Apple tech along with/on top of Bluetooth.

Related questions I looked at:

Q1: This doesn’t adequately address the question because commands can be issued over bluetooth. Certainly a device connected as a keyboard / able to send keystrokes would be able to install malware on a Mac.
Q2: This doesn’t seem adequate, and seems out of date. I found the AirPods case has 1MB flash memory, and I can’t find tech specs for the H1 beyond that it is ~12mm^2… just function lists.