473,385 Members | 1,342 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,385 software developers and data experts.

Using C++ for discrete math

Create a computer program to classify Functions.
The input to this program is two relations R1 and R2, both from a set
A to a set B. Each of these relations should be input into the program
as a set of ordered pairs (a, b) where a ∈ A ⊆ Z, the integers, and b
∈ B ⊆ Z. The sets A and B must be specified. Although not all the
possible values of the domain of the functions need to be considered,
it is expected that the number of domain values considered in the
inputs is sufficient to characterize the function or relation in
question.
The program must list the ordered pairs input for each relation,
indicating the relation to which each of them belong.

Can anyone help with this?

Feb 11 '07 #1
2 2946
zf*****@umd.umich.edu wrote:
Create a computer program to classify Functions.
The input to this program is two relations R1 and R2, both from a set
A to a set B. Each of these relations should be input into the program
as a set of ordered pairs (a, b) where a ? A ? Z, the integers, and b
? B ? Z. The sets A and B must be specified. Although not all the
possible values of the domain of the functions need to be considered,
it is expected that the number of domain values considered in the
inputs is sufficient to characterize the function or relation in
question.
The program must list the ordered pairs input for each relation,
indicating the relation to which each of them belong.

Can anyone help with this?
a) For homework help, the most important rule here is: you have to show your
efforts first.

b) The above problem does not really make any sense. The input-output
behavior of the program is not clearly specified. As far as I can tell,
just copying the input straight to the output would be an acceptable
solution, although I doubt that this is indented. Also, it is not clear
what the statement "Although not all the possible values of the domain of
the functions need to be considered,it is expected that the number of
domain values considered in the inputs is sufficient to characterize the
function or relation in question" is supposed mean: a relation is
characterized by all and only by all of the pairs that form it. The same
holds for a function.

c) Unless you have a specific C++ question, your post is off-topic here. See
the FAQ for what goes here and where to post questions that do not belong
here.

d) As for general advice about how to represent functions and relations in
C++, read up on std::map<and std::multimap<>.
Best

Kai-Uwe Bux
Feb 11 '07 #2
<zf*****@umd.umich.eduwrote in message
news:11**********************@a34g2000cwb.googlegr oups.com
Create a computer program to classify Functions.
The input to this program is two relations R1 and R2, both from a set
A to a set B. Each of these relations should be input into the program
as a set of ordered pairs (a, b) where a ? A ? Z, the integers, and b
? B ? Z. The sets A and B must be specified. Although not all the
possible values of the domain of the functions need to be considered,
it is expected that the number of domain values considered in the
inputs is sufficient to characterize the function or relation in
question.
The program must list the ordered pairs input for each relation,
indicating the relation to which each of them belong.
As Kai-Uwe says, the question as posed doesn't make a lot of sense.

I'm guessing that you have been given a list of functions and you have to
test the data against them. Thus you test if b = f(a) for each possible
(a,b). As soon as you get an inequality, you know that that particular f
doesn't work, so you move on to the next one.

--
John Carson
Feb 11 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sim Nanda | last post by:
Hello All, I'm looking for a data class that can take a floating point input and round it to the nearest float based on a predefined set of boundaries. In other words, an arbitrary float comes in...
11
by: srinivas | last post by:
Hi all, I have one requirement.Is there any way to create a line graph using javascript.If it is please send me the sample code.But the thing is it should work in all browsers. Thanks,...
2
by: Mike | last post by:
I'm more unsure of myself these days: Given a result set of rows with discrete date intevals; but rows may be non contiguous in nature; Can a simple, non cursor driven query produce a result with...
2
by: Francois Vanderseypen | last post by:
Imagine a discrete 2D space of any size. Say, you have a 100x100 pixels (.net) panel and you have discrete cells of 10x10 pixels. Thinking e.g. of the game of life. I would like to draw a line in...
0
by: Alison Givens | last post by:
I have the following problem. (VB.NET 2003 with CR) I have a report with a multiple-value discrete value and a rangevalue. The report shows fine in the viewer, but when I hit the export to pdf...
1
by: khaleel.alyasini | last post by:
anyone could point me out where did i do wrong? it seems that i can't get back the original Lena image after the IDCT(inverse discrete cosine transform) process. the output raw image is nothing...
21
by: James Black | last post by:
I am curious if there is a benefit to set attributes directly, in my javascript, or to use setAttribute. For example, I have this: var input = document.createElementNS(xhtmlNS, 'input');...
1
by: dan_williams | last post by:
Is it possible to pass multiple discrete values to a report document so that I can export it to PDF? I've managed to perform the following code to display a Crystal Report Viewer ok, but i want...
3
by: knightsmastergeneral | last post by:
Hi, I'm currently working on getting junit and junireport to take some java files, convert it to xml and then display error messages / success rates etc in html which is one of the features of...
2
by: zfareed | last post by:
Can anyone suggest some resources (websites/books) to learn coding discrete math problems? I have a problem involving sets,relations and functions and even though the logic is clear I dont know...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.