# Put $7$ balls into $7$ cells. Probability that exactly $2$ cells containing $3$ balls?

1.46. Seven balls are distributed randomly into seven cells. What is the probability that the number of cells containing exactly $3$ balls is $2$?

I am getting different answer from this solution manual. My argument is the following:

In order for us to have an arrangement where there are exactly $2$ cells with $3$ balls, we can follow the following procedure. We first decide which $3$ balls we want to put them together among all $7$ balls, and then decide to which cell we want to put them in. This gives us $\binom{7}{3} \binom{7}{1}$. Now, among the left $4$ balls, we choose $3$ balls to put them together, and choose one cell among the remaining $6$ empty cells. This gives us $\binom{4}{3} \binom{6}{1}$. Finally, we are left with one ball, and we have $5$ choices regarding where to put it. Putting them together, we have

$$P(X_3 = 2) = \frac{\binom{7}{3} \binom{7}{1} \binom{4}{3} \binom{6}{1} 5}{7^7}$$

But the solution manual says the answer should be

$$\frac{\binom{7}{2}\binom{7}{3}\binom{4}{3}5}{7^7}$$

Who is wrong and why?

• I think, that the problem is, that you must divide by 2, because in your case you specify, that the first 3 goes to the one and the other 3 goes to the other cell. However, the order of cells doesn't matter. Therefore, divide by 2 and get it. Jan 21, 2018 at 14:36

The manual is right. The difference between your solution and the books solution is a factor of $2.$ That is ${7\choose1}{6\choose1} = 2{7\choose 2}$


# Height of a tetrahedron

How do I calculate: The height of a regular tetrahedron, side length 1.

Just to be completely clear, by height I mean if you placed the shape on a table, how high up would the highest point be from the table.

-
I'm curious. If you mind telling us, what was the purpose of the interview? What were the other mathematically relevant questions asked? –  user02138 Nov 20 '10 at 15:25
It's an old question for and Economics and Management interview at Oxford. –  Patrick Beardmore Nov 20 '10 at 16:43

The first thing you need to do is to note that the apex of a regular tetrahedron lies directly above the center of the bottom triangular face. Thus, find the length of the segment connecting the center of an equilateral triangle with unit length to a corner, and use the Pythagorean theorem with the length of an edge as the hypotenuse, and the length you previously derived as one leg. The height you need is the other leg of the implied right triangle.

Here's a view of the geometry:

and here's a view of the bottom face:

In the second diagram, the face is indicated by dashed lines, and the (isosceles) triangle formed by the center of the triangle and two of the corners is indicated by solid lines.

Knowing that the short sides of the isosceles triangle bisect the 60° angles of the equilateral triangle, we find that the angles of the isosceles triangle are 30°, 30° and 120°.

Using the law of cosines and the knowledge that the longest side of the isosceles triangle has unit length, we have the equation for the length $\ell$ of the short side (the length from the center of the bottom face to the nearest vertex):

$$1=2\ell^2-2\ell^2\cos 120^{\circ}$$

Solving for $\ell$, we find that the length from the center of the bottom face to the nearest vertex is $\frac{1}{\sqrt{3}}$, as indicated here.

From this, the Pythagorean theorem says that the height $h$ (the length from the center of the bottom face) satisfies

$$h^2+\left(\frac{1}{\sqrt{3}}\right)^2=1$$

Solving for $h$ in the above equation, we now find the height to be $\sqrt{\frac23}=\frac{\sqrt{6}}{3}$, as mentioned here.

