A finite dimensional algebra associated to the symmetric group Let $S_n$ be the finite group given as $n \times n$ permutation matrices.
Define for a given field $K$ the algebra $B_n$ as the subalgebra of $M_n(K)$ generated by all permutation matrices of $S_n$. (more generally we can do this for any subgroup of $S_n$ to associate to a finite group such a subalgebra. Often we will just obtain the group algebra, but not always.)

Question 1: What is the subalgebra $B_n$? Has it been studied before and does it have a name? Can we determine quiver and relations of the basic algebras of the blocks of $B_n$ (over a splitting field of $K$)?

Probably I should know this but I only feel really familiar with quiver algebras.
Here some things that I found out:
-$B_n$ has vector space dimension $(n-1)^2+1$ and is semisimple over a field of characteristic 0. The center of $B_n$ is two dimensional. This implies that the algebra is $M_{n-1}(K) \times K$ since we know two simples that are split over $K$, see the answer of Sasha.
-$B_2$ over a field of characteristic two is isomorphic to $K[x]/(x^2)$ (so it is a non-semisimple Frobenius algebra in this case).
-$B_3$ over a field of characteristic 3 is isomorphic to the the Nakayama with Kupisch series [2,3] (in particular it can have finite non-zero global dimension and thus is not a Frobenius algebra in general).

Question 2: Is it true that any field $K$ is a splitting field for this algebra? What is the number of simple modules?

Note that if any $K$ is really a splitting field, then the number of simples of the algebra $B$ is given by the vector space dimension of
$B/(rad(B)+[B,B])$, which seems to be 2-dimensional(?).
It would be interesting to see what the algebra for $S_p$ is for the primes $p=5$ and $p=7$ (up to Morita equivalence), but the algebra is not baisc anymore.
 A: I claim that if the field is the set of all real numbers or the set of all complex numbers, then $B_{n}$ is the set of all $n\times n$-matrices $A=(a_{i,j})_{i,j}$ where there is some $\lambda$ such that the sum of each row and the sum of each column is $\lambda$ (i.e. $\sum_{i}a_{i,j}=\lambda$ for each $j$ and $\sum_{j}a_{i,j}=\lambda$ for each $i$).
