473,320 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

write program in c++or c

sri my questuon is that
write a program in corc++
to check wether a relation is equlance or not using two dimensional array
Nov 3 '08 #1
7 3580
JosAH
11,448 Expert 8TB
sri my questuon is that
write a program in corc++
to check wether a relation is equlance or not using two dimensional array
What is 'equlance'? Please proofread your question before you dump your
ill formed text in this forum.

Jos (moderator)
Nov 3 '08 #2
newb16
687 512MB
What is 'equlance'? Please proofread your question before you dump your
ill formed text in this forum.
It is "equivalence" but it doesn't help much - relation between what and what is must know.
Nov 3 '08 #3
JosAH
11,448 Expert 8TB
It is "equivalence" but it doesn't help much - relation between what and what is must know.
Ah, ok, that is easy then: for a binary relation R(x, y) check whether or not for
any a and b:

1) R(a, a)
2) if R(a,b) then R(b,a)
3) if R(a,b) and R(b,c) then R(a,c)

The OP should be able to loop over his/her matrix and check the above criteria.

kind regards,

Jos
Nov 3 '08 #4
sir ur answer explained the logic of the programme,
but yet i do not understand how check the equalence within the programming language
plz give some hints or if possible write the programme
Nov 6 '08 #5
the term equalence is from discrete mathematics
its defined as that a set is said to b equlence if it is transitive,reflexive and symmetric at the same time
Nov 6 '08 #6
JosAH
11,448 Expert 8TB
the term equalence is from discrete mathematics
its defined as that a set is said to b equlence if it is transitive,reflexive and symmetric at the same time
The term is 'equivalence'.

kind regards,

Jos
Nov 6 '08 #7
JosAH
11,448 Expert 8TB
Write a boolean function R:

Expand|Select|Wrap|Line Numbers
  1. bool R(T a, T b) { ... }
  2.  
... such that it returns true if the relation R(a, b) holds, false otherwise. Check
your entire matrix using this boolean function, e.g.

1) all elements on the diagonal R(a,a) should be true
2) for all other elements R(a,b) == R(b,a)
3) left as an exercise to the reader.

kind regards,

Jos
Nov 6 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

33
by: Nick Evans | last post by:
Hello there, I have been on and off learning to code (with python being the second language I have worked on after a bit of BASIC). What I really want to know is, if you are going to actually...
8
by: Zheng Da | last post by:
I don't know where should I ask the question, so send the email to this group. I choose this group, because I want to write the program with c++ :) I want to write a program which support...
24
by: gswork | last post by:
Let's write a c program, without knowing what it does... Some of you may recall Jim Roger's excellent series of posts (on comp.programming) exploring the implementation of common software...
24
by: Charles Ulrich | last post by:
Greetings, I hope my greenness isn't showing too bad by asking this, but I ran across this trivial program today that left me flabbergasted: #define MESSAGE "This account is currently not...
18
by: jacob navia | last post by:
In C, we have read-only memory (const), read/write memory (normal data), and write only memory. Let's look at the third one in more detail. Write only memory is a piece of RAM that can only...
4
by: Break2 | last post by:
I am trying to write a simple program which asks a user to enter 5 integers after which the average will be computed and written to the screen. That simple. However I want to do it according to a...
6
by: aagarwal8 | last post by:
Hi, I am trying to write the contents of a textbox to a file in binary format. My code looks like this... private void btnWriteToFile_Click(object sender, EventArgs e) { FileStream fs =...
1
by: Sachin Garg | last post by:
I have a program which opens a fstream in binary input+output mode, creating the file if it doesn't exists. But writing doesn't works after reading, it must be something obvious that I am not aware...
5
by: Jon Skeet [C# MVP] | last post by:
On Sep 9, 9:41 am, raylopez99 <raylope...@yahoo.comwrote: It's tricky in .NET for two reasons: 1) LINQ doesn't have any concept of "remove" 2) List<T>.RemoveAll doesn't pass in the index...
11
by: 960392954 | last post by:
The Towers of Hanoi is a famous problem about moving a certain number of disks from one peg to another.I write a recursive program for it.If you have known it ,you can skip the program. #include...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.