Basic Query Concerning Discrete Math [closed] - math

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
My professor gave an example located on slide 3 of this pdf: can anybody explain to me how he ended up with m_n = 2^(n) - 1. Thanks!

The step is from
mn =2nāˆ’1 +2nāˆ’2 +...+22 +2+1.
to
mn = 2n āˆ’ 1
There are two ways to make the step. One is to recognize this as a geometric series, and know the rule:
sum=(1-rn)/(1-r)
The other is to have played around enough with powers of two to know that if you add up a bunch of them starting from 1, you get the next one, minus one.

There is a formula for the sum of the first n terms of a geometric series.
1 + 2 + 2^2 + 2^3 + ... + 2^{n-1}
= (1 - 2^n) / (1 - 2)
= (1 - 2^n) / (-1)
= 1/(-1) - 2^n/(-1)
= 2^n - 1

It's just one of the relations of series that people have figured out over the years:
2^(n-1) + 2^(n-2) + ... + 2 + 1 == 2^n - 1
You can think of it a lot like the sum of binary numbers:
000001
000010
000100
001000
+ 010000
------
011111 == 1000000 - 1

Actually,
Mn=2^0+2^1+.........+2^(n-1)+2^(n-2)
is the Nth term of the sequence Mk=.....
And this Nth term itself is a sum of a geometrical progression whose 1st term is 1(2^0) and common ratio=2.
And this sum(Mn) is
=a[(r^n)-1]/[r-1]
where a is 1st term and r common ratio
=1*[(2^n)-1]/[2-1]
Mn=2^n - 1

Related

How many ways to get a sum of consecutive whole numbers that total x? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
How would one go to programmatically tackle these questions:
How many different ways are there to write:
a) 2021 as the sum of consecutive whole numbers?
b) x as the sum of consecutive whole numbers?
Supposing the order of the numbers isn't important, there are 8518741657943308344041302580996941768179250799 ways to write 2021 as a sum of positive integers. It's called the partition number. There isn't a simple formula, but there is a recurrence relation that allows to calculate a lot of values.
The function is implemented in Python's sympy:
from sympy import partition
print(partition(2021))
Now, for the new question, to write 2021 as the sum of consecutive integers: n + n+1 + ... + m-1 + m = 2021. First note that negative values for n don't add anything interesting. When n < -m, the sum would clearly be negative. Otherwise, the negative values just "eat up" the corresponding positive values, and you get the same sum as a positive solution.
The sum of the numbers from 1 to m is tri(m)=m*(m+1)/2, (the triangular number). The sum of the numbers from n to m is just tri(m)-tri(n-1). These equations can be solved by a SAT/SMT solver such as Z3:
from z3 import Int, Solver, And, Or, sat
s = Solver()
m = Int('m')
n = Int('n')
s.add(And(n > 0, n < 2022))
s.add(n <= m)
s.add(And(m > 0, m < 2022))
s.add(m * (m + 1) - n * (n - 1) == 2021 * 2)
while s.check() == sat:
mi = s.model()[m].as_long()
ni = s.model()[n].as_long()
if ni > mi - 30:
print("+".join([str(i) for i in range(ni, mi + 1)]), end="=")
else:
print("+".join([str(i) for i in range(ni, ni + 6)]), "+...+",
"+".join([str(i) for i in range(mi - 4, mi + 1)]), end="=", sep="")
print(sum([i for i in range(ni, mi + 1)]))
s.add(Or(m != mi, n != ni))
Output:
26+27+28+29+30+...+64+65+66+67+68=2021
20+21+22+23+24+...+62+63+64+65+66=2021
1010+1011=2021
2021=2021
So, for 2021 there are 4 positive solutions (and 4 corresponding solutions that would include the negative numbers from 1-n to m).

What is the technical way to describe growth factors (exponential change in percent) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
This may be quite simple, but I'm wondering if there is a technical way to describe a relative value that grows exponentially based on the percentage.
e.g. If these numbers grow by 13.5% every month:
100 * 13.5% = 13.5
113.5 * 13.5% = 15.3225
115.3225 * 13.5% = 15.5685375
... etc
I am trying to understand the technical or correct way to describe these changes in mathematics. Is there also an equation that would describe this? Thank you to all the math nerds in advance!
It is called a geometric series/sequence.
The generic form is S = a(1 + r^n)
where:
S is the sum of the first n elements of the series.
a is the first element
r is the multiplication factor
n is the number of terms.
in your example:
a = 100
r = 0.135
n = is the number you want to compute for.
if you want the 10th element then n = 10 if you want the 100th element then n = 100.
When you do compound interest calculations you need to be careful as well that the interest you are given is for the year, but the interest is calculated every month so you must adjust your values accordingly.
here is a link to wikipedia that examplains it. At the base it is the same formula but it accounts for all that other stuff I mentioned.
https://en.wikipedia.org/wiki/Compound_interest
Compounded Annual Growth Rate would be the investment term where what you want is a slightly different formula as there is a 1.135 factor that is being multiplied with itself to compound the return.
Consider a 10% growth rate and different interest calculations over a few years:
Simple interest for 3 years on $100 would be $10 each for a total of $30.
Compound interest for 3 years on $100 would be $10 for the first year, $11 for the second year and $12.10 for the 3rd year for a total of $33.10 in this case.
Are you sure your calculations are correct?
I think what you're looking for is:
100 * 13,5 % = 13,5 %
(100 + 13,5) * 13,5 % = 15,3225
(100 + 13,5 + 15,3225) * 13,5 % = 17,3910375
or in short:
100 * 1,135^t
for t=3
100 * 1,135^3 = 146,2135375

Differentiation Math Limits [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
limit x-->3 2x^2 + 7x-15/x-3
What i Simplified
Step 1 : 2x^2 + 10x -3x -15 / x-3
Step 2 : 2x( x + 5)-3( x + 5)/x-3
Step 3 : (2x - 3)(x + 5)/x-3
but unable to move further.. im thinking either the question ix wrong or there ix some trick which im unable to understand
thanx in advance
as x -> 3, the numerator goes to 3 * 8 = 24 and the denominator goes to 0, so the limit goes to +infinity if you approach 3 from the right, and -infinity if you approach 3 from the left
since you didn't specify which direction, the limit does not exist.
try graphing it: https://www.desmos.com/calculator

Expand 2^(k + 1) [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
http://doyourmath.com/web-algebrator/#c=expand_algexpand&v5=2%5E(k%2B1)
Anyone can explain why does expand 2^(k + 1) equal to (2^k) + 1?
That's not actually possible. 2^(k+1) is always going to be an even number. 2^k + 1 is always going to be an odd number.
I think you mean
2^(k+1) = 2^k * 2^1 = 2^k * 2.
One way of looking at it is the associative property of multiplication:
(2 X 3) X 4 = 2 X (3 X 4)
No matter how you group the numbers, the outcome will always be equal. In this case we're dealing with exponents, which is a shorthand notation for multiplying a number by itself.
It is not!!!
2^(k+1) = 2^k * 2 which is greater than 2^k + 1
Instead (k+1)^2 expands to (k^2)+2k+1
http://doyourmath.com/web-algebrator/#c=expand_algexpand&v5=2%5E(k%2B1) has ERRORS!

Proving a recurrence relation by induction [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have a test coming up, and I need some help with a practise question... Need to prove this by induction:
Reccurence relation: m(i) = m(i-1) + m(i - 3) + 1, i >= 3
Initial conditions: m(0) = 1, m(1) = 2, m(2) = 3
Prove m(i) >= 2^(i/3)
Here is what I have been able to do so far:
Base case: m(3) >= 2 -----> 5 >= 2. Therefore it holds for the base case.
Induction Hypothesis Assume there is a k such that m(k) >= 2^(k/3) holds.
Now I must prove that it holds for k+1.
So we have: m(k+1) >= 2^((k+1)/3)
which equals (by substituting hypothesis):
m(k) + m(k-2) + 1 >= 2^((k+1)/3)
This is where I am stuck. I'm not sure where to go from here. Any help will be appreciated. Thanks guys!
Hints:
Prove that m(k) >= m(k-2). (This is trivial.)
Since m(k+1) = m(k) + m(k-2) + 1, you can replace = with >= to get m(k+1) >= m(k) + m(k-2) + 1.
You can make substitutions on the right-hand side of >=, as long as what you put in is less than or equal to what you take out. Start by using #1 to make a substitution in #2.
Consider your base case: you show that for 3 prior consecutive given values for m(0), m(1), and m(2), that the formula holds for m(4). Then show that m(k+1) formula works if you assume that it's true for 3 prior values m(k), m(k-1), and m(k-2) [this is valid for induction].
By initial condition
m(k+1) = m(k) + m(k-2) + 1
Substitution:
m(k+1) >= 2^(k/3) + 2^((k-2)/3) + 1
Factor the right hand side in terms of 2^((k+1)/3) [HINT: leave the +1 alone] and it should fall out from there.

Resources