## soft question – What benefits of math can be conveyed to mid/high schoolers?

I’m teaching mathematical proof writing to a few of math teachers (in the US) this summer. In the beginning of class, I send a survey asking them why they are here. Most of them are here for getting master degree in teaching to further secure their teaching position. I sense a bit of reluctance, since on the nose mathematical proof writing does not relate too much to teaching mid/high schoolers.

I wish I know how to motivate, but I don’t. I was trained formally, and was not aware of some concrete applications of higher math until I taught an applied algebra course last year. It’s definitely great to see how group theory is actually used in a nontrivial way to real life problem (coding theory, crypto.. etc).

While my knowledge base was extended a bit from that, it seems to only motivate those who are interested in CS. How about other students? I sincerely believe that there are ways to motivate the not-yet traumatized! Please share your experience on (could-be) successful ways to motivate mid/high schoolers. Thank you very much in advance.

## Grade 12 Calculus and Vectors Math Problem

Question: A plane has -4y + 6z – 4 = 0 as its Cartesian equation. Determine the Cartesian equation of a plane that is perpendicular to and contain the point P(-3, -10, 4).

I tried doing this question on my own but I messed up and I don’t understand how I’m supposed to find the answer to this question. To solve the question, I tried to use the cross product but I got even more confused when doing it. Am I supposed to use the cross product? Or do I use another method? i would appreciate if anyone can help me out.

## beginner – Math with numbers and letters! Javascript

I’ve started learning JavaScript last week. Today i ran into a JS exercise available at this link
codewars exercise and decided to give it a try. I’ve used very basic JS because i know only a small number of JS methods. Could you please review and rate my code?

var inputStr, inputsArray, numsArray, arrayStrNumber, isAdd, isSub, isMul, isDiv;

numsArray = ();
strArray = ();
arrayStrNumber = ();
inputStr = "10a 90x 14b 78u 45a 7b 34y";

isSub = true;
isMul = true;
isDiv = true;

// create array from strings
inputsArray = inputStr.split(" ");

// loop in array

for (var i = 0; i < inputsArray.length; i++) {
var inputValue = inputsArray(i);

// seperate numbers from alphabet
for (x = 0; x < inputValue.length; x++) {

//   if it's not a number add it to string's array
if (isNaN(inputValue(x))) {
strArray(i) = inputValue(x);
} else {
isNaN(numsArray(i))
? (numsArray(i) = "" + inputValue(x) + "")
: (numsArray(i) += "" + inputValue(x) + "");
}
}

//create an array with letter on start
arrayStrNumber(i) = strArray(i) + numsArray(i);
}
// sort array based on first alphabet or first number after alphabet
arrayStrNumber.sort(function (a, b) {
if (a(0) != b(0)) {
if (a > b) {
return 1;
}
if (b > a) {
return -1;
}
return 0;
} else {
if (arrayStrNumber.indexOf(a) > arrayStrNumber.indexOf(b)) {
return 1;
}
if (arrayStrNumber.indexOf(b) > arrayStrNumber.indexOf(a)) {
return -1;
}
return 0;
}
});

console.log(arrayStrNumber);
// Do math operation with order +-*/
var finalResult = 0;
for (var i = 0; i < arrayStrNumber.length; i++) {
arrayStrNumber(i) = parseInt(arrayStrNumber(i).slice(1));
if (i === 0) {
finalResult += arrayStrNumber(i);
continue;
}
finalResult += arrayStrNumber(i);
continue;
}
if (isSub) {
finalResult -= arrayStrNumber(i);
isSub = false;
continue;
}
if (isMul) {
finalResult *= arrayStrNumber(i);
isMul = false;
continue;
}
if (isDiv) {
finalResult /= arrayStrNumber(i);
}
isSub = true;
isMul = true;
isDiv = true;
finalResult = Math.round(finalResult);
}


## math – How are front-ends of mathematical calculation (like Mathematica) implemented?

I am interested in starting a personal project which would be quite similar in its interface with Mathematica and other tools of this type, namely the display of mathematical symbols, powers, fractions, etc. .

I have considered plugging in a LaTeX engine in this project, but I would like the front end to be smooth and interactive, so the new repeated rendering required by LaTex might be jarring.

I'm not particularly familiar with word processing, font rendering, etc. My question then is how these programs like Mathematica are generally implemented to support mathematical notation, and how difficult would it be to reproduce even a basic implementation?

## algorithms – Need help understanding the math behind the logic of the planning problem using reinforcement learning

I am working on a problem of planning virtual machines given the efficient use of resources and energy and I came across this document. I understand RL and how Q-Learning works that they are trying to use in paper. However, I fail to intuitively understand the proposed algorithm (page 3).

I understand that equal importance has been given to the use and consumption of energy, but with reverse signs, let's say. But step 3 is not intuitive. Can anyone help me better understand the same algorithm?

## opengl – Some math on the 3D camera

So, after finishing a 2D game for my school project, I decided to dive into the 3D world using raylib instead of Unity. Raylib provides a simple 3D camera implementation without you having to do any calculations, but rather I want to challenge myself to understand 3D trigonometry. Here I am trying to rotate the camera backwards and left to right (like in orbit). After implementing the math, it seems that it only works when the target is at the Vector3 position {0.0f, 0.0f, 0.0f}. If the target position goes further and further, the rotation becomes weird. Here's the demo video I uploaded to YouTube.

And below is my code for math:

Vector3 cubePosition = { 0.0f, 0.5f, 0.0f };

Camera3D camera = { 0 };

camera.position = { 0.0f, 10.0f, 10.0f }; // Camera position

