Author 
Message 
Ali Taghavi science forum addict
Joined: 14 May 2005
Posts: 73

Posted: Tue Oct 25, 2005 9:00 pm Post subject:
Re: IS quantum mechanics a limit cycle theory??



Thank you for your example:
Let's try my question about the following example in R^4:
H=(y(x^3x))zxw
consider the corresponding hamiltonian vector field X_H in R^4 with
respect to standard symplectic structure of R^4 (how many periodic
solutions do exist)?? Now try to construct a Hermitian operator with
H(as usual methods), my question is that what is the operator theoretic
interpretation for the number of closed orbits of X_H...
Quote:  the domain of hamiltonian is even dimensional space!
But can Morse
theory help to my question, namely is dynamic fix if
we do not pass a
critical value (However I prefer to not change the
main subject of my
question, a possible relation between limit cycle
theory and
quantization)
Consider a particle moving in 3 dimensions in the
potential
V(x,y,z) = (1  x^2  y^2)^2 z + z^3 + x^2 + y^2
Note that dV/dz > 0 except on the circle x^2 + y^2
=
1, z = 0, so
the only possible closed orbits are on that circle.
On that circle
there are closed orbits in both directions.
Robert Israel
israel@math.ubc.ca
Department of Mathematics
http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver,
BC, Canada



Back to top 


Ali Taghavi science forum addict
Joined: 14 May 2005
Posts: 73

Posted: Wed Oct 26, 2005 2:30 pm Post subject:
Re: IS quantum mechanics a limit cycle theory??



May you more Explain on "Physical relevance"? Further in this example
the hamiltonian vector field in R^6 has an invariant torus with
infinite number of closed orbits. I search for an example of an
analytic Hamiltonian in R^2n with a finit number of closed orbits....
Is there is any example of such Hamiltonian, with k number of closed
orbits, what is the quantum interpretation for this "k",after an
appropriate quantization of H! Let's try this question for the
following this question for the following hamiltonian:
H=(y(x^3x))zzw (in R^4)
Quote:  israel@math.ubc.ca wrote:
Consider a particle moving in 3 dimensions in the
potential
V(x,y,z) = (1  x^2  y^2)^2 z + z^3 + x^2 + y^2
Note that dV/dz > 0 except on the circle x^2 + y^2
= 1, z = 0, so
the only possible closed orbits are on that circle.
On that circle
there are closed orbits in both directions.
IMHO this cannot have any physical relevance, because
these orbits are
highly _unstable_. Am I wrong?
Han de Bruijn
.



Back to top 


Robert B. Israel science forum Guru
Joined: 24 Mar 2005
Posts: 2151

Posted: Thu Oct 27, 2005 2:30 pm Post subject:
Re: IS quantum mechanics a limit cycle theory??



Ali Taghavi wrote:
Quote:  the domain of hamiltonian is even dimensional space!
Consider a particle moving in 3 dimensions in the
potential
V(x,y,z) = (1  x^2  y^2)^2 z + z^3 + x^2 + y^2
Note that dV/dz > 0 except on the circle x^2 + y^2 =
1, z = 0, so
the only possible closed orbits are on that circle.
On that circle
there are closed orbits in both directions.

I think you may have misunderstood my example. The Hamiltonian system
is 6dimensional (3 components for velocity and 3 for position),
representing a particle moving in the potential V. The complete
Hamiltonian is u^2/2 + v^2/2 + w^2/2 + V(x,y,z) where u, v, w are
conjugate to x, y, z respectively.
Robert Israel israel@math.ubc.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada 

Back to top 


Ali Taghavi science forum addict
Joined: 14 May 2005
Posts: 73

Posted: Fri Oct 28, 2005 1:30 pm Post subject:
Re: IS quantum mechanics a limit cycle theory??



The Hamiltonian vector field corresponding to your H has infinite number
of closed orbits! But my question searched for a hamiltonian with a
finite but non zero number of nontrivial periodic solutions(of
course, it is impossible in 2 dim.) For example how many closed orbits
exist for the following Hamiltonian in R^4 H=(y(x^3x))zxw
Note that the projection in 2 first component is the standarrd vander pol equation.
Finaly : a question about your hamiltonian: as you said there is only
one periodic orbit in (3 dimensional) position space. What is the
Quantum interpretation for this unique orbit (and for this
uniquness)??I mean look at the variable as Hermitian operator....
Quote:  The complete
Hamiltonian is u^2/2 + v^2/2 + w^2/2 + V(x,y,z) where
u, v, w are
conjugate to x, y, z respectively.
Robert Israel
israel@math.ubc.ca
Department of Mathematics
http://www.math.ubc.ca/~israel
University of British Columbia Vancouver,
BC, Canada



