# Counting the number of ways a test can be answered where at least one T/F and at least one multiple choice question must be answered

An exam has $15$ questions: eight true/false questions and seven multiple choice questions. You are asked to answer five of them, but your professor requires you to answer at least one true/false question and at least one multiple choice question. How many ways can you choose the questions you plan to answer.

step1. I chose $1$ question of true false type. $8$ ways of doing so.

step2. I chose $1$ question of MCQ type. $7$ ways of doing so.

step3. I chose $3$ questions of the remaining $13$ questions. $13 \cdot 12 \cdot 11$ ways of doing so.

step4. Hence, $8 \cdot 7 \cdot 13 \cdot 12 \cdot 11$ gives number of sequences of $5$ questions from a collection of $15$ questions such that there is at least one question from t/f type and mcq type each.

step5. Let the number of collections of $5$ questions from a collection of $15$ questions such that there is at least one question from t/f type and mcq type each be $N$.

step6. $N \cdot 5! = 8 \cdot 7 \cdot 11 \cdot 12 \cdot 13$

step7. $N = \dfrac{8 \cdot 7 \cdot 11 \cdot 12 \cdot 13}{5!}$

But this number above is not even a whole number. Where did I go wrong?

• when you chose one question you are also chosing four out of remaining questions you have to multiply them May 16 '18 at 14:27
• Please read this tutorial on how to typeset mathematics on this site. May 16 '18 at 14:41
• You choose tf first and then mc. You are dividing by all ways you can arrange 5. But you should only divide but the number of ways that tf comes first and then mc. May 16 '18 at 16:02

You don't have $5!$ ways of arranging the $5$ questions. You choose the questions specifically so that the first question was a TF and the second was MC. So the numbers of ways to arrange your five question must be that the first is TF and the second MC.

That is, the reason you divide by $5!$ in the first place is that you need to account that picking $ABCDE$ is the same thing as picking $CEDAB$. But unless $C$ is TF and E is MFC picking $CEDAB$ was never an option.

The problem is the number of ways or arranging the $5$ questions depends on knowing how many TF and MC questions there are.

But to choose the number of way you can have $n$ TF question and $5-n$ MC questions first. You can have $1$ to $4$ TF questions and there are ${8 \choose n}$ ways of picking the $n$ TF question s an there are ${7\choose 5-n}$ ways of choosing the $5-n$ MC questions.

So the answer is $\sum_{n=1}^4 {8\choose n}{7\choose 5-n}=$

${8\choose 1}{7\choose 4}+{8\choose 2}{7\choose 3}+{8\choose 3}{7\choose 2}+{8\choose 4}{7\choose 1}=$

$8\frac {7!}{3!4!} + \frac {8!7!}{2!6!3!4!} + \frac {8!7!}{5!3!5!2!} + 7*\frac {8!}{4!4!}=$

$8*(5*7) + (4*7)(5*7) + (8*7)(7*3) + 7*(2*7*5)=$

$7*2(20 + 70 + 84 + 35)= 2926$

======

"The easier way is to count the number of ways you can choose any five questions, then subtract the ones that are all the same kind."

D'oh!

#any 5 - #all 5 TF - #all 5 mc =

${15 \choose 5} - {8\choose 5} - {7\choose 5}=$

$\frac {15!}{10!5!} - \frac {8!}{5!3!} - \frac {7!}{5!2!} =$

$3003 - 56- 21 = 2926$.

You overcount all of the cases. For a case where you answer two true/false questions and three multiple choice questions, there are two way to pick which one you count in step 1 and three in step 2, so this will get counted six times.

The easier way is to count the number of ways you can choose any five questions, then subtract the ones that are all the same kind.


# fplot3

Plot 3-D parametric curve

## Syntax

fplot3(xt,yt,zt)
fplot3(xt,yt,zt,[tmin tmax])
fplot3(___,LineSpec)
fplot3(___,Name,Value)
fplot3(ax,___)
fp = fplot3(___)

## Description

example

fplot3(xt,yt,zt) plots the parametric curve xt = x(t), yt = y(t), and zt = z(t) over the default interval –5 < t < 5.

example

fplot3(xt,yt,zt,[tmin tmax]) plots xt = x(t), yt = y(t), and zt = z(t) over the interval tmin < t < tmax.

example

fplot3(___,LineSpec) uses LineSpec to set the line style, marker symbol, and line color.

example

fplot3(___,Name,Value) specifies line properties using one or more Name,Value pair arguments. Use this option with any of the input argument combinations in the previous syntaxes. Name,Value pair settings apply to all the lines plotted. To set options for individual lines, use the objects returned by fplot3.
fplot3(ax,___) plots into the axes object ax instead of the current axes gca.

example

fp = fplot3(___) returns a parameterized function line object. Use the object to query and modify properties of a specific parameterized line. For details, see ParameterizedFunctionLine Properties.

## Examples

### Plot 3-D Parametric Line

Plot the 3-D parametric line

$\begin{array}{c}x=\mathrm{sin}\left(t\right)\\ y=\mathrm{cos}\left(t\right)\\ z=t\end{array}$

over the default parameter range [-5 5].

syms t xt = sin(t); yt = cos(t); zt = t; fplot3(xt,yt,zt)

### Specify Parameter Range

Plot the parametric line

$\begin{array}{c}x={e}^{-t/10}\mathrm{sin}\left(5t\right)\\ y={e}^{-t/10}\mathrm{cos}\left(5t\right)\\ z=t\end{array}$

over the parameter range [-10 10] by specifying the fourth argument of fplot3.

syms t xt = exp(-t/10).*sin(5*t); yt = exp(-t/10).*cos(5*t); zt = t; fplot3(xt,yt,zt,[-10 10])

### Change Line Properties and Display Markers

Plot the same 3-D parametric curve three times over different intervals of the parameter. For the first curve, use a linewidth of 2. For the second, specify a dashed red line style with circle markers. For the third, specify a cyan, dash-dot line style with asterisk markers.

syms t fplot3(sin(t), cos(t), t, [0 2*pi], 'LineWidth', 2) hold on fplot3(sin(t), cos(t), t, [2*pi 4*pi], '--or') fplot3(sin(t), cos(t), t, [4*pi 6*pi], '-.*c')

### Plot 3-D Parametric Line Using Symbolic Functions

Plot the 3-D parametric line

$\begin{array}{c}x\left(t\right)=\mathrm{sin}\left(t\right)\\ y\left(t\right)=\mathrm{cos}\left(t\right)\\ z\left(t\right)=\mathrm{cos}\left(2t\right).\end{array}$

syms x(t) y(t) z(t) x(t) = sin(t); y(t) = cos(t); z(t) = cos(2*t); fplot3(x,y,z)

### Plot Multiple Lines on Same Figure

Plot multiple lines either by passing the inputs as a vector or by using hold on to successively plot on the same figure. If you specify LineSpec and Name-Value arguments, they apply to all lines. To set options for individual lines, use the function handles returned by fplot3.

Divide a figure into two subplots using subplot. On the first subplot, plot two parameterized lines using vector input. On the second subplot, plot the same lines using hold on.

syms t subplot(2,1,1) fplot3([t -t], t, [t -t]) title('Multiple Lines Using Vector Inputs') subplot(2,1,2) fplot3(t, t, t) hold on fplot3(-t, t, -t) title('Multiple Lines Using Hold On Command') hold off

### Modify 3-D Parametric Line After Creation

Plot the parametric line

$\begin{array}{l}x={e}^{-|t|/10}\mathrm{sin}\left(5|t|\right)\\ y={e}^{-|t|/10}\mathrm{cos}\left(5|t|\right)\\ z=t.\end{array}$

Provide an output to make fplot return the plot object.

syms t xt = exp(-abs(t)/10).*sin(5*abs(t)); yt = exp(-abs(t)/10).*cos(5*abs(t)); zt = t; fp = fplot3(xt,yt,zt)

fp = ParameterizedFunctionLine with properties: XFunction: [1x1 sym] YFunction: [1x1 sym] ZFunction: [1x1 sym] Color: [0 0.4470 0.7410] LineStyle: '-' LineWidth: 0.5000 Show all properties

Change the range of parameter values to [-10 10] and the line color to red by using the TRange and Color properties of fp respectively.

fp.TRange = [-10 10]; fp.Color = 'r';

### Add Title and Axis Labels and Format Ticks

For $t$ values in the range $-2\pi$ to $2\pi$, plot the parametric line

$\begin{array}{c}x=t\\ y=t/2\\ z=\mathrm{sin}\left(6t\right).\end{array}$

Add a title and axis labels. Create the x-axis ticks by spanning the x-axis limits at intervals of pi/2. Display these ticks by using the XTick property. Create x-axis labels by using arrayfun to apply texlabel to S. Display these labels by using the XTickLabel property. Repeat these steps for the y-axis.

To use LaTeX in plots, see latex.

syms t xt = t; yt = t/2; zt = sin(6*t); fplot3(xt,yt,zt,[-2*pi 2*pi],'MeshDensity',30) view(52.5,30) xlabel('x') ylabel('y') title('x=t, y=t/2, z=sin(6t) for -2\pi < t < 2\pi') ax = gca; S = sym(ax.XLim(1):pi/2:ax.XLim(2)); ax.XTick = double(S); ax.XTickLabel = arrayfun(@texlabel, S, 'UniformOutput', false); S = sym(ax.YLim(1):pi/2:ax.YLim(2)); ax.YTick = double(S); ax.YTickLabel = arrayfun(@texlabel, S, 'UniformOutput', false);

### Create Animations

Create animations by changing the displayed expression using the XFunction, YFunction, and ZFunction properties and then by using drawnow to update the plot. To export to GIF, see imwrite.

By varying the variable i from 0 to 4π, animate the parametric curve

$\begin{array}{l}x=t+\mathrm{sin}\left(40t\right)\\ y=-t+\mathrm{cos}\left(40t\right)\\ z=\mathrm{sin}\left(t+i\right).\end{array}$

To play the animation, click the image.

syms t fp = fplot3(t+sin(40*t),-t+cos(40*t), sin(t)); for i=0:pi/10:4*pi fp.ZFunction = sin(t+i); drawnow end

## Input Arguments

collapse all

Parametric input for x-axis, specified as a symbolic expression or function. fplot3 uses symvar to find the parameter.

Parametric input for y-axis, specified as a symbolic expression or function. fplot3 uses symvar to find the parameter.

Parametric input for z-axis, specified as a symbolic expression or function. fplot3 uses symvar to find the parameter.

Range of values of parameter, specified as a vector of two numbers. The default range is [-5 5].

Axes object. If you do not specify an axes object, then fplot3 uses the current axes.

Line style, marker, and color, specified as a character vector or string containing symbols. The symbols can appear in any order. You do not need to specify all three characteristics (line style, marker, and color). For example, if you omit the line style and specify the marker, then the plot shows only the marker and no line.

Example: '--or' is a red dashed line with circle markers

Line StyleDescription
-Solid line
--Dashed line
:Dotted line
-.Dash-dot line
MarkerDescription
'o'Circle
'+'Plus sign
'*'Asterisk
'.'Point
'x'Cross
'_'Horizontal line
'|'Vertical line
's'Square
'd'Diamond
'^'Upward-pointing triangle
'v'Downward-pointing triangle
'>'Right-pointing triangle
'<'Left-pointing triangle
'p'Pentagram
'h'Hexagram
ColorDescription

y

yellow

m

magenta

c

cyan

r