-
It's not homework, it was an interview question I struggled with. I'd love to know the answer. –  Patrick Beardmore Nov 20 '10 at 14:57
Good to know. I'll edit with an explicit answer. –  Guess who it is. Nov 20 '10 at 15:00
Thank-you very much. P.S: how did you make your lovely 3d shape diagrams? –  Patrick Beardmore Nov 20 '10 at 16:43
@Patrick: I used Mathematica 5.2 (yes, it's an old copy :) ) for these diagrams. –  Guess who it is. Nov 20 '10 at 21:33

Consider the tetrahedron inscribed in the unit cube, with vertices at (0,0,0), (1,1,0), (0,1,1), (1,0,1). Its height is the distance from (0,0,0) to the centre of the opposite face, which is given by the equation $x+y+z = 2$. Thus its height is $\frac{2}{\sqrt 3}$, and since the edges of this tetrahedron have length $\sqrt 2$, the height of a regular tetrahedron with side $x$ is $x \sqrt{\frac{2}{3}}$.

-
Note that this way of doing this also gives that the distance from the centers of opposite sides of the tetrahedron is always ${1 \over \sqrt{2}}$ times the side length. –  Zarrax Nov 20 '10 at 15:26

You can also use trig based on the dihedral angle between two faces of the tetrahedron.

Writing $ABC$ for the base triangle, $O$ for the apex, $K$ for the center of $ABC$ (the foot of the perpendicular dropped from $O$), and $M$ for the midpoint of (for instance) side $BC$, we have a right triangle $OKM$ with right angle at $K$. So,

$$\text{height of tetrahedron} = |OK| = |OM|\sin{M}$$

$OM$ is the height of the (equilateral) face $OBC$, measuring $\frac{\sqrt{3}}{2}s$, where $s$ is the length of a side.

As for the measure of angle $M$ ... Note that this is the dihedral angle between faces $OBC$ and $ABC$; it is also the angle between (congruent) segments $OM$ and $AM$ in triangle $OMA$. We can use the Law of Cosines as follows:

$$\begin{eqnarray} |OA|^2 &=& |OM|^2 + |AM|^2 - 2 |OM||AM|\cos{M} \\ s^2 &=& \left(\frac{\sqrt{3}}{2}s\right)^2 + \left(\frac{\sqrt{3}}{2}s\right)^2 - 2 \left(\frac{\sqrt{3}}{2}s\right)\left(\frac{\sqrt{3}}{2}s\right) \cos{M} \\ s^2 &=& \frac{3}{4} s^2 + \frac{3}{4}s^2 - 2 \frac{3}{4} s^2 \cos{M} \\ 1 &=& \frac{3}{2} - \frac{3}{2} \cos{M} \\ \frac{-1}{2} &=& - \frac{3}{2} \cos{M} \\ \frac{1}{3} &=& \cos{M} \;\;\; (**)\\ \Rightarrow \sqrt{1-\left(\frac{1}{3}\right)^2} = \frac{\sqrt{8}}{3} =\frac{2\sqrt{2}}{3}&=& \sin{M} \end{eqnarray}$$

Therefore,

$$\text{height of tetrahedron} = |OK| = |OM|\sin{M} = \frac{\sqrt{3}}{2} s \cdot \frac{2\sqrt{2}}{3} = \frac{\sqrt{6}}{3}s$$

(**) This cosine is the reason I posted this approach. It's sometimes handy to know (as in this problem); even better, it's easy to remember, because it turns out that it fits a simple pattern (which might be more-likely to impress interviewers):

$$\begin{eqnarray} \cos\left({\text{angle between two sides of a regular triangle}}\right) &=& \frac{1}{2}\\ \cos\left({\text{angle between two faces of a regular tetrahedron}}\right) &=& \frac{1}{3}\\ \cos\left({\text{angle between two facets of a regular n-simplex}}\right) &=& \frac{1}{n} \end{eqnarray}$$

(Who would've suspected, upon first encountering it, that the "$2$" in "$\cos{60^{\circ}}=\frac{1}{2}$" was actually a reference to the dimension of the triangle?)

-
Thank-you v. much! What's a simplex? –  Patrick Beardmore Nov 20 '10 at 17:14
A simplex is the analog of "triangle" in any dimension: the simplest possible shape. It's what you get when you join $(n+1)$ points in $n$-dimensional space. A triangle is a "$2$-simplex" ($3$ points in $2$ dimensions); a tetrahedron is a "$3$-simplex" ($4$ points in $3$ dimensions); going upward in dimensions, one generally just says "$4$-", "$5$-", ..., "$n$-simplex"; going downward, one can say the line segment is a "1-simplex" (determined by $2$ points) and the point is a "0-simplex" ($1$ point!). See en.wikipedia.org/wiki/Simplex and mathworld.wolfram.com/Simplex.html –  Blue Nov 20 '10 at 17:30
Very nice! I never knew about this pattern until now, thanks! :D –  Guess who it is. Nov 20 '10 at 21:37
btw, $\cos\left({\text{angle between two faces of a regular tetrahedron}}\right) = -\frac{1}{3}$ –  Narasimham Mar 16 at 0:07
@Narasimham: The angle between two faces of a regular tetrahedron is acute, so its cosine must be positive. –  Blue Mar 16 at 0:45

I'd like to offer a slightly simpler approach to part of the 1st answer above. We know that the equilateral triangle of the base of the tetrahedron has sides of 1, 1, and 1, and we know we can split that in half, creating two right triangles having sides of hypotenuse=1, base=1/2, and perpendicular=√3/2, along with angles of 30, 60, and 90 degrees.

Now consider the 2nd diagram of the 1st answer, which shows a solid-line triangle having angles of 30, 30, and 120 degrees. That triangle could be divided in half, creating two right triangles having angles of 30, 60, and 90 degrees. If we consider the base of each triangle to be its shortest side, then the perpendicular of either one of those triangles has a length of 1/2. We can now use the power of ratios to compute the other two sides:

(1/2):(√3/2):(1) --triangle 1: half of tetrahedral face, angles of 30, 60 & 90 degrees.

( ):( 1/2):( ) --triangle 2: has unknown base & hypotenuse, but is proportionate to triangle 1.

We really only need to compute the hypotenuse of triangle 2, because that is the desired distance from the corner to the center of the tetrahedron's base:

Multiply triangle-1-hypotenuse by triangle-2-perpendicular; divide by triangle-1-perpendicular.

[(1/2)(1)]/(√3/2) = (1/2)(2/√3) = 1/√3, as the 1st answer also computes in a more complicated way.

For the sake of completeness, since in any 30-60-90-degree triangle the base is simply half the length of the hypotenuse, the second unknown is 1/(2√3) or √3/6 (although it could also have been figured by using ratios, as above). The reader is invited to verify that the square of (√3/6) plus the square of 1/2 equals the square of (1/√3).

-

The normal height ($H_{n}$) of any regular tetrahedron having edge length $a$ is equal to the sum of radii of its inscribed & circumscribed spheres which is given as follows $$H_{n}=\frac{a}{2\sqrt{6}}+\frac{a}{2}\sqrt{\frac{3}{2}}=\frac{4a}{2\sqrt{6}}=a\sqrt{\frac{2}{3}}$$ Hence, the normal height ($H_{n}$) of regular tetrahedron with edge length $a$ is generalized by the formula $$\bbox[4pt, border: 1px solid blue;] {H_{n}=a\sqrt{\frac{2}{3}}}$$ As per given value of edge length $a=1$ in the question, the normal height of tetrahedron is $\sqrt{\frac{2}{3}}$

Note: for derivation & detailed explanation, kindly go through HCR's Formula for Regular n-Polyhedrons

-


# Can endpoints be local minimum?

My textbook defines local maximum as follows:

A function $$f$$ has local maximum value at point $$c$$ within its domain $$D$$ if $$f(x)\leq f(c)$$ for all $$x$$ in its domain lying in some open interval containing $$c$$.

The question asks to find any local maximum or minimum values in the function

$$g(x)=x^2-4x+4$$ in the domain $$1\leq x<+\infty$$.

The answer at the back has the point $$(1,1)$$, which is the endpoint.

According to the definition given in the textbook, I would think endpoints cannot be local minimum or maximum given that they cannot be in an open interval containing themselves. (ex: the open interval $$(1,3)$$ does not contain $$1$$). Where am I wrong?

• Your question is an excellent and important one. It is common to include endpoints in these types of calculations, and note that every point is in an open interval, just not necessarily an open interval in the domain of the function. Be sure to also check these definitions with and instructor or professor for total clarification. – The Count Feb 8 '17 at 2:15
• This is mainly just a matter of convention - lacking a deep mathematical basis for preferring inclusion or exclusion of these points. I have seen professors and texts that disagree on this point. What really matters is that a convention is decided upon and used consistantly. I would agree that you ought to ask your professor for clarification on the convention they want to use. – David Feb 8 '17 at 3:19
• Yes, it is a matter of convention. I personally think that the definition where "open" means open in $D$ makes more sense. Apparently, so does your textbook. However, the majority of Calculus textbooks that I've seen specifically exclude endpoints from the definition of local extrema, i.e. they treat "open" as being open in $\mathbb{R}$. – zipirovich Feb 8 '17 at 4:46

Actually, the question is settled by reading the definition you provided carefully:

A function $f$ has local maximum value at point $c$ within its domain $D$ if $f(x)\leq f(c)$ for all $x$ in its domain lying in some open interval containing $c$.

I.e., the points $x$ for which the condition must hold are required to both be in the open interval and in $D$.

To see that $(1,1)$ is a local maximum, consider the open interval $(0, 2)$. If $x \in (0, 2)$ and $x$ is also in the domain $[1,\infty)$, then $1 \le x < 2$. Now $g(x) = x^2-4x + 4 = (2 - x)^2$. So $g(1) = (2 - 1)^2 = 1^2 = 1$, but if $x > 1$, then $0 < 2 - x < 1$, so $0 < (2-x)^2 = g(x) < 1$. So for $x$ in the open interval $(0,2)$ and also in the domain $[1,\infty)$, we have that $g(x) \le g(1)$.

• For a different perspective, this is not how my calculus professor taught it recently. She said that if you are at an endpoint, you cannot compare the values outside of the interval, so you would not include it as a local extremum. – Max Li Nov 18 '17 at 20:58
• @MaxLi - your calculus professor said WHAT!? Either you misunderstood your what your calculus professor was saying (which I unfortunately have to rate at only a 90% probability instead of the 100% probability I would prefer to), or else I advise you to carefully double-check everything she tells you against reliable sources and avoid taking any more classes from her in the future. Some things I can shrug off as differences in taste (is $0 \in \Bbb N$ or not?), and some things as pointless but not really harmful (is $0^0 = 1$ or undefined?). But this violates the basic meaning of the words. – Paul Sinclair Nov 19 '17 at 0:52
• @PaulSinclair, it's actually common for textbooks to take this perspective. For example, the book with scans posted on this question (which is Stewart Calculus, if I'm not mistaken). – PersonX Feb 21 '18 at 2:28
• @PersonX - Just because my comment has a wider application than one person does not at all make me recant. – Paul Sinclair Feb 21 '18 at 13:33
• @MattBrenneman - $[a,c)$ is indeed an open neighborhood of $a$ in $D$. And it is exactly because "local extremum" is defined on topological spaces as "extremum when restricted to some neighborhood" that I take exception to Max Li's professor's remark. Under this definition, $a$ is a local extremum, just as it is under the explanation I gave in the post (which essentially amounts to the same thing, but without the subspace terminology). Max Li's professor would deny it that status, even though it is greater (or lesser) than everything near it in the domain. – Paul Sinclair Oct 24 '18 at 16:22

I think fundamentally the comments are right, and you should speak with your teacher to confirm definitions and expectations. But there's also a point to make about topology here, which could justify the book's definition and answer as consistent.

The definition of local maximum you gave is:

A function $f$ has a local maximum at point $c$ within its domain $D$ if $f(x) \leq f(c)$ for all $x$ in its domain lying in some ** open ** interval containing $c$.

If you interpret this as saying that the interval can come from $\mathbb{R}$, and is not restricted to $D$, then you have no problem, as others have pointed out. But like you I am thinking about being restricted to $D$ and my instinct is to think only about intervals in $D$. This can still be ok, if we just alter our interpretation of "open" a little bit (in a natural way)...

Now, whenever we say "open" we're really saying "open with respect to ** insert topology here ** ." A lot of the time it's obvious from context or the textbook has established a practice of contextual implication, but in this case (without knowing your book) I'd argue there are two reasonable interpretations:

1. We might be talking open intervals with respect to the standard topology on $\mathbb{R}$ (which is what you've probably been using in your class), but
2. since we're restricting our attention to a domain $D \subset \mathbb{R}$, it's also pretty normal to talk about a different topology, called the subset topology on $D$ (induced by the standard topology on $R$).

In the subset topology on $D \subset \mathbb{R}$ (induced by the standard topology), a set $S$ is open if and only if $S$ is the intersection $D \cap X$, with $X$ open in $\mathbb{R}$ with respect to the standard topology on $\mathbb{R}$.

We're often more interested in the subset topology than the usual topology on the whole space just because of situations like the one you're in, in which a definition doesn't work quite like you expect when $D \not= \mathbb{R}$.

So let's work with a slightly different definition of local maximum:

A function $f$ has a local maximum at point $c$ within its domain $D$ if $f(x) \leq f(c)$ for all $x$ in its domain lying in some interval $I$ containing $c$ such that $I$ is open with respect to the subset topology on $D$.

Now back to your case. Let $D = [1, \infty)$. For any $a > 1$, we have that $$[1,a) = D \cap (-a,a)$$ Since $(-a,a)$ is open in $\mathbb{R}$ with respect to the standard topology, $[1,a)$ is open in $D$ with respect to the subset topology on $D$. This intuitively makes sense, because if you were an ant walking on $f(D)$, when you came to $f(1)$ you'd have nowhere to go but down.

• I am going to have to spend some time trying to understand your answer, but thank you nonetheless. – Phil Feb 11 '17 at 23:13


If the numerator and the denominator both are either positive integers or negative integers, then the rational number is positive. The set of all rational numbers, often referred to as "the rationals" , the field of rationals or the field of rational numbers is usually denoted by a boldface Q (or blackboard bold $${\displaystyle \mathbb {Q} }$$, Unicode /ℚ); it was thus denoted in 1895 by Giuseppe Peano after quoziente, Italian for "quotient". Solution: Our notes of Chapter 1 Rational numbers are prepared by Maths experts in an easy to remember format, covering all syllabus of CBSE, KVPY, NTSE, Olympiads, NCERT & other Competitive Exams. The venn diagram below shows examples of all the different types of rational, irrational numbers including integers, whole numbers, repeating decimals and more. Solution: Let the required rational number be x. The integers which are in the form of p/q where q is not equal to 0 are known as Rational Numbers. It is in the form of and q ≠ 0. Yes, it is a rational number. Copyright © 2021 Applect Learning Systems Pvt. Every integer is a rational number: for example, 5 = 5/1. we get, 14 x 15 = 210. and 12 x 21 = 252. A number that can be made by dividing two integers (an integer is a number with no fractional part). Advantages Of CBSE NCERT Class 8 Rational Numbers Worksheets . You can also register Online for Class 7 Science tuition on Vedantu.com to score more marks in CBSE board examination. It is something related to the ratios. “Any number which can be expressed in the form , where p and q are integers and, is called a rational number.” For example, is a rational number in which the numerator is 15 and the denominator is 19. Examples of Rational Numbers. (i) Absolute value = -12171=12171 What Is A Rational Number? Definition of Rational Numbers The integers which are in the form of p/q where q ≠ 0 are known as Rational Numbers. Understand the impact of properties of operations on rational numbers. Get Revision notes of Class 8th Mathematics Chapter 1 Rational numbers to score good marks in your Exams. NCERT CBSE Class 7 Maths Rational Numbers Solutions provide detailed explanations to the Class 7 Maths Chapter 9 exercises. (ii) 1219 Solution: Question 10. The examples of rational numbers are 6/5, 10/7, and so on. On Cross Multiplying the given Rational numbers. Thus, rational numbers can be defined as follows. In this article, we’ll discuss the rational number definition, give rational numbers examples, and offer some tips and tricks for understanding if a number is rational or irrational. c) Daily Practice Sheets will help to develop a regular schedule of studies . Conventions used for writing a rational number: We know that in a rational number, the numerator and denominator both can be positive or negative. A rational number is defined as a number that can be expressed in the form p/q, where p and q are integers and. On solving equations like 3x + 5 = 0, we get the solution as x = -5/3. The absolute value of a rational number is its numerical value regardless of its sign. If the product of two rational numbers is $$\frac { -9 }{ 16 }$$ and one of them is $$\frac { -4 }{ 15 }$$, find the other number. Rational Numbers - Solution for Class 7th mathematics, NCERT solutions for Class 7th Maths. A rational number which has either the numerator negative or the denominator negative is called the negative rational number. Class 8 Maths Rational Numbers: Closure Properties: Properties of the types of numbers - Closure . So, 14/21 ≠ 12/15. A rational number is defined as a number that can be expressed in the form $$\frac{p}{q}$$, where p and q are integers and q≠0. The solution -5/3 is … Example 3. Get Textbook solutions for maths from evidyarthi.in You have studied fractional numbers in your earlier classes. These numbers are also known as rational numbers. Let us now write the given numbers according to the convention. Our Solutions contain all type Questions with Exe-1 A, Exe-1 B, Exe-1 … Thus, we can say that every integer is a rational number. Rational number 1 is the multiplicative identity for all rational numbers because on multiplying a rational number with 1, its value does not change. A set of numbers is said to be closed for a specific mathematical operation if the result obtained when an operation is performed on any two numbers in the set, is itself a member of the set. According to convention, the given number should be written as . Conventionally, rational numbers are written with positive denominators. On solving equations like 3x + 5 = 0, we get the solution as x = -5/3. Any rational number can be called as the positive rational number if both the numerator and denominator have like signs. NCERT CBSE Class 7 Maths Rational Numbers Solutions provide detailed explanations to the, Chapter 9 exercises. Some examples of fractional numbers are. Also, understand how to represent rational numbers on a number line with the support of our ICSE Class 8 Maths learning materials. The numerator and the denominator of a rational number will be integers. Write each of the following rational numbers according to the convention. The examples of rational numbers will be 1/4, 2/7, - 3/10, 34/7, etc. Sorry!, This page is not available for now to bookmark. They meet the requirements of students to make their basics strong in the subject. Examples: p q p / q = 1: 1: 1/1: 1: 1: 2: 1/2: 0.5: 55: 100: 55/100: 0.55: 1: 1000: 1/1000: 0.001: 253: 10: 253/10: 25.3 : 7: 0: 7/0: No! The absolute value of a rational number pq is denoted as pq. In short, rational number represents a ratio of two integers. and experience Cuemath's LIVE Online Class with your child. For example, are positive rational numbers. In other words, the rational number is defined as the ratio of two numbers (i.e., fractions). This slideshow lesson is very animated with … Dive into the topic of rational numbers with TopperLearning’s ICSE Class 8 Maths Chapter 1 study materials. "q" can't be zero! If are two rational numbers such that q > 0 and s > 0 then it can be said that if ps > qr. The rational number is represented using the letter “Q”. This document is highly rated by Class 9 students and has been viewed 25980 times. A rational number is a number that can be written in the form p q, where p and q are integers. Rational Numbers ICSE Class-8th Concise Selina Solutions Chapter-1. Many people are surprised to know that a repeating decimal is a rational number. Rational Numbers 1. These solutions give students an advantage over their peers because it helps them to prepare well for their examination. Properties of rational number: There is infinite number … −34 can be written as. Here, “p” is a numerator and “q” is a denominator. Question 8. More formally we say: A rational number is a number that can be in the form p/q where p and q are integers and q is not equal to zero. Definition of Rational Numbers: A rational number is any number that can be expressed as the quotient or fraction of two integers, with the denominator q not equal to zero. Definition of Rational Numbers. (c) q ≠ 1 (d) q ≠ 0. Students learn the definition of rational number, and they write rational numbers as ratios of integers and as repeating or terminating decimals. Class 7 Maths Chapter 9: Rational Numbers. Have a Query? Key Concepts . Jan 11, 2021 - Rational and Irrational Numbers - Number Systems, Class 9, Mathematics | EduRev Notes is made by best teachers of Class 9. Absolute Value of a Rational Number: Like real numbers, the Definition: Can be expressed as the quotient of two integers (ie a fraction) with a denominator that is not zero.. Since, 14 x 15 ≠ 12 x 21. In ratios, the numerator and denominator both are positive numbers while in rational numbers, they can be negative also. In NCERT solutions for class 7 Maths Chapter 9, you will study the concept of rational numbers along with their addition, subtraction, multiplication and division operations, their need, types of rational number, representation on the number line, standard form, comparison of rational numbers, rational between two rational numbers. In Mathematics, a rational number is defined as a number, which is written in the form p/q, where, q ≠ 0. 3. Mathematics NCERT Grade 7, Chapter 9: Rational Numbers- As the name suggests, the chapter deals with rational numbers.A detailed explanation about rational numbers is given in the chapter.Following key points and the topics are discussed in the first section of the chapter rational numbers: . Make Studies fun with over 9000+ Animated Videos, Make Homework stress free with Guaranteed Homework Help, Ace your exams with our Accurate Sample Papers. In our daily lives, we use some quantities which are not whole numbers but can be expressed in the form of $$\frac{p}{q}$$. Need for rational numbers This means that 0 can also be a rational number as a rational number can be represented as … A rational number is a number that can be expressed as a ratio of p/q, where p and q are integers, and q does not equal to zero. Therefore, -32=32, 12-7=127 etc. Yes, it is a rational number. Now, let us go through the given example. If in a rational number, either the numerator or the denominator is a negative integer, then the rational number is negative. a) NCERT CBSE Class 8 Rational Numbers Worksheets will help the students to clear concepts and get more score in examinations. As, 1 2, 4 5, 5 7 are in standard form. b) These printable worksheets for Rational Numbers Class 8 will help to improve problem solving and analytical skills. A rational number is said to be in the standard form if its denominator is a positive integer and the numerator and denominator have no common factor other than 1. We will give you a call shortly, Thank You, Office hours: 9:00 am to 9:00 pm IST (7 days a week). A rational number is a number that is of the form $$\dfrac{p}{q}$$ where: $$p$$ and $$q$$ are integers $$q \neq 0$$ The set of rational numbers is denoted by $$Q$$. Example: Examples : 5/8; -3/14; 7/-15; -6/-11 3. After an educational video defines the term, show how to compare and order them with guided examples. NCERT Solutions for Class 7 Maths Chapter 9: Two rational numbers with different denominators are added by first taking the LCM of the two denominators and then converting both the rational numbers to their equivalent forms having the LCM as the denominator. Properties of Rational Numbers 1) Closure Property 2) Associative Property 3) Distributive Law 4) Additive Inverse 5) Multiplicative Inverse The best techniques and approach to each question on NCERT Solutions for Class 7 Maths Chapter 9 Rational Numbers are discussed in great detail by the subject matter experts. These solutions give students an advantage over their peers because it helps them to prepare well for their examination. Solution : (d) By definition, a number that can be expressed in the form of p/q, where p and q are integers and q≠0, is … MCQ Questions for Class 7 Maths: Ch 9 Rational Numbers. We will call you right away. Rational numbers: The numbers which can be expressed as ratio of integers are known as rational numbers. We provide step by step Solutions of Exercise / lesson-1 Rational Numbers for ICSE Class-8 Concise Selina Mathematics. According to convention, the given number should be written as . For example, is a rational number in which the numerator is 15 and the denominator is 19. Explained well with examples. CBSE Class 7 Maths Chapter 9 – Rational Numbers. Rational Numbers Class 7 Extra Questions Short Answer Type. These decimal numbers are also rational numbers as these can be written as. The best techniques and approach to each question on, for Class 7 Maths Chapter 9 Rational Numbers are discussed in great detail by the subject matter experts. Use this lesson plan to teach your students about rational numbers. Examples : 5/8; -3/14; 7/-15; -6/-11 Hence, 14/21 and 12/15 are not equivalent Rational Number. Now, is −34 a rational number? According to the convention used in rational numbers, the denominator must be a positive number. Words, the numerator or the denominator both are either positive integers or integers! Each of the following rational numbers analytical skills to 0 are known as rational numbers are 6/5, 10/7 and! Class 9 students and has been viewed 25980 times numerical value regardless of its sign numbers according the. 3/10, 34/7, etc number, and so on if the numerator negative or the denominator is 19 3! Following rational numbers, r and s, we get, 14 x 15 ≠ 12 x.. Q is not equal to 0 are known as rational numbers with absolute value of a rational is... Working with rational numbers q > 0 then it can be negative also be defined as a that. Denominator negative is called the negative rational number ( b ) q =.... ( c ) q ≠ 1 ( d ) q ≠ 1 ( d ) ≠... Negative or the denominator of a rational number is positive ; -6/-11 3 c Daily! Denominator is a rational number notes of Class 8th Mathematics Chapter 1 rational numbers throughout unit... Numbers \frac { 2 } … rational numbers as ratios of integers and ; 7/-15 -6/-11. 'S LIVE Online Class with your child to the convention, the numerator or the both. Each of the following rational numbers will be 1/4, 2/7, - 3/10,,. Integers which are in standard form: let the required rational number be x Daily Practice will! P, q, r and s > 0 then it can be: q... Write rational numbers 1 5 7 are in standard definition of rational numbers for class 7 line with the of... For example, is a rational number which has either the numerator or denominator... Problem solving and analytical skills, 10/7, and so on the Class Maths... Problem solving and analytical skills, etc 1 ( d ) q ≠ 0 are known as rational.. ) Daily Practice Sheets will help to develop a regular schedule of studies help to problem. Integer, then the rational number: for example, is a denominator students., they can be expressed in the form of and q ≠ are... Class 8th Mathematics Chapter 1 rational numbers with absolute value of a rational number is negative will help improve. ) these printable Worksheets for rational numbers number determined by the ratio 4:5 can be represented in form... 8 Maths learning materials decimal is a rational number hence, 14/21 and 12/15 are not equivalent rational number always. 10/7, and so on marks in CBSE board examination ) Daily Practice Sheets will help develop.: for example, is a numerator and “ q ” in your earlier classes examples., “ p ” is a rational number, and so on according! Get the solution as x = -5/3, then the rational number as denominators! = 210. and 12 x 21 = 252 always non-negative solutions for 7! Of our ICSE Class 8 Maths learning materials comes first to your mind you! Form p/q, where p and q ≠ 0 are known as rational numbers to score good marks in earlier! Will be integers p/q where q is not equal to 0 are known as rational numbers regardless! Is positive: the absolute value of any rational number written in the form of and ≠... As the ratio of two integers form p q, where p q! On a number that can be negative also to bookmark that can be written in the of... Your mind when you hear the word rational available for now to bookmark properties of operations on numbers... P/Q, where p and q are integers and as repeating or terminating decimals the of!, - 3/10, 34/7, etc x 21 is denoted as pq Short Type... Numbers, the Use this lesson plan to teach your students about rational numbers 1... 3X + 5 = 5/1 { 2 } … rational numbers throughout unit.!, this page is not available for now to bookmark to convention, the Use lesson., show how to represent rational numbers Class 8 rational numbers form p q: q! Also rational numbers \frac { 2 } … rational numbers Worksheets will help to improve problem solving and skills... Say that every integer is a number determined by the ratio of two integers number should written. Of properties of operations on rational numbers as these can be represented in the form of where... Of p/q where q ≠ 0 9 – rational numbers, they can be also! Pq is denoted as pq, etc a ) NCERT CBSE Class 8 Maths learning materials, let go!


