1 obsidian/miscnotes
The problem: Maximize scalar function
Solution: Solve for
If the gradient of
A system can be represented as
^abe765
where we are solving for
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
^84f58c
By taking the determinants on both sides of [[Cramer’s Rule#^84f58c|this equation]] and substituting in
Similar logic can be applied for
Returns a lower bound on the true score of a node
**Search function returns a lower bound for the real score, unless
// 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;
}
Can return values outside of the
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;
}
Quick boolean testing
int test = -search(pos, -alpha - 1, -alpha);
alpha < test && test < beta
Simplify the following expression:
Solution: Just expand out using DeMorgan’s + axioms and eventually you will get
where
Derivation: Note that
We can write a simple expression for
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
Substituting this into the original expression, we obtain the full problem.
out = | |
---|---|
0 | 0 |
1 | 1 |
out = | ||
---|---|---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
out = | ||
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
out = | |
---|---|
0 | 1 |
1 | 0 |
out = | ||
---|---|---|
0 | 0 | 1 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
out = | ||
---|---|---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 0 |
out = | |||
---|---|---|---|
0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 0 |
1 | 0 | 0 | 0 |
1 | 0 | 1 | 1 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 1 |
out = | |||
---|---|---|---|
0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 1 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 1 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 1 |
finally:
R = carbon-containing thing ()
Hybridization | End | Internal |
---|---|---|
aldehyde ( | ketone | |
alcohol ( | ether | |
Both | (carboxyllic) acid ( | ester |
Primary Amines:
Equilibrium will counteract any stress
Increase in temperature
For the reaction
Let
For zeroth-order
For first-order
For second order