TITLE: Strange induction proof
QUESTION [0 upvotes]: I'm trying to solve an induction proof exercise but this time I can't even understand how to proceed.
I must prove that for every given $n\in \mathbb{N}$ with $n\geq2$ there exist $a,a_1,a_2,...,a_n$ in $\Bbb N\setminus\{0\}$ so that:
$$a^2 = a_1^2 + a_2^2 +\ldots+ a_n^2$$
I can't even think about the base case.
Can someone help me solving this problem please?

REPLY [3 votes]: HINT: The base case is $n=2$: you must find positive integers $a,a_1$, and $a_2$ such that $a^2=a_1^2+a_2^2$. All you need is one example of this; think about familiar right triangles.
For the induction step step you’ll assume that you’ve found positive integers $a,a_1,\ldots,a_n$ such that
$$a^2=a_1^2+a_2^2+\ldots+a_n^2\;,\tag{1}$$
and you’ll try to use that to show that there are positive integers $b,b_1,\ldots,b_{n+1}$ such that
$$b^2=b_1^2+b_2^2+\ldots+b_{n+1}^2\;.$$
Note that if $k$ is any positive integer, and you multiply $(1)$ by $k^2$, you get another solution for $n$:
$$(ka)^2=(ka_1)^2+(ka_2)^2+\ldots+(ka_n)^2\;.$$
You can use this idea to make $(ka_n)^2$ a number that can be written as the sum of two squares, then set $b=ka$, $b_1=ka_1$, and so on up to $b_{n-1}=ka_{n-1}$.

REPLY [2 votes]: Induction Step: Suppose we know that there exist positive integers $a$, $a_1,a_2,\dots a_k$ such that
$a^2=a_1^2+a_2^2+\cdots+a_k^2$.
For $i=1$ to $k$, let $b_i=3a_i$, and let $b_{k+1}=4a$. Let $b=5a$. Then
$$b_1^2+b_2^2+\cdots+b_k^2+b_{k+1}^2=9a^2+16a^2=(5a)^2=b^2.$$


TITLE: Is the inverse relation of a multiary algebraic function a multivalued function, or a set-valued function?
QUESTION [0 upvotes]: A multiary function is a function $X_1\times X_2\times ...\times X_n\rightarrow Y$, with $n>1$.
Is the inverse relation of a multiary algebraic function a multivalued function, or is it a set-valued function?
A multivalued function is not a function.

REPLY [0 votes]: The inverse relation of a multiary algebraic function is a multivalued function. But a multivalued function is not a function. "Multivalued function" is a misnomer because a function can be only one-to-one or many-to one. For treating multivalued functions as functions, you have to treat them e.g. as set-valued functions or as tuple-valued functions.


TITLE: Bullet interception?
QUESTION [0 upvotes]: I am programming a space game, and I put this on the physics stack exchange because I need some help in the physics behind it. Let's say there is a moving enemy ship - referred to as "target", and we want to lead our ship's torpedo to a point where the bullet will intercept the moving target. Before we go on further, let's assume some constraints:

The motion is constant, there is no acceleration or net forces being applied.
We will not account for the angular velocity of our ship to meet the
intersection point.
The problem is in two dimensions. X and Y plane. No Z component.
The origin is relative to the top left at (0,0).  For this case however, I
want to make all vectors relative to our ship.
We will assume the ship (torpedo) has no initial velocity right now.

The motion is constant in terms of the space game server I am running, I will factor gravitation later and angular velocity for the best result. For now, let's break down the variables we know:
Target :

Velocity of the moving target (including direction) as a vector
Displacement of the target to the ship as a vector.
Initial position of the ship as a point.

Ship (Torpedo to be specific) :