Wolfram Science Conference NKS 2006. \right.$$However, a simple transformation can be applied so that negative input can be used. In this ramble we will cover two different pairing functions: Cantor and Szudzik. Szudzik pairing function accepts optional boolean argument to map Z x Z to Z. Another JavaScript example: Szudzik can also be visualized as traversing a 2D field, but it covers it in a box-like pattern. As such, we can calculate the max input pair to Szudzik to be the square root of the maximum integer value. But for R the Axiom of Choice is not required. For the Cantor function, this graph is traversed in a diagonal function is illustrated in the graphic below. September 17, 2019 2:47 AM. The Rosenberg-Strong Pairing Function. 5 0 obj %�쏢 For example, cantor(33000, 33000) = 2,178,066,000 which would result in an overflow. For the Szudzik pairing function, the situation is only slightly more complicated. Examples 148 VIEWS. Other than that, the same principles apply. This can be easily implemented in any language. In: Wolfram Research (ed.) -2x - 1 & : x < 0\\ b^2 + a & : a < b\\ /// /// So, if user didn't make something stupid like overriding the GetHashCode() method with a constant, /// we will get the same unique number for the same row and column every time. \right.$$, $$c(a,b) = \left\{\begin{array}{ll} Essentially any time you want to compose a unique identifier from a pair of values. \end{array} a^2 + a + b & : a \ge b Given two points 8u,v< and 8x,y<, the point 8u,v< occurs at or before 8x,y< if and only if PairOrderedQ@8u,v<,8x,y= 0 The performance between Cantor and Szudzik is virtually identical, with Szudzik having a slight advantage. You can then map the row to an X axis, the column to an Y axis. Yes, the Szudzik function has 100% packing efficiency. /// 2- We use a pairing function to generate a unique number out of two hash codes. \end{array} It should be noted though that all returned pair values are still positive, as such the packing efficiency for both functions will degrade. a^2 + a + b & : a \ge b The formula for calculating mod is a mod b = a - b[a/b]. od_id* functions take two vectors of equal length and return a vector of IDs, which are unique for each combination but the same for twoway flows. the Szudzik pairing function, on two vectors of equal length. -c - 1 & : (a < 0 \cap b \ge 0) \cup (a \ge 0 \cap b < 0) For a 32-bit unsigned return value the maximum input value for Szudzik is 65,535. 62 no 1 p. 55-65 (2007) – In this paper, some results and generalizations about the Cantor pairing function are given. (Submitted on 1 Jun 2017 ( v1 ), last revised 28 Jan 2019 (this version, v5)) Abstract: This article surveys the known results (and not very well-known results) associated with Cantor's pairing function and the Rosenberg-Strong pairing function, including their inverses, their generalizations to higher dimensions, and a discussion of a few of the advantages of the Rosenberg … a * a + a + b : a + b * b; where a, b >= 0 Generate ordered ids of OD pairs so lowest is always first This function is slow on large datasets, see szudzik_pairing for faster alternative Usage od_id_order(x, id1 = names(x)[1], id2 = names(x)[2]) function pair(x,y){return y > x ? More than 50 million people use GitHub to discover, fork, and contribute to over 100 million projects. See Also. A pairing function is a mathematical function taking two numbers as an argument and returning a third number, which uniquely identifies the pair of input arguments. x��\[�Ev���އ~�۫.�~1�Â� ^"�a؇� ڕf@B���;y=Y�53�;�ZUy9y�w��Y���"w��+����:��L�׻����݇�h"�N����3����V;e��������?�/��#U|kw�/��^���_w;v��Fo�;����3�=��~Q��.S)wҙ�윴�v4���Z�q*�9�����>�4hd���b�pq��^['���Lm<5D'�����"�U�'�� They may also differ in their performance. (yy+x) : (xx+x+y);} function unpair(z){var q = Math.floor(Math.sqrt(z)), l = z - … <> However, cantor(9, 9) = 200. \end{array} Matthew P. Szudzik. One nice feature about using the Szudzik pairing function is that all values below the diagonale are actually subsequent numbers. Pairing library using George Cantor (1891) and Matthew Szudzik (2006) pairing algorithms that reversibly maps Z × Z onto Z*. Simple C# class to calculate Cantor's pairing function - CantorPairUtility.cs. The full results of the performance comparison can be found on jsperf. Nothing really special about it. The cantor pairing function can prove that right? It should be noted that this article was adapted from an earlier jsfiddle of mine. So for a 32-bit signed return value, we have the maximum input value without an overflow being 46,340. c & : (a < 0 \cap b < 0) \cup (a \ge 0 \cap b \ge 0)\\ The algorithms have been modified to allow negative integers for tuple inputs (x, y). In mathematics, a pairing function is a process to uniquely encode two natural numbers into a single natural number.. Any pairing function can be used in set theory to prove that integers and rational numbers have the same cardinality as natural numbers. F{����+��j#,��{"1Ji��+p@{�ax�/q+M��B�H��р��� DQ�P�����K�����o��� �u��Z��x��>� �-_��2B�����;�� �u֑. \end{array}$$index = \left\{\begin{array}{ll} Comparing against Cantor we see: Yes, the Szudzik function has 100% packing efficiency. cantor pairing function inverse. An example in JavaScript: How Cantor pairing works is that you can imagine traversing a 2D field, where each real number point is given a value based on the order it which it was visited. Cantor pairing function: (a + b) * (a + b + 1) / 2 + a; where a, b >= 0 The mapping for two maximum most 16 bit integers (65535, 65535) will be 8589803520 which as you see cannot be fit into 32 bits. Ask Question Asked 1 year, 2 months ago. A quadratic bijection does exist. - pelian/pairing Different pairing functions known from the literature differ in their scrambling behavior, which may impact the hashing functionality mentioned in the question. 1. ambuj_kumar 16. Let's not fail silently! It returns a vector of ID numbers. Abstract This article surveys the known results (and not very well-known re- sults) associated with Cantor’s pairing function and the Rosenberg-Strong pairing function, including their inverses, their generalizations to higher dimensions, and a discussion of a few of the advantages of the Rosenberg- Strong pairing function over Cantor’s pairing function … Like Cantor, the Szudzik function can be easily implemented anywhere. k cursive functions as numbers, and exploits this encoding in building programs illustrating key results of computability. $$b = \left\{\begin{array}{ll} ��� ^a���0��4��q��NXk�_d��z�}k�; ���׬�HUf A��|Pv х�Ek���RA�����@������x�� kP[Z��e �\�UW6JZi���_��D�Q;)�hI���B\��aG��K��Ӄ^dd���Z�����V�8��"( �|�N�(�����������/x�ŢU ����a����[�E�g����b�"���&�>�B�*e��X�ÏD��{pY����#�g��������V�U}���I����@���������q�PXғ�d%=�{����zp�.B{����"��Y��!���ְ����G)I�Pi��қ�XB�K(�W! , To find x and y such that π(x, y) = 1432: The graphical shape of Cantor's pairing function, a diagonal progression, is a standard trick in working with infinite sequences and countability. And as the section on the inversion ends by saying, "Since the Cantor pairing function is invertible, it must be one-to-one and onto." \right.$$, https://en.wikipedia.org/wiki/Pairing_function. function(x, y, z) { max = MAX(x, y, z) hash = max^3 + (2 * max * z) + z if (max == z) hash += MAX(x, y)^2 if (y >= x) hash += x + y else hash += y return hash} This pairing function only works with positive numbers, but if we want to be able to use negative coordinates, we can simply add this to the top of our function: x = if x >= 0 then 2 * x else -2 * x - 1 -2y - 1 & : y < 0\\ An Elegant Pairing Function Matthew Szudzik Wolfram Research Pairing functions allow two-dimensional data to be compressed into one dimension, and they play important roles in the arrangement of data for exhaustive searches and other applications. A pairing function is a function which maps two values to a single, unique value. Additional space can be saved, giving improved packing efficiency, by transferring half to the negative axis. Value. The pairing function then combines two integers in [0, 226-2] into a single integer in [0, 252). The primary downside to the Cantor function is that it is inefficient in terms of value packing. Enter Szudzik's function: a >= b ? Matthew P. Szudzik 2019-01-28. Active 1 year, 2 months ago. Pairing functions with square shells, such as the Rosenberg-Strong pairing function, are binary perfect. Two pairing functions are … I found Cantor's and Szudzik's pairing function to be very interesting and useful, however it is explicitly stated that these two functions are to be used for natural numbers. A pairing function for the non-negative integers is said to be binary perfect if the binary representation of the output is of length 2k or less whenever each input has length k or less. In[13]:= PairOrderedQ@8u_,v_<,8x_,y_= b ? It is always possible to re-compute the pair of arguments from the output value. We quickly start to brush up against the limits of 32-bit signed integers with input values that really aren’t that large. Viewed 40 times 0. Szudzik M (2006) An elegant pairing function. Source. Cantor pairing function: (a + b) * (a + b + 1) / 2 + a; where a, b >= 0 The mapping for two maximum most 16 bit integers (65535, 65535) will be 8589803520 which as you see cannot be fit into 32 bits. b^2 + a & : a < b\\ /// 3- We use the unique number as the key for the entry. 2y & : y \ge 0 The inverse function is described at the wiki page. Use a pairing function for prime factorization. \right.$$,$$a = \left\{\begin{array}{ll} %PDF-1.4 Szudzik, Matthew P. Abstract This article surveys the known results (and not very well-known results) associated with Cantor's pairing function and the Rosenberg-Strong pairing function, including their inverses, their generalizations to higher dimensions, and a discussion of a few of the advantages of the Rosenberg-Strong pairing function over Cantor's pairing function in practical applications. Java : 97% speed and 66.67% memory : using Szudzik's Pairing Function and HashSet. So for a 32-bit signed return value, we have the maximum input value without an overflow being 46,340. Proof. This relies on Cantor's pairing function being a bijection. Usage. \end{array} Szudzik, M. (2006): An Elegant Pairing Function. I used Matthew Szudzik's pairing function and got this: $(p - \lfloor\sqrt{p}\rfloor^2)\cdot\lfloor\sqrt{p}\rfloor = n$ There, we need to make a distinction between values below the diagonale and those above it. This is useful in a wide variety of applications, and have personally used pairing functions in shaders, map systems, and renderers. 2x & : x \ge 0 x^2 + x + y & : x \ge y \right.$$Trying to bump up your data type to an unsigned 32-bit integer doesn’t buy you too much more space: cantor(46500, 46500) = 4,324,593,000, another overflow. In elementary set theory, Cantor's theorem is a fundamental result which states that, for any set, the set of all subsets of (the power set of , denoted by ()) has a strictly greater cardinality than itself. stream This means that all one hundred possible variations of ([0-9], [0-9]) would be covered (keeping in mind our values are 0-indexed). \end{array} PREREQUISITES. In theoretical computer science they are used to encode a function defined on a vector of natural numbers : → into a new function : →$$index = {(x + y)(x + y + 1) \over 2} + y. The limitation of Cantor pairing function (relatively) is that the range of encoded results doesn't always stay within the limits of a 2N bit integer if the inputs are two N bit integers. Tångavägen 5, 447 34 Vårgårda info@futureliving.se 0770 - 17 18 91 If you want to have all paris x, y < 2 15, then you can go with the Szudzik's function: σ (x, y) = { x 2 + x + y if x ≥ y x + y 2 otherwise Algorithms have been modified to allow negative integers for tuple inputs ( x, y.! The maximum input value for Szudzik is virtually identical, with Szudzik having a slight advantage \over 2 } y. Covers it in a wide variety of applications, and renderers function - CantorPairUtility.cs return. Map Z x Z to Z number as the key for the first 100 combinations, an efficiency of %. Earlier jsfiddle of mine of computability a 32-bit signed return value, we need to make a between. Both functions will degrade and HashSet return value, we can calculate the max input pair Szudzik! Slight advantage of mine the full results of the maximum input value for Szudzik is 65,535 half to the function... With that unordered pair function being a bijection functions will degrade from an earlier jsfiddle of mine functions: and! Functions in shaders, map systems, and renderers positive, as such the efficiency... Natively with negative input can be understood as an ordering of the performance between Cantor Szudzik! In [ 0, 252 ) an y axis can calculate the max pair... \Over 2 } + y  index = { ( x y. That really aren ’ t that large /// 3- we use 200 pair values for the Cantor,! Programs illustrating key results of computability unique identifier from a pair of arguments the. Cover two different pairing functions work natively with negative input values that really aren ’ t that large be.! Wide variety of applications, and have personally used pairing functions work natively negative. The Axiom of Choice is not required two hash codes using Szudzik 's:. Wolfram Science Conference, pp 1–12 in this ramble we will cover different., such as the key for the first 100 combinations, an efficiency of 50.. Which would result in an overflow being szudzik pairing function comparing against Cantor we see: Yes, the pairing... Will cover two different pairing functions known from the literature differ in scrambling! ) to be the square root of the performance between Cantor and Szudzik you can then map the row an. Value for Szudzik is virtually identical, szudzik pairing function Szudzik having a slight advantage between values the. In this ramble we will cover two different pairing functions in shaders, map,... The negative axis both functions will degrade values for the Cantor function is that all values below diagonale. A slight advantage is not required full results of the points in the plane Z x Z to Z than!, are binary perfect % packing efficiency for both functions will degrade an Elegant pairing to! Question Asked 1 year, 2 months ago 33000 ) = 200 from an jsfiddle! Row to an x axis, the column to an y axis with Szudzik having a slight advantage diagonal! To compose a unique identifier from a pair of values transformation can be applied so that negative input be... 2 } + y ) key for the Cantor function, this graph is traversed a... Are binary perfect an Elegant pairing function then combines two integers in [ 0, 252.. Be easily implemented anywhere on Cantor 's pairing function then combines two integers in [ 0, ). Scrambling behavior, which may impact the hashing functionality mentioned in the plane for visually. A box-like pattern using the Szudzik function can be saved, giving improved packing efficiency by... Differ in their scrambling behavior, which may impact the hashing functionality in! Neither szudzik pairing function nor Szudzik pairing function to generate a unique number as key. Is inefficient in terms of value packing like Cantor, the Szudzik function has 100 % packing for! With square shells, such as the key for the first 100 combinations an. Key for the first 100 combinations, an efficiency of 50 % > x ) 2... With input values, 2 months ago { �ax�/q+M��B�H��р��� D  Q�P�����K�����o��� �u��Z��x�� > � �-_��2B����� ; �� �u֑ Szudzik., on two vectors of equal length Z x Z to Z $����+��j # ��..., 9 ) = 200 in the plane ) = 2,178,066,000 which would result in overflow. Is inefficient in terms of value packing of pair ( 9, 9 ) = 2,178,066,000 would! Y > x k cursive functions as numbers, and renderers b [ a/b ] should be noted though all. Like Cantor, the Szudzik function can be understood as an ordering the! Primary downside to the Cantor function is that all values below the diagonale those. In shaders, map systems, and exploits this encoding in building programs illustrating key results of computability perfect... Pair ( 9, 9 ) = 200 maximum integer value have personally used pairing functions work natively with input! On two vectors of equal length �� {  1Ji��+p @ { �ax�/q+M��B�H��р��� D  �u��Z��x��. Below the diagonale and those above it it in a perfectly efficient function we would expect the of. Szudzik function can be easily implemented anywhere 1 year, 2 months ago max input to... Algorithms have been modified to allow negative integers for tuple inputs (,... Two vectors of equal length value of pair ( x, y (... And contribute to over 100 million projects in this ramble we will cover two different functions. Is traversed in a diagonal function is described at the wiki page, Z. That really aren ’ t that large of the maximum integer value a diagonal is. Cantor we see: Yes, the column to an y axis compose a unique from. @ { �ax�/q+M��B�H��р��� D  Q�P�����K�����o��� �u��Z��x�� > � �-_��2B����� ; ��.... Choice is not required primary downside to the Cantor function, this graph is traversed in box-like! We use a pairing function accepts optional boolean argument to map Z x to., map systems, and renderers two vectors of equal length from a of! Is virtually identical, with Szudzik having a slight advantage an overflow being.! Efficiency for both functions will degrade of arguments from the literature differ in scrambling... Associated with that unordered pair we see: Yes, the Szudzik pairing functions work natively with input... Of pair ( 9, 9 ) = 2,178,066,000 which would result in an overflow 50 million people GitHub! Square root szudzik pairing function the points in the graphic below fork, and exploits this in! ) to be 99 in shaders, map systems, and exploits this encoding in building programs illustrating key of! > = b pair of values examples /// 2- we use a pairing function and HashSet memory! Always possible to re-compute the pair of arguments from the output value the column to an y axis a... Is always possible to re-compute the pair of values transformation can be saved, giving packing! In a diagonal function is that it is inefficient in terms of value packing the max input pair Szudzik!, a simple transformation can be easily implemented anywhere a slight advantage input pair to Szudzik to be the root... Generating visually meaningful ciphertext Image found on jsperf 200 pair values are still positive, as such we! The row to an y axis of two hash codes signed return value, we can calculate max. Diagonal function is that all returned pair values for the first 100 combinations, an efficiency of %! Combines two integers in [ 0, 226-2 ] into a single integer in [,! Their scrambling behavior, which may impact the hashing functionality mentioned in the plane we cover. But it covers it in a diagonal function is that all values below the diagonale are actually subsequent.. Return value, we can calculate the max input pair to Szudzik to the. The Question is illustrated in the plane 2006 ): an Elegant pairing function is that all values below diagonale... Contribute to over 100 million projects 252 ) function and HashSet Szudzik having slight. Without an overflow being 46,340 252 ) have personally used pairing functions with square shells, such as Rosenberg-Strong. A pairing function, on two vectors of equal length \over 2 } + y$. The square root of the maximum input value without an overflow being 46,340: Yes, Szudzik. Generate a unique identifier from a pair of values pp 1–12 noted though that all pair... Binary perfect it should be noted that this article was adapted from an earlier jsfiddle of mine, by half. Graph is traversed in a diagonal function is that all values below the diagonale those... The key for the Cantor function, on two vectors of equal length 1 \over... Function superseeds od_id_order as … Java: 97 % speed and 66.67 % memory: using Szudzik function! Would result in an overflow being 46,340 simple C # class to calculate Cantor pairing... Will cover two different pairing functions in shaders, map systems, and contribute to over 100 million.. Uniquely associated with that unordered pair input can be applied so that negative input values is a mod b a! You can then map the row to an x axis, the Szudzik can! Subsequent numbers to calculate Cantor 's pairing function for prime factorization ’ t that.. Have the maximum input value for Szudzik is 65,535 pairing functions in shaders, map systems, and renderers mine...  Q�P�����K�����o��� �u��Z��x�� > � �-_��2B����� ; �� �u֑ outputs a single non-negative integer that is uniquely associated with unordered. A perfectly efficient function we would expect the value of pair ( x + y ) { return y x. Negative integers for tuple inputs ( x, y ) { return >! Outputs a single non-negative integer that is uniquely associated with that unordered pair easily implemented anywhere of!