red

g

green

b

blue

w

white

k

black

### Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'Marker','o','MarkerFaceColor','red'

The properties listed here are only a subset. For a complete list, see ParameterizedFunctionLine Properties.

Number of evaluation points, specified as a number. The default is 23. Because fplot3 uses adaptive evaluation, the actual number of evaluation points is greater.

Line color, specified as an RGB triplet, a hexadecimal color code, a color name, or a short name.

For a custom color, specify an RGB triplet or a hexadecimal color code.

• An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,1]; for example, [0.4 0.6 0.7].

• A hexadecimal color code is a character vector or a string scalar that starts with a hash symbol (#) followed by three or six hexadecimal digits, which can range from 0 to F. The values are not case sensitive. Thus, the color codes '#FF8800', '#ff8800', '#F80', and '#f80' are equivalent.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.

Color NameShort NameRGB TripletHexadecimal Color CodeAppearance
'red''r'[1 0 0]'#FF0000'

'green''g'[0 1 0]'#00FF00'

'blue''b'[0 0 1]'#0000FF'

'cyan' 'c'[0 1 1]'#00FFFF'

'magenta''m'[1 0 1]'#FF00FF'

'yellow''y'[1 1 0]'#FFFF00'

'black''k'[0 0 0]'#000000'

'white''w'[1 1 1]'#FFFFFF'

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB® uses in many types of plots.

[0 0.4470 0.7410]'#0072BD'

[0.8500 0.3250 0.0980]'#D95319'

[0.9290 0.6940 0.1250]'#EDB120'

[0.4940 0.1840 0.5560]'#7E2F8E'

[0.4660 0.6740 0.1880]'#77AC30'

[0.3010 0.7450 0.9330]'#4DBEEE'

[0.6350 0.0780 0.1840]'#A2142F'

Example: 'blue'

Example: [0 0 1]

Example: '#0000FF'

Line style, specified as one of the options listed in this table.

Line StyleDescriptionResulting Line
'-'Solid line

'--'Dashed line

':'Dotted line

'-.'Dash-dotted line

'none'No lineNo line

Line width, specified as a positive value in points, where 1 point = 1/72 of an inch. If the line has markers, then the line width also affects the marker edges.

The line width cannot be thinner than the width of a pixel. If you set the line width to a value that is less than the width of a pixel on your system, the line displays as one pixel wide.

Marker symbol, specified as one of the values listed in this table. By default, the object does not display markers. Specifying a marker symbol adds markers at each data point or vertex.

ValueDescription
'o'Circle
'+'Plus sign
'*'Asterisk
'.'Point
'x'Cross
'_'Horizontal line
'|'Vertical line
'square' or 's'Square
'diamond' or 'd'Diamond
'^'Upward-pointing triangle
'v'Downward-pointing triangle
'>'Right-pointing triangle
'<'Left-pointing triangle
'pentagram' or 'p'Five-pointed star (pentagram)
'hexagram' or 'h'Six-pointed star (hexagram)
'none'No markers

Marker outline color, specified as 'auto', an RGB triplet, a hexadecimal color code, a color name, or a short name. The default value of 'auto' uses the same color as the Color property.

For a custom color, specify an RGB triplet or a hexadecimal color code.

• An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,1]; for example, [0.4 0.6 0.7].

• A hexadecimal color code is a character vector or a string scalar that starts with a hash symbol (#) followed by three or six hexadecimal digits, which can range from 0 to F. The values are not case sensitive. Thus, the color codes '#FF8800', '#ff8800', '#F80', and '#f80' are equivalent.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.

Color NameShort NameRGB TripletHexadecimal Color CodeAppearance
'red''r'[1 0 0]'#FF0000'

'green''g'[0 1 0]'#00FF00'

'blue''b'[0 0 1]'#0000FF'

'cyan' 'c'[0 1 1]'#00FFFF'

'magenta''m'[1 0 1]'#FF00FF'

'yellow''y'[1 1 0]'#FFFF00'

'black''k'[0 0 0]'#000000'

'white''w'[1 1 1]'#FFFFFF'

'none'Not applicableNot applicableNot applicableNo color

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB uses in many types of plots.

[0 0.4470 0.7410]'#0072BD'

[0.8500 0.3250 0.0980]'#D95319'

[0.9290 0.6940 0.1250]'#EDB120'

[0.4940 0.1840 0.5560]'#7E2F8E'

[0.4660 0.6740 0.1880]'#77AC30'

[0.3010 0.7450 0.9330]'#4DBEEE'

[0.6350 0.0780 0.1840]'#A2142F'

Marker fill color, specified as 'auto', an RGB triplet, a hexadecimal color code, a color name, or a short name. The 'auto' value uses the same color as the MarkerEdgeColor property.

For a custom color, specify an RGB triplet or a hexadecimal color code.

• An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,1]; for example, [0.4 0.6 0.7].

