1 obsidian/miscnotes

Miscellaneous Notes

Table of Contents

Lagrange Multipliers

The problem: Maximize scalar function under the constraints .

Solution: Solve for . The values of the do not matter, only the value of .

If the gradient of does not lie purely in the space spanned by the gradients of the constraints, then we can always increase by moving along the constraint manifold (moving along the constraint manifold = moving in a direction perpendicular to the gradients of the constraint functions, think about contours of constant value). Adding constraints removes constraints on the gradient of .

Cramer’s Rule

A system can be represented as

^abe765

where we are solving for , , and know everything else.

Because the area of a parallelepiped is base times height, (diagram most likely needed here)

^ab78d8

For determinants, we know

[[Cramer’s Rule#^ab78d8|Focus on x]]: The [[Cramer’s Rule#^abe765|original equation]] says transformed by the matrix must be , so we know

^84f58c

By taking the determinants on both sides of [[Cramer’s Rule#^84f58c|this equation]] and substituting in , we get Cramer’s rule:

Similar logic can be applied for and .

- pruning Minimax/Negamax search

Returns a lower bound on the true score of a node

**Search function returns a lower bound for the real score, unless

Fail hard

// alpha = best score we can get (from whole search up until this depth)
// beta = best score our opponent can get (from whole search up until this depth)
// fail hard: Only returns values in [alpha, beta]
int search(Position pos, int alpha, int beta) {
	for (auto move : pos.legal_moves()) {
		pos.make(move);
		
		// next beta = our best move
		// next alpha = best score opponent can get (beta)
		// negatives for perspective change
		int score = -search(pos, -beta, -alpha);
		
		pos.unmake(move);

		alpha = std::max(score, alpha);
		if (alpha >= beta) {
			// higher up, the search found a better
			// branch, so this path doesn't need to be explored further
			return beta;
		}
	}

	return alpha;
}

Fail soft Version

Can return values outside of the range

int search(Position pos, int alpha, int beta) {
	int val = std::numeric_limits<int>::min();
	for (auto move : pos.legal_moves()) {
		pos.make(move);
		val = std::max(val, -search(pos, -beta, -alpha));
		pos.unmake(move);

		alpha = std::max(val, alpha);
		if (alpha >= beta)
			return val;
	}

	return val;
}

Null windows

Quick boolean testing

int test = -search(pos, -alpha - 1, -alpha);

Comp Arch

Boolean Problem (2025-01-23)

Simplify the following expression:

Solution: Just expand out using DeMorgan’s + axioms and eventually you will get

where denotes XOR.

Derivation: Note that

We can write a simple expression for by nesting these expressions, using both versions for the subexpression in :

Expanding the extreme left term with de Morgan’s twice:

However, by the idempotency we can expand it and AND it together with itself with no effect:

By the absorption identity, we can further do

Substituting this into the original expression, we obtain the full problem.

Buffer

out =
00
11

AND

out =
000
010
100
111

OR

out =
000
011
101
111

Inverter

out =
01
10

NAND

out =
001
011
101
110

NOR

out =
001
010
100
110

Curveball 1

out =
0000
0010
0100
0110
1000
1011
1101
1111

Curveball 2

out =
0000
0010
0100
0111
1001
1011
1101
1111

Harmonic Series Stuff

The Actual Stuff

Extending Where

Cases for

Cursed U-sub

Stuff

finally:

𝟙

Orgo Chem 2022-09-25

R = carbon-containing thing ()

HybridizationEndInternal
aldehyde ()ketone
alcohol ()ether
Both(carboxyllic) acid ()ester

Primary Amines: Secondary Amines: Tertiary Amines:

Le Chatelier’s 2022-12-07

Equilibrium will counteract any stress

Increase in temperature

Math of Kinetics

For the reaction

Let be the concentration of the limiting reactant in the reaction. Let be the coefficient that reactant has in the equation. Let be the rate of the reaction. Let be any positive real number. Let be the order of the reaction.

For zeroth-order reactions,

For first-order reactions,

For second order reactions, is linear with respect to time, and its slope is the value of .

Test Suite for TikzJax


Log in to Comment

Firebase not Loaded