Is there a formula for converting binary numbers to an ordered pair output?

In summary: A function is a set of ordered pairs (x, y), where each x is a unique input, and each y is a unique output.
  • #1
Davega Putra
5
0

Homework Statement


One of the problem in my homework is a question that ask is ASCII table (https://en.wikipedia.org/wiki/ASCII) a function and require me to answer mathematically which i don't know how.

Homework Equations

The Attempt at a Solution


I think ASCII table is not a function because if we get the decimal numbers to be the domain, it won't be a function since it's not assigned exactly one output since a particular decimal number have equivalents in hex and char. I want to do a vertical line test but i don't know how to graph it
 
Physics news on Phys.org
  • #2
Davega Putra said:

Homework Statement


One of the problem in my homework is a question that ask is ASCII table (https://en.wikipedia.org/wiki/ASCII) a function and require me to answer mathematically which i don't know how.

Homework Equations

The Attempt at a Solution


I think ASCII table is not a function because if we get the decimal numbers to be the domain, it won't be a function since it's not assigned exactly one output since a particular decimal number have equivalents in hex and char. I want to do a vertical line test but i don't know how to graph it
Decimal and hexadecimal representations of a particular integer have nothing to do with whether something is a function. Each form is a different representation of the same number. There's nothing in the definition of a function which says that f(x) = x2 must use only decimal notation for the input and output.

Code:
 --------- x ---------   -------- f(x) ---------
 (decimal)     (hex)     (decimal)      (hex)
     0            0          0            0
     1            1          1            1
     2            2          4            4
     4            4         16           10
    10            A        100           64
 
  • #3
So what is the definition of a function?
For any single input, there is a unique output. That output might be multiple columns.
Domain of x might be decimal, and the range of x might be the entire row where x is found.
input (x) --> output [ bin(x), hex(x), x, oct(x), glyph(x)]
or, it could simply be input decimal and output glyph.
The question is, for any x, could there be two outputs? which is different from one output with two (or more) entries.
 
  • #4
SteamKing said:
Decimal and hexadecimal representations of a particular integer have nothing to do with whether something is a function. Each form is a different representation of the same number. There's nothing in the definition of a function which says that f(x) = x2 must use only decimal notation for the input and output.

Code:
--------- x ---------   -------- f(x) ---------
(decimal)     (hex)     (decimal)      (hex)
     0            0          0            0
     1            1          1            1
     2            2          4            4
     4            4         16           10
    10            A        100           64
RUber said:
So what is the definition of a function?
For any single input, there is a unique output. That output might be multiple columns.
Domain of x might be decimal, and the range of x might be the entire row where x is found.
input (x) --> output [ bin(x), hex(x), x, oct(x), glyph(x)]
or, it could simply be input decimal and output glyph.
The question is, for any x, could there be two outputs? which is different from one output with two (or more) entries.
Thanks for the reply! sorry for the late response, so ASCII table can be a function with the output consisting of multiple column, now i have to define the function by interval notation. I need help though, as i only able to define function that are very simple.
 
  • #5
This is a pretty simple function. Give it a value in one format, it returns the same value in a different format.
What is "interval notation"? Is that defining the domain and range?
First you have to decide what your function does. Is it a function that takes a decimal value and translates it to just one column? Is the column to translate into an additional input variable? Does the function return an entire row?

The table on its own cannot be called a function since there is no sense of what you are putting in or getting out.
 
  • #6
RUber said:
This is a pretty simple function. Give it a value in one format, it returns the same value in a different format.
What is "interval notation"? Is that defining the domain and range?
First you have to decide what your function does. Is it a function that takes a decimal value and translates it to just one column? Is the column to translate into an additional input variable? Does the function return an entire row?

The table on its own cannot be called a function since there is no sense of what you are putting in or getting out.
RUber said:
This is a pretty simple function. Give it a value in one format, it returns the same value in a different format.
What is "interval notation"? Is that defining the domain and range?
First you have to decide what your function does. Is it a function that takes a decimal value and translates it to just one column? Is the column to translate into an additional input variable? Does the function return an entire row?

The table on its own cannot be called a function since there is no sense of what you are putting in or getting out.

No i was mistaken, what i meant is defining the function like this
Let D = {1, 2, 3}
Let C = {X | X ∈ ℕ+}
F ∶ D → C= f(x)= 4- x

Define the function formally or mathematically my lecturer said.

Does it make sense if i create a group of functions where each returns 1 output for every input? (i build a group of function with an input of decimal, each returning hexa,char and so on) or would it make more sense to make a single function where the output returns and entire row?
 
  • #7
Davega Putra said:
No i was mistaken, what i meant is defining the function like this
Let D = {1, 2, 3}
Let C = {X | X ∈ ℕ+}
F ∶ D → C= f(x)= 4- x

Define the function formally or mathematically my lecturer said.

Does it make sense if i create a group of functions where each returns 1 output for every input? (i build a group of function with an input of decimal, each returning hexa,char and so on) or would it make more sense to make a single function where the output returns and entire row?
The hexadecimal equivalent for the input is furnished purely as a courtesy to the computer types, so they can easily decode the input value in terms of binary digits (1's and 0's)

In the ASCII table shown in the Wiki article, they don't even bother with hex, but the table is based on the ASCII code written using 7 bits (a bit is a binary digit).

In other words, forget about the hex.
 
  • #8
Davega Putra said:

Homework Statement


One of the problem in my homework is a question that ask is ASCII table (https://en.wikipedia.org/wiki/ASCII) a function and require me to answer mathematically which i don't know how.

Homework Equations



The Attempt at a Solution


I think ASCII table is not a function because if we get the decimal numbers to be the domain, it won't be a function since it's not assigned exactly one output since a particular decimal number have equivalents in hex and char. I want to do a vertical line test but i don't know how to graph it
Please state the entire question as it was given to you.

As RUber pointed out, it's absolutely important that it's clear as to what is the output of this relation which you are working with.

What is the domain and what is the co-domain?
 
  • #9
SammyS said:
Please state the entire question as it was given to you.

As RUber pointed out, it's absolutely important that it's clear as to what is the output of this relation which you are working with.

What is the domain and what is the co-domain?
81910.jpg
 
  • #10
Perhaps your rule of correspondence is supposed to take you from some number (whether it's in decimal or hex or binary or octal or whatever base) to an ordered pair consisting of a row number and a column number .
 
  • #11
SammyS said:
Perhaps your rule of correspondence is supposed to take you from some number (whether it's in decimal or hex or binary or octal or whatever base) to an ordered pair consisting of a row number and a column number .
Can you give an example, i don't quite get it
 
  • #12
Davega Putra said:
Can you give an example, i don't quite get it
For instance:The function (if it is a function) maps the number (0101001)2 to the 10th row and 3rd column of the table of characters which contains the character " ) " ,the right parenthesis .
 
  • #13
I would infer that the input is the binary, however you might know how to define that set from (0000000) to (1111111), and the output would be the set of 128 unique values in the table. As SammyS said, it might be easier to define a functional relationship it you define the table value by the (row, column) they are in.
 
  • #14
Have you made any progress on this problem?

you might define spaces like ##\mathbb{Z}^{0,127}_{B7}:## the 7 digit binary set of integers from 0 to 127,
##\mathbb{Z}^{0,15}:## the set of integers from 0 to 15, and ##\mathbb{Z}^{0,7}:## the set of integers from 0 to 7.
Then your notation might look something like ##f:\mathbb{Z}^{0,127}_{B7}\to \mathbb{Z}^{0,15}\times \mathbb{Z}^{0,7}##
However, it seems like the question is asking you to write out the mathematical function to go from a binary input to an ordered pair output. Can you define that function?

You might find it convenient to be able to refer to your individual digits, ##( b_6, b_5, b_4, b_3, b_2, b_1, b_0) ##.
 

1. What is an ASCII table?

An ASCII table is a character encoding standard used for representing text in computers. It assigns a unique numerical value to each character, including letters, numbers, and symbols, allowing them to be stored and transmitted digitally.

2. How does an ASCII table work?

An ASCII table works by using a 7-bit binary code to represent each character. This means that there are 128 possible characters that can be represented in an ASCII table. The binary code is converted into decimal numbers, which are then mapped to their corresponding characters.

3. Is an ASCII table a function?

Yes, an ASCII table can be considered a function in computer science terms. It takes in a character or symbol and returns a unique numerical value. This function is used by computers to display and process text in various applications.

4. Are there different versions of ASCII tables?

Yes, there are different versions of ASCII tables, such as the original 7-bit ASCII table, the extended 8-bit ASCII table, and the Unicode table. These versions have different character sets and encoding schemes, but they all serve the same purpose of representing text in computers.

5. How is an ASCII table useful?

An ASCII table is useful for storing and transmitting text in a standardized format that can be read and processed by computers. It is also helpful for troubleshooting and debugging issues with text-based programs and applications.

Similar threads

Replies
4
Views
932
  • Engineering and Comp Sci Homework Help
Replies
2
Views
4K
  • Precalculus Mathematics Homework Help
Replies
4
Views
15K
  • Precalculus Mathematics Homework Help
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • Astronomy and Astrophysics
Replies
4
Views
143
  • Precalculus Mathematics Homework Help
Replies
4
Views
3K
  • Precalculus Mathematics Homework Help
Replies
6
Views
2K
  • Precalculus Mathematics Homework Help
Replies
3
Views
4K
Replies
4
Views
416
Back
Top