Finding Minimum Coefficient of (1+x)^n for k<=20

  • Context: Mathematica 
  • Thread starter Thread starter 76Ahmad
  • Start date Start date
  • Tags Tags
    Coefficient Minimum
Click For Summary

Discussion Overview

The discussion revolves around programming in Mathematica to find the minimum coefficient of the polynomial (1 + x)^n, where n is derived from a variable k that is constrained to be a non-negative integer less than or equal to 20. Participants explore the implications of using non-integer values for n and the correct syntax for loops in Mathematica.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant presents a Mathematica code snippet intended to compute the minimum coefficient for (1 + x)^n based on values of k.
  • Another participant points out a syntax error in the code, specifically a missing comma.
  • A different participant questions the logic of using n as a non-integer in the loop, suggesting that it leads to nonsensical iterations.
  • One participant suggests manually calculating expected results for small values of k and n to inform the programming approach.
  • Another participant clarifies that if n is defined as a function of k, it can still be used in polynomial expansions, but the implications of non-integer n need to be considered.
  • A later reply proposes an alternative code structure using CoefficientList to extract coefficients from the polynomial, suggesting that Expand may not be necessary.

Areas of Agreement / Disagreement

Participants express differing views on the feasibility of using non-integer values for n in the context of the programming task. There is no consensus on the correct approach or syntax for the Mathematica code.

Contextual Notes

Participants highlight limitations related to the assumptions about the integer nature of n and the syntax errors in the proposed code. The discussion also reflects uncertainty about the meaningfulness of Taylor expansions for non-integer powers.

76Ahmad
Messages
46
Reaction score
0
Hello every one, I wish i can some help in my mathematica programing.

I hane k <= 20, k is + integer.
n = 1/12(3(5 - 2Sqrt[6])^k)

what I need to do is for every value of n (comes from K ofcourse),

Print the minmum coefficient for (1 + x)^n

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I tryed to do the following:


For[k = 0, k ≤ 20, k++,
For[n=1/12(3(5 - 2Sqrt[6])^k,n++
Print[Min[Coefficient[(1 + x)\)^n], x^i]], {i, 1, n}]]]


and i got nothing I know i did it wrong please help.
 
Physics news on Phys.org
You're missing a comma in the second line.
 
I add the comma, but still the same
not working
 
Not sure what you are trying to do, here.
The second For loop actually looks like a mix between a For and a Do.
But... with k integer, n is not integer at all. How can you use it as the final value of an integer iterator is beyond me.

For example:
k= 2 implies n = 0.0255...

According to the last {i,1,n}, the iterator i should vary between 1 and... 0.0255...
Nonsense. (at least to me)

Plus, the syntax is not right (parentheses do not match, no wonder since you are undecided between For and Do).

Try again, possibly explaining what you are trying to achieve.
 
By hand work out exactly what your result should be for k=1,k=2,k=3 and n=1,n=2,n=3.

Given those 3 or 9 values we might be able to guess how to write something that will give those values.
 
what I mean by my question is:

if I want to get a value of n which is depend on K, where k >= 0.
after that:::
these values of n is the power of some polynomial p(x) that I need to expand,
and get the minmum coefficient of x


I hope that can help
 
for example if n = 2k, and if i change the polynomial to (1+x^2)^n (1-x)^(2n)...
it well be like:


For[k=0,k>=0,K++,
?
?
Print[
Min[
Table[
Coefficient[
Expand[(1+x^2)^n (1-x)^(2n),x^i,{i,1,Floor[(n-1)/2]}]]]]]




this well work I think, except that I don't know how to right about n
the second line ?
 
ok, if n is an integer, albeit function of k, you can expand the polynomial in x in a finite number of terms. If n is non-integer you could still get a Taylor expansion around zero, for example, but I don't know how meaningful that could be.

As for your example, I doubt it would run since you seem to have closed all the brackets at the end of the line.
Try this
Code:
Table[
  n = 2k;
  Min[ CoefficientList[ Expand[(1 + x^n)^2 (1 - x)^(2 n)], x] ],
  {k, 1, 20}]

CoefficientList gives you a list of all the coefficients in the polynomial passed to it. I believe the Expand is not even necessary since it will be performed by coefficient list itself.
Be prepared to see a lot of negative values.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
Replies
5
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
4
Views
2K