Materials:

Recent questions tagged functions

2 2 votes
1 1 answer
264
264 views
#include <stdio.h int main() { double x = 9.0; double result; result = sqrt(x); printf("%f\n", result); return 0; } A) It prints 3.000000 B) It prints 0.000000 C) Behavio...
0 0 votes
1 1 answer
172
172 views
What is the output of the below code snippet?def move(list1, list2): for num in list1: list2.append(num) list1.remove(num) list1 = [1,2,3,4,5] list2 = [10] move(list1, li...
7 7 votes
2 2 answers
313
313 views
What is the output of the following code?#include <stdio.h struct Item { int code; int price; }; void update(struct Item *p) { p->price = p->price + 20; (*p).code = (*p)....
0 0 votes
1 1 answer
112
112 views
Consider the following Python code:def update(lst): lst = lst[0] + lst lst.append(lst[-1] + 1) return lst[:2] nums = [3, 5] result = update(nums) print(nums, result)Wha...
1 1 vote
1 1 answer
96
96 views
Consider the following Python code:def search(nums, target): for x in nums: print(x) if x == target: return x + 10 return -1 print(search([2, 4, 6, 8], 6))What is the out...
1 1 vote
1 1 answer
92
92 views
Consider the following Python code:def show(x): print(x + 1) return x * 2 value = show(3) print(value)What is the output of the code above?4 66 44 None3 6
0 0 votes
1 1 answer
100
100 views
Consider the following Python code:def compute(a, b): a = a + 2 b = b * 2 return a + b x = 3 y = 4 ans = compute(x, y) print(ans, x, y)What is the output of the code abov...
1 1 vote
1 1 answer
85
85 views
Consider the following Python code:def first(): print("A") def second(): print("B") first() print("C") print("Start") second() print("End")What is the output of the code ...
7 7 votes
1 1 answer
207
207 views
What is the output of the following code?#include <stdio.h void fun() { static int x = 3; int y = 2; x = x + y; y = y + x; printf("%d ", x); } int main() { fun(); fun(); ...
3 3 votes
2 2 answers
274
274 views
What is the output of the following code?#include <stdio.h int update(int x) { x = x + 3; return x * 2; } int main() { int a = 4, b; b = update(a); printf("%d %d", a, b);...
0 0 votes
1 1 answer
207
207 views
Let $f(x)=\left|x-\lfloor x\rfloor-\frac{1}{2}\right|$, where $\lfloor x\rfloor$ denotes the greatest integer less than or equal to $x$. The value of $\int_{0.2}^{2.75} f...
4 4 votes
1 1 answer
376
376 views
Let $A$ be the set of all finite binary strings, including the empty string $\epsilon$. Define $F:A\to A$ as follows: $F(w)$ is obtained by writing $0$ before the string ...
1 1 vote
1 1 answer
249
249 views
Let $A$ and $B$ be non-empty sets and let $f:A\to B$ be a function. For $S\subseteq A$, define $S^c=A-S$. For $Y\subseteq B$, define $Y^c=B-Y$. Which of the following sta...
2 2 votes
1 1 answer
234
234 views
Find the domain of the function $F(x)=\sqrt{\ln(x-1)}+\ln\left(\dfrac{\sqrt{x+1}-2}{x^2-5x+6}\right)$.$[2,\infty)$ $(2,\infty)$ $(2,3)\cup(3,\infty)$ $[2,3)\cup(3,\infty)...
1 1 vote
2 2 answers
219
219 views
Let $A=\{1,2,3,4,5,6\}$. Find the number of bijections $f:A\to A$ such that $f(1)\neq1$, $f(2)\neq2$, $f(3)\neq3$, and $f(4)=5$ if and only if $f(5)=4$.
4 4 votes
1 1 answer
220
220 views
Let $A$ be the set of all non-constant linear functions from $\mathbb R$ to $\mathbb R$. Define $T:A\to\mathbb R$ by $T(\phi)=$ the unique real number $x$ for which $\phi...
0 0 votes
1 1 answer
154
154 views
Let $A$ and $B$ be finite non-empty sets and let $f:A\to B$ be a function. Match $\textbf{List-I}$ with $\textbf{List-II}$.$$\begin{array}{lcl} \mathbf{List-I} && \mathbf...
1 1 vote
1 1 answer
147
147 views
Let $A,B,C$ be non-empty sets. Let $g:A\to B$ and $f:B\to C$ be functions. The composition $f\circ g$ always exists. For the reverse composition $g\circ f$ to exist as a ...
0 0 votes
1 1 answer
110
110 views
Let $A,B,C$ be finite non-empty sets and let $f:A\to B$ and $g:B\to C$ be functions. Suppose $g\circ f:A\to C$ is bijective. Which of the following statements must be tru...
1 1 vote
1 1 answer
133
133 views
Let $A$ and $B$ be finite non-empty sets such that $|A|=m$ and $|B|=n$, where $1\le m\le n$. Let $X$ be the set of all injective functions from $A$ to $B$. Let $Y=A\times...
0 0 votes
1 1 answer
102
102 views
Let all logarithms be natural logarithms unless a base is written. Consider the following functions:$f:(0,\infty)\to\mathbb R$ defined by $f(x)=2\log x$. $g:(0,\infty)\to...
0 0 votes
1 1 answer
90
90 views
Let $A=\{a_1,a_2,a_3,a_4,a_5\}$ and $B=\{b_1,b_2,b_3,b_4,b_5,b_6,b_7\}$. Find the number of injective functions $f:A\to B$ such that for every $i=1,2,3,4,5$, $f(a_i)\neq ...
1 1 vote
1 1 answer
89
89 views
Let $f:\mathbb Z^+\to B$ be defined by $f(n)=\frac{n^2+n}{2n^2+2n+1}$. Which of the following statements is correct?If $B=\mathbb Q$, then $f$ is bijective. If $B={q\in\m...
0 0 votes
1 1 answer
96
96 views
Let $f:A\to B$ be a bijective function and let $I_A:A\to A$ and $I_B:B\to B$ denote the identity functions. Let $g:B\to A$ be any function. Consider the following stateme...
0 0 votes
1 1 answer
80
80 views
Let $f:A\to B$ be defined by $f(x)=\frac{3x-5}{2x+1}$. Which of the following choices of $A$ and $B$ makes $f$ a bijection?$A=\mathbb R$ and $B=\mathbb R$ $A=\mathbb R-{-...
0 0 votes
1 1 answer
99
99 views
Let $f:A\to B$ and $g:B\to C$ be functions, where $A,B,C$ are non-empty sets. Define $h=g\circ f:A\to C$. Consider the following statements:$p:$ If $g\circ f$ is one-to-o...
1 1 vote
1 1 answer
198
198 views
Let $f:A\to B$ be a function. Suppose that for every set $X$ and for every pair of functions $g,h:B\to X$, we have $g\circ f=h\circ f\Rightarrow g=h$. Which of the follow...
1 1 vote
0 0 answers
97
97 views
Let $S$ and $R$ be finite sets with $|S|=m$ and $|R|=n$, where $m<n$ and $m\geq 3$. A function $f:S\to R$ is called exactly double-colliding if there is exactly one eleme...
1 1 vote
1 1 answer
104
104 views
Let $A=\{1,2,3,4,5,6\}$ and $B=\{x_1,x_2,x_3,\ldots,x_n\}$. The number of one-one functions $f:A\to B$ is $151200$. Find the value of $n$.
0 0 votes
1 1 answer
101
101 views
The total number of functions $f:{1,2,3,\ldots,12}\to{0,1}$ such that $f$ assigns $1$ to exactly two even integers less than $12$ and assigns $0$ to exactly three odd int...