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

AI Thread Summary
The discussion focuses on finding the minimum coefficient of the polynomial (1 + x)^n, where n is derived from k, with k being a positive integer less than or equal to 20. The initial Mathematica code provided is incorrect due to syntax errors and the non-integer nature of n for certain k values. Participants suggest that the user clarify their goal and provide specific examples for k values to better understand the desired output. A proposed solution involves using CoefficientList to extract coefficients from the polynomial, which may yield negative values. The conversation emphasizes the importance of correct syntax and understanding the relationship between k and n in polynomial expansions.
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
5
Views
2K
Replies
12
Views
2K
Replies
3
Views
2K
Back
Top