Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9929 > unrolled thread

New to Mathematica

Started by"J.Jack.J." <jack.j.jepper@googlemail.com>
First post2012-05-03 08:40 +0000
Last post2012-05-08 08:15 +0000
Articles 9 — 5 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  New to Mathematica "J.Jack.J." <jack.j.jepper@googlemail.com> - 2012-05-03 08:40 +0000
    Re: New to Mathematica "J.Jack.J." <jack.j.jepper@googlemail.com> - 2012-05-05 08:16 +0000
      Re: New to Mathematica David Bailey <dave@removedbailey.co.uk> - 2012-05-06 07:25 +0000
        Re: New to Mathematica "J.Jack.J." <jack.j.jepper@googlemail.com> - 2012-05-07 00:30 +0000
      Re: New to Mathematica "Oleksandr Rasputinov" <oleksandr_rasputinov@ymail.com> - 2012-05-08 08:07 +0000
    Re: New to Mathematica Murray Eisenberg <murray@math.umass.edu> - 2012-05-06 07:24 +0000
      Re: New to Mathematica "J.Jack.J." <jack.j.jepper@googlemail.com> - 2012-05-07 00:30 +0000
    Re: New to Mathematica "J.Jack.J." <jack.j.jepper@googlemail.com> - 2012-05-08 08:09 +0000
    Re: New to Mathematica Bob Hanlon <hanlonr357@gmail.com> - 2012-05-08 08:15 +0000

#9929 — New to Mathematica

From"J.Jack.J." <jack.j.jepper@googlemail.com>
Date2012-05-03 08:40 +0000
SubjectNew to Mathematica
Message-ID<jntga4$2c$1@smc.vnet.net>
Hi,

 I have just downloaded my free trial version of Mathematica.
 I only need it for one thing (as yet, anyway), and I wonder whether
someone can help me in step-by-step fashion to get what I want. I need
the solution to the following (I might make amendments to the values):

"For any integer k, let r(k) be x such that

(x/ln(x))*(1 + 1/ln(x)) = 108.2 + k)


product (k = 0 to 3000) (1-1/r(k))"

With many thanks in advance.

[toc] | [next] | [standalone]


#9968

From"J.Jack.J." <jack.j.jepper@googlemail.com>
Date2012-05-05 08:16 +0000
Message-ID<jo2nld$mds$1@smc.vnet.net>
In reply to#9929
On May 3, 9:40 am, "J.Jack.J." <jack.j.jep...@googlemail.com> wrote:
> Hi,
>
>  I have just downloaded my free trial version of Mathematica.
>  I only need it for one thing (as yet, anyway), and I wonder whether
> someone can help me in step-by-step fashion to get what I want. I need
> the solution to the following (I might make amendments to the values):
>
> "For any integer k, let r(k) be x such that
>
> (x/ln(x))*(1 + 1/ln(x)) = 108.2 + k)
>
> product (k = 0 to 3000) (1-1/r(k))"
>
> With many thanks in advance.

Can nobody help me with this? Just for a Newbie?
As most will realise, the first lines define my function and the
product (k = 0 to 3000) (1-1/r(k))
is my desired calculation. I need to know what inputs to use.

With thanks in advance.

[toc] | [prev] | [next] | [standalone]


#9973

FromDavid Bailey <dave@removedbailey.co.uk>
Date2012-05-06 07:25 +0000
Message-ID<jo591i$2c1$1@smc.vnet.net>
In reply to#9968
On 05/05/2012 09:16, J.Jack.J. wrote:
> On May 3, 9:40 am, "J.Jack.J."<jack.j.jep...@googlemail.com>  wrote:
>> Hi,
>>
>>   I have just downloaded my free trial version of Mathematica.
>>   I only need it for one thing (as yet, anyway), and I wonder whether
>> someone can help me in step-by-step fashion to get what I want. I need
>> the solution to the following (I might make amendments to the values):
>>
>> "For any integer k, let r(k) be x such that
>>
>> (x/ln(x))*(1 + 1/ln(x)) = 108.2 + k)
>>
>> product (k = 0 to 3000) (1-1/r(k))"
>>
>> With many thanks in advance.
>
> Can nobody help me with this? Just for a Newbie?
> As most will realise, the first lines define my function and the
> product (k = 0 to 3000) (1-1/r(k))
> is my desired calculation. I need to know what inputs to use.
>
> With thanks in advance.
>