• A hexadecimal color code is a character vector or a string scalar that starts with a hash symbol (#) followed by three or six hexadecimal digits, which can range from 0 to F. The values are not case sensitive. Thus, the color codes '#FF8800', '#ff8800', '#F80', and '#f80' are equivalent.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.

Color NameShort NameRGB TripletHexadecimal Color CodeAppearance
'red''r'[1 0 0]'#FF0000'

'green''g'[0 1 0]'#00FF00'

'blue''b'[0 0 1]'#0000FF'

'cyan' 'c'[0 1 1]'#00FFFF'

'magenta''m'[1 0 1]'#FF00FF'

'yellow''y'[1 1 0]'#FFFF00'

'black''k'[0 0 0]'#000000'

'white''w'[1 1 1]'#FFFFFF'

'none'Not applicableNot applicableNot applicableNo color

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB uses in many types of plots.

[0 0.4470 0.7410]'#0072BD'

[0.8500 0.3250 0.0980]'#D95319'

[0.9290 0.6940 0.1250]'#EDB120'

[0.4940 0.1840 0.5560]'#7E2F8E'

[0.4660 0.6740 0.1880]'#77AC30'

[0.3010 0.7450 0.9330]'#4DBEEE'

[0.6350 0.0780 0.1840]'#A2142F'

Example: [0.3 0.2 0.1]

Example: 'green'

Example: '#D2F9A7'

Marker size, specified as a positive value in points, where 1 point = 1/72 of an inch.

## Output Arguments

collapse all

One or more parameterized line objects, returned as a scalar or a vector. You can use these objects to query and modify properties of a specific parameterized line. For details, see ParameterizedFunctionLine Properties.

### Topics

Introduced in R2016a

## Support

#### Mathematical Modeling with Symbolic Math Toolbox

Get examples and videos


# How many possible passwords of a four digit length contain at least one uppercase character and at least one number?

How many possible passwords of a four digit length contain at least one uppercase character and at least one number?

• 95 total ACII Symbols
• 26 uppercase letters
• 26 lowercase letters
• 10 numbers
• 33 special characters

So I have calculated that there are $26$ possibilities for the uppercase letter digit and $10$ possibilities for the number digit and also a variation of all the other possibilites, thus:

$26 \cdot 10 \cdot |var_2([1,95])| = 26 \cdot 10 \cdot 95^2 =2 346 500$

Unfortunately this is the wrong solution. It should be $18700240$.

Question: Were is my mistake?

• Your mistake is that you counted the number of passwords where the first character is upper case, the second character is a number, and your remaining two characters are anything. You neglected to count the password "3aBc" as well as neglected to count the password "133T" etc... For a correct solution, apply inclusion-exclusion. There are $95^4$ total passwords. $(95-26)^4$ of which contain no capital letters so we remove those from the count. $(95-10)^4$ of which contain no numbers so we remove those too, but in doing so the passwords with neither got removed twice so we correct it by... – JMoravitz Mar 30 '17 at 8:44

Your mistake is that you counted the number of passwords where the first character is upper case, the second character is a number, and your remaining two characters are anything. You neglected to count the password "3aBc" as well as neglected to count the password "133T" etc...

For a correct solution, apply inclusion-exclusion. There are $95^4$ total passwords. $(95-26)^4$ of which contain no capital letters so we remove those from the count. $(95-10)^4$ of which contain no numbers so we remove those too, but in doing so the passwords with neither got removed twice so we correct it by adding that amount back in.

In more detail, let $\Omega$ be the set of passwords of length $4$ using these $96$ characters with no other restrictions. Let $A$ be the set of passwords with no capital letters. Let $B$ be the set of passwords with no numbers.

We are tasked with counting $|A^c\cap B^c|$, i.e. the set of passwords where there is at least one capital letter and there is at least one number.

By demorgan's, $A^c\cap B^c = (A\cup B)^c = \Omega\setminus(A\cup B)$

We have then by inclusion-exclusion $$|A^c\cap B^c|=|\Omega\setminus(A\cup B)|=|\Omega|-|A|-|B|+|A\cap B|$$

We find $|\Omega|=95^4$, $|A|=(95-26)^4$, $|B|=(95-10)^4$, and $|A\cap B|=(95-26-10)^4$ each by straightforward application of multiplication principle.

The final total is then

$$95^4-69^4-85^4+59^4$$

• What does the $c$ mean in $|A^c\cap B^c|$? – jublikon Mar 30 '17 at 9:38
• @jublikon the complementary set. Given a universal set $\Omega$ one has $A^c:= \{x\in\Omega~:~x\notin A\}=\Omega\setminus A$ – JMoravitz Mar 30 '17 at 9:48

For one, this does not account for the possible variations of order.

Here's a short way to compute this: Let $\Omega$ denote the set of all passwords, $U$ denote the set of passwords that include no uppercase letter, and $N$ the set of passwords that include no digit. Then, the set of passwords that include an uppercase letter and a number is $$\Omega - (N \cup C),$$ so the number of passwords satisfying the criteria is $$|\Omega - (N \cup C)| = |\Omega| - |N \cup C| .$$ Now, use the Inclusion-Exclusion principle to evaluate $|N \cup C|$.

You have worked out the number of passwords that have, say, the first characters an uppercase letter and the second character a number. This does not allow for cases where, say, our first two spaces are lowercase characters and/or special characters and our uppercase letter and number fill the last two spaces of the password.

Because the question says "at least $1$" I would immediately be drawn to considering the the compliment case i.e. The passwords with no uppercase letters, no numbers or neither uppercase letters nor numbers.

$$\text{total unrestriced passwords}=95^4$$ $$\text{passwords with no uppercase letters}=(95-26)^4=69^4$$ $$\text{passwords with no numbers}=(95-10)^4=85^4$$ $$\text{passwords with no uppercase letters or numbers}=(95-26-10)^4=59^4$$

then by the principle of inclusion-exclusion we subtract the two complement cases from the total and add back their intersection:

$$\text{desired count}=95^4-(69^4+85^4)+59^4=18\,700\,240\tag{Answer}$$


# Convergent sequences and accumulation points

I am very confused about the relationship between convergent sequences and accumulation points.

Basically, my question boils down to: if $(a_n)_{n\in N}$ is a convergent sequence in $\mathbb{R}$ then,

(1) Does the set $\{a_n\}$ have exactly one accumulation point?

(2) If so, does $(a_n)_{n\in N}$ necessarily converge to the said accumulation point?

I'm tempted to say no to (1), but I'm afraid that I'm missing something. My counter-example to (1) is $\{a_n\} = \{ 4, 3, 2, 1, 0,0,0,...\}$ (i.e. inserting $0$s after the 4th element). Then the set has no accumulation point and it converges to 0. Is that correct?

If I'm right about (1), let's assume that $\{a_n\}$ has exactly one accumulation point. Then does $(a_n)_{n\in N}$ necessarily converge to the said accumulation point?

Lastly, is it possible that $\{a_n\}$ could have more than one accumulation point?

Update:

I define accumulation point as: Let $a$ be an accumulation point of $A$. Then $\forall \ \epsilon >0$, $B_{\epsilon}(a) \setminus \{a\}$ contains an element of $A$.

• What is your definition of accumulation point? – wjm Dec 4 '17 at 5:44
• @Raptor updated. – user1691278 Dec 4 '17 at 5:57
• The situation is quite simple. If a sequence $(a_n)_{n\in\Bbb N}$ is convergent, then every accumulation point of the set $\{\, a_n\mid n\in\Bbb N\,\}$ is equal to the limit of the sequence (easy proof using an extracted sequence). This implies there is at most one accumulation point, but not that such an accumulation point exists. – Marc van Leeuwen Dec 4 '17 at 9:52

I am calling $x$ an accumulation point of the set $A$ iff $(B(x,\epsilon) \cap A)\setminus \{x\} \neq \emptyset$ for all $\epsilon>0$.

Suppose $a_n \to a$.

The set $\{a_n\}_n$ can have at most one accumulation point which would have to be $a$. If $b \neq a$, then there is some $\epsilon>0$ such that $B(b,\epsilon)$ contains a finite number of points hence $b$ cannot be an accumulation point.

Note that the sequence $a_n = 1$ has $\{a_n\}_n = \{1\}$ which has no accumulation points.

In general, the set $\{a_n\}_n$ will have $a$ as an accumulation point iff for all $N$ there is some $n \ge N$ such that $a_n \neq a$.

If $\{a_{n}\}$ has an accumulation point, say, $a$, and $(a_{n})$ is convergent. Then choose some $n_{1}$ such that $a_{n_{1}}\in B_{1}(a)-\{a\}$. Then choose some $n_{2}$ such that $B_{1/2}(a)-\{a,a_{1},...,a_{n_{1}}\}$, proceed in this way we have $a_{n_{k}}\rightarrow a$. Since $(a_{n})$ is convergent, one has $a_{n}\rightarrow a$.

Here I use the following definition:

$a$ is an accumulation point for $A$ if for every $\delta>0$, $(B_{\delta}(a)-\{a\})\cap A\ne\emptyset$.

And note that in the topology of ${\bf{R}}$, being such an accumulation point also implies that $(B_{\delta}(a)-\{a\})\cap A$ contains infinitely many points.

• If $\{a_{n}\}$ has two distinct accumulation points, say, $a$, $b$, one can find subsequences $(a_{n_{k}})$, $(a_{n_{l}})$ such that $a_{n_{k}}\rightarrow a$ and $a_{n_{l}}\rightarrow b$, a contradiction. – user284331 Dec 4 '17 at 5:54
• Your counterexample $(a_n)$ is not a convergent sequence though... – user1691278 Dec 4 '17 at 6:04
• I have edited, let's see if there is any mistake. – user284331 Dec 4 '17 at 6:13

The usual definition of an accumulation point (for a subset of $\mathbb{R}$) is as follows:

Let $A \subseteq \mathbb{R}$. We say that $a$ is an accumulation point of $A$ if for all $r > 0$ the set $B(a,r) \cap A \setminus \{a\}$ is nonempty. That is, every ball centered at $a$ contains a point of $A$ other than $a$ itself.

Even if the sequence $(a_n)$ converges, the set $\{ a_n \}$ needn't have any accumulation points. For example, any constant set $\{a, a, a, \dotsc, \} = \{a\}$ does not have any accumulation points (as no ball centered at $a$ contains any point of the set other than $a$, but the sequence $(a,a,a,\dotsc)$ converges to $a$. On the other hand, if $\{a_n\}$ has an accumulation point, and $(a_n)$ is convergent, then the accumulation point is necessarily the limit.

• Thank you. Does that mean it cannot have more than one accumulation point since limits are unique? – user1691278 Dec 4 '17 at 6:05
• In $\mathbb{R}$ with the usual topology, a convergent sequence can have at most one accumulation point, yes. As noted above, it needn't have even that. – Xander Henderson Dec 4 '17 at 14:38

Here's a somewhat more general proof of this:

Let $X$ be a Hausdorff topological space, and let $\left\{x_n\right\}_{n\in\mathbb N}$ be a sequence in $X$ that converges to $x\in X$. Suppose that $y\in X$ is an accumulation point of $\left\{x_n\right\}_{n\in\mathbb N}$ such that $x\neq y$. Then, since $X$ is Hausdorff, there are disjoint open neighborhoods $U$ and $V$ of $x$ and $y$, respectively. Since $\left\{x_n\right\}_{n\in\mathbb N}$ converges to $x$, there is an $N\in\mathbb N$ such that $x_n\in U$ whenever $n\geq N$. However, this implies that there are at most $N-1$ elements of $\left\{x_n\right\}_{n\in\mathbb N}$ in $V$ different from $y$. Denote this set of finite elements by $\left\{y_n\right\}_{n=1}^m$. Again, since $X$ is Hausdorff, there are disjoint open neighborhoods $U_n$ and $V_n$ of $y_n$ and $y$, respectively. Then $\bigcap_{n=1}^m V_n$ is an open neighborhood of $y$ containing no elements of $\left\{x_n\right\}_{n\in\mathbb N}$, which is a contradiction.

• In the context of this question, it is rather confusing to use braces to designate the sequence, especially when you then immediately use the very same notation for the set. OP rightly uses parentheses for the sequence, and braces for the set. – Marc van Leeuwen Dec 4 '17 at 9:56

Yes, you are right. If $x_n$ is a convergent sequence, then

• $\{x_n\}$ has an accumulations point if and only if $\{x_n\}$ is infinite.
• $\{x_n\}$ has at most one accumulation point and if it has one, then it coincides with the limit.

None of these statements is true for non-convergent squences.


Find a multiplicative inverse…

Find a multiplicative inverse of $a=11$ modulo $m=13$.

What is this saying?

This seems like such a simple question, I just don't understand what it is asking for.

An additional question related to this I have is:

If $a$ has a multiplicative inverse modulo $m$, explain why $\gcd(a,m)=1$.

Is this also saying $ab \equiv 1 (mod \space m)$? Do $a$ and $m$ have to be prime since the $\gcd(a,m)=1$?

Thanks again.

-

It's asking to find $b$ such that

$$ab \equiv 1 \pmod m$$

Hint: Euclidean algorithm

Edit:

Suppose that $a$ has a multiplicative inverse mod $m$. That is, there is a number $b$ such that $ab = 1 + km$ (for some $k \in \mathbb{Z}$). Hence, $ab - km = 1$.

If $a$ and $m$ have a common divisor $d$, then $d$ is a divisor of $ba − km$ and hence of 1.

Therefore $d=1$, which means that $\gcd(a,m)=1$.

And, no $a$ and $m$ don't have to be prime! Just co-prime.

-
So, for $11b \equiv 1 (mod 13)$ we get $b=6$ This doesn't seem like the multiplicative inverse. Where do I go from here? Thanks. –  student.llama Oct 16 '12 at 16:40
@student.llama No, that's it! The modular multiplicative inverse of 11 modulo 13 is 6. –  Alex Oct 16 '12 at 16:42
That is the multiplicative inverse since $$11\cdot 6=66=1+5\cdot 13=1\pmod {13}$$ –  DonAntonio Oct 16 '12 at 16:43
Oh, ok, thanks! Could you take a look at what I added to the OP, if you haven't already? –  student.llama Oct 16 '12 at 16:47
@student.llama See my edit :) –  Alex Oct 16 '12 at 16:59

$11^2=121\equiv 4\pmod{13}$

$11^3\equiv4\cdot 11\equiv 5$

$11^4=(11^2)^2\equiv 4^2=16\equiv 3$

$11^5\equiv3\cdot11=33\equiv 7$

$11^6\equiv7\cdot 11= 77=-1$

$\implies 11\cdot 11^5\equiv-1\implies (11)^{-1}\equiv -11^5\equiv -7\equiv 6\pmod{13}$

Alternatively, using convergent property of continued fraction,

$\frac{13}{11}=1+\frac 2{11}=1+\frac1{\frac{11}2}=1+\frac1{5+\frac12}$

So, the last but one convergent is $1+\frac15=\frac 6 5$

So, $11\cdot 6-13\cdot 5=66-65=1\implies 11\cdot 6\equiv 1\pmod{13}$ $\implies (11)^{-1}\equiv 6\pmod{13}$

-


# Need help with the general formula for the Taylor series of $e^x+\sin(x)$

A while ago, I asked about ways to derive the sigma notation for the infinite series of $$e^x+sin(x)$$.

$$e^x+\sin(x) = 1+2x+\dfrac{x^2}{2!}+\dfrac{x^4}{4!}+\dfrac{2x^5}{5!}+\dfrac{x^6}{6!}+\dfrac{x^8}{8!}+\dfrac{2x^9}{9!}+...$$

Clive Newstead brilliantly gave me two formulas.

There, he said that the pattern of the series, regarding the coefficient of the numerators, is as followed: 1,2,1,0,1,2,1,0

He said that the pattern is "is periodic with period 4"

This comment still puzzles me. I have tried to validate his formula and it is true, they are all correct, but I don't know why he can come up with succinct representation of the pattern:

$$\sum_{k=0}^{\infty} \left( \dfrac{x^{4k}}{(4k)!} + \dfrac{2x^{4k+1}}{(4k+1)!} + \dfrac{x^{4k+2}}{(4k+2)!} \right)$$

How does one realize that the power is related to $$4k, 4k+1$$ and $$4k+2$$ and $$4k+3$$?

This seems to relate to finding the general formula for a sequence or series of number, for example, trivially

$$1, 3, 5, 7, ...$$ can be represented as $$2k+1$$

$$0, 2, 4, 6, ...$$ can be represented as $$2k$$

with $$k$$ as the position of the term in the sequence.

So my thought is you to count the terms that have the numerator's coefficient as $$1$$, $$2$$ and $$0$$

The ones that have $$1$$ is $$1^{st}$$, $$3^{sd}$$, $$5^{th}$$, $$7^{th}$$, etc.

The ones that have $$2$$ is $$2^{sd}$$, $$6^{th}$$, $$10^{th}$$, $$14^{th}$$, etc.

The ones that have $$0$$ is $$4^{th}$$, $$8^{th}$$, $$12^{th}$$, $$16^{th}$$, etc.

So the difference between the positions of the terms that contain the coefficient $$1$$ is $$2$$

So the difference between the positions of the terms that contain the coefficient $$2$$ is $$4$$

So the difference between the positions of the terms that contain the coefficient $$0$$ is $$4$$

I find that the general term for terms that contain $$1$$ is $$2k+1$$

I find that the general term for terms that contain $$2$$ is $$4k-2$$

I find that the general term for terms that contain $$0$$ is $$4k$$

But I don't know how to derive these into $$4k$$, $$4k+1$$, $$4k+2$$, $$4k+3$$

I realize that this is similar to finding patterns of a sequence on an IQ test, but I don't know how to derive it. One my friend said I should look into Lagrange's interpolation, but I don't why this technique has anything to do with writing down the general terms for sequences and series.

Could you help me on this?

Methinks, this is a simple question. I am not good at writing down general term of a sequence yet.