Speed of the bullet (constant) (magnitude of it's velocity)
Initial position of the bullet (in this case, the same as the position of the
ship)

Now that I have covered that, let's state what we need to figure out:

I wan't to find the point of intersection so that if I shoot a torpedo in
that direction, it will perfectly intercept the target.
I need to find the final position of the ship as a function of time. Then I
can make a displacement vector from the final position of the ship to the
initial position of the ship.

Here are the steps I am taking:
We have several vectors here -  U, V and C. Our origin is our ship (the torpedo).

Vector U is the displacement vector from our ship to the target's initial
 position
Vector V is the displacement vector from the target's initial position to
 the target's final position as a function of time (need to solve for that)
Vector C is the resultant vector of U and V. Vector C will tell me the point
 of intersection

My program already has a Vector class, so there shouldn't be any worry in implementation. This is in Java btw. (Again, I put this in a physics forum to talk about the physics of what's going on).
In my program, I can easily calculate the distance between the ship and the target's initial position using a head minus tail rule. In this example, Vector U is <7,3>.
Vector V on the other hand is the troubling part. Vector V is a vector from it's predicted final position to it's initial position. The question is : how do we find this?
I have modeled the predicted final position with an equation. (Pt)f stands for final position. (Pt)i stands for initial position. Note t is the subscript for target. i means initial. Vt = initial target velocity. T means time.
(Pt)f = (Pt)i + Vt * T.
(Pt)f is a vector, (Pt)i is a vector, Vt is a vector and time is a scalar. If you think about it, I'm doing a vector addition of two position values (You can think of Vt*time as a position vector as a result of velocity scaled by time).
(Pt)f is going to be the vector sum of (Pt)i + (Vt * T).
I am concerned with finding T though. Here's what I know:

The bullet needs to be at the same point. We can model the bullet by saying
(Pb)f = Vb*T.
If they need to be at the same point, that means that (Pb)f = (Pt)f.
That means that Vb*T = (Pt)i + (Vt * T). We can solve for T.
I did the algebra and concluded that T = (Pt)i /((Vb) - (Vt))

The problem is, this is Time, a scalar quantity. How do I find that? I can't just divide two vectors. Vb-Vt is just vector subtraction. How do I divide that from the vector (Pt)i?
Additionally, is this the correct approach? In the end, I can create vector V in my diagram by finding a vector between (Pt)f and (Pt)i. Then, once I have that, I can find the point of intersection by adding vector U and V. Then I have to convert that point to world space (remember origin is top left at (0,0)). I have a function that will rotate my ship towards that point and shoot in that point's direction.
Let me know if I have to be more clear, and thanks for the help!

REPLY [0 votes]: In problems like this it is usually very convenient to set the time as additional dimension of your vector space. In this case you make your 2D problem 3D with the $z$-component actually being time. Solving your then 3D vector equations gives the time immediately as 3rd component.


TITLE: Overview of Arakelov intersection theory and the Arakelov Chow ring
QUESTION [8 upvotes]: I'm looking for a reference that gives an overview of the most important properties of Arakelov intersection theory (on arithmetic varieties of arbitrary dimension) and that describes basic properties of the Arakelov Chow ring. There's a similar MO question asking about
survey articles on (classical) intersection theory, so I guess that I'm asking the same question, but for Arakelov intersection theory.

REPLY [7 votes]: A good reference in my humble opinion is Bost's paper in Bourbaki:
Théorie de l'intersection et théorème de Riemann-Roch arithmétiques
Séminaire BOURBAKI. Novembre 1990. 43ème année, 1990-91, n° 731
Another reference would be Soule's book on Arakelov geometry "Lectures on Arakelov geometry" written with Abramovich, Burnol and Kramer.
Finally, I know you didn't ask this, but in the case of arithmetic surfaces there are more references (besides Faltings' "Calculus on arithmetic surfaces" and Arakelov's original paper). For example, Deligne's paper "le determinant de la cohomologie" and  R. de Jong's Ph.D. thesis: http://www.math.leidenuniv.nl/~rdejong/publications/thesis.pdf
Also, Moret-Bailly's paper "Metriques permises" in Szpiro's 1985 Asterisque is wonderful.


TITLE: Angular momentum of a translating and rotating body
QUESTION [5 upvotes]: If a rod is rotating about one end, does it have pure rotation or do you also consider the translation of centre of mass when calculating its angular momentum?
Also, how would one calculate the angular momentum of a body that is both rotating and translating?