For simplicity, let $K=\mathbb{R}$. The Birkhoff–von Neumann theorem states that the convex closure of $S_{n}$ is precisely the set of all doubly stochastic matrices. Now, since the set of all doubly stochastic matrices is convex closed and closed under multiplication, $B_{n}$ is the set of all matrices of the form $\alpha_{1}A_{1}+\dotsb+\alpha_{r}A_{r}$ where $A_{1},\dotsc,A_{r}$ are doubly stochastic. However, after doing a simplification, the matrices of the form $\alpha_{1}A_{1}+\dotsb+\alpha_{r}A_{r}$ are precisely the matrices of the form $\alpha A-\beta B$ where $A$, $B$ are doubly stochastic and $\alpha,\beta\geq 0$.
Now clearly, every matrix of the form $\alpha A-\beta B$ where $A$, $B$ are doubly stochastic and $\alpha,\beta\geq 0$ is a matrix where the sum of every row and every column is $\alpha-\beta$. Furthermore, if $C$ is an $n\times n$-matrix where the sum of each row and each column is $\lambda$, then let $D=(1/n)_{i,j}$. Then $D$ is a doubly stochastic matrix. Now, there is some $\delta$ where $C+\delta D$ has only positive entries and $C-\delta D$ has only negative entries. Therefore,
$$C=(C+\delta D)/2+(C-\delta D)/2=(\delta D+C)/2-(\delta D-C)/2.$$ Therefore, if
$\alpha=(\delta+\gamma)/2$ and $\beta=(\delta-\gamma)/2$ and
$$A=(\delta D+C)/(2\alpha),B=(\delta D-C)/(2\beta),$$
then $A$, $B$ are doubly stochastic with $C=\alpha A-\beta B$.
The more general case
It turns out that for all underlying fields, $B_{n}$ is always equal to the set of all $n\times n$-matrices $A$ where there is some $\lambda$ such that the sum of each row and the sum of each column is equal to $\lambda$. We shall now prove this fact directly without using any facts from representation theory or other result beyond basic linear algebra.
Lemma: For all $n$, $\operatorname{Dim}(B_{n})\geq(n-1)^{2}+1$.
Proof: This can be proven by induction on $n$. The base case follows from the fact that $\operatorname{Dim}(B_{1})=1$ and $\operatorname{Dim}(B_{2})=2$.
Suppose now that $\operatorname{Dim}(B_{n-1})\geq(n-2)^{2}+1$.
Let $r=(n-2)^{2}+1$. Then let $s_{1},\dotsc,s_{r}\in S_{n-1}$ be linearly independent permutations. Then let $\sigma_{1},\dotsc,\sigma_{r}\in S_{n}$ be the permutations with $\sigma_{i}(j)=s_{i}(j)$ whenever $1\leq i\leq r,1\leq j\leq n-1$.
Let $u_{1},\dotsc,u_{n-1}\in S_{n}$ be arbitrary permutations with
$u_{i}(n)=i,u_{i}(n-1)=n$. Let $v_{1},\dotsc,v_{n-2}\in S_{n}$ be arbitrary permutations with $v_{i}(i)=n$. Then the $(n-1)^{2}+1$ permutations
$$\sigma_{1},\dotsc,\sigma_{r},u_{1},\dotsc,u_{n-1},v_{1},\dotsc,v_{n-2}$$ are all linearly independent, so $\operatorname{Dim}(B_{n})\geq(n-1)^{2}+1$. Q.E.D.
Let $B_{n}^{\sharp}$ be the set of all $n\times n$-matrices $A$ where there is a constant $\lambda$ where the sum of each row and the sum of each column is $\lambda$. Observe that both $B_{n},B_{n}^{\sharp}$ are subalgebras of $M_{n}(K)$. Then $B_{n}\subseteq B_{n}^{\sharp}$. However,
$\operatorname{Dim}(B_{n})\geq (n-1)^{2}+1$ while $\operatorname{Dim}(B_{n}^{\sharp})=(n-1)^{2}+1$. Therefore, $B_{n}=B_{n}^{\sharp}$.
A: Let $K$ be a field.  The literal answer has already been given by several people but let me try and get at the algebraic structure and provide a quiver with relations (see the addition).  Let $J$ be the $n\times n$ all ones matrix.  Then $J$ centralizes $S_n$ and the centralizer of $J$ consists of all matrices whose rows and columns all sum to some fixed field element $k\in K$.  This has dimension $(n-1)^2+1$ and several people have proved the subalgebra spanned by $S_n$ has this dimension so $B_n$ is the centralizer of $J$.
If the characteristic of $K$ is zero or does not divide $n$, then we can change the basis to consists of $(1,\cdots,1)$ and $e_1-e_i$ with $2\leq i\leq n$ with $e_i$ standard basis vectors.  Then $J$ becomes the elementary matrix $E_{11}$ in this basis and its centralizer is clearly $K\times M_{n-1}(K)$, which can also be seen by representation theory.  This is a split semisimple algebra with two simple modules and there is nothing much to say.
If $K$ has characteristic $p$ dividing $n$, then $J^2=0$ and it is easy to see the Jordan canonical form of $J$ is a $2\times 2$ block and $n-2$ blocks that are $1\times 1$.  In fact the basis $e_1,(1,\ldots, 1), e_i-e_1$ for $2\leq i\leq n-1$ gives the Jordan form with $e_1,(1,\ldots,1)$ giving the $2\times 2$-block.  Thus we can identify $B_n$ with the centralizer of $$J'=N_2\oplus 0_{n-2}$$ where $N_2= \begin{bmatrix} 0 & 0\\ 1&0\end{bmatrix}$.  A more ring theoretic view is the following.
Let $R=K[x]/(x^2)$; its a  self-injective local $K$-algebra and $K$ is the unique simple where $x$ acts by $0$.  Then the centralizer of $J'$ is $\mathrm{End}_R(R\times K^{n-2})$.  I claim the the semisimple quotient here is $K\times M_{n-2}(K)$ and hence there are two simple modules and the algebra $B_n$ is split over $K$.  This is not to difficult to check directly since $R$ is a projective indecomposable $R$-module with simple quotient $K$ and simple socle $K$.  Also note that the radical of $R$ is its socle.  So the radical of $\mathrm{End}_R(R\times K^{n-2})$ is the direct sum of the $1$-dimensional radical of $R$ (viewed as endomorphisms of the first summand $R$), the $n-2$-dimensional space of $R$-module homomorphisms $R\to K^{n-2}$ and the $n-2$-dimensional space of $R$-module homomorphisms $K^{n-2}\to R$ (which all land in the one-dimensional socle=radical).  From this description it is easy to see that the radical squares to $0$ which means that as soon as you know the quiver, you know the basic algebra.  The semismple quotient is a copy of $K$ coming from $R/\mathrm{rad}(R)$ and the endomorphisms of the semisimple module $K^{n-2}$, which is $M_{n-2}(K)$. Note that any composition $K^{n-2}\to R\to K^{n-2}$ is zero since the socle of $R$ is its radical. But the compositions $R\to K^{n-2}\to R$ give the elements of $\mathrm{rad}(R)$ and so the radical cubed is zero.
If we view $B_n$ as the centralizer of $J$, then the radical (which has dimension $2n-3$) is spanned by those matrices where each row is a constant vector and each column sums to $0$ and those matrices where each column is a constant vector and each row sums to $0$.  Hopefully a representation theorist can compute the basic algebra from this description.
Let me add that when $n=2=p$, this description recovers that $B_2\cong K[x]/(x^2)$ and when $n=3=p$, it recovers that $B_3$ is a basic algebra with semisimple quotient $K\times K$.  I would guess in general that the basic algebra is $\mathrm{End}_R(R\times K)$ but I am not 100% sure.
Added and edited based on corrections by the OP and @JeremyRickard.  If I am not mistaken, the quiver of $B_n$ when $p\mid n$ and $n>2$ has two vertices $v,w$.  There is one edge from $v$ to $w$, one edge from $w$ to $v$.and one loop at $v$.  Since its a radical-squared zero split algebra, the quiver presentation for the basic algebra then says that all paths of length $2$ are $0$.  But an expert should check this.  There is a relation saying the path of length two from $v$ to $v$ is zero. Indeed view $B_n$ as $A=\mathrm{End}_R(R\times K^{n-2})$.  A complete set of orthogonal primitive idempotents are the projection $e$ to $R$ and the $n-2$ projections to $K$, but the latter $n-2$ all give isomorphic projective indecomposables so we just need one of them, say the projection $f$ to the first factor, for the quiver.  Then since the radical squared is zero, to compute the quiver we have that $f\mathrm{rad}(A)e=fAe$ is one dimensional and so is $e\mathrm{rad}(A)f=eAf$ since there is a one-dimensional space of homomorphisms $R$ to $K$ and $K$ to $R$.  Also $eAe\cong R$ but $e\mathrm{rad}(R$ is the radical squared as noted above and so $e(\mathrm{rad}(A)/\mathrm{rad}^2(A))e\cong 0$.  On the other hand, $fAf\cong K$ and so $f\mathrm{rad}(A)f=0$. This gives my description of the quiver. That the compositions $K\to R\to K$ are zero but $R\to K\to R$ are not all zero gives the relation.
A: For starters one can think about an algebraically closed field of characteristic zero. I will only sketch, so there is no need to accept it as an anwer. One can think in terms of representation theory. This $K^n$, viewed as a representation of $S_n$ via permutations, breaks down into the standard representation $V$ (the vectors for which sum of entries is zero) and the trivial representation $W$ (the vectors for which all entries are equal). Then, you can think of the corresponding homomorphism from the group algebra to $M_n (K) \cong End_K (K^n)$. One should recall how the group algebra is the product of matrix algebras parametrized by irreducible representation (Artin-Wederburn theorem..), and realize that there are not a lot of options (there are few two-sided ideals), but to have $End_K (V) \times End_K (W) \cong M_{n-1} (K) \times K$ being isomorphic to the image...
A: Here's a basis-free description of this algebra (which was already fully described over an arbitrary field in the second part of this answer).
Fix $n\ge 1$. Let $D$ be the line generated by $(1,\dots,1)$, and $H$ the hyperplane $\sum x_i=0$. Let $A_n$ be the algebra of matrices $M$ such that

*

*$M$ preserves $D$

*$M$ preserves $H$

*$M$ acts by the same scalar on $D$ and on $K^n/H$ (this condition is redundant if $K^n=H\oplus D$, i.e., if $n1_K\neq 0$; however if $n1_K=0$ then $D\subset H$ and this condition removes one dimension)


I claim the subspace(=subalgebra) $B_n$ generated by permutation matrices equals $A_n$. ($K$ being an arbitrary field)

Note that the dimension of $A_n$ is $(n-1)^2+1$ regardless of vanishing of $n1_K$. We can assume $n\ge 2$ since $n=1$ is trivial.
(Also note that to prove this above result one can clearly assume $K$ algebraically closed, although it's unnecessary.)

Proof:
First, $B_n\subset A_n$ is clear. Next, taking differences of pairs of permutations differing by one transposition, one sees that $E_{11}-E_{1k}-E_{\ell 1}+E_{k\ell}\in B_n$ for all $k,\ell\ge 2$. Hence, if $M_0\in A_n$, there exists $M$ in $A_n$ such that $M-M_0\in B_n$ and $M_{\ell k}=0$ for all $k,\ell\ge 2$.
Since $M\in A_n$, there exist $u,v,w\in K$ such that $M_{11}=w$, $M_{1k}=u$ for all $k\ge 2$, $M_{\ell 1}=v$ for all $\ell\ge 2$, and $(n-1)v+w=u$, $(n-1)u+w=v$. In particular $n(u-v)=0$.
If $n1_K\neq 0$, we deduce $u=v$. But in general, the action on $D$ is given by the scalar $v$, while the action on $K^n/H$ is given by the scalar $u$. So $u=v$ follows without restriction on the characteristic of $K$.
Then using transposition matrices, we deduce the existence of a diagonal matrix $M'$ such that $M-M'\in B_n$. Since $M'\in A_n$ is diagonal, all its diagonal entries are equal, and hence $M'\in B_n$. So $M\in B_n$.

PS when $n1_K\neq 0$, the result is straightforward from representation theory, since $H\oplus D$ is the isotypic decomposition of the representation and consists of irreducibles (and since one can suppose $K$ algebraically closed).