If you press F1, you will enter the help system. Once there, you could 
try looking up log and product. The examples will give you the basics of 
Mathematica syntax, and you can cut and paste them into your notebook, 
and alter them as desired.

David Bailey
http://www.dbaileyconsultancy.co.uk

[toc] | [prev] | [next] | [standalone]


#9980

From"J.Jack.J." <jack.j.jepper@googlemail.com>
Date2012-05-07 00:30 +0000
Message-ID<jo753j$bsa$1@smc.vnet.net>
In reply to#9973
On May 6, 8:25 am, David Bailey <d...@removedbailey.co.uk> wrote:
> On 05/05/2012 09:16, J.Jack.J. wrote:
>
>
>
>
>
>
>
>
>
> > On May 3, 9:40 am, "J.Jack.J."<jack.j.jep...@googlemail.com>  wrote:
> >> Hi,
>
> >>   I have just downloaded my free trial version of Mathematica.
> >>   I only need it for one thing (as yet, anyway), and I wonder whethe=
r
> >> someone can help me in step-by-step fashion to get what I want. I need
> >> the solution to the following (I might make amendments to the values):
>
> >> "For any integer k, let r(k) be x such that
>
> >> (x/ln(x))*(1 + 1/ln(x)) = 108.2 + k)
>
> >> product (k = 0 to 3000) (1-1/r(k))"
>
> >> With many thanks in advance.
>
> > Can nobody help me with this? Just for a Newbie?
> > As most will realise, the first lines define my function and the
> > product (k = 0 to 3000) (1-1/r(k))
> > is my desired calculation. I need to know what inputs to use.
>
> > With thanks in advance.
>
> If you press F1, you will enter the help system. Once there, you could
> try looking up log and product. The examples will give you the basics of
> Mathematica syntax, and you can cut and paste them into your notebook,
> and alter them as desired.
>
> David Baileyhttp://www.dbaileyconsultancy.co.uk


Have tried and failed, tried and failed, with this method! Can
somebody give me the requisite inputs? Note that I need to add the
condition that x be the highest integer for which <definition of
r(k)>.

With thanks.

[toc] | [prev] | [next] | [standalone]


#9993

From"Oleksandr Rasputinov" <oleksandr_rasputinov@ymail.com>
Date2012-05-08 08:07 +0000
Message-ID<joak8u$nfp$1@smc.vnet.net>
In reply to#9968
On Mon, 07 May 2012 01:30:43 +0100, J.Jack.J.  
<jack.j.jepper@googlemail.com> wrote:

> On May 6, 8:25 am, David Bailey <d...@removedbailey.co.uk> wrote:
>> On 05/05/2012 09:16, J.Jack.J. wrote:
>>
>> > On May 3, 9:40 am, "J.Jack.J."<jack.j.jep...@googlemail.com>  wrote:
>> >> Hi,
>>
>> >>   I have just downloaded my free trial version of Mathematica.
>> >>   I only need it for one thing (as yet, anyway), and I wonder whether
>> >> someone can help me in step-by-step fashion to get what I want. I  
>> need
>> >> the solution to the following (I might make amendments to the  
>> values):
>>
>> >> "For any integer k, let r(k) be x such that
>>
>> >> (x/ln(x))*(1 + 1/ln(x)) = 108.2 + k)
>>
>> >> product (k = 0 to 3000) (1-1/r(k))"
>>
>> >> With many thanks in advance.
>>
>> > Can nobody help me with this? Just for a Newbie?
>> > As most will realise, the first lines define my function and the
>> > product (k = 0 to 3000) (1-1/r(k))
>> > is my desired calculation. I need to know what inputs to use.
>>
>> > With thanks in advance.
>>
>> If you press F1, you will enter the help system. Once there, you could
>> try looking up log and product. The examples will give you the basics of
>> Mathematica syntax, and you can cut and paste them into your notebook,
>> and alter them as desired.
>>
>> David Baileyhttp://www.dbaileyconsultancy.co.uk
>
>
> Have tried and failed, tried and failed, with this method! Can
> somebody give me the requisite inputs? Note that I need to add the
> condition that x be the highest integer for which <definition of
> r(k)>.
>
> With thanks.
>

