cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community email notifications are disrupted. While we are working to resolve, please check on your favorite boards regularly to keep up with your conversations and new topics.

Need help with the implication and equivalence functions

engr_mkhalid
4-Participant

Need help with the implication and equivalence functions

Hi everyone,


I am trying to solve a problem. I don't know about the implication and equivalence functions. I tried using chatgpt but got a weird answer which I completely did not understand. I copied the answer to Mathcad Prime which is attached below.
Please help me out I will be thankful to you.

 

Thank you

Regards

Khalid

1 ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:engr_mkhalid)

There's just one thing missing: State which version of Prime you are using. Otherwise you run a higher risk getting an answer in a newer version of Prime, and you cannot open the file.

Anyway, you're using Prime 8.

 

Now to your problem.

You have defined P, Q and R to be arrays of 1 row and 24 columns. No problem with that.

But in your AND function you multiply the arguments. If you multiply two arrays, vector and matrix rules apply. For two vectors (arrays with n rows and 1 column) this happens:

LucMeekes_0-1716572711438.png

You don't get a vector as result, but a scalar.

For two arrays like you have, you get:

LucMeekes_1-1716572795233.png

an error message, stating that the array dimensions do not match.

What Prime might have expected is this:

LucMeekes_2-1716572904407.png

or this:

LucMeekes_3-1716572914356.png

Now how do you get the array elements to be operated on (multiplied, in your AND case) element by element? That is done by using the vectorise operator. You place an arrow over the expression to have it vectorised, Like this:

LucMeekes_4-1716573027188.png

You find the vectorise operator at the bottom right of the operators panel of Prime.

Go ahead and play with it, and come back if you have more questions.

Success!
Luc

View solution in original post

4 REPLIES 4

It is usually better to rely on your own intelligence than on artificial intelligence.

And why do you think Prime is a suitable tool for this task? I guess that you are not forced to use Prime, aren't you?
Why don't you try working on this homework yourself instead of trying to get a solution via AI or forum questions?

 

If you try something yourself (not just copying AI garbage), set up a worksheet and get stuck, feel free to come back here, post your sheet (not just pics) and ask a specific question.

If you really want to implement and define Boolean functions in Prime, you could start with

NOT(x):=1-x

AND(x,y):=x*y

OR(x,y):=1-(1-x)*(1-y)

or you use

OR(x,y):=NOT(AND(NOT(x),NOT(y)))

...

engr_mkhalid
4-Participant
(To:Werner_E)

Thanks for the quick reply. I missed the class related to this homework but I am trying to learn online. However, following your advice, I am developing a sheet and am now stuck at a point. I have attached the prime file. Thanks again for your help.

LucMeekes
23-Emerald III
(To:engr_mkhalid)

There's just one thing missing: State which version of Prime you are using. Otherwise you run a higher risk getting an answer in a newer version of Prime, and you cannot open the file.

Anyway, you're using Prime 8.

 

Now to your problem.

You have defined P, Q and R to be arrays of 1 row and 24 columns. No problem with that.

But in your AND function you multiply the arguments. If you multiply two arrays, vector and matrix rules apply. For two vectors (arrays with n rows and 1 column) this happens:

LucMeekes_0-1716572711438.png

You don't get a vector as result, but a scalar.

For two arrays like you have, you get:

LucMeekes_1-1716572795233.png

an error message, stating that the array dimensions do not match.

What Prime might have expected is this:

LucMeekes_2-1716572904407.png

or this:

LucMeekes_3-1716572914356.png

Now how do you get the array elements to be operated on (multiplied, in your AND case) element by element? That is done by using the vectorise operator. You place an arrow over the expression to have it vectorised, Like this:

LucMeekes_4-1716573027188.png

You find the vectorise operator at the bottom right of the operators panel of Prime.

Go ahead and play with it, and come back if you have more questions.

Success!
Luc

Thanks mate!

Top Tags