MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

AW: Re: Dirichlet function plot

  • To: mathgroup at
  • Subject: [mg23607] AW: [mg23573] Re: [mg23552] Dirichlet function plot
  • From: Wolf Hartmut <hwolf at>
  • Date: Wed, 24 May 2000 02:16:07 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

See below

	-----Ursprüngliche Nachricht-----
	Von:	David Ong [SMTP:do226 at]
	Gesendet am:	Samstag, 20. Mai 2000 23:45
	An:	mathgroup at
	Betreff:	[mg23573] Re: [mg23552] Dirichlet function plot

	Sorry, I misstated the function.
	f(x)=1/q when x is an element of p/q in lowest terms and f(x)=0
	otherwise. This is a strange looking function because it is
continous at
	every irrational and discontinuous at every rational.

	On Sat, 20 May 2000, Andrzej Kozlowski wrote:

	> The problem with your question is that the concept of an
"irrational number"
	> does not really make sense in relation to a present day computer.
	> Mathematica not any other computer program can distinguish between
	> and irrationals and no sensible concept of an "irrational" number
can be
	> implemented. Of course you could invent a new  Mathematica
	> IrrationalQ, an tell Mathematica it should return True for some
well known
	> irrationals, e.g. Pi, E, Sqrt[2], this would not get you very far.
It is
	> well known that there can be no algorithm which would decide
whether any
	> given (constructible) real number is rational or not.  One can
	> generate arbitrary long sequences consisting entirely of
irrationals, e.g.,
	> anything of the form p^(1/n) where p is a prime and n a  positive
	> or  any real number of the form (1-x^n)^(1/n), where x is any
rational s.t.
	> 0<x<1, and n a positive integer>2, but no  computer can check
	> However, in spite of all the above,  it is very easy to  plot your
	> You simply take the union of the graph of 1/x  and the real axis
(you must
	> exclude 0 since your function has no value there). This is as good
	> approximation as one can ever hope for!
	> -- 
	> Andrzej Kozlowski
	> Toyama International University
	> on 5/20/00 4:10 PM, David Ong at do226 at wrote:
	> > Hi, 
	> > 
	> > Would anyone know of an easy way to plot some approximation of
	> > variant of the Dirichlet function?
	> > f(x)=1/x if x is an element of the rationals and 0 if x is not
an element
	> > of the rationals.
	> > 
	> > 
	> > 
As Andrzej already has pointed out, this is nothing to be "seen".  Yet there
still may be some aspect to be visualized; so it might be interesting to
"look at" this part of the Dirichlet function:

	tt[n_] := Table[{x, 1/Denominator[Rationalize[x]]}, {x, 0, 1, 1/n}];

	t = Join @@ tt /@ Prime /@ Range[100] // Union;

	ListPlot[t, PlotJoined -> True, PlotRange -> {{0, 1}, {0, 1}}]

It makes up quite a pleasant graph.

Kind regards,   Hartmut

  • Prev by Date: Re: ISING model
  • Next by Date: Re: ContourPlots,DensityPlots
  • Previous by thread: Re: ISING model
  • Next by thread: Re: AW: Re: Dirichlet function plot