Just give up. There is no such integer x for any integer k between 0 and  
3000 inclusive, and Mathematica can prove it:

Exists[
   x, x \[Element] Integers,
   (x/Log[x]) (1 + 1/Log[x]) == 541/5 + k &&
    k \[Element] Integers &&
     0 <= k <= 3000
  ] // Resolve

False

However, your problem was not well stated from the beginning, so I doubt  
if you really meant what you wrote above. Here is one of the 3^3001  
possible solutions (type this into Mathematica; it is an absurdly large  
number, too big to post here) to your problem consistent with the  
definition of r(k) originally given, and with the additional assumption  
that r(k) is the largest *real* x such that (x/Log[x]) (1 + 1/Log[x]) ==  
541/5 + k:

r[k_?NumericQ] := Block[{x},
   x /. FindRoot[
     (x/Log[x]) (1 + 1/Log[x]) == 541/5 + k,
     {x, 5}, WorkingPrecision -> $MachinePrecision
    ]
  ];

Product[1 - 1/r[k], {k, 0, 3000}]

0.6308341356354897

I don't know if you will be able to find a closed form for this, but if an  
approximation good to 100 places will do, you could use the second root of:

0 == -70 - 13047 x + 9183 x^2 - 5019 x^3 + 35491 x^4 - 3680 x^5 -
      14978 x^6 + 6707 x^7 + 28462 x^8 + 9675 x^9 + 30267 x^10 +
      19638 x^11 + 3179 x^12 + 15750 x^13 - 21197 x^14 - 5200 x^15 +
      37078 x^16 - 4243 x^17 + 10128 x^18 - 15288 x^19 + 27082 x^20

[toc] | [prev] | [next] | [standalone]


#9970

FromMurray Eisenberg <murray@math.umass.edu>
Date2012-05-06 07:24 +0000
Message-ID<jo58um$2b8$1@smc.vnet.net>
In reply to#9929
First, perhaps folks were reluctant to respond because this looked like 
it could be a homework exercise.

Second, you don't even have proper Mathematica syntax in your equation 
relating x and k. Did you even try to read the documentation to learn 
the very basics? For example, proper syntax for the equation would be:

   (x/Log[x]) (1 + 1/Log[x]) == 108.2 + k

Function arguments must be enclosed in brackets, not parentheses, and 
the equality is a doubled "=" sign. Moreover, your original expression 
had an unbalanced terminal parenthesis.

Third, the equation itself looks really nasty. Aside from the fact that 
it mixes exact formulas with an approximate real (108.2), the left-hand 
side is transcendental.

Fourth, the equation does not seem to uniquely define x as a function of 
k! For example, form the difference between the two sides...

   f[x_] := (x/Log[x]) (1 + 1/Log[x]) - 108.2 - k

... and plot f for, say, k = 2:

   Plot[Evaluate[f[x] /. k -> 2], {x, 0.5, 2}, Exclusions -> {x == 1},
  AxesOrigin -> {0, 0}, PlotRange -> {-5, 5}]

The graph crosses the x-axis twice. And indeed, if you use FindRoot with 
initial guesses above and below 1, you'll see that this is so:

    FindRoot[Evaluate[f[x] /. k -> 2], {x, 0.9}]
{x -> 0.916554}

    FindRoot[Evaluate[f[x] /. k -> 2], {x, 1.1}]
{x -> 1.11137}



