Isomorphic subalgebras of $K^n$ are just "permutations" of each other? Let $K$ be a field$^{[1]}$ and $n$ be a positive integer.
The $K$-vector space $K^n$ endowed with pointwise multiplication is an unital commutative associative $K$-algebra.
Suppose $A$ and $B$ are two unital$^{[2]}$ subalgebras$^{[3]}$ of $K^n$ and that there exists a $K$-algebra isomorphism $\phi : A \to B$.
Is it true that there exists a permutation $\pi : \{1,\ldots,n\} \to \{1,\ldots,n\}$ such that $\phi((a_1, \ldots, a_n)) = (a_{\pi(1)}, \ldots, a_{\pi(n)})$ for each $(a_1, \ldots, a_n) \in A$ ?
If it is not so: Are there some other characterizations of $\phi$ ?
I am stuck on this problem for a while.
Thank you in advance for suggestions or references.
[1] If necessary, you can assume $K = \mathbb C$ but I do not think this is really important.
[2] Since Eric Wofsey and Don L. have found counterexamples in the case of non-unital subalgebras, I required $A$ and $B$ to be unital, i.e., they contain $(1, \ldots, 1)$ where $1$ appears $n$ times.
[3] By "subalgebra" I mean that $A$ is closed respect to sum, product, and scalar multiplication by elements of $K$.
 A: To answer your first question: no, there are isomorphic subalgebras which are not permutations of one another.  For example, consider the subalgebras generated by $(1,0,0,\ldots,0)$ and $(1,1,1,\ldots,1)$.  They are both isomorphic to $K$, but all permutations of the latter give itself.
Without the unital assumption, I don't know of a nice way to classify the subalgebras, so I don't know of a way to characterize the isomorphisms between them.
A: No.  For instance, consider the subalgebras $A=K\times\{0\}$ and $B=\{(x,x):x\in K\}$ of $K^2$.  These are both isomorphic to $K$, but they are not permutations of each other.  If you want a unital counterexample, consider $A=\{(x,x,x,y):x,y\in K\}$ and $B=\{(x,x,y,y):x,y\in K\}$ in $K^4$.
In general, if $A\subseteq K^n$ is a subalgebra, you can define an equivalence relation $\sim$ on $\{1,\dots,n\}$ by saying $i\sim j$ iff $a_i=a_j$ for all $a=(a_1,\dots,a_n)\in A$.  You can also define a subset $S\subseteq\{1,\dots,n\}$ to be set of all $i$ such that $a_i=0$ for all $a\in A$ (note that $S$ is either empty or is one of the equivalence classes of $\sim$).  It is then not hard to prove that in fact $A$ contains all elements $(a_1,\dots,a_n)\in K^n$ such that $a_i=a_j$ whenever $i\sim j$ and $a_i=0$ whenever $i\in S$, so $A$ is completely determined by $\sim$ and $S$.  Note that $A\cong K^m$, where $m$ is the number of equivalence classes of $\{1,\dots,n\}\setminus S$ under $\sim$.  Since every automorphism of $K^m$ comes from a permutation of $\{1,\dots,m\}$, we get that any isomorphism $A\to B$ between two such subalgebras comes from a bijection between the sets of equivalence classes $(\{1,\dots,n\}\setminus S_A)/\sim_A$ and $(\{1,\dots,n\}\setminus S_B)/\sim_B$.