camera.target = { 0.0f, 0.0f, 0.0f }; // Camera looking at point

camera.up = { 0.0f,2.0f, 0.0f }; // Camera up vector (rotation towards target)

camera.fovy = 45.0f; // Camera field-of-view Y

float distance = 15.0f; // Set the distance from camera.target to camera.position

float verticalAngle = 45.0f; // The Y/XZ angle

float horizontalAngle = 90.0f; // The X/Z angle, y is considered as 0

float horizontalDistance = distance * cosf(verticalAngle * PI / 180.0f); // Horizontal distance, the magnitude

camera.position.x = horizontalDistance * cosf(horizontalAngle * PI / 180.0f); // Calculate the position of camera.position x based on distance etc..

camera.position.z = horizontalDistance * sinf(horizontalAngle * PI / 180.0f);

camera.position.y = distance * sinf(verticalAngle * PI / 180.0f);

Vector3 selectedTarget = cubePosition;


And for the main loop:

if (IsKeyDown(KEY_A))

{

camera.position.x = horizontalDistance * cosf(horizontalAngle * PI / 180.0f);

camera.position.z = horizontalDistance * sinf(horizontalAngle * PI / 180.0f);

horizontalAngle -= 1.0f;

}

else if (IsKeyDown(KEY_D))

{

camera.position.x = horizontalDistance * cosf(horizontalAngle * PI / 180.0f);

camera.position.z = horizontalDistance * sinf(horizontalAngle * PI / 180.0f);

horizontalAngle += 1.0f;

}

else if (IsKeyDown(KEY_W) && verticalAngle < 88.0f)

{

horizontalDistance = distance * cosf(verticalAngle * PI / 180.0f);

camera.position.x = horizontalDistance * cosf(horizontalAngle * PI / 180.0f);

camera.position.z = horizontalDistance * sinf(horizontalAngle * PI / 180.0f);

camera.position.y = distance * sinf(verticalAngle * PI / 180.0f);

verticalAngle += 1.0f;

}

else if (IsKeyDown(KEY_S) && verticalAngle > 2.0f)

{

horizontalDistance = distance * cosf(verticalAngle * PI / 180.0f);

camera.position.x = horizontalDistance * cosf(horizontalAngle * PI / 180.0f);

camera.position.z = horizontalDistance * sinf(horizontalAngle * PI / 180.0f);

camera.position.y = distance * sinf(verticalAngle * PI / 180.0f);

verticalAngle -= 1.0f;

}

if (IsKeyPressed(KEY_RIGHT))

{

camera.position.x += 1.0f;

selectedTarget.x += 1.0f;

}

else if (IsKeyPressed(KEY_LEFT))

{

camera.position.x -= 1.0f;

selectedTarget.x -= 1.0f;

}

if (IsKeyPressed(KEY_UP))

{

camera.position.z -= 1.0f;

selectedTarget.z -= 1.0f;

}

else if (IsKeyPressed(KEY_DOWN))

{

camera.position.z += 1.0f;

selectedTarget.z += 1.0f;

}

if (IsKeyPressed(KEY_SPACE))

{

cubeList.push_back(selectedTarget);

}

camera.target = selectedTarget;


Since raylib uses opengl, so I tried to use the following link and image to understand the camera system.
https://learnopengl.com/Getting-started/Camera

This is the image I used to calculate the position of my camera.

Any help would be appreciated. Thank you..

## Discrete Math – A More Concise Way to Say It?

Thanks for contributing to the answer to Math Stack Exchange!

• Make sure you respond to the question. Give details and share your research!

But to avoid

• Ask for help, clarification or respond to other responses.
• Make statements based on opinion; save them with references or personal experience.

Use MathJax to format the equations. Reference MathJax.

## Morse Theory Question – Math Stack Exchange

Let M be a closed and smooth variety, and f: M → R a perfect Morse function Z / 2Z.
(a) Show that −f: M → R is a perfect Morse function Z / 2Z. (b) Show that bi (M; Z / 2Z) = bn – i (M; Z / 2), where n = dimN.
Could you help me with this question? I get stack with it.

## Olympic Number Theory – Math Stack Exchange

Thanks for contributing to the answer to Math Stack Exchange!

• Make sure you respond to the question. Give details and share your research!

But to avoid

• Ask for help, clarification or respond to other responses.
• Make statements based on opinion; save them with references or personal experience.

Use MathJax to format the equations. Reference MathJax.

## math optimization – How do I get FindMinimum to give me the right answer the first time I call it?

I am trying to minimize the Chi Square error on a complex function. The first time I run FindMinimum I get a response that is close to the overall minimum, the second time I run it, with the results of the first pass, I get a better response (note the results below). How do you do this in one pass?

result = FindMinimum({chiSquared(ber, btm, dsr, dcd),
0 < ber && 0 < btm && 0 < dsr && 0 < dcd}, {{ber, 1.}, {btm,
10^10}, {dsr, 1.}, {dcd, 1000}})

Out(402)= {1603.9032996720166, {ber -> 0.30175546158546906,
btm -> 8.984265873668348*^9, dsr -> 3.114204410911019,
dcd -> 1100.9245439266256}}

In(403):= result =
FindMinimum({chiSquared(ber, btm, dsr, dcd)}, {{ber,
OptionValue(result((2)), ber)}, {btm,
OptionValue(result((2)), btm)},
{dsr, OptionValue(result((2)), dsr)}, {dcd,
OptionValue(result((2)), dcd)}})

Out(403)= {1558.845892206124, {ber -> 0.4090451007924997,
btm -> 1.1343566072120678*^10, dsr -> 3.4512578697898606,
dcd -> 928.6070747021281}}