REPLY [1 votes]: If you know the motion of a point A on a rigid body, with linear velocity $\vec{v}_A$ and angular velocity $\vec{\omega}$ then the formulas below will give you the linear momentum of the rigid body, and the angular momentum about point A. If the body is pivoting about A then $\vec{v}_A=0$, otherwise in the general case $\vec{v}_A \neq 0 $.
Linear momentum is given from the velocity of the center of mass, point C. Consider the c.m. located at $\vec{c}$ from point A.
$$ \vec{L} = m \vec{v}_C = m \left( \vec{v}_A - \vec{c}\times \vec{\omega} \right) $$
Now the angular momentum about the center of mass is $\vec{H}_C = I_C\,\vec{\omega}$ and so by transferring the motion be about A it becomes
$$ \begin{aligned} \vec{H}_A & = \vec{H}_C + \vec{c}\times\vec{L}
\\ & = I_C\,\vec{\omega} + m \vec{c}\times \left( \vec{v}_A - \vec{c}\times \vec{\omega} \right)
\\ & = \left( I_C\,\vec{\omega}-m (\vec{c}\times \vec{c}\times \vec{\omega}) \right) +  \vec{c}\times m \vec{v}_A
\end{aligned}$$
In 6×6 matrix form (which I prefer) the above is
$$ \begin{bmatrix} \vec{L} \\ \vec{H}_A \end{bmatrix} =
\begin{bmatrix} m \bf{1} & -m [\vec{c}] \\
m [\vec{c}] & I_C-m [\vec{c}][\vec{c}]\end{bmatrix}
\begin{bmatrix} \vec{v}_A \\ \vec{\omega} \end{bmatrix}
$$
where $[\vec{c}]$ is the cross product matrix operator defined as
$$[\begin{pmatrix}x\\y\\z\end{pmatrix}] = \begin{pmatrix}0&-z&y\\z&0&-z\\-y&x&0\end{pmatrix}$$
This 6×6 matrix is the spatial inertia matrix, seen also in the Spatial equations of motion.
The component $I_A = I_C-m [\vec{c}][\vec{c}]$ represents the parallel axis theorem, if the rotation is not about the center of mass. For the planar case $\vec{c}=(c_x,c_y,0)$ the mass moment about A becomes $I_A = I_C + m \left(c_x^2+c_y^2\right)$. Try it yourself.
Just for kicks I will point out that the instant center of rotation P is located at $$\vec{p} = \frac{\vec{\omega}\times\vec{v}_A}{\vec{\omega}\cdot\vec{\omega}}$$ relative to A
Note that $\vec{v}_P=\vec{v}_A+\vec{\omega}\times\vec{p}$ yields a parallel condition $\vec{v}_P \; \parallel \; \vec{\omega}$


TITLE: Show inequality
QUESTION [5 upvotes]: I want to how nicely define the $f(x)$ for this type of question
to prove the inequality use the mean value theorem
$$e^x  \ge 1+x ,\ x \in \mathbb{R}$$
How to choose $f(x)$ to show that inequality  and do
$$f(b) - f(a)  = f'(c)(b-a),\ \text{since}\ f:[a,b] \to \mathbb{R} $$
is continuous and differentiable

REPLY [3 votes]: Bernoulli's Inequality says that for $n\ge1$ and $x\ge-n$
$$
\left(1+\frac xn\right)^n\ge1+x
$$
Since
$$
e^x=\lim_{n\to\infty}\left(1+\frac xn\right)^n
$$
we get that for all $x\in\mathbb{R}$,
$$
e^x\ge1+x
$$

Let $f(x)=e^x-x$. Then for some $\xi$ between $0$ and $x$, the Mean Value Theorem says
$$
\frac{(e^x-x)-1}{x-0}=e^\xi-1
$$
That is,
$$
e^x-1-x=x(e^\xi-1)
$$
Note that $x\gt0\iff e^\xi-1\gt0$; therefore,
$$
e^x-1-x\ge0
$$


TITLE: Cardinality of a conic and quadric over the field $\mathbb{F}_9$
QUESTION [2 upvotes]: I have the following question in an assignment:
Over the field $\mathbb{F}_9$ of nine elements, find the cardinality of
a) the conic $x_0^2 + x_1^2 + x_2^2 = 0$ in $\mathbb{P}_2$
b) the quadric $x_0^2 + x_1^2 + x_2^2 + x_3^2 = 0$ in $\mathbb{P}_3$
Any hints on how to proceed? One way would be to just substitute the points of $\mathbb{F}_9=\mathbb{Z_3}[x]/\langle x^2+1\rangle$. But that's way too much computation.

