1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nezavi [6.7K]
3 years ago
7

Give an example of a function from N to N that is:______.

Computers and Technology
1 answer:
vichka [17]3 years ago
4 0

Answer:

Let f be a function

a) f(n) = n²

b) f(n) = n/2

c) f(n) = 0

Explanation:

a) f(n) = n²

This function is one-to-one function because the square of two different or distinct natural numbers cannot be equal.

Let a and b are two elements both belong to N i.e. a ∈ N and b ∈ N. Then:

                                f(a) = f(b) ⇒ a² = b² ⇒ a = b

The function f(n)= n² is not an onto function because not every natural number is a square of a natural number. This means that there is no other natural number that can be squared to result in that natural number.  For example 2 is a natural numbers but not a perfect square and also 24 is a natural number but not a perfect square.

b) f(n) = n/2

The above function example is an onto function because every natural number, lets say n is a natural number that belongs to N, is the image of 2n. For example:

                                f(2n) = [2n/2] = n

The above function is not one-to-one function because there are certain different natural numbers that have the same value or image. For example:

When the value of n=1, then    

                                   n/2 = [1/2] = [0.5] = 1

When the value of n=2 then

                                    n/2 = [2/2] = [1] = 1

c) f(n) = 0

The above function is neither one-to-one nor onto. In order to depict that a function is not one-to-one there should be two elements in N having same image and the above example is not one to one because every integer has the same image.  The above function example is also not an onto function because every positive integer is not an image of any natural number.

You might be interested in
Advantages of e commerce
Sloan [31]

Answer:

A Larger Market

Customer Insights Through Tracking And Analytics

Fast Response To Consumer Trends And Market Demand

Lower Cost

More Opportunities To "Sell"

Personalized Messaging

Hope this helps!

4 0
4 years ago
The smallest signed integer number, base 16, that can be store in a variable of type BYTE is__________.
sveta [45]

Answer:

The correct answer is ushort

8 0
4 years ago
A certain program takes 26.67 seconds to run on 3 processors and 16 s to run on 7 processors. Find the execution time on one pro
brilliants [131]

Answer:

The explanation for the question is listed in the section below on Explanation.

Explanation:

The time needed for a program to execute in 26.67 seconds on 3 processors. Time expected to run the program, therefore, should be as follows:

The time to run on one processor = \frac{26.67}{3} = 8.89 seconds.

The time needed for a program to execute in 26.67 seconds on 7 processors, should be:

Time = \frac{16}{7} = 2.2857 seconds.

Whenever the amount of processors increases the performance or speed should increase.

The time is taken in percentage = \frac{26.67}{16}×100% = 170 %

As the number of processors increases from 3 to 7, the time required according to each processor increases by 70%.

In one processor the execution time should be as follows:

26.67+(26.67×0.7) = 45.339

                              = 45 seconds

Therefore. the execution period for a single processor is about 45 seconds.

The work is performed in parallel, whereas the program is already being parallelized. The overall function ought to be shared between the processor. The time is shortened to around half. Hence the duration taken will be 8 seconds after parallelization.

Theoretical execution time would be Tp > T infinity.

Thus, T infinity<45

The theoretical processing interval on processor count P1/2 would therefore be less than 8 seconds. Because, the time required during parallelization was just that.

5 0
3 years ago
By 1955, half of all U.S. households ________ had access to the internet. had satellite radio in at least one car. owned at leas
storchak [24]

Answer:

Owned at least one television.

Explanation:

Part among most of the U.S. families with at least 1 TV had internet connection in the year 1955.

Average American invests between two and a part to nearly several times in a day enjoying tv, based on the study as well as the period of the year. This was never only critical that such a period should be expended on tv however that it remains not wasted on other things, including studying or hanging out or making friends.

8 0
4 years ago
Using a loop and indexed addressing, write code that rotates the members of a 32-bit integer array forward one position. The val
My name is Ann [436]
<h2>Answer:</h2><h2></h2>

//begin class definition

public class Rotator{

    //main method to execute the program

    public static void main(String []args){

       

       //create and initialize an array with hypothetical values

       int [] arr =  {10, 20, 30, 40};

       

       //create a new array that will hold the rotated values

       //it should have the same length as the original array

       int [] new_arr = new int[arr.length];

       

       

       //loop through the original array up until the

       //penultimate value which is given by 'arr.length - 1'

      for(int i = 0; i < arr.length - 1; i++ ){

           //at each cycle, put the element of the

           //original array into the new array

           //one index higher than its index in the

           //original array.

          new_arr[i + 1] = arr[i];

       }

       

       //Now put the last element of the original array

       //into the zeroth index of the new array

       new_arr[0] = arr[arr.length - 1];

       

       

       //print out the new array in a nice format

      System.out.print("[ ");

       for(int j = 0; j < new_arr.length;  j++){

           System.out.print(new_arr[j] + " ");

       }

       System.out.print("]");

       

    }

   

   

}

<h2>Sample Output:</h2>

[ 40 10 20 30 ]

<h2>Explanation:</h2>

The code above is written in Java. It contains comments explaining important parts of the code.  A sample output has also been provided.

7 0
3 years ago
Other questions:
  • Technlogies are having a negative impact on business true or false
    7·1 answer
  • Which statement describes borders and shading?
    11·2 answers
  • Choose the false statement below. The content that displays in the browser is contained in the head section. The content that di
    14·1 answer
  • The most efficient tables in a relational database in terms of storage space have no redundant data and very few null values bec
    13·1 answer
  • He flow of electric charges through a material describes an electric _______.
    10·1 answer
  • SXXSSSSSSSSSZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
    14·1 answer
  • Will has been asked to recommend a protocol for his company to use for a VPN connection to the cloud service provider that his c
    6·1 answer
  • Which of the following best describes the existence of undecidable problems? *
    6·1 answer
  • What is the default return type of a method in Java language?
    9·2 answers
  • Test unit 8 edhesive answers ​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!