LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

An Array of Relatively Prime Numbers

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.

0 Kudos
Message 1 of 7
(4,181 Views)

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?

Message 2 of 7
(4,170 Views)

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.

0 Kudos
Message 3 of 7
(4,163 Views)

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?

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 4 of 7
(4,158 Views)

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.

0 Kudos
Message 5 of 7
(4,153 Views)

You still haven't answered whether this is homework. Smiley Wink

 

You also said "1. The error has to be 10%". The error of what?

0 Kudos
Message 6 of 7
(4,087 Views)

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...

 

 

0 Kudos
Message 7 of 7
(4,074 Views)