I need help in mathematica

  • Mathematica
  • Thread starter 76Ahmad
  • Start date
  • #1
48
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.
 

Answers and Replies

  • #2
418
4
You're missing a comma in the second line.
 
  • #3
48
0
I add the comma, but still the same
not working
 
  • #4
192
41
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.
 
  • #5
1,069
29
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.
 
  • #6
48
0
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
 
  • #7
48
0
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 dont know how to right about n
the second line ??????????????
 
  • #8
192
41
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.
 

Related Threads on I need help in mathematica

Replies
2
Views
1K
Replies
1
Views
1K
Replies
7
Views
2K
Replies
2
Views
3K
Replies
4
Views
2K
Replies
1
Views
2K
Replies
9
Views
2K
Replies
23
Views
10K
Replies
1
Views
2K
Top