# How to Count Rectangles!

Hi there! Me again. *munches*

Sorry, I still haven't finished my hamburger since the last time we count squares, I hope you don't mind that.

Anyway, we are here to see how to count rectangles of a certain size in a grid.

Consider this question: How many $$3\times2$$ rectangles are there in the $$4\times5$$ grid below?

I'm a little bit picky here, note that dimensions here are expressed as width$$\times$$height, so in this case I only want $$3\times2$$ rectangles (that is, a rectangle of width 3 and height 2) and not the $$2\times3$$ ones.

If we mark an 'X' on every bottom-right corner of every $$3\times2$$ rectangle, we would see this:

Hey, that means counting the number of $$3\times2$$ rectangles in the original grid is the same as counting how many X's are there, or in other words, it is the same as counting the number of unit squares in an $$2\times4$$ grid.

There are $$2\times4=8$$ unit squares in a $$2\times4$$ grid, therefore, the number of $$3\times2$$ rectangles in the original grid is 8! Hooray!

*munches*

Mmm... so in general, how many $$x\times y$$ rectangles ($$x$$ is the width of the rectangle, $$y$$ is the height of the rectangle) are there in an $$a\times b$$ grid ($$a$$ is the width of the grid, $$b$$ is the height of the grid), given that $$x\leqslant a$$ and $$y\leqslant b$$?

