Evaluate the summation:
SUMMATION i=1 to n=7 of (i)
28
State the contrapositive of the following:
"If you forget your breakfast, you will be tired and hangry"
If you are not tired and not hangry, then you did not forget your breakfast
According to many sources, which programming language is generally listed as the #1 most used? This includes across freelancing, industry, education, etc.
Python
We are given the array:
[4, -2, 9, 12, -2, 5, 4, 77, -1, 12, 18, 4]
We decide to put the elements in a set.
How many elements are in the set and what are they?
8 elements
{4, -2, 9, 12, 5, 77, -1, 18}
Sets don't contain duplicates
In Java, what is the default value of an object reference declared as an instance variable?
Null
What is the closed form formula for
SUMMATION i=1 to n of (i2)
[(n)(n+1)(2n+1)]/6
Express this English statement using logical propositions.
If berries are ripe along the trail, hiking is safe if and only if grizzly bears have not been seen in the
area.
p: Berries are ripe along the trail
q: Hiking is safe.
r: Grizzly bears have not been seen in the area.
Answer: p -> (q <=> r)
What distinguishes weak induction from strong induction?
Strong induction has multiple base cases and weak induction has 1
How many elements are in the power set of S if S has 7 elements?
27 = 128
What Java class pulls arbitrary integers from a range, when prompted?
Random
Given the following summation, state three things you can try to do to simplify the problem
SUMMATION i=6 to n=16 of (2*2i)
1) Change the bounds to start at i=1 or i=0
2) Use the closed form formula
3) Bring the constant 2 out front
Draw a truth table for the following propositional statement:
!(p -> q) XOR (q -> r)
Be sure to have all necessary columns.p | q | r | p->q | !(p->q) | (q->r) | !(p->q)XOR (q->r)
T T T T F T T
T T F T F F F
T F T F T T F
T F F F T T F
F T T T F T T
F T F T F F F
F F T T F T T
F F F T F T T
What is the 7th prime number? (Do not count 1 as a prime number)
2, 3, 5, 7, 11, 13, 17
17
Consider the sets A={1, 2, 3, 6} and B={4, 7, 8}
Are these disjoint? Explain
Yes because they have no element in common.
What is the smallest "number-holding" variable in Java that is not a boolean?
Byte
1, 2, 6, 24, 120, _
What's the next term in the sequence?
Give a formula for the sequence
720
n!
Provide an example in English of the following propositional statement:
!r -> (p XOR q)
Example: Unless I am trying to type something, my cat is either eating or sleeping.
p: My cat is eating.
q: My cat is sleeping.
r: I'm trying to type.
Who was the first computer programmer?
Ada Lovelace
If C is a set such that C∪A=C and C∩B={}, what can you infer about sets A and B with respect to C?
1) A is a subset of C
2) B is disjoint from C
This object allows you to connect data like chains or trees, but is rarely accessible from outside of its class.
Node
Evaluate the summation:
SUMMATION i=2 to n=52 of (2)
102
Translate the following statement into a logical expression with quantifiers: "There is no greatest natural number."
¬∃x∈N, ∀y∈N (y≤x)
The simplest way of computing matrix multiplication requires n3 operations where n is the rows and columns of the matrix. Computer scientist, Volker Strassen, discovered an algorithm to do it in only n2.807 operations. What year did he make this discovery? (do not Google this, closest answer gets the points)
1969
Find the sets A and B if:
A – B = {1, 5, 7, 8}
B – A = {2, 10}
A ∩ B = {3, 6, 9}
A={1,5,7,8,3,6,9}
B={2,10,3,6,9}
You can store a numeric value in a variable of this type, but whether you get one out is questionable.
char