Skip to Content

Discrete Math

For which values of nn can we subdivide an equilateral triangle into nn sub-triangles where each sub-triangle is also equilateral?

Prove that every integer greater than 1 can be written as the product of primes.

How many chicken nuggets can you buy exactly using denominations of 6, 9, and 20 pieces? Prove that you can buy exactly nn chicken McNuggets for all n>43n > 43.

Find the sum of n2n^2 from n=1n = 1 to n=5n = 5.

Find the sum of 2n2^n from n=1n = 1 to n=6n = 6.

Find the sum of 3n+23n + 2 from n=1n = 1 to n=5n = 5.

Find the sum of the first 100 terms of the sequence given by 4n+54n + 5.

Calculate the sum of the first four terms of the sequence given by 32n1\frac{3}{2}^{n-1}.

Determine the sum of the infinite geometric sequence represented by 8(23)n18 \left( \frac{2}{3} \right)^{n-1}.

Translate the following predicate logic statement to English: "xy(C(x,y)R(x,y)L(x,y))\forall x \forall y ( C(x, y) \land R(x, y) \Rightarrow L(x, y) )".

Get the sum of elements of a binary tree using recursion: Calculate root's value, and for each subtree, calculate the sum of its elements until reaching the base case where the node is null.

Get the maximum value in a binary tree using recursion: For each node, determine the maximum value in the left subtree and the right subtree, then return the maximum between root's value, leftMax, and rightMax.

Get the height of a binary tree using recursion: Calculate the height of both subtrees and return 1 plus the maximum between them.

Check if a specific value exists in a binary tree using recursion: Compare with the root's value, check in the left subtree, and in the right subtree.

Reverse a binary tree using recursion: Reverse its left subtree, reverse its right subtree, and swap the left node with the right node.

Give the pre-order, in-order, and post-order traversal of the tree below.