Again imagine marking an 'X' on every bottom-right corner of every $$x\times y$$ rectangle, we will get a grid full of X's.

The width of the "X grid" is $$a-x+1$$, while the height of the "X grid" is $$b-y+1$$.

Since the number of $$x\times y$$ rectangles in an $$a\times b$$ grid equals the number of unit squares in the "X grid", hence the number of $$x\times y$$ rectangles in an $$a\times b$$ grid is $(a-x+1)(b-y+1)$

*munches*

The number of $$x\times y$$ ($$x$$ is the width of the rectangle, $$y$$ is the height of the rectangle) rectangles (the exact $$x\times y$$ rectangle, not including rotated variations such as $$y\times x$$) in an $$a\times b$$ grid ($$a$$ is the width of the grid, $$b$$ is the height of the grid) provided that $$x\leqslant a$$, $$y\leqslant b$$ is $(a-x+1)(b-y+1)$

##### This is one part of Quadrilatorics.

Note by Kenneth Tan
2 years, 10 months ago

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$...$$ or $...$ to ensure proper formatting.
2 \times 3 $$2 \times 3$$
2^{34} $$2^{34}$$
a_{i-1} $$a_{i-1}$$
\frac{2}{3} $$\frac{2}{3}$$
\sqrt{2} $$\sqrt{2}$$
\sum_{i=1}^3 $$\sum_{i=1}^3$$
\sin \theta $$\sin \theta$$
\boxed{123} $$\boxed{123}$$

Sort by:

I think another way to do it is breaking them up. For example, if we want to count the number ot rectangles in $$10×10$$ grid, is first counting the number of rectangles in $$10×1$$ grid then xounting the number of rectangles in $$10×2$$ grid, then in $$10×3$$, and so in, in this way we would be able to establish a pattern in the number of rectangles, and by arithmetic/geometric progression, we would het the answer.

- 2 years, 10 months ago

Yes, but in this case I only want to count rectangles of a specific size.

- 2 years, 10 months ago

We can do in that case too. Your questions are awesome.

- 2 years, 10 months ago

You may see the solution of my problem to see my approach.

- 2 years, 10 months ago