04-11-2009 03:34 PM
Hi,
I am new to Labview. This is my first time using it so I am not sure of all the things just yet. I need some help with a problem that creates an array of Relatively Prime Numbers. The conditions are:
1. The error has to be 10%
2. The relatively prime numbers have to be between 8 bit and 20 bit
3. The array generates 4 numbers (m1, m2, m3, and m4) at a time that are relatively prime
4. No number can be repeated
If you can post a sample VI for this problem I would really appreciate it.
04-11-2009 04:29 PM
Is this homework?
General forum policy is not to provide solutions for someone to do their homework, but do assist in other ways in solving LabVIEW programming problems to assist you in learning and finding the solution on you home.
First question, exactly what does "relatively prime number" mean?
04-11-2009 04:42 PM
Relatively Prime Numbers: The number 15 is relatively prime to 16, but neither 15 nor 16 is prime. By definition, two numbers are relatively prime if and only if the greatest common divisor of both numbers is 1. The most common type of problem found on number sense tests involving relatively prime numbers is “How many positive numbers less than or equal to x are relatively prime to x ?”
I just need someone to get me started and may be give a sample code. I am really lost.
Thanks.
04-11-2009 04:49 PM
Here's a bit of a start. Just my initial thoughts and somebody will probably come up with something better.
Since you want to do them 4 at a time, and you want to go from 8 bits to 20 bits....
That would be 256 to about a million.
So, divide both of those by 4 and loop from 64 to 250K. Multiply the loop index by 4 for the first number, and add 1, 2, and 3 to get the other four numbers to test. Does this sound like what you want to do?
04-11-2009 04:58 PM
Yes, it does sound exactly like what I want to do except I have no clue how to interpret in Labview coding. I am only familiar with the most basic stuff in Labview. This seems very complex to me.
Thanks by the way.
04-13-2009 10:40 AM
You still haven't answered whether this is homework. ![]()
You also said "1. The error has to be 10%". The error of what?
04-13-2009 11:36 AM
It's not homework. It's a practice problem for my final exam.
And the statement about the error being 10%, disregard that for now. I just need some help with the whole generating an array of Relatively Prime Numbers. And it generates 4 numbers at a time...I have no clue how to go about doing that...