Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

more ranging variable problems

Status
Not open for further replies.

dismalactivist

Aerospace
Joined
Nov 12, 2006
Messages
4
Location
US
i'm currently using mathcad to calculate probabilities. the formula i'm using used 3 differing variables(p,N,n). in part 1 p and N are constant and n ranges from 0-5. now i know how to make n a ranging variable, my problem is when trying to solve the equation it has a problem with me asking for n! with the message 'this must be a vector or scalar' any help guys?
 
You are probably trying to use a range variable as a vector. It is not a vector. To make a vector variable V from a range variable n,

Vn:=n
 
still got a problem: i labeled a vector variable(Vn=n) and wrote n=0;5 - no help. then tried n=(0,1,2,3,4,5) and still problems..now it says n needs to be an integer...any suggestions?
 
Nice of you to share the answer with the group.
 
if you're being sarcastic..and i think you are, here is what i was trying to do and what i did to get what i wanted:

Simple probability function with changing variable:
k=5
n:=1..5
vn:=n (that's V sub n)
vn= (will print a table of all values) again v sub n
p:=5
P(n,k,p):=[k!/(vn!(k-n)!)][p^n][1-p]^(k-n)
P(n,k,p):= (will print probabilities)

what i ended up doing was I hadn't labeled P as a function of variables P(n,k,p). when i had it as just P=...., it wouldn't do anything - seemed to clear up my 'n isnt an integer problem'

did that help?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top