How can I create a more elegant array diagram in LabVIEW? [closed] - block

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I want the LEDs to light up in the following order:
station A - w - w2 - station B - w2 - w3 - w4 - station C -w4 - w5 - station D - w5 - w4 - w3 - station E - w3 - w2 - w - station A
and this is repeated.
I started giving a false value to the leds that can't be lit in that case but I didn't continue after the fourth. Does anyone have any idea how this could be solved more elegantly?

What you really want is a Simple State Machine.
These are a recommended early design pattern from NI and allow you to do the kind of sequential operation you are after while allowing for more dynamic responsiveness to inputs.
This allows you to do a bunch of different things like:
Not need all those off/on local variables
Have a single timer running for consistent operation time
The ability to interrupt the sequence at any step
Significantly simplified extension of the process.
Something like this:

Related

nCr mod 10^9 + 7 for n<=10^9 and r <=1000 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 4 years ago.
Improve this question
This may have been asked before but none of the answers I saw worked for me. I tried Lucas Theorem,Fermat's theorem but none of them worked. Is there an efficient way to find the value of:
nCr mod 10^9+7 where n<=10^9 and r<=1000
Any help will be very useful
n is large while r is small, you are better off compute nCr by n(n-1)...(n-r+1)/(1*2*...*r)
You may need to find multiplicate inverse of 1, 2, ... r mod 10^9+7

Calculus with Constants [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
An electric current, I, in amps, is given by
I=cos(wt)+√(8)sin(wt),
where w≠0 is a constant. What are the maximum and minimum values of I?
I have tried finding the derivative, but after that, I do not know how to solve for 0 because of the constant w.
Well David,you can convert this function into one trigonometric function by multiplying and dividing it by
√(1^2 + 8) i.e, 3. So your function becomes like this
I = 3*(1/3 cos(wt) + √8/3 sin(wt))
= 3* sin(wt + atan(1/√8))
Now, you can easily say its maximum value is
I = 3 amp
and minimum value is
I = 0 amp.

Confused to get that 2^(n^2 )=Θ(2^(n^3 ))? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
Can anyone help me to understand that Is 2^(n^2 )=Θ(2^(n^3 )) ? it will be great if also provide the proof for this. As per my view this does not need to be equal.
The given assumption is not true:
First of all, 2^(n^2) is a function and Theta(2^(n^3)) is a set of functions, so it would be correct to say that 2^(n^2) ∈ Theta(2^(n^3)). The = is just a common abuse of notation, but it actually means ∈. To find out whether that statement is true, solve the following limit:
lim (n->infinity) of (2^(n^2)) / (2^(n^3))
If the result is 0 or infinite then the function does not belong to that particular Theta class. If it is some other value, it does belong to that class.

automata theorem: existance of a DFA [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 8 years ago.
Improve this question
I need to prove that for every k, there's a DFA M with k+2 states, so in every automat M' who accepts the language reverse(L(M)) there are at least 2^k states.
Help would be really appreciated.
Thanks :)
Assuming that the alphabet set contains at least two elements, let it be {0,1}.
Next, let M be the automata accepting the language L defined as:
All the strings which k-th position is 1
defined as:
M = {Q,{0,1},q0,{qk+1},δ}, where
Q={q0,q1,...,qk,qF}
δ(qi,a) = qi+1, for a in {0,1} and i=0,1,...,k-2
δ(qk-1,0) = qF,
δ(qk-1,1) = qk,
δ(qF,a) = qF, for a in {0,1}
Note that M has exactly k+2 states, and that it accepts the language L.
Now, note that the language reverse(L(M)) can be translated as:
All the strings which k-th position from the end is 1
To recognize that language, note that we need to remember the last k symbols, because we don't know when the string will end. We know that there are at least 2k possible strings of length k (since the alphabet size is at least 2).
So using a DFA, we need at least 2k states, each to represent one possible string of length k. ▢
Author's note:
The idea of this proof is to find a language which is "easy" to be recognized in normal way, but "difficult" when is read backward. Through experience, I remember that fixing the k-th position from the beginning is "easy", while k-th position from the end is "difficult", hence my answer.

How to calculate current velocity using Euler integration [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I want to know if I convert formula correctly. I'm not sure of that.
I know:
force = mass * acceleration
acceleration = (Velocity - previousVelocity) / deltaTime
acceleration = force / mass
So:
(Velocity - previousVelocity) / deltaTime = Force / Mass
If I know the force to apply , the mass , deltaTime and previousVelocity, to convert it in the new velocity for a euler integration? This formula is correct ?:
Velocity = (Force / mass * deltaTime) + previousVelocity
I feel like something is wrong or missing, I need the real formula.
thanks a lot!
What you've written is Forward Euler on dv/dt = f(t) (with m=1) ... i.e. v(n+1) = v(n) + f(n) * dt.