Author Topic: Random Number question  (Read 8295 times)

0 Members and 7 Guests are viewing this topic.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Random Number question
« Reply #15 on: March 17, 2011, 04:19:49 am »
Well, actually N provides the upper bound for the random number because everything is (mod N) ;)
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Random Number question
« Reply #16 on: March 17, 2011, 04:23:18 am »
Yeah, sorry :D Actually, I just realised I typed up the wrong equation...

What I meant to say is that I multiply rand by floor(rand/N2) and then take mod N of that result.

I don't know why I said N2 provided an upper bound ...

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Random Number question
« Reply #17 on: March 17, 2011, 04:27:15 am »
I think you should change it to be n^2. That way your users can scratch their heads trying to figure out how to get Rand mod 2 with integers...
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