Question

Give an example of a function f: Σ* x N -> Z , where Σ =...

Give an example of a function f: Σ* x N -> Z , where Σ = {a,b} and where N represents the non-negative integers and Z represents the integers.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

There are multiple such function. Consider the input of the form string w \in \Sigma^* and non negative integer N, and f outputs |w|-N i.e. the difference of size of input string w with non negative integer N. Clearly the output will be integer.

Ex:- f(abba,2) = 4-2 =2 and f(ababab,10)=6-10= -4

Please comment for any clarification

Add a comment
Know the answer?
Add Answer to:
Give an example of a function f: Σ* x N -> Z , where Σ =...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT