Foundationdefault_graphtheory_linearalg_svgHardD1 function process%QUESTION.NUMBER%(QNo) { QT1=QuestionText1%QUESTION.NUMBER% QT2=QuestionText2%QUESTION.NUMBER% QT3=QuestionText2%QUESTION.NUMBER% ET1=EquationText1%QUESTION.NUMBER% COR=Correct%QUESTION.NUMBER% //displays general feedback ANS= "
Given matrix is the representation of an undirected graph.

The degree sequence of an undirected graph is the non-increasing sequence of its vertex degrees.

The degree of a vertex is the number of edges connected to the vertex.

For a directed graphs, there are two types of degrees, namely indegree and outdegree and if the graph is not symmetric their values differ.
An undirected graph is symmetric. Therefore indegree and outdegree of a vertex are equal and are called a degree.

Recall that each not connected vertex in such a graph has 0 degree.

To determine the degree sequence you first have to determine the degree of each vertex and then rearrange them into non-increasing order.

In this problem:
the list of degrees (for the vertices from "+alphabet(0,1)+" to "+alphabet(n-1,1)+") is "+degreelist+". Thus, rearranged gives the degree sequence to be "+listofdegrees+".
" for (var i=5; iYour answer, "+document.forms.elements[item].value+", was correct.
"} else {document.forms.elements[item+3].value = "Your answer, "+document.forms.elements[item].value+", should have been "+COR+"

"+ANS+"

"} document.forms.elements[item+3].value = QuestionText1%QUESTION.NUMBER% + EquationText1%QUESTION.NUMBER% + QuestionText3%QUESTION.NUMBER%+ document.forms.elements[item+3].value; } function question%QUESTION.NUMBER%() { n = displayarray(1,5,7,0); W = getrandommatrix(n,n,0,0,1); do{ do{ do{ A = getrandommatrix(n, n, 0, 0, 1); for(i = 1; i <= n-1; i++){ for(j = i+1; j <= n; j++){ A[i][j] = Math.round(Math.random()); } } for(i = 1; i <= n-1; i++){ for(j = i+1; j <= n; j++){ W[i][j] = A[i][j]; W[j][i] = W[i][j]; }} degreelist = new Array(n); for(i = 1; i <= n; i++){ degreelist[i-1] = 0; for(j = 1; j <= n; j++){ degreelist[i-1] += (W[i][j]-0); } } listofdegrees = sorting(degreelist,0); seergedfotsil = sorting(degreelist,1); } while (seergedfotsil <= 1) } while (seergedfotsil <= 2) } while (seergedfotsil[n-1] >= 6) labels = new Array(); for (i = 1; i <= n; i++){ labels[i]=alphabet(i-1,1); } Nwidth1 = getFontSize()/16*(n * 45) ; Nheight = getFontSize()/16*(n * 50) ; m1="" m2="" m3="" c1%QUESTION.NUMBER% = "" QuestionText1%QUESTION.NUMBER% = "Consider the following matrix representation of a graph and input the degree sequence: "; QuestionText2%QUESTION.NUMBER% = "The degree sequence is "; QuestionText3%QUESTION.NUMBER% = "

Important: input your answer as a non-increasing sequence, without spaces. Separate each value with a comma e.g. 4,4,2,1...

"; EquationText1%QUESTION.NUMBER%="
"+m1+m2+m3+c1%QUESTION.NUMBER%+"
"; //EquationText1%QUESTION.NUMBER% = ""; //just graph displayed ratio_along_line = 0; filled = 1; // = 1 filled arrow else open double_path_colour = "black"; double_path_skinnyness = 10; SVG_graph%QUESTION.NUMBER% = "
"+SVG_digraph(W,ratio_along_line,filled,double_path_colour,double_path_skinnyness) + "
" Correct%QUESTION.NUMBER% = listofdegrees; //document.write(Correct%QUESTION.NUMBER%+"

"); //document.write(Feedback%QUESTION.NUMBER%+"

"); document.write(QuestionText1%QUESTION.NUMBER%+EquationText1%QUESTION.NUMBER%+QuestionText2%QUESTION.NUMBER%); document.write("") document.write(QuestionText3%QUESTION.NUMBER%); document.write("") } if (document.forms.name=="FEEDBACK") {} else {question%QUESTION.NUMBER%()} ]]> "Choice" INCLUDES "was correct"Well done!]]> "Choice" INCLUDES NOCASE "should have been"You were wrong!]]> OTHERYou should have tried this question!]]> if (document.forms.name=="FEEDBACK") { Count=document.forms.elements.length document.write(document.forms.elements[Count-1].value) var titleofpopup = "Related material"; var help = wheretolook("%QUESTION.TAGS%","%QUESTION.TOPIC%"); document.write("

"+""+"
") } ]]>
Foundationdefault_graphtheory_linearalg_svgHardD1 function process%QUESTION.NUMBER%(QNo) { QT1=QuestionText1%QUESTION.NUMBER% QT2=QuestionText2%QUESTION.NUMBER% QT3=QuestionText2%QUESTION.NUMBER% ET1=EquationText1%QUESTION.NUMBER% COR=Correct%QUESTION.NUMBER% //displays general feedback ANS= "
Given matrix is the representation of an undirected graph.

The degree sequence of an undirected graph is the non-increasing sequence of its vertex degrees.

The degree of a vertex is the number of edges connected to the vertex.

For a directed graphs, there are two types of degrees, namely indegree and outdegree and if the graph is not symmetric their values differ.
An undirected graph is symmetric. Therefore indegree and outdegree of a vertex are equal and are called a degree.

Recall that each not connected vertex in such a graph has 0 degree.

To determine the degree sequence you first have to determine the degree of each vertex and then rearrange them into non-increasing order.

In this problem:
the list of degrees (for the vertices from "+alphabet(0,1)+" to "+alphabet(n-1,1)+") is "+degreelist+". Thus, rearranged gives the degree sequence to be "+listofdegrees+".
" for (var i=5; iYour answer, "+document.forms.elements[item].value+", was correct.
"} else {document.forms.elements[item+3].value = "Your answer, "+document.forms.elements[item].value+", should have been "+COR+"

"+ANS+"

"} document.forms.elements[item+3].value = QuestionText1%QUESTION.NUMBER% + EquationText1%QUESTION.NUMBER% + QuestionText3%QUESTION.NUMBER%+ document.forms.elements[item+3].value; } function question%QUESTION.NUMBER%() { n = displayarray(1,5,7,0); selectone=displayarray(1,0,n-1,0); //document.write(loops+"

"); W = getrandommatrix(n,n,0,0,1); do{ do{ do{ A = getrandomsymmetricmatrix(n,n,0,1,1); B = getrandomsymmetricmatrix(n,n,0,1,1); for(i = 1; i <= n; i++){ A[i][i] = (A[i][i]-0)*0; B[i][i] = A[i][i]; B[selectone][i] = 0; B[i][selectone] = 0; } for(i = 1; i <= n-1; i++){ for(j = i+1; j <= n; j++){ W[i][j] = B[i][j]; W[j][i] = W[i][j]; }} degreelist = new Array(n); for(i = 1; i <= n; i++){ degreelist[i-1] = 0; for(j = 1; j <= n; j++){ degreelist[i-1] += (W[i][j]-0); } } listofdegrees = sorting(degreelist,0); seergedfotsil = sorting(degreelist,1); } while (seergedfotsil < 0) } while (seergedfotsil <=2) } while (seergedfotsil[n-1] >= 6) labels = new Array(); for (i = 1; i <= n; i++){ labels[i]=alphabet(i-1,1); } Nwidth1 = getFontSize()/16*(n * 45) ; Nheight = getFontSize()/16*(n * 50) ; m1="" m2="" m3="" c1%QUESTION.NUMBER% = "" QuestionText1%QUESTION.NUMBER% = "Consider the following matrix representation of a graph and input the degree sequence: "; QuestionText2%QUESTION.NUMBER% = "The degree sequence is "; QuestionText3%QUESTION.NUMBER% = "

Important: input your answer as a non-increasing sequence, without spaces. Separate each value with a comma e.g. 4,4,2,1...

"; EquationText1%QUESTION.NUMBER%="
"+m1+m2+m3+c1%QUESTION.NUMBER%+"
"; //EquationText1%QUESTION.NUMBER% = ""; //just graph displayed //document.write(EquationText1%QUESTION.NUMBER%+"

"); ratio_along_line = 0; filled = 1; // = 1 filled arrow else open double_path_colour = "black"; double_path_skinnyness = 10; SVG_graph%QUESTION.NUMBER% = "
"+SVG_digraph(W,ratio_along_line,filled,double_path_colour,double_path_skinnyness) + "
" Correct%QUESTION.NUMBER% = listofdegrees; //document.write(Correct%QUESTION.NUMBER%+"

"); //document.write(Feedback%QUESTION.NUMBER%+"

"); document.write(QuestionText1%QUESTION.NUMBER%+EquationText1%QUESTION.NUMBER%+QuestionText2%QUESTION.NUMBER%); document.write("") document.write(QuestionText3%QUESTION.NUMBER%); document.write("") } if (document.forms.name=="FEEDBACK") {} else {question%QUESTION.NUMBER%()} ]]> "Choice" INCLUDES "was correct"Well done!]]> "Choice" INCLUDES NOCASE "should have been"You were wrong!]]> OTHERYou should have tried this question!]]> if (document.forms.name=="FEEDBACK") { Count=document.forms.elements.length document.write(document.forms.elements[Count-1].value) var titleofpopup = "Related material"; var help = wheretolook("%QUESTION.TAGS%","%QUESTION.TOPIC%"); document.write("

"+""+"
") } ]]>
Foundationdefault_graphtheory_linearalg_svgHardD1 function process%QUESTION.NUMBER%(QNo) { QT1=QuestionText1%QUESTION.NUMBER% QT2=QuestionText2%QUESTION.NUMBER% QT3=QuestionText2%QUESTION.NUMBER% ET1=EquationText1%QUESTION.NUMBER% COR=Correct%QUESTION.NUMBER% //displays general feedback ANS= "
Given matrix is the representation of an undirected graph.

The degree sequence of an undirected graph is the non-increasing sequence of its vertex degrees.

The degree of a vertex is the number of edges connected to the vertex.

For a directed graphs, there are two types of degrees, namely indegree and outdegree and if the graph is not symmetric their values differ.
An undirected graph is symmetric. Therefore indegree and outdegree of a vertex are equal and are called a degree.

Recall that each not connected vertex in such a graph has 0 degree, that 2 on the diagonal represents a loop.

To determine the degree sequence you first have to determine the degree of each vertex and then rearrange them into non-increasing order.

In this problem:
the list of degrees (for the vertices from "+alphabet(0,1)+" to "+alphabet(n-1,1)+") is "+degreelist+". Thus, rearranged gives the degree sequence to be "+listofdegrees+".
" for (var i=5; iYour answer, "+document.forms.elements[item].value+", was correct.
"} else {document.forms.elements[item+3].value = "Your answer, "+document.forms.elements[item].value+", should have been "+COR+"

"+ANS+"

"} document.forms.elements[item+3].value = QuestionText1%QUESTION.NUMBER% + EquationText1%QUESTION.NUMBER% + QuestionText3%QUESTION.NUMBER%+ document.forms.elements[item+3].value; } function question%QUESTION.NUMBER%() { n = displayarray(1,5,7,0); multiedge=displayarray(2,0,n-1,0); doubleedge=sorting(multiedge,1); twoloops=displayarray(2,0,n-1,0); loops=sorting(twoloops,1); //document.write(loops+"

"); W = getrandommatrix(n,n,0,0,1); do{ do{ do{ A = getrandomsymmetricmatrix(n,n,0,2,1); B = getrandomsymmetricmatrix(n,n,0,2,1); for(i = 1; i <= n; i++){ A[i][i] = (A[i][i]-0)*0; B[i][i] = A[i][i]; B[doubleedge][doubleedge] = 2; } for(i = 1; i <= n-1; i++){ for(j = i+1; j <= n; j++){ W[i][j] = B[i][j]; W[loops][loops] = 2; W[loops][loops] = 2; W[j][i] = W[i][j]; }} degreelist = new Array(n); for(i = 1; i <= n; i++){ degreelist[i-1] = 0; for(j = 1; j <= n; j++){ degreelist[i-1] += (W[i][j]-0); } } listofdegrees = sorting(degreelist,0); seergedfotsil = sorting(degreelist,1); } while (seergedfotsil <= 1) } while (seergedfotsil <= 2) } while (seergedfotsil[n-1] >= 6) labels = new Array(); for (i = 1; i <= n; i++){ labels[i]=alphabet(i-1,1); } Nwidth1 = getFontSize()/16*(n * 45) ; Nheight = getFontSize()/16*(n * 50) ; m1="" m2="" m3="" c1%QUESTION.NUMBER% = "" QuestionText1%QUESTION.NUMBER% = "Consider the following matrix representation of a graph and input the degree sequence: "; QuestionText2%QUESTION.NUMBER% = "The degree sequence is "; QuestionText3%QUESTION.NUMBER% = "

Important: input your answer as a non-increasing sequence, without spaces. Separate each value with a comma e.g. 4,4,2,1...

"; EquationText1%QUESTION.NUMBER%="
"+m1+m2+m3+c1%QUESTION.NUMBER%+"
"; //EquationText1%QUESTION.NUMBER% = ""; //just graph displayed //document.write(EquationText1%QUESTION.NUMBER%+"

"); ratio_along_line = 0; filled = 1; // = 1 filled arrow else open double_path_colour = "black"; double_path_skinnyness = 10; SVG_graph%QUESTION.NUMBER% = "
"+SVG_digraph(W,ratio_along_line,filled,double_path_colour,double_path_skinnyness) + "
" Correct%QUESTION.NUMBER% = listofdegrees; //document.write(Correct%QUESTION.NUMBER%+"

"); //document.write(Feedback%QUESTION.NUMBER%+"

"); document.write(QuestionText1%QUESTION.NUMBER%+EquationText1%QUESTION.NUMBER%+QuestionText2%QUESTION.NUMBER%); document.write("") document.write(QuestionText3%QUESTION.NUMBER%); document.write("") } if (document.forms.name=="FEEDBACK") {} else {question%QUESTION.NUMBER%()} ]]> "Choice" INCLUDES "was correct"Well done!]]> "Choice" INCLUDES NOCASE "should have been"You were wrong!]]> OTHERYou should have tried this question!]]> if (document.forms.name=="FEEDBACK") { Count=document.forms.elements.length document.write(document.forms.elements[Count-1].value) var titleofpopup = "Related material"; var help = wheretolook("%QUESTION.TAGS%","%QUESTION.TOPIC%"); document.write("

"+""+"
") } ]]>
Foundationdefault_graphtheory_linearalg_svgHardD1 function process%QUESTION.NUMBER%(QNo) { QT1=QuestionText1%QUESTION.NUMBER% QT2=QuestionText2%QUESTION.NUMBER% QT3=QuestionText2%QUESTION.NUMBER% ET1=EquationText1%QUESTION.NUMBER% COR=Correct%QUESTION.NUMBER% //displays general feedback ANS= "
Given matrix is the representation of an undirected graph.

The degree sequence of an undirected graph is the non-increasing sequence of its vertex degrees.

The degree of a vertex is the number of edges connected to the vertex.

For a directed graphs, there are two types of degrees, namely indegree and outdegree and if the graph is not symmetric their values differ.
An undirected graph is symmetric. Therefore indegree and outdegree of a vertex are equal and are called a degree.

Recall that each not connected vertex in such a graph has 0 degree.

To determine the degree sequence you first have to determine the degree of each vertex and then rearrange them into non-increasing order.

In this problem:
the list of degrees (for the vertices from "+alphabet(0,1)+" to "+alphabet(n-1,1)+") is "+degreelist+". Thus, rearranged gives the degree sequence to be "+listofdegrees+".
" for (var i=5; iYour answer, "+document.forms.elements[item].value+", was correct.
"} else {document.forms.elements[item+3].value = "Your answer, "+document.forms.elements[item].value+", should have been "+COR+"

"+ANS+"

"} document.forms.elements[item+3].value = QuestionText1%QUESTION.NUMBER% + EquationText1%QUESTION.NUMBER% + QuestionText3%QUESTION.NUMBER%+ document.forms.elements[item+3].value; } function question%QUESTION.NUMBER%() { n = displayarray(1,5,7,0); multiedge=displayarray(2,0,n-1,0); doubleedge=sorting(multiedge,1); //document.write(doubleedge+"

"); W = getrandommatrix(n,n,0,0,1); do{ do{ do{ A = getrandomsymmetricmatrix(n,n,0,2,1); B = getrandomsymmetricmatrix(n,n,0,2,1); for(i = 1; i <= n; i++){ A[i][i] = (A[i][i]-0)*0; B[i][i] = A[i][i]; B[doubleedge][doubleedge] = 2; } for(i = 1; i <= n-1; i++){ for(j = i+1; j <= n; j++){ W[i][j] = B[i][j]; W[j][i] = W[i][j]; }} degreelist = new Array(n); for(i = 1; i <= n; i++){ degreelist[i-1] = 0; for(j = 1; j <= n; j++){ degreelist[i-1] += (W[i][j]-0); } } listofdegrees = sorting(degreelist,0); seergedfotsil = sorting(degreelist,1); } while (seergedfotsil <= 1) } while (seergedfotsil <= 2) } while (seergedfotsil[n-1] >= 6) labels = new Array(); for (i = 1; i <= n; i++){ labels[i]=alphabet(i-1,1); } Nwidth1 = getFontSize()/16*(n * 45) ; Nheight = getFontSize()/16*(n * 50) ; m1="" m2="" m3="" c1%QUESTION.NUMBER% = "" QuestionText1%QUESTION.NUMBER% = "Consider the following matrix representation of a graph and input the degree sequence: "; QuestionText2%QUESTION.NUMBER% = "The degree sequence is "; QuestionText3%QUESTION.NUMBER% = "

Important: input your answer as a non-increasing sequence, without spaces. Separate each value with a comma e.g. 4,4,2,1...

"; EquationText1%QUESTION.NUMBER%="
"+m1+m2+m3+c1%QUESTION.NUMBER%+"
"; //EquationText1%QUESTION.NUMBER% = ""; //just graph displayed //document.write(EquationText1%QUESTION.NUMBER%+"

"); ratio_along_line = 0; filled = 1; // = 1 filled arrow else open double_path_colour = "black"; double_path_skinnyness = 10; SVG_graph%QUESTION.NUMBER% = "
"+SVG_digraph(W,ratio_along_line,filled,double_path_colour,double_path_skinnyness) + "
" Correct%QUESTION.NUMBER% = listofdegrees; //document.write(Correct%QUESTION.NUMBER%+"

"); //document.write(Feedback%QUESTION.NUMBER%+"

"); document.write(QuestionText1%QUESTION.NUMBER%+EquationText1%QUESTION.NUMBER%+QuestionText2%QUESTION.NUMBER%); document.write("") document.write(QuestionText3%QUESTION.NUMBER%); document.write("") } if (document.forms.name=="FEEDBACK") {} else {question%QUESTION.NUMBER%()} ]]> "Choice" INCLUDES "was correct"Well done!]]> "Choice" INCLUDES NOCASE "should have been"You were wrong!]]> OTHERYou should have tried this question!]]> if (document.forms.name=="FEEDBACK") { Count=document.forms.elements.length document.write(document.forms.elements[Count-1].value) var titleofpopup = "Related material"; var help = wheretolook("%QUESTION.TAGS%","%QUESTION.TOPIC%"); document.write("

"+""+"
") } ]]>
Foundationdefault_graphtheory_linearalg_svgHardD1 function process%QUESTION.NUMBER%(QNo) { QT1=QuestionText1%QUESTION.NUMBER% QT2=QuestionText2%QUESTION.NUMBER% QT3=QuestionText2%QUESTION.NUMBER% ET1=EquationText1%QUESTION.NUMBER% COR=Correct%QUESTION.NUMBER% //displays general feedback ANS= "
You were given an undirected graph.

The degree sequence of an undirected graph is the non-increasing sequence of its vertex degrees.

The degree of a vertex is the number of edges connected to the vertex.

For a directed graphs, there are two types of degrees, namely indegree and outdegree and if the graph is not symmetric their values differ.
An undirected graph is symmetric. Therefore indegree and outdegree of a vertex are equal and are called a degree.

Recall that each not connected vertex in such a graph has 0 degree.

To determine the degree sequence you first have to determine the degree of each vertex and then rearrange them into non-increasing order.

In this problem:
the list of degrees (for the vertices from "+alphabet(0,1)+" to "+alphabet(n-1,1)+") is "+degreelist+". Thus, rearranged gives the degree sequence to be "+listofdegrees+".
" for (var i=5; iYour answer, "+document.forms.elements[item].value+", was correct.
"} else {document.forms.elements[item+3].value = "Your answer, "+document.forms.elements[item].value+", should have been "+COR+"

"+ANS+"

"} document.forms.elements[item+3].value = QuestionText1%QUESTION.NUMBER% + SVG_graph%QUESTION.NUMBER% + QuestionText3%QUESTION.NUMBER%+ document.forms.elements[item+3].value; } function question%QUESTION.NUMBER%() { n = displayarray(1,5,7,0); W = getrandommatrix(n,n,0,0,1); do{ do{ do{ A = getrandommatrix(n, n, 0, 0, 1); for(i = 1; i <= n-1; i++){ for(j = i+1; j <= n; j++){ A[i][j] = Math.round(Math.random()); } } for(i = 1; i <= n-1; i++){ for(j = i+1; j <= n; j++){ W[i][j] = A[i][j]; W[j][i] = W[i][j]; }} degreelist = new Array(n); for(i = 1; i <= n; i++){ degreelist[i-1] = 0; for(j = 1; j <= n; j++){ degreelist[i-1] += (W[i][j]-0); } } listofdegrees = sorting(degreelist,0); seergedfotsil = sorting(degreelist,1); } while (seergedfotsil <= 1) } while (seergedfotsil <= 2) } while (seergedfotsil[n-1] >= 6) labels = new Array(); for (i = 1; i <= n; i++){ labels[i]=alphabet(i-1,1); } Nwidth1 = getFontSize()/16*(n * 45) ; Nheight = getFontSize()/16*(n * 50) ; m1="" m2="" m3="" c1%QUESTION.NUMBER% = "" QuestionText1%QUESTION.NUMBER% = "Consider the following graph and input the degree sequence: "; QuestionText2%QUESTION.NUMBER% = "The degree sequence is "; QuestionText3%QUESTION.NUMBER% = "

Important: input your answer as a non-increasing sequence, without spaces. Separate each value with a comma e.g. 4,4,2,1...

"; EquationText1%QUESTION.NUMBER%=m1+m2+m3+c1%QUESTION.NUMBER%+"
"; //EquationText1%QUESTION.NUMBER% = ""; //just graph displayed ratio_along_line = 0; filled = 1; // = 1 filled arrow else open double_path_colour = "black"; double_path_skinnyness = 10; SVG_graph%QUESTION.NUMBER% = "
"+SVG_digraph(W,ratio_along_line,filled,double_path_colour,double_path_skinnyness) + "
" Correct%QUESTION.NUMBER% = listofdegrees; //document.write(Correct%QUESTION.NUMBER%+"

"); //document.write(Feedback%QUESTION.NUMBER%+"

"); document.write(QuestionText1%QUESTION.NUMBER%+SVG_graph%QUESTION.NUMBER%+QuestionText2%QUESTION.NUMBER%); document.write("") document.write(QuestionText3%QUESTION.NUMBER%); document.write("") } if (document.forms.name=="FEEDBACK") {} else {question%QUESTION.NUMBER%()} ]]> "Choice" INCLUDES "was correct"Well done!]]> "Choice" INCLUDES NOCASE "should have been"You were wrong!]]> OTHERYou should have tried this question!]]> if (document.forms.name=="FEEDBACK") { Count=document.forms.elements.length document.write(document.forms.elements[Count-1].value) var titleofpopup = "Related material"; var help = wheretolook("%QUESTION.TAGS%","%QUESTION.TOPIC%"); document.write("

"+""+"
") } ]]>
Foundationdefault_graphtheory_linearalg_svgHardD1 function process%QUESTION.NUMBER%(QNo) { QT1=QuestionText1%QUESTION.NUMBER% QT2=QuestionText2%QUESTION.NUMBER% QT3=QuestionText2%QUESTION.NUMBER% ET1=EquationText1%QUESTION.NUMBER% COR=Correct%QUESTION.NUMBER% //displays general feedback ANS= "
You were given an undirected graph.

The degree sequence of an undirected graph is the non-increasing sequence of its vertex degrees.

The degree of a vertex is the number of edges connected to the vertex.

For a directed graphs, there are two types of degrees, namely indegree and outdegree and if the graph is not symmetric their values differ.
An undirected graph is symmetric. Therefore indegree and outdegree of a vertex are equal and are called a degree.

Recall that each not connected vertex in such a graph has 0 degree.

To determine the degree sequence you first have to determine the degree of each vertex and then rearrange them into non-increasing order.

In this problem:
the list of degrees (for the vertices from "+alphabet(0,1)+" to "+alphabet(n-1,1)+") is "+degreelist+". Thus, rearranged gives the degree sequence to be "+listofdegrees+".
" for (var i=5; iYour answer, "+document.forms.elements[item].value+", was correct.
"} else {document.forms.elements[item+3].value = "Your answer, "+document.forms.elements[item].value+", should have been "+COR+"

"+ANS+"

"} document.forms.elements[item+3].value = QuestionText1%QUESTION.NUMBER% + SVG_graph%QUESTION.NUMBER% + QuestionText3%QUESTION.NUMBER%+ document.forms.elements[item+3].value; } function question%QUESTION.NUMBER%() { n = displayarray(1,5,7,0); selectone=displayarray(1,0,n-1,0); //document.write(loops+"

"); W = getrandommatrix(n,n,0,0,1); do{ do{ do{ A = getrandomsymmetricmatrix(n,n,0,1,1); B = getrandomsymmetricmatrix(n,n,0,1,1); for(i = 1; i <= n; i++){ A[i][i] = (A[i][i]-0)*0; B[i][i] = A[i][i]; B[selectone][i] = 0; B[i][selectone] = 0; } for(i = 1; i <= n-1; i++){ for(j = i+1; j <= n; j++){ W[i][j] = B[i][j]; W[j][i] = W[i][j]; }} degreelist = new Array(n); for(i = 1; i <= n; i++){ degreelist[i-1] = 0; for(j = 1; j <= n; j++){ degreelist[i-1] += (W[i][j]-0); } } listofdegrees = sorting(degreelist,0); seergedfotsil = sorting(degreelist,1); } while (seergedfotsil < 0) } while (seergedfotsil <=2) } while (seergedfotsil[n-1] >= 6) labels = new Array(); for (i = 1; i <= n; i++){ labels[i]=alphabet(i-1,1); } Nwidth1 = getFontSize()/16*(n * 45) ; Nheight = getFontSize()/16*(n * 50) ; m1="" m2="" m3="" c1%QUESTION.NUMBER% = "" QuestionText1%QUESTION.NUMBER% = "Consider the following graph and input the degree sequence: "; QuestionText2%QUESTION.NUMBER% = "The degree sequence is "; QuestionText3%QUESTION.NUMBER% = "

Important: input your answer as a non-increasing sequence, without spaces. Separate each value with a comma e.g. 4,4,2,1...

"; EquationText1%QUESTION.NUMBER%=m1+m2+m3+c1%QUESTION.NUMBER%+"
"; //EquationText1%QUESTION.NUMBER% = ""; //just graph displayed //document.write(EquationText1%QUESTION.NUMBER%+"

"); ratio_along_line = 0; filled = 1; // = 1 filled arrow else open double_path_colour = "black"; double_path_skinnyness = 10; SVG_graph%QUESTION.NUMBER% = "
"+SVG_digraph(W,ratio_along_line,filled,double_path_colour,double_path_skinnyness) + "
" Correct%QUESTION.NUMBER% = listofdegrees; //document.write(Correct%QUESTION.NUMBER%+"

"); //document.write(Feedback%QUESTION.NUMBER%+"

"); document.write(QuestionText1%QUESTION.NUMBER%+SVG_graph%QUESTION.NUMBER%+QuestionText2%QUESTION.NUMBER%); document.write("") document.write(QuestionText3%QUESTION.NUMBER%); document.write("") } if (document.forms.name=="FEEDBACK") {} else {question%QUESTION.NUMBER%()} ]]> "Choice" INCLUDES "was correct"Well done!]]> "Choice" INCLUDES NOCASE "should have been"You were wrong!]]> OTHERYou should have tried this question!]]> if (document.forms.name=="FEEDBACK") { Count=document.forms.elements.length document.write(document.forms.elements[Count-1].value) var titleofpopup = "Related material"; var help = wheretolook("%QUESTION.TAGS%","%QUESTION.TOPIC%"); document.write("

"+""+"
") } ]]>
Foundationdefault_graphtheory_linearalg_svgHardD1 function process%QUESTION.NUMBER%(QNo) { QT1=QuestionText1%QUESTION.NUMBER% QT2=QuestionText2%QUESTION.NUMBER% QT3=QuestionText2%QUESTION.NUMBER% ET1=EquationText1%QUESTION.NUMBER% COR=Correct%QUESTION.NUMBER% //displays general feedback ANS= "
Given matrix is the representation of an undirected graph.

The degree sequence of an undirected graph is the non-increasing sequence of its vertex degrees.

The degree of a vertex is the number of edges connected to the vertex.

For a directed graphs, there are two types of degrees, namely indegree and outdegree and if the graph is not symmetric their values differ.
An undirected graph is symmetric. Therefore indegree and outdegree of a vertex are equal and are called a degree.

Recall that each not connected vertex in such a graph has 0 degree, that loop should be counted as 2 edges.

To determine the degree sequence you first have to determine the degree of each vertex and then rearrange them into non-increasing order.

In this problem:
the list of degrees (for the vertices from "+alphabet(0,1)+" to "+alphabet(n-1,1)+") is "+degreelist+". Thus, rearranged gives the degree sequence to be "+listofdegrees+".
" for (var i=5; iYour answer, "+document.forms.elements[item].value+", was correct.
"} else {document.forms.elements[item+3].value = "Your answer, "+document.forms.elements[item].value+", should have been "+COR+"

"+ANS+"

"} document.forms.elements[item+3].value = QuestionText1%QUESTION.NUMBER% + SVG_graph%QUESTION.NUMBER% + QuestionText3%QUESTION.NUMBER%+ document.forms.elements[item+3].value; } function question%QUESTION.NUMBER%() { n = displayarray(1,5,7,0); multiedge=displayarray(2,0,n-1,0); doubleedge=sorting(multiedge,1); twoloops=displayarray(2,0,n-1,0); loops=sorting(twoloops,1); //document.write(loops+"

"); W = getrandommatrix(n,n,0,0,1); do{ do{ do{ A = getrandomsymmetricmatrix(n,n,0,2,1); B = getrandomsymmetricmatrix(n,n,0,2,1); for(i = 1; i <= n; i++){ A[i][i] = (A[i][i]-0)*0; B[i][i] = A[i][i]; B[doubleedge][doubleedge] = 2; } for(i = 1; i <= n-1; i++){ for(j = i+1; j <= n; j++){ W[i][j] = B[i][j]; W[loops][loops] = 2; W[loops][loops] = 2; W[j][i] = W[i][j]; }} degreelist = new Array(n); for(i = 1; i <= n; i++){ degreelist[i-1] = 0; for(j = 1; j <= n; j++){ degreelist[i-1] += (W[i][j]-0); } } listofdegrees = sorting(degreelist,0); seergedfotsil = sorting(degreelist,1); } while (seergedfotsil <= 1) } while (seergedfotsil <= 2) } while (seergedfotsil[n-1] >= 6) labels = new Array(); for (i = 1; i <= n; i++){ labels[i]=alphabet(i-1,1); } Nwidth1 = getFontSize()/16*(n * 45) ; Nheight = getFontSize()/16*(n * 50) ; m1="" m2="" m3="" c1%QUESTION.NUMBER% = "" QuestionText1%QUESTION.NUMBER% = "Consider the following graph and input the degree sequence: "; QuestionText2%QUESTION.NUMBER% = "The degree sequence is "; QuestionText3%QUESTION.NUMBER% = "

Important: input your answer as a non-increasing sequence, without spaces. Separate each value with a comma e.g. 4,4,2,1...

"; EquationText1%QUESTION.NUMBER%=m1+m2+m3+c1%QUESTION.NUMBER%+"
"; //EquationText1%QUESTION.NUMBER% = ""; //just graph displayed //document.write(EquationText1%QUESTION.NUMBER%+"

"); ratio_along_line = 0; filled = 1; // = 1 filled arrow else open double_path_colour = "black"; double_path_skinnyness = 10; SVG_graph%QUESTION.NUMBER% = "
"+SVG_digraph(W,ratio_along_line,filled,double_path_colour,double_path_skinnyness) + "
" Correct%QUESTION.NUMBER% = listofdegrees; //document.write(Correct%QUESTION.NUMBER%+"

"); //document.write(Feedback%QUESTION.NUMBER%+"

"); document.write(QuestionText1%QUESTION.NUMBER%+SVG_graph%QUESTION.NUMBER%+QuestionText2%QUESTION.NUMBER%); document.write("") document.write(QuestionText3%QUESTION.NUMBER%); document.write("") } if (document.forms.name=="FEEDBACK") {} else {question%QUESTION.NUMBER%()} ]]> "Choice" INCLUDES "was correct"Well done!]]> "Choice" INCLUDES NOCASE "should have been"You were wrong!]]> OTHERYou should have tried this question!]]> if (document.forms.name=="FEEDBACK") { Count=document.forms.elements.length document.write(document.forms.elements[Count-1].value) var titleofpopup = "Related material"; var help = wheretolook("%QUESTION.TAGS%","%QUESTION.TOPIC%"); document.write("

"+""+"
") } ]]>
Foundationdefault_graphtheory_linearalg_svgHardD1 function process%QUESTION.NUMBER%(QNo) { QT1=QuestionText1%QUESTION.NUMBER% QT2=QuestionText2%QUESTION.NUMBER% QT3=QuestionText2%QUESTION.NUMBER% ET1=EquationText1%QUESTION.NUMBER% COR=Correct%QUESTION.NUMBER% //displays general feedback ANS= "
" for (var i=5; iYour answer, "+document.forms.elements[item].value+", was correct.
"} else {document.forms.elements[item+3].value = "Your answer, "+document.forms.elements[item].value+", should have been "+COR+"

"+ANS+"

"} document.forms.elements[item+3].value = QuestionText1%QUESTION.NUMBER% + SVG_graph%QUESTION.NUMBER% + QuestionText3%QUESTION.NUMBER%+ document.forms.elements[item+3].value; } function question%QUESTION.NUMBER%() { n = displayarray(1,5,7,0); multiedge=displayarray(2,0,n-1,0); doubleedge=sorting(multiedge,1); //document.write(doubleedge+"

"); W = getrandommatrix(n,n,0,0,1); do{ do{ do{ A = getrandomsymmetricmatrix(n,n,0,2,1); B = getrandomsymmetricmatrix(n,n,0,2,1); for(i = 1; i <= n; i++){ A[i][i] = (A[i][i]-0)*0; B[i][i] = A[i][i]; B[doubleedge][doubleedge] = 2; } for(i = 1; i <= n-1; i++){ for(j = i+1; j <= n; j++){ W[i][j] = B[i][j]; W[j][i] = W[i][j]; }} degreelist = new Array(n); for(i = 1; i <= n; i++){ degreelist[i-1] = 0; for(j = 1; j <= n; j++){ degreelist[i-1] += (W[i][j]-0); } } listofdegrees = sorting(degreelist,0); seergedfotsil = sorting(degreelist,1); } while (seergedfotsil <= 1) } while (seergedfotsil <= 2) } while (seergedfotsil[n-1] >= 6) labels = new Array(); for (i = 1; i <= n; i++){ labels[i]=alphabet(i-1,1); } Nwidth1 = getFontSize()/16*(n * 45) ; Nheight = getFontSize()/16*(n * 50) ; m1="" m2="" m3="" c1%QUESTION.NUMBER% = "" QuestionText1%QUESTION.NUMBER% = "Consider the following graph and input the degree sequence: "; QuestionText2%QUESTION.NUMBER% = "The degree sequence is "; QuestionText3%QUESTION.NUMBER% = "

Important: input your answer as a non-increasing sequence, without spaces. Separate each value with a comma e.g. 4,4,2,1...

"; EquationText1%QUESTION.NUMBER%=m1+m2+m3+c1%QUESTION.NUMBER%+"
"; //EquationText1%QUESTION.NUMBER% = ""; //just graph displayed //document.write(EquationText1%QUESTION.NUMBER%+"

"); ratio_along_line = 0; filled = 1; // = 1 filled arrow else open double_path_colour = "black"; double_path_skinnyness = 10; SVG_graph%QUESTION.NUMBER% = "
"+SVG_digraph(W,ratio_along_line,filled,double_path_colour,double_path_skinnyness) + "
" Correct%QUESTION.NUMBER% = listofdegrees; //document.write(Correct%QUESTION.NUMBER%+"

"); //document.write(Feedback%QUESTION.NUMBER%+"

"); document.write(QuestionText1%QUESTION.NUMBER%+SVG_graph%QUESTION.NUMBER%+QuestionText2%QUESTION.NUMBER%); document.write("") document.write(QuestionText3%QUESTION.NUMBER%); document.write("") } if (document.forms.name=="FEEDBACK") {} else {question%QUESTION.NUMBER%()} ]]> "Choice" INCLUDES "was correct"Well done!]]> "Choice" INCLUDES NOCASE "should have been"You were wrong!]]> OTHERYou should have tried this question!]]> if (document.forms.name=="FEEDBACK") { Count=document.forms.elements.length document.write(document.forms.elements[Count-1].value) var titleofpopup = "Related material"; var help = wheretolook("%QUESTION.TAGS%","%QUESTION.TOPIC%"); document.write("

"+""+"
") } ]]>