How to define a function involving strings?

  • Thread starter Thread starter DevNeil
  • Start date Start date
  • Tags Tags
    Function Strings
Click For Summary

Homework Help Overview

The discussion revolves around defining a function from a set of strings of length 4 over the alphabet {a,b} to a set of strings of length 3 over the same alphabet. The participants are exploring the properties of this function, specifically whether it is one-to-one (injective) or onto (surjective).

Discussion Character

  • Conceptual clarification, Assumption checking, Problem interpretation

Approaches and Questions Raised

  • Participants discuss the nature of the function f and its mapping from set X to set Y, questioning the definitions of injective and surjective functions. There are attempts to clarify the meaning of the alpha variable and whether listing all elements of the sets is necessary. Some participants provide examples to illustrate their points.

Discussion Status

There is an ongoing exploration of the function's properties, with some participants suggesting that the function is not one-to-one due to counterexamples. Others are seeking clarification on how to formally define the function and whether the provided definition is acceptable. The discussion is active, with multiple interpretations being considered.

Contextual Notes

Participants express confusion regarding the formal definition of the function and its properties, indicating a need for further clarification on mathematical definitions and examples.

DevNeil
Messages
4
Reaction score
0

Homework Statement



We have a problem set on my Discrete Mathematics class:

Let X be the set of strings over {a,b} of length 4 and let Y be the set of the strings over {a,b} of length 3. Define function f from X to Y by the rule:

f(alpha) = string consisting of the first three characters of alpha.

Is f one-to-one? is f onto?

The Attempt at a Solution


I don't know where to start but what I understand on the problem is that X is a set with {aaaa,bbbb,aaab...etc} and Y has {aaa,bbb,aab...etc}. Do I need to list all the elements of the sets? I was also confused by the alpha variable. Hoping for your answers. Thanks.
 
Last edited:
Physics news on Phys.org
Alpha is any element in the set X, so any string of length 4. Your function f takes an element of X and maps it into an element of Y. For example, f(bbaa) = bba.

What does it mean for f to be one-to-one or onto?
 
clamtrox said:
Alpha is any element in the set X, so any string of length 4. Your function f takes an element of X and maps it into an element of Y. For example, f(bbaa) = bba.

What does it mean for f to be one-to-one or onto?

You need to state if it's injective(1to1) or surjective(onto) or bijective(injective && surjective). I can say that this is not one-to-one (injective) because as counterexample f(aabb) = aab , f(aaba)= aab, same result but different alpha.

Can you also tell me how to define the function formally?
 
DevNeil said:
You need to state if it's injective(1to1) or surjective(onto) or bijective(injective && surjective). I can say that this is not one-to-one (injective) because as counterexample f(aabb) = aab , f(aaba)= aab, same result but different alpha.

And then you only need to figure out if it's onto. That should be straightforward too.

DevNeil said:
Can you also tell me how to define the function formally?
The definition you were given looks pretty formal to me. Is there something wrong with it?
 
clamtrox said:
And then you only need to figure out if it's onto. That should be straightforward too.


The definition you were given looks pretty formal to me. Is there something wrong with it?

Ohh... I am thinking of a function that was mathematically defined. So another question, is this an acceptable definition of a function? I am having a hard time defining it. Thanks for your time :)
 
DevNeil said:
Ohh... I am thinking of a function that was mathematically defined. So another question, is this an acceptable definition of a function? I am having a hard time defining it. Thanks for your time :)

A function f:X->Y is just a rule that gives you a unique element of Y for each element of X. In this case, the rule is simple: drop the last digit.
 
You could just list all 16 ordered pairs (x,f(x)) in X×Y.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 21 ·
Replies
21
Views
4K
  • · Replies 23 ·
Replies
23
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 14 ·
Replies
14
Views
4K
Replies
4
Views
4K
  • · Replies 14 ·
Replies
14
Views
3K