REPLY [2 votes]: Your two degree $2$ varieties  are smooth and contain at least a point over $\mathbb F_9$, say $(1:1:1)$ on the conic and $P=(1:1:1:0)$ on the quadric $\mathcal Q$.
Projecting from that point on the line $x_0=0$ of $\mathbb P^2(\mathbb F_9)$, respectively on the plane $\Pi:x_0=0$ of $\mathbb P^3(\mathbb F_9)$, you will find that over $\mathbb F_9$ your conic has $10$ points and your quadric $100$ points.
Edit: a few details  for the more difficult case of the quadric
The tangent plane $T_P$ to the quadric $\mathcal Q$ at $P=(1:1:1:0)$  has equation $T_P: x_0+x_1+x_2=0$.
It cuts the the quadric $\mathcal Q: x_0^2 + x_1^2 + x_2^2 + x_3^2 = 0$ along the degenerate conic $$x_0+x_1+x_2=0,\quad x_1^2+x_2^2+x_1x_2-x_3^2=(x_1-x_2+x_3)(x_1-x_2-x_3)=0$$ consisting of the union of the lines $$L_1:x_0+x_1+x_2=0,x_1-x_2+x_3=0 \\L_2:x_0+x_1+x_2=0,x_1-x_2-x_3=0$$
The projection of our quadric $\mathcal Q$ from its point $P$ to the plane $\Pi: x_0=0$ of $\mathbb P^3$ induces a bijection from $\mathcal Q\setminus (L_1\cup L_2)$ onto the affine plane $\Pi\setminus T_P\cong \mathbb A^2(\mathbb F_9)$.
This accounts for $\vert \Pi\setminus T_P\vert=\vert \mathbb A^2(\mathbb F_9)\vert=9^2=81$ points of the quadric.
To obtain the complete  quadric we have to add the points of $L_1\cup L_2$.
Since there are $19$ of them (union of two $10$-point projective lines meeting in $1$ point) , we see that $\mathcal Q$ contains a total of $$81+19=100$$points over $\mathbb F_9$
The exact same reasoning proves that the quadric $\mathcal Q: x_0^2 + x_1^2 + x_2^2 + x_3^2 = 0$ in $\mathbb P^3(\mathbb F_q)$ has $q^2+2q+1=(q+1)^2$ points over an arbitrary finite field with $q$ elements $\mathbb F_q$.


TITLE: Why does the universality of the speed of light prove there is no ether?
QUESTION [4 upvotes]: So I definitely don’t think there is an ether for starters. I am reading electrodynamics by Griffith and he states that Einstein’s second postulate which says “The speed of light in vacuum is the same for all inertial observers, regardless of the motion of the source” disproves the ether. Griffiths then says the principle of relativity is not enough to disprove the ether.
My thought process is that the ether would imply an absolute reference frame which would violate the first postulate but Griffiths claims that is not true. I have been thinking about it a lot and I can’t seem to find a clear argument just from Einsteins two postulates which disproves the ether.
Can anyone give me a clear argument as to how this works? Also in this thought experiment I am not using the wave particle duality of light because then it’d be obvious.

REPLY [3 votes]: Nothing disproves the ether. Lorentz and Poincaré created a theory, equivalent to special relativity, that incorporated an unobservable ether. But Einstein's approach was simpler and clearer, especially with Minkowski's geometric interpretation, so that's what we use.


TITLE: Studying the convergence of $\sum_1^\infty \frac{(\beta n )^n}{n!}$
QUESTION [2 upvotes]: $\sum_1^\infty \frac{(\beta n )^n}{n!}$ I've applied
$$\frac{1}{R}= \lim_{n\to\infty} |\frac{a_{n+1}}{a_n}|$$
Where R is the radius of convergence. Answer I got:
Converges for $-e^{-1}<\beta< e^{-1}$
How would I test the convergence for endpoints though? $$\lim_{n\to\infty}\frac{n^n}{n!}= \infty$$ Clearly $\beta = - e^{-1}$ won't work since the coefficient is not monotonically decreasing (above) How to test $e^{-1}$ though?

REPLY [5 votes]: From Stirling's formula, we have
$$n!\sim \sqrt{2\pi n}\left(\frac ne \right)^n$$
as $n\to \infty$.
Hence we see that $\frac{n^n}{e^n\,n!}\sim \frac{1}{\sqrt{2\pi n}}$.
By the comparison test, the series diverges for $\beta =1/e$. If Leibniz's alternating series test applies, the series converges for $\beta =-1/e$.
Leibniz's alternating series test requires that the summand $a_n=\frac{n^n}{e^n\,n!}$ is monotonically decreasing. To check this condition, we write
$$\begin{align}
\frac{a_{n+1}}{a_n}&=\left(\frac{(n+1)^{n+1}}{e^{n+1}(n+1)!}\right)\left(\frac{e^n n!}{n^n}\right)\\\\
&=\frac1e \left(1+\frac{1}{n}\right)^n\\\\
&<1
\end{align}$$
Hence $a_{n+1}<a_n$ for all $n$ and the summand decreases monotonically, which proves that the series indeed converges for $\beta =-1/e$.


