Random vector generating - help

  • Thread starter Thread starter bgy
  • Start date Start date
  • Tags Tags
    Random Vector
Click For Summary
SUMMARY

The discussion focuses on generating a random vector |Q> in the form |Q> = a*(1,0) + b*(0,1), where |a|^2 + |b|^2 = 1. The participants suggest using the Monte Carlo simulation method to achieve this, specifically by generating a random number R in the interval [0.0, 1.0]. The values for a and b are derived using trigonometric functions, with a = sin(2πR) and b = cos(2πR). C++ source code for this implementation is requested for practical application.

PREREQUISITES
  • Understanding of linear algebra and vector representation
  • Familiarity with Monte Carlo simulation techniques
  • Knowledge of trigonometric functions and their applications
  • Proficiency in C++ programming language
NEXT STEPS
  • Research Monte Carlo simulation methods in C++
  • Learn about random number generation techniques in C++
  • Explore linear algebra concepts related to vector superposition
  • Study the application of trigonometric functions in random vector generation
USEFUL FOR

Mathematicians, physicists, computer scientists, and developers interested in random vector generation and Monte Carlo simulations.

bgy
Messages
7
Reaction score
0
hi,

I have to generate a random vector |Q>, which has the following form:

|Q>=a*(1,0)+b*(0,1), where |a*a|+|b*b|=1 and (...,...) is a 2 dimensional column vector.

This is a linear superposition of two vectors simply and the values of the vectors change between [0,1] randomly.

I think, I schould use Monte Carlo simulation method...

Please, if you have a source code (in C++), send me... this is very important!
 
Technology news on Phys.org
Monte Carlo ?!

Well, I would first generate a random number , let's say R in [0.0 , 1.0] interval.
Then I would evaluate X = 2Pi * R , and
a = sin X
b = cos X
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 9 ·
Replies
9
Views
3K
Replies
3
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K