• note that the coefficients of the Maclaurin series for $\sin x$ are periodic with period $4$ – J. W. Tanner Jan 24 at 22:33
• The general formula for $\sin(x)$ is $$\sum_{k=0}^{\infty}\dfrac{x^{2n+1}}{(2n+1)!}$$, the coefficients of the numerators are all ones, so I don't quite understand what are you trying to say? Sorry, could you clarify more? – James Warthington Jan 24 at 23:17
• I realize that he breaks terms that contain $1$ in the numerators into 2, $4k$ and $4k+2$, quite clever. – James Warthington Jan 24 at 23:23
• @JamesWarthington: That is the formula for $\sinh x$, not $\sin x$. – TonyK Jan 24 at 23:39
• Yeah, thanks, I forgot to add $(-1)^{n}$ – James Warthington Jan 24 at 23:44

$$e^x = 1 + x + \frac {x^2}{2} + \frac {x^3}{3!} + \cdots$$

It seem pretty natural to write this as
$$e^x = \sum_\limits{n=0}^\infty \frac {x^n}{n!}$$

But we could look at pairs of terms.

$$e^x = \sum_\limits{n=0}^\infty \left(\frac {x^{2n}}{2n!}+\frac {x^{2n+1}}{(2n+1)!}\right)$$

Or, even triples of terms.

$$e^x = \sum_\limits{n=0}^\infty \left(\frac {x^{3n}}{3n!}+\frac {x^{3n+1}}{(3n+1)!}+\frac {x^{3n+2}}{(3n+3)!}\right)$$

And do the same thing with $$\sin x$$

$$\sin x = \sum_\limits{n=0}^\infty (-1)^n \frac {x^{2n+1}}{(2n+1)!} = \sum_\limits{n=0}^\infty \left(\frac {x^{4n+1}}{(4n+1)!} - \frac {x^{4n+3}}{(4n+3)!}\right)$$

Now find a representation of $$e^x$$ that plays nicely with our representation of $$\sin x$$ add them together and you have what you show above.

• Thanks, very instructive.I've understood! – James Warthington Jan 24 at 23:34

Remember that for the series centered around the point b, the coefficient $$a_{n} = \frac{f^{(n)}(b)}{n!}$$. So if $$f^{(4)}(x) = f(x)$$ then $$f^{(n)}(b)$$ is periodic with not necessarily prime period 4.

This is why you can be sure that the $$f^{(n)}(b)$$ is periodic with period 4 in your case.

Let $$f(x) = e^{x}$$, then $$f'(x) = e^{x}$$, and so continuing to take derivatives $$f^{(4)}(x)=e^{x}$$.

Let $$g(x) = sin(x)$$ then $$g''(x)=-sin(x)$$ and so $$g^{(4)}(x) = sin(x)$$