TITLE: Proving $F_{1} - F_{2} + F_{3} - F_{4} + F_{5} ... + F_{2n-1} - F_{2n} = 1 - F_{2n-1}$
QUESTION [1 upvotes]: Here is what I have so far for proof by induction:
Base case:
Suppose n = 3
$$\sum_{i=1}^{n}(F_{2n-1} - F_{2n}) = 1 - F_{2n-1}$$
$$\sum_{i=1}^{3}(F_{2n-1} - F_{2n}) = 1 - F_{2*3-1}$$
$$F_{1} - F_{2} + F_{3} - F_{4} + F_{5} - F_{6} = 1 - F_{5}$$
$$1 - 1 + 2 - 3 + 5 - 8 = 1 - 5$$
$$-4 = -4$$
Inductive hypothesis:
$$\sum_{i=1}^{k}(F_{2k-1} - F_{2k}) = 1 - F_{2k-1} \forall k \geq 1$$
Inductive step:
$$\textrm{We must prove that} \ \sum_{i=1}^{k+1}(F_{2k+1} - F_{2k+2}) = 1 - F_{2k+1}$$
This is where I get stuck. I am also unsure whether the equation in the inductive step is actually correct or not. I know I have to sub in k+1 for k, but when I try a base case with the new equation to see if it is still true, I can't actually make it work out. I have been at this question for over an hour now so maybe my brain is just fried. Have I been going at this question wrong?

REPLY [2 votes]: Note that the sum "telescopes" using the Fibonacci recursion $F_{2n}=F_{2n-1}+F_{2n-2}$, so that
$$
\sum_{i=1}^n(F_{2i-1}-F_{2i})=-\left(\sum_{i=0}^{n-1}F_{2i}\right).
$$
Thus it suffices to show
$$
\sum_{i=0}^{n-1}F_{2i}=F_{2n-1}-1;
$$
this is much easier to induct with, as if
$$
F_0+\dots+F_{2n-2}=F_{2n-1}-1,
$$
then
$$
F_0+\dots+F_{2n-2}+F_{2n}=F_{2n-1}-1+F_{2n}=F_{2n+1}-1
$$

REPLY [1 votes]: Why do you have $n=3$ as your base case? Why not just $n=1$?
Also, make sure to use the running index $i$ as your variable in the formula inside the summation (you are using $n$ and $k$, which is not right!)
So I would do:
Claim: for all $n \ge 1$:
$$\sum_{i=1}^{n}(F_{2i-1}-F_{2i})=1-F_{2n-1}$$
Base: $n=1$
$$F_1-F_2=1-1=1-F_1$$ Check!
Step:
Inductive hypothesis: Suppose that for some arbitrary $k$:
$$\sum_{i=1}^{k}(F_{2i-1}-F_{2i})=1-F_{2k-1}$$
now consider $k+1$:
$$\sum_{i=1}^{k+1}(F_{2i-1}-F_{2i})=$$
$$\sum_{i=1}^{k}(F_{2i-1}-F_{2i})+F_{2(k+1)-1}-F_{2(k+1)}=\text{ (Inductive Hypothesis)}$$
$$1-F_{2k-1}+F_{2k+1}-F_{2k+2}=$$
$$1-F_{2k-1}+F_{2k-1}+F_{2k}-F_{2k}-F_{2k+1}=$$
$$1-F_{2(k+1)-1}$$
Check!


TITLE: Different work needed for same momentum change in diff ref frames
QUESTION [0 upvotes]: The amount of work done by a force on an object at rest can be expressed as $$\frac{1}{2}m{v_0}^2$$
Where $v$ is the final velocity of the object as measured by a reference frame A
Frame B is moving in the opposite direction with a velocity $v_1$
Before any work is done on the object, frame A measures the object to have zero  kinetic energy. Frame B measures it has a kinetic energy of $$\frac{1}{2}m{v_1}^2$$
It shouldn't matter that they have different kinetic energies in different frames as energy is frame-dependent.
However, let's say that a force does work on an object to change its velocity by $v_0$. Frame A measures the work needed to make this change in velocity as $$\frac{1}{2} m {v_0}^2$$
But frame B will measure that the work needed to make this change in velocity as $$\frac{1}{2}m(v_1+v_0)^2 -\frac{1}{2}m{v_1}^2$$
(which is the difference in kinetic energy)
There is a difference of $2v_0v_1$ between the amount of work required for the same change in momentum in each frame? This seems completely absurd, have I made an error in my experiment/logic?