On 5/5/12 4:14 AM, J.Jack.J. wrote:
> On May 3, 9:40 am, "J.Jack.J."<jack.j.jep...@googlemail.com>  wrote:
>> Hi,
>>
>>   I have just downloaded my free trial version of Mathematica.
>>   I only need it for one thing (as yet, anyway), and I wonder whether
>> someone can help me in step-by-step fashion to get what I want. I need
>> the solution to the following (I might make amendments to the values):
>>
>> "For any integer k, let r(k) be x such that
>>
>> (x/ln(x))*(1 + 1/ln(x)) = 108.2 + k)
>>
>> product (k = 0 to 3000) (1-1/r(k))"
>>
>> With many thanks in advance.
>
> Can nobody help me with this? Just for a Newbie?
> As most will realise, the first lines define my function and the
> product (k = 0 to 3000) (1-1/r(k))
> is my desired calculation. I need to know what inputs to use.
>
> With thanks in advance.
>

-- 
Murray Eisenberg                     murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305

[toc] | [prev] | [next] | [standalone]


#9981

From"J.Jack.J." <jack.j.jepper@googlemail.com>
Date2012-05-07 00:30 +0000
Message-ID<jo752l$brq$1@smc.vnet.net>
In reply to#9970
Thanks for replying. Responses embedded:


On May 6, 8:24 am, Murray Eisenberg <mur...@math.umass.edu> wrote:
> First, perhaps folks were reluctant to respond because this looked like
> it could be a homework exercise.
>
> Second, you don't even have proper Mathematica syntax in your equation
> relating x and k. Did you even try to read the documentation to learn
> the very basics?

I tried and tried for hours but couldn't so much as find any section
that would even tell me how to write the condition that k be an
integer.

 For example, proper syntax for the equation would be:
>
>    (x/Log[x]) (1 + 1/Log[x]) == 108.2 + k
>
> Function arguments must be enclosed in brackets, not parentheses, and
> the equality is a doubled "=" sign. Moreover, your original expression
> had an unbalanced terminal parenthesis.
>

Thanks.

> Third, the equation itself looks really nasty. Aside from the fact that
> it mixes exact formulas with an approximate real (108.2), the left-hand
> side is transcendental.
>
> Fourth, the equation does not seem to uniquely define x as a function of
> k! For example, form the difference between the two sides...
>
>    f[x_] := (x/Log[x]) (1 + 1/Log[x]) - 108.2 - k
>
> ... and plot f for, say, k = 2:
>
>    Plot[Evaluate[f[x] /. k -> 2], {x, 0.5, 2}, Exclusions -> {x ==
= 1},
>   AxesOrigin -> {0, 0}, PlotRange -> {-5, 5}]
>
> The graph crosses the x-axis twice. And indeed, if you use FindRoot with
> initial guesses above and below 1, you'll see that this is so:
>
>     FindRoot[Evaluate[f[x] /. k -> 2], {x, 0.9}]
> {x -> 0.916554}
>
>     FindRoot[Evaluate[f[x] /. k -> 2], {x, 1.1}]
> {x -> 1.11137}
>

Am sorry, I should have said "let r(k) be the highest x such that..."

Can you give me the required inputs? That would help me immensely.

[toc] | [prev] | [next] | [standalone]


#9995

From"J.Jack.J." <jack.j.jepper@googlemail.com>
Date2012-05-08 08:09 +0000
Message-ID<joakas$ngh$1@smc.vnet.net>
In reply to#9929
OK I have got my answer now.

[toc] | [prev] | [next] | [standalone]


#9998

FromBob Hanlon <hanlonr357@gmail.com>
Date2012-05-08 08:15 +0000
Message-ID<joakmb$nkh$1@smc.vnet.net>
In reply to#9929
Build one step at a time.

For a given value of k (say k=2) use exact values (i.e., 1082/10
rather than 108.2) and restrict the domain of Solve to Reals

With[{k = 2}, Solve[(x/Log[x]) (1 + 1/Log[x]) == 1082/10 + k,
  x, Reals]]