So for $$h(x)=f(x) + g(x)$$ we have $$h^{(4)}(x) = (f(x)+g(x))'''' = f^{(4)}(x) + g^{(4)}(x) = f(x) + g(x) = h(x)$$.

In this way you can see that the $$f^{(n)}(b)$$ has the period 4 structure.

• What if, by continuously taking the derivatives, the function we are dealing with do not have periodic derivatives? For example $\tan(x)$? – James Warthington Jan 25 at 0:06
• Insightful comment, thank you, BTW! :) – James Warthington Jan 25 at 0:07
• @JamesWarthington Then the coefficients will likely not have this periodic form, Of course what they do will depend on the function you are working with, they could still have some sort of pattern. – open problem Jan 25 at 0:09
• So I guess it is not always possible to write a general formula for all power series? Am I correct? Or is it otherwise? – James Warthington Jan 25 at 0:11
• To do so you will need a formula for the evaluation of the nth derivative of the function at the point you have centered your power series around. – open problem Jan 25 at 0:14

The mod $$4$$ periodicity can perhaps be most easily understood using the formula $$e^{ix}=\cos x+i\sin x$$, so that $$\sin x={e^{ix}-e^{-ix}\over2i}$$, which gives

$$e^x+\sin x={1\over2i}\sum_{n=0}^\infty{(2i+i^n-(-i)^n)x^n\over n!}$$

Since $$i^4=1$$, the coefficients $$2i+i^n-(-i)^n$$ cycle through the values

\begin{align} 2i+i^0-(-i)^0&=2i+1-1=2i\\ 2i+i^1-(-i)^1&=2i+i-(-i)=4i\\ 2i+i^2-(-i)^2&=2i-1-(-1)=2i\\ 2i+i^3-(-i)^3&=2i-i-i=0 \end{align}


# How to Handle Stronger Induction Hypothesis - Strong Induction

I'm having trouble understanding strong induction proofs

I understand how to do ordinary induction proofs and I understand that strong induction proofs are the same as ordinary with the exception that you have to assume that the theorem holds for all numbers up to and including some $n$ (starting at the base case) then we try and show: theorem holds for $n+1$.

How do you show this exactly.

Here is a proof by induction:

Thm: $n≥1, 1+6+11+16+\dots+(5n-4) = (n(5n-3))/2$

Proof (by induction)

Basis step: for $n=1: 5-4=(5-3)/2 \Rightarrow 1=1$. The basis step holds

Induction Step: Suppose that for some integer $k≥1$, $$1+6+11+16+...+(5k-4) = \frac{k(5k-3)}{2} \qquad\text{(inductive hypothesis)}$$

Want to show: $$1+6+11+16+...+(5k-4)+(5(k+1)-4) = \frac{(k+1)(5(k+1)-3)}{2}$$ so $$\frac{k(5k-3)}{2} + (5(k+1)-4) = \frac{(k+1)(5(k+1)-3)}{2}$$

then you just show that they are equal.

So how can I do the same proof using strong induction? What are the things I need to add/change in order for this proof to be a strong induction proof?

You wrote:

i understand how to do ordinary induction proofs and i understand that strong induction proofs are the same as ordinary with the exception that you have to show that the theorem holds for all numbers up to and including some n (starting at the base case) then we try and show: theorem holds for $n+1$

No, not at all: in strong induction you assume as your induction hypothesis that the theorem holds for all numbers from the base case up through some $n$ and try to show that it holds for $n+1$; you don’t try to prove the induction hypothesis.

In your example the simple induction hypothesis that the result is true for $n$ is already enough to let you prove that it’s true for $n+1$, so there’s neither need nor reason to use a stronger induction hypothesis. The proof by ordinary induction can be seen as a proof by strong induction in which you simply didn’t use most of the induction hypothesis.

I suggest that you read this question and my answer to it and see whether that clears up some of your confusion; at worst it may help you to pinpoint exactly where you’re having trouble.

Added: Here’s an example of an argument that really does want strong induction. Consider the following solitaire ‘game’. You start with a stack of $n$ pennies. At each move you pick a stack that has at least two pennies in it and split it into two non-empty stacks; your score for that move is the product of the numbers of pennies in the two stacks. Thus, if you split a stack of $10$ pennies into a stack of $3$ and a stack of $7$, you get $3\cdot7=21$ points. The game is over when you have $n$ stacks of one penny each.

Claim: No matter how you play, your total score at the end of the game will be $\frac12n(n-1)$.

If $n=1$, you can’t make any move at all, so your final score is $0=\frac12\cdot1\cdot0$, so the theorem is certainly true for $n=1$. Now suppose that $n>1$ and the theorem is true for all positive integers $m<n$. (This is the strong induction hypothesis.) You make your first move; say that you divide the pile into a pile of $m$ pennies and another pile of $n-m$ pennies, scoring $m(n-m)$ points. You can now think of the rest of the game as splitting into a pair of subgames, one starting with $m$ pennies, the other with $n-m$.

Since $m<n$, by the induction hypothesis you’ll get $\frac12m(m-1)$ points from the first subgame. Similarly, $n-m<n$, so by the induction hypothesis you’ll get $\frac12(n-m)(n-m-1)$ points from the second subgame. (Note that the two subgames really do proceed independently: the piles that you create in one have no influence on what you can do in the other.)

Your total score is therefore going to be

$$m(n-m)+\frac12m(m-1)+\frac12(n-m)(n-m-1)\;,$$

which (after a bit of algebra) simplifies to $\frac12n(n-1)$, as desired, and the result follows by (strong) induction.

• A question related to "No, not at all: in strong induction you ... from the base case up through some n ...". Agree with this statement, but I usually see proofs describing it without considering the base case, for example: "Assume $P(x)$ holds $\forall x, x\le i$", so strictly speaking this kind of statement is incorrect? (The correct one should change the range to $b\le x\le i$, where $b$ is the base?) Jul 23, 2019 at 8:19
• Nice strong induction example! But BTW here is (IMHO) an even nicer non-induction solution. Model the coins as the vertices of a graph, two vertices adjacent iff the coins are in the same stack. Initially all coins are in one stack so we have the complete graph on $n$ vertices. Splitting into stacks of say $a$ and $b$ coins means removing all the edges between the remaining graphs $K_a$ and $K_b$; the number of edges removed is $ab$, which is the score for this step. Completing the process means removing all $n(n-1)/2$ original edges, so this is the final score. Apr 28 at 7:43
• @David: That is indeed an elegant solution. And a student who looks closely can even see the structure of the strong induction proof in a sense ‘hiding’ in it: it could be recast as essentially the same induction, but in this form we can actually see the inevitable end result without having to go through the induction. Apr 28 at 17:23
• Thanks @Brian! The graph theory solution also makes it clear why the score for a move (in a sense) has to be the product in order for this problem to work. Apr 28 at 22:57


# How do I solve $x^4 -2x^3-6x^2-2x+1=0$? [closed]

$$x^4 -2x^3-6x^2-2x+1=0$$ $\left[\text{Hint let } v = x + \frac{1}{x}\right]$

I am stumped, and have no idea how to proceed. I have tried solving it, but have had no success.

P.S: This question is meant to be solved, using only techniques for solving quadratic equations.

• Do you mean "find the roots" or something like that? Have you searched for rational roots? Note: there is an obvious rational root. – lulu Jul 22 '17 at 15:56
• – lab bhattacharjee Jul 22 '17 at 15:57
• Ok, now there is a question. In which case my hint is valid, and there is no need for the substitution. – lulu Jul 22 '17 at 15:59
• Doesn't "solve" mean "find the roots"? A difference in language? – Tobi Alafin Jul 22 '17 at 16:38
• A simplistic way to find the roots is to graph the polynomial, look to see if there are any obvious rational roots, then divide the polynomial by the factors corresponding to rational roots ($x+1$ in this case). Repeat as many times as you can. – Χpẘ Jul 22 '17 at 19:07

I think you meant for $$x^4 -2x^3-6x^2-2x+1=0$$

Obviously $x=0$ is not a solution. So we divide by $x^2$ and get

$$x^2 -2x-6-2x^{-1}+x^{-2}=0$$ $$(x^2+2+x^{-2}) - 2(x+x^{-1}) -8=0$$ $$v^2-2v-8=0$$ $$(v-4)(v+2)=0$$

• Thanks for the pointer. :) – Tobi Alafin Jul 22 '17 at 16:39
• @TobiAlafin you're welcome :) – Yujie Zha Jul 22 '17 at 17:15
• I'm just curious: how did you know to divide by $x^2$? Obviously the $v$ contained a $x^{-1}$ term, but one could make that pattern appear in a variety of ways… – gen-ℤ ready to perish Jul 24 '17 at 7:36
• @ChaseRyanTaylor Just observed that equation has $x$ interns with power of 4,3,2,1,0, and thus it would make it symmetrical to divide by $x^2$ and make it to be $x$ items with power of 2,1,0,-1,-2.. – Yujie Zha Jul 24 '17 at 11:05
• Care explaining the downvote? – Yujie Zha Jul 24 '17 at 12:45

since $x=0$ is not a solution we can divide by $x^2$ $$x^2+\frac{1}{x^2}-2\left(x+\frac{1}{x}\right)-6=0$$ and no set $$t=x+\frac{1}{x}$$ then you will get $$t^2=x^2+\frac{1}{x^2}+2$$ and $$t^2-2=x^2+\frac{1}{x^2}$$ and you have to solve $$t^2-2t-8=0$$

I would not bother with the substitution. The only possible rational roots are $\pm 1$ and it is easy to check that $-1$ works. A quick calculation shows that your polynomial is $$(x + 1)^2 \,(x^2 - 4 x + 1)$$ and we are done.

• Aren't solutions generally defined on $\mathbb{R}$, and not on $\mathbb{Q}$? – Tobi Alafin Jul 22 '17 at 17:29
• Not following. I imagined you were looking for complex solutions, no? In any case, searching for rational solutions is a very easy and natural first step...as that solves the problem entirely (well, up to a trivial quadratic) then I don't see any point in looking for a more elaborate solution. – lulu Jul 22 '17 at 17:35
• To be clear: there was no a priori reason why searching for rational roots should have solved the problem. But then, there was no a priori reason why this particular substitution should have solved it. For what it's worth: In general, there is a closed formula for the roots of quartics (granted, it isn't very nice). – lulu Jul 22 '17 at 17:42

$x^4 -2x^3-6x^2-2x+1=0$

Divide all terms by $x^2$

$x^2-2x-6-\dfrac{2}{x}+\dfrac{1}{x^2}=0$

Rearrange in this way

$\left(x^2+\dfrac{1}{x^2}\right)-2\left(x+\dfrac{1}{x}\right)-6=0$

Now set $v=x+\dfrac{1}{x}$

squaring you get

$v^2=x^2+\dfrac{1}{x^2}+2\to x^2+\dfrac{1}{x^2}=v^2-2$

Plug in the equation

$v^2-2 -2v -6=0\to v^2-2v-8=0\to v_1=4;\;v_2=-2$

As we want to solve for $x$ two more steps

For $v=4\to x+\dfrac{1}{x}=4 \to x^2-4x+1=0 \to x= 2\pm\sqrt{3}$

for $v=-2\to x+\dfrac{1}{x}=-2\to x^2+2x+1\to x=-1$

Sometimes you can add and subtract the right thing and land in Pascal's triangle. The 4th row of Pascal's triangle is $1 4 6 4 1$, so add and subtract $6x^2+12x^2+6x$ to get

$$x^4+4x^3+6x^2+4x+1 - 6x^3-12x^2-6x = 0$$

or

$$(x+1)^4 - 6x(x+1)^2=0.$$

Factor out $(x+1)^2$ to get

$$(x+1)^2((x+1)^2 - 6x) = 0$$

or $$(x+1)^2(x^2-4x+1)=0.$$


# how many unique patterns exist for a $N\times N$ grid

I'm trying to figure out if there is a way to determine how many unique patterns exist for a given $N\times N$ grid if you choose N points on the grid. For example, for a $2\times 2$ grid we can get two unique patterns from the six possible combinations. The rest are just rotations and mirrors of the two unique patterns below

[x] [x]

[ ] [ ]

and

[x] [ ]

[ ] [x]

Is there a mathematical way of determining a unique number of patterns for a NxN grid where N=3,4,5,6,7,8?

I figured for a 3x3, there are 14 unique patterns for picking 3 random points on the grid, but it gets tedious after that.

N:   N^2 : N^2 Choose N Unique pattern
2    4     6            2
3    9     84           14
4    16    1820         ????
5    25    53130        ????
6    36    1947792      ????
7    49    85900584     ????

• one must choose $N$ points on a binary grid? – nbubis Nov 17 '13 at 4:46
• yes, forgot to add that in – user109380 Nov 17 '13 at 4:52
• Are you familiar with group theory? Polya enumeration could be the way to go here. – Gerry Myerson Nov 17 '13 at 5:26

We can actually do a bit more and compute the cycle index $Z(G_N)$ for general $N$, where we have to distinguish between $N$ even and $N$ odd. This will permit lookup in the OEIS, which in turn leads to more material about this interesting problem.

We proceed to enumerate the permutations of $G_N$ by their cycle structure. For $N$ even, we get the identity, which contributes $$a_1^{N^2}.$$ There is a vertical reflection, which contributes $$a_2^{N^2/2},$$ the same for a horizontal reflection, i.e. $$a_2^{N^2/2}.$$ The reflection in the rising diagonal contributes $$a_1^N a_2^{(N^2-N)/2},$$ the same for the other diagonal, i.e. $$a_1^N a_2^{(N^2-N)/2}.$$

What remains are the rotations. Two of these contribute (recall that $N$ is even) $$2\times a_4^{N^2/4}$$ and one of them, $$a_2^{N^2/2}.$$ This gives for even $N$ the cycle index $$Z(G_N) = \frac{1}{8} \left( a_1^{N^2} + 3 a_2^{N^2/2} + 2 a_1^N a_2^{(N^2-N)/2} + 2 a_4^{N^2/4}\right).$$ For $N$ odd, we get the identity, which is $$a_1^{N^2}.$$ The two reflections now contribute $$2\times a_1^N a_2^{(N^2-N)/2}.$$ The reflection in the two diagonals are unchanged and contribute $$2\times a_1^N a_2^{(N^2-N)/2}$$ What remains is the rotations, two of which have cycle structure $$2\times a_1 a_4^{(N^2-1)/4}$$ and the last one has cycle structure $$a_1 a_2^{(N^2-1)/2}.$$

This gives for odd $N$ the cycle index $$Z(H_N) = \frac{1}{8} \left( a_1^{N^2} + 4 a_1^N a_2^{(N^2-N)/2} + 2 a_1 a_4^{(N^2-1)/4}+a_1 a_2^{(N^2-1)/2}\right).$$ Evidently for $N$ marks being placed on the grid we seek to compute $$[z^N] Z(G_N)(1+z) \quad\text{and}\quad [z^N] Z(H_N)(1+z),$$ alternating between the two for $N$ even and $N$ odd.

This produces the sequence $$1, 2, 16, 252, 6814, 244344, 10746377, 553319048, 32611596056, 2163792255680,\ldots$$ which is A019318 from the OEIS.

Here is the Maple program that was used to compute these cycle indices.

with(numtheory);
with(group):
with(combinat):

pet_varinto_cind :=
proc(poly, ind)
local subs1, subs2, polyvars, indvars, v, pot, res;

res := ind;

polyvars := indets(poly);
indvars := indets(ind);

for v in indvars do
pot := op(1, v);

subs1 :=
[seq(polyvars[k]=polyvars[k]^pot,
k=1..nops(polyvars))];

subs2 := [v=subs(subs1, poly)];

res := subs(subs2, res);
od;

res;
end;

G :=
proc(N)
if type(N,odd) then return FAIL; fi;

1/8*(a[1]^(N^2)+3*a[2]^(N^2/2)+
2*a[1]^N*a[2]^((N^2-N)/2) + 2*a[4]^(N^2/4));
end;

H :=
proc(N)
if type(N,even) then return FAIL; fi;

1/8*(a[1]^(N^2)+4*a[1]^N*a[2]^((N^2-N)/2)+
a[1]*a[2]^((N^2-1)/2) + 2*a[1]*a[4]^((N^2-1)/4));
end;

v :=
proc(N)
option remember;
local p, k, gf;

if type(N, even) then
gf := expand(pet_varinto_cind(1+z, G(N)));
else
gf := expand(pet_varinto_cind(1+z, H(N)));
fi;

coeff(gf, z, N);
end;

Here is another interesting MSE cycle index computation I. This MSE cycle index computation II is relevant also.

• I want to ask about the notation $Z(G_N)(1+z).$ I assume this means that $a_1$ gets replaced by $1+z,$ $a_2$ gets replaced by $1+z^2,$ and $a_4$ gets replaced by $1+z^4,$ but I wanted to double check. – Will Orrick Jan 1 '14 at 15:27
• That is correct. Wikipedia has useful data on this: Cycle Index and Polya Enumeration Theorem. – Marko Riedel Jan 1 '14 at 15:46

You're looking for the number of orbits of the dihedral group $D_N$ acting on the $N\times N$ grid with $N$ chosen cells. (Caution: This group is often expressed as $D_{2N}$ as it has $2N$ elements.)

You want to use the Cauchy-Frobenius-Burnside Lemma (aka Burnside Lemma, aka "Not Burnside Lemma") to compute this. That is, you have a group action of $D_N$ on the set $\Omega$ of all such patterns ($N\times N$ grids with $N$ marked cells), and the number of orbits in this action (which is what you want) is then given by $$\frac{1}{2N}\sum_{g\in G} |\Omega^g|$$ where $|\Omega^g|$ is the number of elements in $\Omega$ fixed by $g$.

• and I agree with Gerry (above) that Polya enumeration is an efficient way of doing this. (See also, cycle index.) – Doc Nov 17 '13 at 6:03
• For the uninitiated (and probably the OP as well), would you like to present the final formula? – nbubis Nov 17 '13 at 6:34
• @nbubis, by "formula" I'm interpreting that you mean a closed form for the answer. I doubt this is even possible. However, your comment inspired me to cook up an example (below) that hopefully clarifies most of the procedure. – Doc Nov 17 '13 at 16:50

Consider the action of the group $G$ on a set $\Omega$ of cardinality $n$. The cycle index of $(G,\Omega)$ is the polynomial defined by $$Z_G(X_1,X_2,\dots, X_n)=\frac{1}{|G|} \sum_{g\in G} X_1^{c_1(g)}X_2^{c_2(g)}\cdots X_n^{c_n(g)}$$ where $c_i(g)$ denotes the number of $i$-cycles in the cycle decomposition of the element $g$ acting on $\Omega$.

For example, if we consider the action of $D_4$ on the square, we would first label the vertices of the square by $\{1,2,3,4\}$ in some order. Let's do this in cyclic clockwise order, starting from the upper left corner. Then we get the following table. \begin{array}{c|c|c} g & \mbox{permutation} & \mbox{cycle index term}\\ \hline \mbox{identity} & (1)(2)(3)(4) & X_1^4 \\ 90^o \mbox{rotation} & (1,2,3,4) & X_4^1 \\ 180^o \mbox{rotation} & (1,3)(2,4) & X_2^2 \\ 270^o \mbox{rotation} & (1,4,3,2) & X_4^1 \\ \mbox{horizontal reflection} & (1,4)(2,3) & X_2^2\\ \mbox{vertical reflection} & (1,2)(3,4) & X_2^2\\ \mbox{diagonal reflection} & (1,3)(2)(4) & X_1^2X_2\\ \mbox{opposite diag reflection} & (2,4)(1)(3)& X_1^2X_2 \end{array}

Thus we obtain as cycle index $$Z_G(X_1,X_2,\dots, X_n)=\frac{1}{8}(X_1^4 + 2X_1^2X_2+3X_2^2+2X_4).$$

Now consider $$Z_G(b+1,b^2+1,b^3+1,b^4+1).$$ The coefficient of $b^i$ will give the number (up to isomorphism!) of positions in which there are precisely $i$ marked squares. Returning to the grid problem, we are only interested in the coefficient of the $b^2$ term. This turns out to be $\frac{1}{8}(16) = 2$.

Here's an answer that leads to explicit formulas whose most complicated term is a sum over a product of binomial coefficients. I haven't yet made any attempt to connect it to the excellent solutions in the answers given earlier.

First some notation. The dihedral group of the square, $D_4,$ has elements $\{e,\rho,\rho^2,\rho^3,h,v,d_1,d_2\},$ where $e$ is the identity, $\rho$ is the $90^\circ$ rotation, $h$ is the reflection about the horizontal axis, $v$ is the reflection about the vertical axis, $d_1$ is the reflection about the forward diagonal, and $d_2$ is the reflection about the backward diagonal.

(Added: Having never learned Pólya enumeration properly, I made my answer overly complicated. I leave my previous answer, but add a more direct route to equation (**) which appears below. In this problem we have $D_4$ acting on the set $X,$ consisting of the $\binom{n^2}{n}$ ways of coloring $n$ small squares in the $n\times n$ grid black, leaving the remaining squares white. The orbit counting theorem leads immediately to (**) since $$K(n)=\lvert\mathcal{O}\rvert=\frac{1}{8}\sum_{g\in D_4}C(n,n,\langle g\rangle)$$ is identical to (**) when one realizes that $\langle\rho\rangle=\langle\rho^3\rangle=C_4.$ The orbit counting theorem is described in many places. For convenience I've appended some background information about it to the end of this post.)

Since the order of $D_4$ is $8,$ all subgroups are of order $1,$ $2,$ $4,$ or $8.$ Either of the two elements of order $4,$ $\rho$ and $\rho_3,$ generates $C_4,$ the rotation group of the square. Each of the five elements of order $2$, $\rho^2,$ $h,$ $v,$ $d_1,$ and $d_2,$ generates a subgroup of order $2.$ There are two additional subgroups of order $4,$ isomorphic to $C_2\times C_2.$ They are $\{e,\rho^2,h,v\}$ and $\{e,\rho^2,d_1,d_2\}.$ Any other group generated by two elements of order $2$ is all of $D_4.$

There are therefore $10$ subgroups with inclusions given by the following Hasse diagram.

Define $C(n,b,G)$ to be the set of configurations of the $n\times n$ grid with $b$ marked squares that are invariant under the group $G.$ We are ultimately interested in $b=n,$ but will start out with slightly greater generality. Define $\overline{C}(n,b,G)$ to be the subset of $C(n,b,G)$ consisting of elements that are not invariant under any group that properly contains $G.$ The number we wish to compute, which we denote $K(n),$ is \begin{aligned} (*)\quad K(n)=&\frac{\lvert\overline{C}(n,n,D_4)\rvert}{1}+\frac{\lvert\overline{C}(n,n,\{e,\rho^2,h,v\})\rvert}{2}+\frac{\lvert\overline{C}(n,n,C_4)\rvert}{2}+\frac{\lvert\overline{C}(n,n,\{e,\rho^2,d_1,d_2\})\rvert}{2}\\ &+\frac{\lvert\overline{C}(n,n,\{e,h\})\rvert}{4}+\frac{\lvert\overline{C}(n,n,\{e,v\})\rvert}{4}+\frac{\lvert\overline{C}(n,n,\{e,\rho^2\})\rvert}{4}+\frac{\lvert\overline{C}(n,n,\{e,d_1\})\rvert}{4}\\ &+\frac{\lvert\overline{C}(n,n,\{e,d_2\})\rvert}{4}+\frac{\lvert\overline{C}(n,n,\{e\})\rvert}{8}. \end{aligned}

(Added: The set $C(n,n,G)$ is the set of colorings whose stabilizer contains $G,$ while $\overline{C}(n,n,G)$ is the set of colorings whose stabilizer equals $G.$ The formula (*) for $K(n),$ the number of orbits, comes from counting each coloring with a weight equal to the reciprocal of the size of its orbit, the weight having been computed using the orbit-stabilizer theorem. (See the end of the post.) For example, if $x$ has stabilizer $D_4,$ then the weight is $1/1=8/8;$ if $x$ has stabilizer $\{e,\rho^2,h,v\},$ then the weight is $1/2=4/8.$ Of course, as noted above, the use of (*) and the inclusion-exclusion argument below is rendered superfluous by the use of the orbit counting theorem. It is interesting that although (*) involves all ten subgroups of $D_4,$ the final expression (**) involves only the seven cyclic subgroups. My naive derivation does not explain this, but the orbit counting theorem makes it manifest that that must be the case.)

From the diagram, we obtain expressions for the $\overline{C}(n,b,G)$ in terms of the $C(n,b,G):$ \begin{aligned} \lvert\overline{C}(n,b,D_4)\rvert&=\lvert C(n,b,D_4)\rvert\\ \vert\overline{C}(n,b,\{e,\rho^2,h,v\})\rvert&=\lvert C(n,b,\{e,\rho^2,h,v\})\rvert- \lvert C(n,b,D_4)\rvert\\ \vert\overline{C}(n,b,C_4)\rvert&=\lvert C(n,b,C_4)\rvert- \lvert C(n,b,D_4)\rvert\\ \vert\overline{C}(n,b,\{e,\rho^2,d_1,d_2\})\rvert&=\lvert C(n,b,\{e,\rho^2,d_1,d_2\})\rvert- \lvert C(n,b,D_4)\rvert\\ \vert\overline{C}(n,b,\{e,h\})\rvert&=\lvert C(n,b,\{e,h\})\rvert- \lvert C(n,b,\{e,\rho^2,h,v\})\rvert\\ \vert\overline{C}(n,b,\{e,v\})\rvert&=\lvert C(n,b,\{e,v\})\rvert- \lvert C(n,b,\{e,\rho^2,h,v\})\rvert\\ \vert\overline{C}(n,b,\{e,d_1\})\rvert&=\lvert C(n,b,\{e,d_1\})\rvert- \lvert C(n,b,\{e,\rho^2,d_1,d_2\})\rvert\\ \vert\overline{C}(n,b,\{e,d_2\})\rvert&=\lvert C(n,b,\{e,d_2\})\rvert- \lvert C(n,b,\{e,\rho^2,d_1,d_2\})\rvert\\ \vert\overline{C}(n,b,\{e,\rho^2\})\rvert&=\lvert C(n,b,\{e,\rho^2\})\rvert- \lvert \overline{C}(n,b,\{e,\rho^2,h,v\})\rvert- \lvert \overline{C}(n,b,C_4)\rvert\\ &\quad- \lvert \overline{C}(n,b,\{e,\rho^2,d_1,d_2\})\rvert- \lvert \overline{C}(n,b,D_4)\rvert\\ &=\lvert C(n,b,\{e,\rho^2\})\rvert- \lvert C(n,b,\{e,\rho^2,h,v\})\rvert- \lvert C(n,b,C_4)\rvert\\ &\quad- \lvert C(n,b,\{e,\rho^2,d_1,d_2\})\rvert+2 \lvert C(n,b,D_4)\rvert\\ \vert\overline{C}(n,b,\{e\})\rvert&=\lvert C(n,b,\{e\})\rvert- \lvert \overline{C}(n,b,\{e,h\})\rvert- \lvert \overline{C}(n,b,\{e,v\})\rvert- \lvert \overline{C}(n,b,\{e,\rho^2\})\rvert\\ &\quad- \lvert \overline{C}(n,b,\{e,d_1\})\rvert- \lvert \overline{C}(n,b,\{e,d_2\})\rvert- \lvert \overline{C}(n,b,\{e,\rho^2,h,v\})\rvert\\ &\quad- \lvert \overline{C}(n,b,C_4)\rvert- \lvert \overline{C}(n,b,\{e,\rho^2,d_1,d_2\})\rvert- \lvert \overline{C}(n,b,D_4)\rvert\\ &=\lvert C(n,b,\{e\})\rvert- \lvert C(n,b,\{e,h\})\rvert- \lvert C(n,b,\{e,v\})\rvert- \lvert C(n,b,\{e,\rho^2\})\rvert\\ &\quad- \lvert C(n,b,\{e,d_1\})\rvert- \lvert C(n,b,\{e,d_2\})\rvert+2\lvert C(n,b,\{e,\rho^2,h,v\})\rvert\\ &\quad+2\lvert C(n,b,\{e,\rho^2,d_1,d_2\})\rvert \end{aligned} These imply that \begin{aligned} (**)\quad K(n)=&\frac{\lvert C(n,n,C_4)\rvert}{4}+\frac{\lvert C(n,n,\{e,h\})\rvert}{8}+\frac{\lvert C(n,n,\{e,v\})\rvert}{8}+\frac{\lvert C(n,n,\{e,\rho^2\})\rvert}{8}\\ &+\frac{\lvert C(n,n,\{e,d_1\})\rvert}{8}+\frac{\lvert C(n,n,\{e,d_2\})\rvert}{8}+\frac{\lvert C(n,n,\{e\})\rvert}{8}. \end{aligned}

It remains to compute the quantities $C(n,b,G)$ for the seven groups that appear in the expression above. (Added: It is usual in Pólya enumeration at this point to use the cycle index and generating function techniques. My more bare-handed approach yields the final expressions in a fairly direct fashion.) We have $$C(n,b,\{e\})=\binom{n^2}{b}.$$ In general, the counting depends on whether $n$ is even or odd. If $n$ is odd, then the action of $C_4$ fixes the center square; every other square has an orbit of size $4.$ Therefore, a configuration that is invariant under the action of $C_4$ is specified by choosing the markings of the center square and of one square from each of the $\frac{n^2-1}{4}$ orbits of size $4.$ (The other three squares in an orbit of size $4$ must be marked the same way as the first square.) Since the total number of marked squares must be $b,$ we have $$C(n,b,C_4)=\begin{cases}\binom{(n^2-1)/4}{b/4} & \text{if b\equiv0\pmod{4}}\\ \\ \binom{(n^2-1)/4}{(b-1)/4} & \text{if b\equiv1\pmod{4}}\\ \\ 0 & \text{otherwise.}\end{cases}$$ The center square is unmarked when $b\equiv0\pmod{4}$ and marked when $b\equiv1\pmod{4}.$ If $n$ is even then, under the action of $C_4,$ every square has an orbit of size $4.$ Therefore $$C(n,b,C_4)=\begin{cases}\binom{n^2/4}{b/4} & \text{if b\equiv0\pmod{4}}\\ \\ \binom{n^2/4}{(b-1)/4} & \text{if b\equiv1\pmod{4}}\\ \\ 0 & \text{otherwise.}\end{cases}$$ Specializing to $b=n,$ we get $$C(n,n,C_4)=\begin{cases}\binom{n^2/4}{n/4} & \text{if n\equiv0\pmod{4}}\\ \\ \binom{(n^2-1)/4}{(n-1)/4} & \text{if n\equiv1\pmod{4}}\\ \\ 0 & \text{otherwise.}\end{cases}$$

The analysis for $G=\{e,\rho^2\}$ is similar. The orbit sizes are now $2$ instead of $4,$ with the exception of the center square in the $n$ odd case, which has orbit size $1.$ The result, for $b=n,$ is $$C(n,n,\{e,\rho^2\})=\begin{cases}\binom{n^2/2}{n/2} & \text{if n even}\\ \\ \binom{(n^2-1)/2}{(n-1)/2} & \text{if n odd.}\end{cases}$$

When $G=\{e,h\}$ and $n$ is odd, the action of $G$ fixes the $n$ squares on the horizontal centerline. All other squares have orbit size $2.$ A configuration invariant under the action of $\{e,h\}$ is specified by marking $j$ of these orbits and $b-2j$ squares on the centerline. When $n$ is even, all squares have orbit size $2,$ so we need only mark $b/2$ of these orbits. The analysis when $G=\{e,v\}$ is similar. In the $b=n$ case, this gives $$C(n,n,\{e,h\})=C(n,n,\{e,v\})=\begin{cases}\binom{n^2/2}{n/2} & \text{if n even}\\ \\ \sum_j\binom{(n^2-n)/2}{j}\binom{n}{n-2j} & \text{if n odd.}\end{cases}$$

When $G=\{e,d_1\}$ or $\{e,d_2\},$ it is a diagonal that is fixed by the action of $G.$ So the analysis is the same as for $G=\{e,h\}$ with $n$ odd. We have $$C(n,n,\{e,d_1\})=C(n,n,\{e,d_2\})= \sum_j\binom{(n^2-n)/2}{j}\binom{n}{n-2j}.$$ Mathematica recognizes this sum, which we denote by $S,$ as a generalized hypergeometric function with argument $-1:$ $$S=\sum_j\binom{(n^2-n)/2}{j}\binom{n}{n-2j} = \ _3F_2\left[\begin{matrix}1/2-n/2 & -n/2 & (n-n^2)/2\\1/2 & 1 & \end{matrix};-1\right].$$ Indeed, \begin{aligned} S=&\sum_j\binom{(n^2-n)/2}{j}\binom{n}{n-2j} =\sum_j\binom{(n^2-n)/2}{j}\binom{n}{2j}\\ =&\sum_j\frac{\frac{n^2-n}{2}(\frac{n^2-n}{2}-1)\ldots(\frac{n^2-n}{2}-j+1)}{j!}\frac{n(n-1)\ldots(n-2j+1)}{2j(2j-1)\ldots1}\\ =&\sum_j\frac{n-n^2}{2}\left(\frac{n-n^2}{2}+1\right)\ldots\left(\frac{n-n^2}{2}+j-1\right)\frac{\frac{-n}{2}\frac{-n+1}{2}\ldots\frac{-n+2j-1}{2}}{j(j-\frac{1}{2})\ldots\frac{2}{2}\frac{1}{2}}\frac{(-1)^j}{j!}\\ =&\sum_j\frac{n-n^2}{2}\left(\frac{n-n^2}{2}+1\right)\ldots\left(\frac{n-n^2}{2}+j-1\right)\\ &\times\frac{\frac{-n}{2}\left(\frac{-n}{2}+1\right)\ldots\left(\frac{-n}{2}+j-1\right)\frac{1-n}{2}\left(\frac{1-n}{2}+1\right)\ldots\left(\frac{1-n}{2}+j-1\right)}{\frac{1}{2}\frac{3}{2}\ldots\left(\frac{1}{2}+j-1\right)\cdot1\cdot2\ldots\cdot j}\frac{(-1)^j}{j!}, \end{aligned} which, by definition, is the stated generalized hypergeometric function.

Combining these results, we have $$K(n)=\begin{cases} \frac{1}{8}\binom{n^2}{n} + \frac{1}{4}\binom{n^2/4}{n/4} + \frac{3}{8}\binom{n^2/2}{n/2} + \frac{1}{4}S & \text{for n\equiv0\pmod{4}}\\ \frac{1}{8}\binom{n^2}{n} + \frac{1}{4}\binom{(n^2-1)/4}{(n-1)/4} + \frac{1}{8}\binom{(n^2-1)/2}{(n-1)/2} + \frac{1}{2}S & \text{for n\equiv1\pmod{4}}\\ \frac{1}{8}\binom{n^2}{n} + \frac{3}{8}\binom{n^2/2}{n/2} + \frac{1}{4}S & \text{for n\equiv2\pmod{4}}\\ \frac{1}{8}\binom{n^2}{n} + \frac{1}{8}\binom{(n^2-1)/2}{(n-1)/2} + \frac{1}{2}S & \text{for n\equiv3\pmod{4}.} \end{cases}$$ This answer agrees with that of Marko Riedel and the OEIS sequence he cites. (Added: These formulas can be obtained without much difficulty by extracting the relevant coefficient from the final generating function in Marko Riedel's answer.)

Added: (Some background about the orbit-stabilizer theorem and the orbit counting theorem.) Let $G$ be a group acting on a set $X.$. The stabilizer of $x\in X$ is the set of elements of $G$ that fix $x,$ that is, the set of $g\in G$ such that $gx=x.$ The orbit of $x\in X$ is the set of elements of $X$ to which $x$ is sent by some element of $G.$

The orbit-stabilizer theorem states that, for any $x\in X,$ $$\lvert G\rvert=\lvert\text{orbit}(x)\rvert\cdot\lvert\text{stabilizier}(x)\rvert.$$ It is a consequence of the fact that $\text{stabilizer}(x)$ is a subgroup of $G$ and the fact that the elements of $\text{orbit}(x)$ are in one-to-one correspondence with the left cosets of $\text{stabilizer}(x).$

The action of $G$ on $X$ partitions $X$ into disjoint orbits. Let $\mathcal{O}$ be the set of orbits. The fixed set of $g\in G$ is the set of elements of $X$ fixed by $g,$ that is, the set of $x\in X$ such that $gx=x.$ The orbit counting theorem, which is often called Burnside's lemma, states that the number of orbits equals the average (over all $g\in G$) of $\lvert\text{fixed}(g)\rvert.$ It is proved by considering the set $P$ of pairs $(g,x)$ satisfying $gx=x.$ We may count the elements of $P$ either by running over $G$ or by running over $X:$ \begin{aligned} \lvert P\rvert=\sum_{g\in G}\lvert\text{fixed}(g)\rvert&=\sum_{x\in X}\lvert\text{stabilizer}(x)\rvert\\ &=\sum_{x\in X}\frac{\lvert G\rvert}{\lvert\text{orbit}(x)\rvert}\\ &=\lvert G\rvert\sum_{O\in\mathcal{O}}\sum_{x\in O}\frac{1}{\lvert\text{orbit}(x)\rvert}\\ &=\lvert G\rvert\sum_{O\in\mathcal{O}}1\\ &=\lvert G\rvert\cdot\lvert\mathcal{O}\rvert, \end{aligned} where the orbit-stabilizer theorem was used to obtain the second line. This implies that $$\lvert\mathcal{O}\rvert=\frac{1}{\lvert G\rvert}\sum_{g\in G}\lvert\text{fixed}(g)\rvert,$$ which is the desired result.

http://puzzlemaker.discoveryeducation.com/MathSquareForm.asp

Above is a link to a puzzlemaker referred to as Math Square.

It allows you to create matrice puzzle.

For example, you can create a 6x6 grid and the rows and columns are maths equation having multiplication, division, addition and subtraction. The answers to the equation are available on the extreme right and the extreme bottom of the grid. However, no number in the grid is provided. Can such a puzzle be logically or mathematically solved using any of the above methods mentioned in this thread.


# Math Help - number of integers bet 90 and 990

1. ## number of integers bet 90 and 990

How many integers bet 90 and 990 are divisible by 7?

is there any short and simple way of finding the answer?

thanks

2. ## Re: number of integers bet 90 and 990

Originally Posted by rcs
How many integers bet 90 and 990 are divisible by 7?

is there any short and simple way of finding the answer?

$\left\lfloor {\frac{{990}}{7}} \right\rfloor - \left\lfloor {\frac{{90}}{7}} \right\rfloor=~?$

3. ## Re: number of integers bet 90 and 990

Originally Posted by rcs
How many integers bet 90 and 990 are divisible by 7?

is there any short and simple way of finding the answer?

thanks
Hi rcs!

The answer is 990 / 7 - (90 - 1) / 7, where "/" denotes a division that is rounded down.
I am assuming that you would count 990 and 90 if they would have been divisible by 7 (which they are not anyway).

To explain:
(90 - 1) / 7 is the number of integers divisible by 7 below and excluding 90.
990 / 7 is the number of integers divisible by 7 below and including 990.
The difference is the total number.

Suppose you are in the middle of a road with poles alongside the road.
And suppose you want to know the number of poles from where you are to the end of the road.

To find out you count the number that you can see from where you stand to the beginning of the road.
And if you are next to a pole you do not count that one.
Subtract from the total number of poles and there you are.

4. ## Re: number of integers bet 90 and 990

thanks Prof . Plato

5. ## Re: number of integers bet 90 and 990

Originally Posted by Plato
$\left\lfloor {\frac{{990}}{7}} \right\rfloor - \left\lfloor {\frac{{90}}{7}} \right\rfloor=~?$
the answer is 128 4/7 is this correct sir?

i wonder why the book the answer they posted is 56... however they do not post the solution

6. ## Re: number of integers bet 90 and 990

Originally Posted by rcs
the answer is 128 4/7 is this correct sir?
i wonder why the book the answer they posted is 56... however they do not post the solution
First that is the floor function. It returns an integer.

There are $\left\lfloor {\frac{{990}}{7}} \right\rfloor=141$ integers from 1 to 990 that are by seven.

There are $\left\lfloor {\frac{{90}}{7}} \right\rfloor=12$ integers from 1 to 90 that are by seven.

Note that neither 990 nor 90 is divisible by seven.

So you book is not correct. The answer is 129.

7. ## Re: number of integers bet 90 and 990

Originally Posted by Plato
First that is the floor function. It returns an integer.

There are $\left\lfloor {\frac{{990}}{7}} \right\rfloor=141$ integers from 1 to 990 that are by seven.

There are $\left\lfloor {\frac{{90}}{7}} \right\rfloor=12$ integers from 1 to 90 that are by seven.

Note that neither 990 nor 90 is divisible by seven.

So you book is correct. The answer is 129.
you mean to say that the book i've read whose answer is 56 is correct and your answer 129 is also correct... therefore, there are two correct answers now... 56 and 129

8. ## Re: number of integers bet 90 and 990

Sorry that was a typo. It should be NOT CORRECT

9. ## Re: number of integers bet 90 and 990

ahhh i see... well then thank you again Sir. God Bless

10. ## Re: number of integers bet 90 and 990

Suggest we find the multiple of 7 just greater than 90 and just less than 990.
We will get 91 and 987. Now all the multiples of 7 between these two numbers will form an AP with first term 91, common difference 7 and last term 987.
Question now simply is to find n such that the nth term is 987.
If a is the first term, common difference d then the nth term is given by
an = a + ( n-1) d
Thus we have 91 + ( n – 1 ) x 7 = 987
OR 91 + 7n – 7 = 987
7n = 987 – 91 + 7 = 903
n = 129 Hence there are 129 integers between 90 and 990 which are divisible by 7


# Orthogonality of Legendre polynomials using specific properties

I'm having significant issues with a problem and would appreciate any help at all with it. It is regarding proving the orthogonality of Legendre polynomials using a specific recursion formula and property of Legendre polynomials.

I have been given the following relation $$x P'_n(x) -P'_{n-1}(x) = n P_n (x)$$ And that $$\int^{1}_{-1} f(x) P_n (x) dx = 0$$ for any polynomial $$f(x)$$ of degree less than $$n$$.

I must then show that for $$n \geq 1$$

$$\int^{1}_{-1} P_n (x)^2 dx = \frac{1}{2n} \int^{1}_{-1} x \frac{d}{dx} (P_n (x)^2)dx$$

And then determine the value of the integral, that being $$\frac{2}{2n+1}$$. I must use the two stated facts, I'd be grateful for any help with this, thank you guys.

• Have you tried integration by parts yet? – Somos Nov 14 '20 at 0:31
• My first thought too but I decided its a no-go. Id like to see your approach, @Somos. – CogitoErgoCogitoSum Nov 14 '20 at 1:31

$$\int\limits_{-1}^{1} P_n(x)^2 \;dx =$$ $$\int\limits_{-1}^{1} P_n(x)P_n(x) \;dx =$$ $$\frac{1}{2n}\int\limits_{-1}^{1} 2n P_n(x)P_n(x) \;dx =$$

Substituting your first relation in: $$\frac{1}{2n}\int\limits_{-1}^{1} 2 \left[x P'_n(x) - P'_{n-1}(x)\right] P_n(x)\;dx =$$

$$\frac{1}{2n}\int\limits_{-1}^{1} 2 x P'_n(x) P_n(x) \; dx - \frac{1}{2n}\int\limits_{-1}^{1} 2 P'_{n-1}(x) P_n(x)\;dx =$$

Given your second property defining orthogonality (since after all $$P'$$ is of lesser degree than $$P$$) the entire second integral drops out.

$$\frac{1}{2n}\int\limits_{-1}^{1} x 2 P_n(x) P'_n(x) \; dx =$$

Reverse of the chain rule:

$$\frac{1}{2n}\int\limits_{-1}^{1} x \frac{d}{dx} P^2_n(x) \; dx$$

QED

And for anyone who asks/wonders, or is inclined to criticize... I answered this question because it was asked, and this is a Q&A forum. I shouldnt have to justify answering questions on a Q&A forum though, but this is the culture here.

• Did you read the part in the question stating: "And then determine the value of the integral, that being 2/(2n+1)."? You seem to have not done that part yet. – Somos Nov 14 '20 at 21:55
• Youre right, I didnt. I dont feel the need to do all 100% of the work when OP is hindered only by the first 10%. Dont know what your point is. I dont believe in "handing out answers". OP should be able to do some of it, dont you think? – CogitoErgoCogitoSum Nov 14 '20 at 23:20

I immediately thought of integration by parts. Here is my work:

By the product rule of derivative we have $$\frac{d}{dx} x\, P_n(x)^2 = P_n(x)^2 + x\, \frac{d}{dx}(P_n(x)^2) \tag{1}$$

Note that Legendre polynomials have the property $$P_n(1) = 1,\quad \text{ and } \quad P_n(-1)=(-1)^n. \tag{2}$$

By integrating equation $$(1)$$ and using equation $$(2)$$ we get $$2 = 1 - (-1) = \int_{-1}^1 P_n(x)^2 dx + \int_{-1}^1 x\, \frac{d}{dx}(P_n(x)^2) dx. \tag{3}$$

Define $$\, a_n := \int_{-1}^1 P_n(x)^2 dx.\,$$ Equation $$(3)$$ implies that $$2 - a_n = \int_{-1}^1 x\, \frac{d}{dx}(P_n(x)^2)\,dx. \tag{4}$$ We are given the property that $$x P'_n(x) -P'_{n-1}(x) = n P_n (x). \tag{5}$$ Multiply this equation $$(5)$$ by $$\,P_n(x)\,$$ and integrate to get $$\int_{-1}^1\!P_n(x)(xP'_n(x)\!-\!P'_{n-1}(x))dx \!=\!\int_{-1}^1\!P_n(x)nP_n(x)dx. \tag{6}$$ We are also given the property that $$\int_{-1}^1 P_n(x)\,f(x)\,dx = 0 \tag{7}$$ for any polynomial $$\,f(x)\,$$ of degree less than $$\,n.\,$$ Now notice that $$x\, \frac{d}{dx}(P_n(x)^2) = 2\,x\,P_n(x)P'_n(x). \tag{8}$$ Combining equations $$(6)$$, $$(7)$$, and $$(8)$$ we get that $$\frac12(2-a_n) = n\,a_n. \tag{9}$$ Dividing this equation $$(9)$$ through by $$\,n\,$$ and using the definition of $$\,a_n\,$$ and equation $$(4)$$ gives the result we wanted: $$\int_{-1}^1 P_n(x)^2 dx = \frac{2-a_n}{2n} = \frac1{2n} \int_{-1}^1 x\, \frac{d}{dx}(P_n(x)^2)\,dx. \tag{10}$$ Also, solving for $$\,a_n\,$$ in equation $$(9)$$ gives $$a_n = \frac2{2n+1} \tag{11}$$ which was also requested.

NOTE: The property in equation $$(2)$$ was not given to us. It would have to be proven using equations $$(5)$$ and $$(7)$$ which are given to us. It can be done, and would take some effort, but I have not given the steps required.

• A few points/criticisms, if you dont mind. For one thing, it isnt obvious how your suggestion to use "integration by parts" is being utilized. Frankly I dont see I by P in your work. Secondly, your work doesnt flow all that well... you make a few leaps. The logic is sound but effort must be used to comprehend the somewhat convoluted steps. Its just a bit scattered and disorderly. Thirdly, property (2), although true, was not one of the properties OP provided; Im not sure its appropriate to use it. Just some things to consider... – CogitoErgoCogitoSum Nov 14 '20 at 20:27
• In the Wikipedia article on Integration by parts is stated "The rule can be thought of as an integral version of the product rule of differentiation." That is what I used. You say "leaps". I say "steps". I don't see anything convoluted. In my NOTE at the end I admit the status of property (2), but the original quesition did not explicitly state than no other properties of Legendre polynomials can be used. If you have a better proof, you can answer the question yourself, which, of course, you have done. Thanks for commenting. – Somos Nov 14 '20 at 20:45


# Show that there exists $x_0\in(a,b)$ such that $f(x_0)=\frac{1}{n}(f(x_1)+f(x_2)+\cdots+f(x_n)).$

Question: Suppose that $$f:[a,b]\to\mathbb{R}$$ is continuous. Let $$x_1,x_2,\cdots, x_n$$ be any $$n$$ points in $$(a,b).$$ Show that there exists $$x_0\in(a,b)$$ such that $$f(x_0)=\frac{1}{n}(f(x_1)+f(x_2)+\cdots+f(x_n)).$$

Solution: Let $$g:[a,b]\to\mathbb{R}$$ be such that $$g(x)=nf(x)-\sum_{k=1}^nf(x_k), \forall x\in[a,b].$$ Observe that to prove the statement of the problem it is enough to show that $$g(x_0)=0$$ for some $$x_0\in(a,b)$$.

Now note that by the 3rd form of the Pigeon Hole principle we can conclude that there exists $$1\le i,j\le n$$ such that $$f(x_i)\le \frac{1}{n}\sum_{k=1}^nf(x_k)\le f(x_j)\\\implies nf(x_i)\le \sum_{k=1}^nf(x_k)\le nf(x_j).$$ Thus, $$g(x_i)=nf(x_i)-\sum_{k=1}^nf(x_k)\le 0$$ and $$g(x_j)=nf(x_j)-\sum_{k=1}^nf(x_k)\ge 0.$$ Now if $$g(x_i)=0$$ or $$g(x_j)=0$$, then we are done. Thus, let us assume that $$g(x_i)<0$$ and $$g(x_j)>0$$. Now since $$f$$ is continuous on $$[a,b]$$, implies that $$g$$ is continuous on $$[a,b]$$. Therefore, by IVT we can conclude that there exists $$x_0\in(x_i,x_j)$$ or $$x_0\in(x_j,x_i)$$ such that $$g(x_0)=0$$. This completes the proof.

Is this solution correct and rigorous enough and is there any other way to solve the problem?

• What is the PHP? Aug 26, 2020 at 19:22
• @MartinR, it's the "Pigeon Hole Principle". Sorry, I will expand that term in a bit. Aug 26, 2020 at 19:24

Your proof looks fine to me. There is no need however to introduce the function $$g$$. You know that $$f(x_i)\le \frac{1}{n}\sum_{k=1}^nf(x_k)\le f(x_j)$$ for some indices $$i, j$$, so you can just apply the intermediate value theorem to $$f$$ on the interval $$I = [\min(x_i, x_j), \max(x_i, x_j)]$$ and conclude that $$\frac{1}{n}\sum_{k=1}^nf(x_k) = f(x)$$ for some $$x \in I$$.

Instead of using the pigeon hole principle you can also apply the mean value theorem to $$f$$ on the interval $$J= [\min_k x_k, \max_k x_k] \subset (a, b)$$ because $$m\le \frac{1}{n}\sum_{k=1}^nf(x_k)\le M$$ with $$m = \min_J f(x)$$ and $$M = \max_J f(x)$$.

Given a continuous $$f(x)$$, an iterated application of the Intermediate value Theorem gives \eqalign{ & \exists x_{1,2} \in \left[ {x_1 ,x_2 } \right]:f(x_{1,2} ) = t\;f(x_1 ) + \left( {1 - t} \right)f(x_2 )\quad \left| {\,0 \le t \le 1} \right. \cr & \exists x_{2,3} \in \left[ {x_2 ,x_3 } \right]:f(x_{2,3} ) = u\;f(x_2 ) + \left( {1 - u} \right)f(x_3 )\quad \left| {\,0 \le u \le 1} \right. \cr} which express the possibility of finding a point corresponding to the weighted mean within each interval.

Putting $$t=2/3, \, u=1/3$$, we can write \eqalign{ & \exists x_{1,2} \in \left[ {x_1 ,x_2 } \right]:f(x_{1,2} ) = {2 \over 3}\;f(x_1 ) + {1 \over 3}f(x_2 )\quad \left| {\,0 \le t \le 1} \right. \cr & \exists x_{2,3} \in \left[ {x_2 ,x_3 } \right]:f(x_{2,3} ) = {1 \over 3}\;f(x_2 ) + {2 \over 3}f(x_3 )\quad \left| {\,0 \le u \le 1} \right. \cr & \exists x_{1,3} \in \left[ {x_1 ,x_2 } \right] \cup \left[ {x_2 ,x_3 } \right]:f(x_{1,3} ) = {1 \over 2}\,f(x_{1,2} ) + {1 \over 2}f(x_{2,3} ) = \cr & = {{f(x_1 ) + f(x_2 ) + f(x_3 )} \over 3} \cr} and the extension to n points is clear.

Pick $$i$$ with \begin{align} f(x_i) &\le f(x_k) & \text{for all k = 1, \ldots, n.} \tag{1} \end{align}
Pick $$j$$ with \begin{align} f(x_j) &\ge f(x_k) & \text{for all k = 1, \ldots, n.} \tag{2} \end{align}
If $$i = j$$, then all $$x_k$$ are equal, and $$x_0 = x_i$$ solves the problem.
Consider the case $$i < j$$; the $$i > j$$ case is almost identical. But equation $$1$$, we have $$n f(x_i) \le \sum_k f(x_k)$$ By equation 2, similarly $$n f(x_j) \ge \sum_k f(x_k)$$.
Then by the Intermediate value theorem, there's an $$x_0 \in [x_i, x_j]$$ such that $$f(x_0) = \frac{1}{n} \sum_k f(x_k).$$