Back to top 


Ali Taghavi science forum addict
Joined: 14 May 2005
Posts: 73

Posted: Mon Oct 31, 2005 4:00 pm Post subject:
Re: IS quantum mechanics a limit cycle theory??



The projection of all closed orbits of Hamiltonian is mentioned by
Robert Israel, is a single circle in 3 dimensional position space.
But the total number of closed orbits in 6 dimension is infinite. Thus
this is not the answer of my Question:"I search for a Hamiltonian
vector Field with a finite (but nonzeros) number of closed orbits) As
an example: What is the number of closed orbits of the following
system (hamiltonian vector field) in R^4: H=(y(x^3x))zxw. The
Hamiltonian vector field is a vector field in R^4 which projection in
2 Dimensional space is the standard vander Pol equation Thank you
Ali Taghavi
Quote: 
Consider a particle moving in 3 dimensions in the
potential
V(x,y,z) = (1  x^2  y^2)^2 z + z^3 + x^2 + y^2
Note that dV/dz > 0 except on the circle x^2 + y^2
=
1, z = 0, so
the only possible closed orbits are on that circle.
On that circle
there are closed orbits in both directions.
Robert Israel
israel@math.ubc.ca
Department of Mathematics
http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver,
BC, Canada



Back to top 


Ali Taghavi science forum addict
Joined: 14 May 2005
Posts: 73

Posted: Wed Nov 02, 2005 3:34 pm Post subject:
Re: IS quantum mechanics a limit cycle theory??



"Due to the main subject of this topic I present the following new question(related to the title of this Topic)":
Assume X is a non vanishing Vector field on a manifold M,it generates an operator(say X) on functional space
C^inf(M),with the standard formule f>X.f
(the derivative of f along the trajectories of X)
Does there exist a linear operator S on C^inf (M) such that XSSX=1 (1=identity)
Thank you Ali Taghavi
alitghv_at_yahoo.com 

Back to top 


Robert Clark science forum Guru Wannabe
Joined: 30 Apr 2005
Posts: 129

Posted: Tue Nov 15, 2005 7:22 pm Post subject:
Re: Math question about trajectory for beamed propulsion.



I'm concerned with means to minimize the distance from
the launch point to a beamed propulsion craft to so
that the beamed energy reaching the craft is not
diminished too greatly.
Here's the scenario. The craft has to reach a certain
speed in order
to reach orbital velocity. It's on the order of 7800
m/s. I'll just call it
10,000 m/s for simplicity. You also would like the
acceleration not to be too
large The reason is that for beamed propulsion, for a
given amount of beamed energy
transmitted, a fixed thrust is going to be provided.
Quote:  From Newton's equation F=ma, so
if you make the acceleration large, the mass, or 
payload will be reduced. So
let's say the acceleration is kept below 40 m/s^2, or
about 4 g's.
But then it takes time to build up the large velocity
required. And
traveling at the limited acceleration allowed would
force a long distance to
be used to build up the necessary speed. Indeed for
the space shuttle
for example the distance from the launch pad is on the
order of 2000 km for
powered thrust. This large distance is what I'm trying
to avoid. A few hundred km is
what I'm looking for.
So here's the suggestion. What's really needed for
the beamed
propulsion is keeping the *straightline* distance to
the craft low. Then what you
could do would have the craft travel in say a helical
path. Then it could be
traveling a long distance, the length of the helical
path, while the
straightline distance from start to finish might be
low.
Yet this introduces more problems. For when the craft
is turning in
that helical path, it is undergoing acceleration. And
if the turning radius
is small, the acceleration could be high, and your low
acceleration
condition might be contradicted anyway.
So as a math problem, what I'm looking for is a
trajectory in 3dim'l space s(t) such that the
magnitude of the acceleration is low, s"(t) <= 40
m/s^2, the final speed s'(t) is 10,000m/s, but the
curve is contained in a sphere of minimal diameter.
This is a calculus of variations problem, like the
brachistochrone problem, though of a different kind
since it is not an integral that has to be minimized.
Note that without the condition that the acceleration
is limited we could make the straightline distance
arbitrarily small by making the curve make many twists
and turns while enclosed in a small box.
With the acceleration condition, I'm inclined to
believe you can't do any better than a straightline
but I don't see how to prove that.
 Bob Clark
