0% found this document useful (0 votes)
10 views2 pages

Basic Math - Ad-Hoc Math Patterns

The document outlines various mathematical strategies for problem-solving, emphasizing techniques such as binary search for optimization, greedy approaches for formula construction, and the use of floor division and modulo for calculations. It also highlights the importance of simplifying problems by focusing on relevant constraints, analyzing edge cases, and employing iterative methods when necessary. Additionally, it discusses properties of XOR operations and strategies for managing multiple variables effectively.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Basic Math - Ad-Hoc Math Patterns

The document outlines various mathematical strategies for problem-solving, emphasizing techniques such as binary search for optimization, greedy approaches for formula construction, and the use of floor division and modulo for calculations. It also highlights the importance of simplifying problems by focusing on relevant constraints, analyzing edge cases, and employing iterative methods when necessary. Additionally, it discusses properties of XOR operations and strategies for managing multiple variables effectively.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Basic math/ad-hoc math patterns

1.​ If a problem asks MINIMISE or MAXIMISE a value USE BINARY SEARCH!!! If the
answer is not calculable by a direct formula, stick to binary search. Topic: Finding
min/max values that suit a range
2.​ (If necessary) Identify the greedy approach for a problem, start smaller etc. and then
make a generalised formula that you can reapply. Topic: Formula construction
3.​ Use a combination of floor division + modulo to figure out how much you can make out
of something. Floor division = whole parts, modulo = leftovers. Topic: Using floor
division + modulo
4.​ It may help sometimes to focus on what is relevant to a given section of a problem.
Ignoring other constraints that don’t apply to the solution can help you simplify a problem
down. Topic: Think about it! (AoPS)
5.​ Fixing a given constraint, solving for it, and looking at observations may help you apply it
to the overall answer. Topic: Constraint restrictions!
6.​ If you are given some game/algorithm/series of steps, especially if it's greedy, evaluate
all cases to ensure that no special patterns/outliers are ignored. Topic: edge case
analysis
7.​ View some sequence of letters/numbers etc. as blocks. Imagine them not as individual
parts, but as one entire contiguous block and work on with the properties of the block.
Topic: sequence simplification
8.​ If you are given some equation, try to rearrange it in order to achieve two things: a) an
isolated variable which you can solve for b) some isolated/independent term. By doing
this, you may be able to solve equations quicker. Topic: equation rearrangement
9.​ If you are given some statements, inequalities, etc. try to think about the variable
parameters and see if you can simplify it into plain english, or just completely cancel it.
Topic: Inequality abstraction
10.​If you notice yourself having to repeat some process with a different input each time,
consider an iterative approach – A direct formula may not be worth it. Don’t waste your
time, especially if the iterative method is an easy implementation. Topic: iterative
formulas
11.​If you notice that a naive solution may be possible based on the given constraints e.g. n
<= 5000 for O(n²), try to focus on the naive implementation if possible. Don’t optimise if
you can get the AC easier.
12.​X ^ Y = X + Y if and only if X and y are inverses e.g. X = 0110010 Y = 10011101. Topic:
XOR inequalities
13.​You can identify powers of 2 as (x & (x - 1)) == 0. Remember to also view XOR in terms
of its bits, ignore the original number (most times). XOR’s also cancel each other out if
it's the same value. XOR’s are also associative and transitive and commutative. Topic:
XOR properties and thoughts
14.​If you have to keep track of multiple variables, constraints or conditions, try to see if you
can fix a variable. You can do this by literally fixing it or keeping its sequence monotonic
in order to make searching easier. Topic: Variable simplification
15.​

You might also like