REPLY [0 votes]: This seems completely absurd, have I made an error in my experiment/logic?

You have not made an error, the result that you have found is indeed correct and the only mistake is the mistaken feeling that it is absurd. Indeed, it is correct that the same $\Delta v$ corresponds to different $\Delta KE$ in different frames.
The reason that this most likely feels "absurd" is that it is difficult, on its face, to reconcile such a result with the conservation of energy. To understand this it is useful to consider a “toy model” that is easy to analyze. Specifically, let’s consider an assembly consisting of a 10 kg base and a 1 kg projectile which is attached to a massless spring.
Suppose this spring has enough energy stored that when the assembly is initially at rest it can propel the base to 1 m/s, and by conservation of momentum the projectile is propelled to -10 m/s. Conversely, if the assembly starts at 5 m/s then after launching the projectile the base is propelled to 6 m/s and the projectile moves at -5 m/s.
So now let’s check energy. In the first case the KE of the base increased from 0 J to 5 J, while in the second case it increased from 125 J to 180 J. The spring stores the same amount of energy in both cases, so why does the KE increase by 5 J at the low speed and by 55 J at the high speed?
Notice that we forgot to calculate the energy that went into the projectile. This is the pivotal mistake of most such analyses. In the first case the KE of the projectile increased from 0 J to 50 J, while in the second case the KE was 12.5 J before and after. So in both cases the total change in KE (both the base and the projectile) was 55 J.
At low speeds most of the spring's energy is “wasted” in the KE of the projectile. At higher speeds more goes into the base and less into the projectile. Both energy and momentum are conserved, and in fact more power is delivered to the base as the speed increases under constant thrust.


TITLE: Induction step of proof of 'Every element of $O(n)$ is product of hyperplane reflections'
QUESTION [5 upvotes]: The following came up in induction step of proof of 'Every element of $O(n)$ is product of hyperplane reflections'.
An element $A$ in $O(n)$ is called hyperplane reflection if  $$A=Pdiag(1,\cdots , 1,-1)P^T$$
where $P\in O(n)$.
If $$A'=P \begin{bmatrix}
A_{n-1} & \\
 & \pm 1
\end{bmatrix} P^T
$$
 and $A_{n-1}$ is in $O(n-1)$ then $A'$ is product of hyperplane reflections in $O(n)$. Why is this true?
All we know is $A_{n-1}$ is product of hyperplane reflections. How does this give result?

REPLY [1 votes]: I think this is the lemma you need:
Lemma:  Suppose $B$ has the block diagonal form $diag(A,\pm 1)$, where $A\in O(n-1)$ is a hyperplane reflection.  Then $B$ is a product of at most 2 hyperplane reflections.
Proof:  We first handle the case when $B = diag(A,1)$.  Write $A = P \, diag(1,1..,1,-1)\, P^t$, where all of these matrices are in $O(n-1)$.
Consider the homomorphism $\hat{}:O(n-1)\rightarrow O(n)$ with $\hat{C}$ the block diagonal matrix $diag(C,1)$.
Then $B = \hat{A} = \hat{P}\,diag(1,....,1,-1,1)\, \hat{P}^t$.  This is almost a hyperplane reflection.  The issue is that that $-1$ appears in the wrong slot.  So, let's fix it.
Let $Q\in O(n)$ be obtained from the $n\times n$ identity matrix by swapping the last two rows.  Then $diag(1,...,1,-1,1) =Q\, diag(1,....,1,-1)\, Q^t$.  Substituting this into our formula for $B$ above, we get $B = \hat{A} = \hat{P}Q\,diag(1,...,1,-1),^t \hat{P}^t = (\hat{P}Q)diag(1,...,1,-1) (\hat{P}Q)^t.$
Since $\hat{P},Q\in O(n)$, it follows that $\hat{P}Q\in O(n)$, so $B$ is a hyperplane reflection in this case.
Now, we may assume $B = diag(A,-1) = diag(A,1)diag(1,...,1,-1)$, where, as above, $A = P\,diag(1,...,1,-1)\,P^t$.  From the first case, $B$ is of the form $C\,diag(1,...,1-1)$ where $C$ is a hyperplane reflection.  Since $diag(1,...,1,-1)$ is obviously a hyperplane reflection, $B$ is a product of hyperplane reflections in this case.