[ Moderator's note:
Clearly he also wants the initial condition s'(0) = 0.
 ri ] 

Back to top 


John Baez science forum Guru Wannabe
Joined: 01 May 2005
Posts: 220

Posted: Fri Nov 18, 2005 12:45 pm Post subject:
Re: Presheaf as functor



In article <djj3uo$1ss$1@news.ks.uiuc.edu>,
joe.shmoe.joe.shmoe <joe.shmoe.joe.shmoe@gmail.com> wrote:
Quote:  One could add slightly modify the definition of a presheaf, starting
with a fixed "base" functor R: Opens(X) > B, and a "projection"
functor P:C > B, and then saying a presheaf into C ("relative to R
and P") is a functor F:Opens(X)> C such that P o F=R. However, this
does make things a lot more cumbersome, and I have not seen this sort
of thing done anywhere.
Any thoughts on this?

What you're suggesting here is okay  and it's just another way
of doing what Roig was suggesting.
Roig suggests that we consider the category of "rings with modules",
whose objects are a ring and a module of that ring. Call it RingMod.
There's an obvious forgetful functor
U: RingMod > Ring
that throws out the module and keeps the ring.
A "presheaf of rings with modules" is a contravariant functor
F: Opens(X) > RingMod
and composing with U we get a presheaf of rings
U o F: Opens(X) > Ring
You're just talking about the reverse process! You're starting
with a presheaf of rings
P: Opens(X) > Ring
and then you're looking for some presheaf of rings with modules
F: Opens(X) > RingMod
that gives P when we forget the module:
P = U o F
That's fine too. There's kind of a choice here as to whether you
want to take the presheaf of rings as "fixed", or part of what you
want to vary. The same issue shows up when we consider "bundles over
a fixed manifold" versus "bundles over manifolds". 

Back to top 


Vallenstream science forum beginner
Joined: 17 Nov 2005
Posts: 2

Posted: Tue Nov 22, 2005 10:30 am Post subject:
Re: Conjecture Related to Goldbach's Conjecture



Thanks, Gerry. I see there is an interesting graph of numbers for Levy's Conjecturedoesn't actually look much like Goldbach's Comet.
Levy's Conjecture isn't exactly the same as the one I described, since he apparently doesn't require that the "twice a prime" number be twice an odd prime. I also guess that his conjecture allows the "twice a prime" to be twice the prime that is added to it, to get the odd integer. I don't use that, because it is, of course, simply a multiple of three, which just repeats the odd number rather than being a total with new primes.
My idea was to formulate a conjecture that used only the odd primes as factors of the "twice a prime" term, since the same primes would then be available for that conjecture as for Goldbach'sof course, it's impossible to use integer two as one of the primes in Goldbach's strong conjecture, but many odd integers are four more than a prime.
Looks like quite a bit of research has been done on Levy's Conjecture, so maybe there is, in the research, some analytical method that I can use.
Another interesting "sums of primes" investigation, is the problem of using only primes that are twin primeswhich have some unusual propertiesas pairs of primes that equal even integers. The two primes, of course, don't have to be the two successive twin primes of the pairs they belong to.
I guess the proposition would be, that, at some magnitude, most even numbers above that magnitude are not the sums of two primes that are both twin primes. It's rather interesting that, among small even integers, only three even numbers between 90 and 100 are not the sum of two twin primes. Since twin primes thin out faster at large magnitudes than primes in general do, I have to think that, above a certain number, very few integers are the sum of two twin primes. Would be interesting to see how the diminishing of sums works out. 

Back to top 


baez@galaxy.ucr.edu science forum addict
Joined: 21 Oct 2005
Posts: 53

Posted: Sun Feb 12, 2006 9:59 pm Post subject:
Re: This Week's Finds in Mathematical Physics (Week 226)



Here are some corrections and clarifications, mostly thanks to a
friend who usually prefers to remain anonymous:
In article <dsirq1$pjg$1@glue.ucr.edu>,
John Baez <baez@math.removethis.ucr.andthis.edu> wrote:
Quote:  MD5 is a popular hash function invented by Ron Rivest in 1991.

This is what it says in Wikipedia:
http://en.wikipedia.org/wiki/MD5
with a big picture of Rivest right on top of the article,
but my friend says
"I think it's usually credited to a small set of coinventors,
and I think Ralph Merkle is a coinventor either of MD5 or one
of its immediate ancestors."
I'd like more information on this.
Quote:  People use it for checking the integrity of files: first you compute the
digest of a file, and then, when you send the file to someone, you also send
the digest. If they're worried that the file has been corrupted or
tampered with, they compute its digest and compare it to what you sent them.

Of course, if deliberate tampering is what you fear, you have
to send the digest by a different channel than the original file,
or use some other trick.
Quote:  But if you prove that P *does* equal NP, you might make more money by
breaking cryptographic hash codes and setting yourself up as the Napoleon
of crime.

Or, you could make lots of money by solving problems that nobody
else can solve. This could be a more sustainable lifestyle... but
I wanted to work in a reference to that Sherlock Holmes quote, to
play off against the von Neumann quote.
Quote:  We can define a "random sequence" to be one that no algorithm can guess
with a success rate better than chance would dictate.

Here "generate" would be clearer than "guess", since I was
trying to allude to the usual notion of randomness from
algorithmic information theory (in an informal sort of way).
I don't know if there are sequences that no algorithm can generate
with a success rate beating chance, but where an algorithm can do
well guessing the (n+1)st digit after having seen the first n.
Does anyone know?
Quote:  Chaitin has given a marvelous definition of a
particular random sequence of bits called Omega using the fact that no
algorithm can decide which Turing machines halt... but this random
sequence is uncomputable, so you can't really "exhibit" it:

On the other hand, Wolfgang Brand points out this paper:
http://www.cs.auckland.ac.nz/~cristian/Calude361_370.pdf
where the first 64 bits of Omega have been computed.
(There's no contradiction, as the paper explains.)
Quote:  Then Aaronson gets to the heart of the subject: a history of the P vs. NP
question. This leads up to the amazing 1993 paper of Razborov and Rudich,
which I'll now summarize.

Here's the paper:
Alexander A. Razborov and Steven Rudich, Natural proofs, in
Journal of Computer and System Sciences, Vol. 55, No 1, 1997, pages 2435.
Available at http://www2.cs.cmu.edu/~rudich/papers/natural.ps and
http://genesis.mi.ras.ru/~razborov/int.ps
Aaronson says it was written in 1993 even though the date of publication
and the date on the paper itself (1996 or 1999, depending on which copy
you look at) are later. I believe him; you have to be careful when using
the /today command in LaTeX, since if you LaTeX the same paper 6 years
later, you'll get a new date.
Quote:  The P versus NP question can be formulated as a question about the size
of Boolean circuits  but Razborov and Rudich show that, under certain
assumptions, there is no "natural" proof that P is not equal to NP.
What are these assumptions? They concern the existence of good
pseudorandom number generators. However, the existence of these
pseudorandom number generators would follow from P = NP! So, if
P = NP is true, it has no natural proof.

Aargh!
In both cases here when I wrote P = NP, I meant P *not* equal to NP. 

Back to top 


baez@galaxy.ucr.edu science forum addict
Joined: 21 Oct 2005
Posts: 53

Posted: Mon Feb 13, 2006 8:08 pm Post subject:
Re: This Week's Finds in Mathematical Physics (Week 226)



In article <Pine.LNX.4.61.0602102025360.19201@zeno1.math.washington.edu>,
<tessel@um.bot> wrote:
Quote:  On Sat, 11 Feb 2006, John Baez mentioned that md5sum was "broken" about a
year ago. I just wanted to add:
1. If I am not mistaken, sha1 and md5sum are different algorithms (IIRC,
both are known to be insecure).

Yeah. Here's a nice review of the situation:
Arjen K. Lenstra, Further progress in hashing cryptanalysis,
February 26, 2005, http://cm.belllabs.com/who/akl/hash.pdf
Quote:  These are huge and wonderful philosophicophysicomathematical questions
with serious practical implications.
You mean the Weyl curvature hypothesis? :/

Heh, no  I mean stuff like whether there's such a thing as a provably
good cryptographic hash code function, or cipher.
Quote:  Joel Spencer, The Strange Logic of Random Graphs, Springer 2001
Here's a thought: "Everyone knows" that if on day D, mathematician M is
studying an example of size S in class C, he is more likely to be studying
a "secretly special" representative R than a generic representative G of
size S. Why? Because the secretly special reps show up in disguise in
other areas, and M was probably hacking through the jungle from one of
those places when he got lost and ate a poisoned cache.

Interesting.
Here's some more stuff, from my email correspondence.
I wrote:
Quote:  Allan Erskine wrote:
I enjoyed week 226! Algorithmic complexity was the area I studied
in... Your readers might find "The Tale of Oneway Functions" by
Leonid Levin an enjoyable read:
http://arxiv.org/abs/cs.CR/0012023
Hey, that's great! I'm printing it out now... Levin and I have
argued against Greg Kuperberg and others on sci.physics.research:
we tend to think that quantum computers are infeasible *in principle*.
As for your "shortest proof of this statement has n lines" question,
you may have noticed that Chaitin asks a very similar question about
the shortest proofs that a LISP program is "elegant" (most short) and
proves a strong incompleteness result with an actual 410 + n
character LISP program! Crazy...
http://www.cs.auckland.ac.nz/CDMTCS/chaitin/lisp.html
Yes. You might like the following related article below.
Best,
jb

It's an old one...
From: b...@math.ucr.edu (john baez)
Subject: Re: compression, complexity, and the universe
Date: 1997/11/20
MessageID: <652c5t$62g$1@agate.berkeley.edu>#1/1
XDejaAN: 291100089
References: <64nsqo$8rg$1@agate.berkeley.edu> <346fd86d.1059260@news.demon.co.uk> <64t2ar$qcs@charity.ucr.edu>
Originator: bunn@pac2
Organization: University of California, Riverside
Newsgroups: sci.physics.research,comp.compression.research
In article <651lm1$q3...@agate.berkeley.edu>,
Aaron Bergman <aaron.berg...@yale.edu> wrote:
Quote:  The smallest number not expressable in under ten words

Hah! This, by the way, is the key to that puzzle I laid out:
prove that there's a constant K such that no bitstring can be
proved to have algorithmic entropy greater than K.
Let me take this as an excuse to say a bit more about this.
I won't give away the answer to the puzzle; anyone who gets
stuck can find the answer in Peter Gacs' nice survey, "Lecture
notes on descriptional complexity and randomness", available at
http://www.cs.bu.edu/faculty/gacs/
In my more rhapsodic moments, I like to think of K as the
"complexity barrier". The world *seems* to be full of incredibly
complicated structures  but the constant K sets a limit on our
ability to *prove* this. Given any string of bits, we can't rule
out the possibility that there's some clever way of printing it
out using a computer program less than K bits long. The Encyclopedia
Brittanica, the human genome, the detailed atombyatom recipe for
constructing a blue whale, or for that matter the entire solar system
 we are unable to prove that a computer program less than K bits
long couldn't print these out. So we can't firmly rule out the
reductionistic dream that the whole universe evolved mechanistically
starting from a small "seed", a bitstring less than K bits long.
(Maybe it did!)
So this raises the question, how big is K?
It depends on ones axioms for mathematics.
Recall that the algorithmic entropy of a bitstring is defined
as the length of the shortest program that prints it out. For
any finite consistent firstorder axiom system A exending the
usual axioms of arithmetic, let K(A) be the constant such that
no bitstring can be proved, using A, to have algorithmic entropy
greater than K(A). We can't compute K(A) exactly, but there's a
simple upper bound for it. As Gacs explains, for some constant c
we have:
K(A) < L(A) + 2 log_2 L(A) + c
where L(A) denotes the length of the axiom system A, encoded as
bits as efficiently as possible. I believe the constant c is
computable, though of course it depends on details like what
universal Turing machine you're using as your computer.
What I want to know is, how big in practice is this upper
bound on K(A)? I think it's not very big! The main problem
is to work out a bound on c. 

Back to top 


tchow@lsa.umich.edu science forum addict
Joined: 15 Sep 2005
Posts: 53

Posted: Tue Feb 14, 2006 1:18 am Post subject:
Re: This Week's Finds in Mathematical Physics (Week 226)



In article <dsn2cd$som$1@glue.ucr.edu>, John Baez <baez@galaxy.ucr.edu> wrote:
Quote:  Alexander A. Razborov and Steven Rudich, Natural proofs, in
Journal of Computer and System Sciences, Vol. 55, No 1, 1997, pages 2435.
Available at http://www2.cs.cmu.edu/~rudich/papers/natural.ps and
http://genesis.mi.ras.ru/~razborov/int.ps
Aaronson says it was written in 1993 even though the date of publication
and the date on the paper itself (1996 or 1999, depending on which copy
you look at) are later. I believe him; you have to be careful when using
the /today command in LaTeX, since if you LaTeX the same paper 6 years
later, you'll get a new date.

It probably has less to do with the "today" command than with the fact
that papers in computer science tend to exist in more versions than in,
say, math. The two "official" versions of the RazborovRudich paper are
STOC 1994 (conference version) and JCCS 1997 (journal version). However,
I wouldn't be surprised if it circulated in preprint form in 1993, and if
the authors continued to revise the paper after the "final" journal version,
since this isn't uncommon practice.

Tim Chow tchowatalumdotmitdotedu
The range of our projectileseven ... the artilleryhowever great, will
never exceed four of those miles of which as many thousand separate us from
the center of the earth. Galileo, Dialogues Concerning Two New Sciences 

Back to top 


DariushA science forum beginner
Joined: 15 Mar 2006
Posts: 5

Posted: Sat Mar 18, 2006 11:15 am Post subject:
Re: Subset Vector Sum



Thank you All, so very much, for your comments and hints.
I think the algorithms Victor directed me to will keep me
happily busy for a while.
I will report any possible progress.
Much Regards,
Dariush.
"Victor S. Miller" <victor@algebraic.org> wrote in message
news:dveofd$2s6$1@dizzy.math.ohiostate.edu...
Quote: 
"Gerhard" == Woeginger Gerhard <gwoegi@figipc70.tugraz.ac.at
writes:
Gerhard> This is a 2dimensional variant of SUBSETSUM (Given n
Gerhard> integers a_1,...,a_n and a goalvalue b, does there exists a
Gerhard> subset of the a_i that adds up to b?).
Gerhard> SUBSETSUM is NPhard. The special case of SUBSETSUM with
Gerhard> b=0 is also NPhard.
Gerhard> So you should not expect a fast solution algorithm for your
Gerhard> 2dimensional generalization.
On the contrary  just because the general problem is NP complete
doesn't mean that your specific instance might not be solved quickly.
This is a special case of the integer relation algorithm. For
example, look at the following page for a good overview. The
FergusonForcade, or PSLQ algorithm might be a good one to use. You
can also set this up for lattice reduction and use the LLL algorithm.
Victor
http://mathworld.wolfram.com/IntegerRelation.html 


Back to top 


Matt Heath science forum beginner
Joined: 04 Apr 2006
Posts: 3

Posted: Tue Apr 04, 2006 4:57 pm Post subject:
Re: Results for: 'From Commutative Algebra to Functional Analysis'



For semisimple algebras there is a theorem of Johnson that a Banach algebra norm is unique  and hence that being a semisimple Banach algebra is an algebraic property. 

Back to top 


Giovanni Resta science forum beginner
Joined: 11 Apr 2006
Posts: 1

Posted: Tue Apr 11, 2006 4:30 pm Post subject:
Re: A conditional random number generation problem (please help me!)



rjmachado3 wrote:
Quote:  I need to know the formula for the random function that return random
numbers in a range of a and b integers [a,b] but that obey on a custom
probability (possibly different!) for each integer number on this [a,b]
range (of course the sum of all integer number probabilities are = 1!).
Finally, what i want is the general function formula that simulate the
random behavior (based on a custom probability value for each integer
number between the [a,b] range. confuse? i hope not! please help me!!!!
what i know so far is that the function formula for generating a "pure"
random number between [a,b] range is:
rand()*(ba)+a
where rand() return a random number between 0 and 1.

I'm not completely sure to have correctly understood you
question. Anyway...
Here is a very naive apprach that can work, at least
if the interval is small. Maybe if the interval is large
one can think about something more efficient.
I make an example with 4 values, each with a custom prob.,
that can be easily generalized.
Let the integer values be a,b,c,d (they do not need to be consecutive
numbers) and let p_a, p_b, p_c, p_d the probability to
extract respectively a,b,c, and d.
Clearly p_a+p_b+p_c+p_d = 1.
First you build these constants:
P_a = p_a
P_b = p_a+p_b
P_c = p_a+p_b+p_c
then you extract a random number U between 0 and 1, and
if U <= P_a you select a,
else if U <= P_b you select b
else if U <= P_c you select c
else you select d.
I hope this example helps you
giovanni 

Back to top 


Google


Back to top 



The time now is Tue Apr 23, 2019 8:51 am  All times are GMT