{{x -> Root[{-551 Log[#1]^2 + 5 #1 + 5 Log[#1] #1 &,
     0.91655356819195758220}]}, {x ->
   Root[{-551 Log[#1]^2 + 5 #1 + 5 Log[#1] #1 &,
     1.11136974029598568569}]}, {x ->
   Root[{-551 Log[#1]^2 + 5 #1 + 5 Log[#1] #1 &, 611.73540466624378639}]}}

Use N to convert Root objects to their values (last entry in Root object)

With[{k = 2}, Solve[
   (x/Log[x]) (1 + 1/Log[x]) == 1082/10 + k,
   x, Reals] // N]

{{x -> 0.916554}, {x -> 1.11137}, {x -> 611.735}}

Use ReplaceAll to extract values from rules

With[{k = 2}, x /. Solve[
    (x/Log[x]) (1 + 1/Log[x]) == 1082/10 + k,
    x, Reals] // N]

{0.916554, 1.11137, 611.735}

Use Part, Last, or Max to extract largest value

With[{k = 2}, x /. Solve[
     (x/Log[x]) (1 + 1/Log[x]) == 1082/10 + k,
     x, Reals][[-1]] // N]

611.735

Convert to a function of k with k restricted to Integers

r[k_Integer] := x /. Solve[
     (x/Log[x]) (1 + 1/Log[x]) == 1082/10 + k,
     x, Reals][[-1]] // N

r[2]

611.735

Plot of r

ListPlot[{#, r[#]} & /@ Range[-20, 20, 4],
 Frame -> True, Axes -> False]

Define your Product as a function of kmax

p[kmax_Integer] :=
 Product[1 - 1/r[k], {k, 0, kmax}]

p[10]

0.982714

This is quite slow so calculation for large values of kmax will take
considerable time. Plot of p

ListPlot[{#, p[#]} & /@ Range[0, 20, 2],
 Frame -> True, Axes -> False]


Bob Hanlon


On Sun, May 6, 2012 at 8:28 PM, J.Jack.J. <jack.j.jepper@googlemail.com> wr=
ote:
> Thanks for replying. Responses embedded:
>
>
> On May 6, 8:24 am, Murray Eisenberg <mur...@math.umass.edu> wrote:
>> First, perhaps folks were reluctant to respond because this looked like
>> it could be a homework exercise.
>>
>> Second, you don't even have proper Mathematica syntax in your equation
>> relating x and k. Did you even try to read the documentation to learn
>> the very basics?
>
> I tried and tried for hours but couldn't so much as find any section
> that would even tell me how to write the condition that k be an
> integer.
>
>  For example, proper syntax for the equation would be:
>>
>>    (x/Log[x]) (1 + 1/Log[x]) == 108.2 + k
>>
>> Function arguments must be enclosed in brackets, not parentheses, and
>> the equality is a doubled "=" sign. Moreover, your original expression
>> had an unbalanced terminal parenthesis.
>>
>
> Thanks.
>
>> Third, the equation itself looks really nasty. Aside from the fact that
>> it mixes exact formulas with an approximate real (108.2), the left-hand
>> side is transcendental.
>>
>> Fourth, the equation does not seem to uniquely define x as a function of
>> k! For example, form the difference between the two sides...
>>
>>    f[x_] := (x/Log[x]) (1 + 1/Log[x]) - 108.2 - k
>>
>> ... and plot f for, say, k = 2:
>>
>>    Plot[Evaluate[f[x] /. k -> 2], {x, 0.5, 2}, Exclusions -> {x ==
=
> = 1},
>>   AxesOrigin -> {0, 0}, PlotRange -> {-5, 5}]
>>
>> The graph crosses the x-axis twice. And indeed, if you use FindRoot with
>> initial guesses above and below 1, you'll see that this is so:
>>
>>     FindRoot[Evaluate[f[x] /. k -> 2], {x, 0.9}]
>> {x -> 0.916554}
>>
>>     FindRoot[Evaluate[f[x] /. k -> 2], {x, 1.1}]
>> {x -> 1.11137}
>>
>
> Am sorry, I should have said "let r(k) be the highest x such that..."
>
> Can you give me the required inputs? That would help me immensely.
>

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web