<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://drorbn.net/index.php?action=history&amp;feed=atom&amp;title=10-1100%2FAssignment_1_Part_1_by_Peter</id>
	<title>10-1100/Assignment 1 Part 1 by Peter - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://drorbn.net/index.php?action=history&amp;feed=atom&amp;title=10-1100%2FAssignment_1_Part_1_by_Peter"/>
	<link rel="alternate" type="text/html" href="https://drorbn.net/index.php?title=10-1100/Assignment_1_Part_1_by_Peter&amp;action=history"/>
	<updated>2026-05-04T18:25:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.6</generator>
	<entry>
		<id>https://drorbn.net/index.php?title=10-1100/Assignment_1_Part_1_by_Peter&amp;diff=9563&amp;oldid=prev</id>
		<title>Badeamug at 04:25, 12 October 2010</title>
		<link rel="alternate" type="text/html" href="https://drorbn.net/index.php?title=10-1100/Assignment_1_Part_1_by_Peter&amp;diff=9563&amp;oldid=prev"/>
		<updated>2010-10-12T04:25:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Pyraminx Analysis Using Matlab ==&lt;br /&gt;
=== By: Peter Badea ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This article will attempt to guide the reader through an analysis of the number of possible permutations of a Pyraminx puzzle (see [http://en.wikipedia.org/wiki/Pyraminx Pyraminx]):&lt;br /&gt;
&lt;br /&gt;
[[Image:10-1100-Peter-pyraminx.jpg]]&lt;br /&gt;
----&lt;br /&gt;
Please Note: It has come to my attention that Mr. Charles Tsang has also posted an analysis of the Pyraminx problem. This is an unfortunate coincidence that was only observed after the problem had been solved. A quick glance at the very different program code (and even program used) will surely lead any reader to this conclusion. His solution can be found [http://katlas.math.toronto.edu/drorbn/index.php?title=10-1100/Assignment_1_Part_1_by_Charles here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
As can be seen above, this puzzle is similar to that of the Rubik&amp;#039;s cube except for the differing shape (that of a tetrahedron as opposed to a cube). Each side is an equilateral triangle composed of 9 smaller equilateral triangles all joined in the fashion shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:10-1100-Peter-pyramix_map.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The labeling shown above is important to understand the meaning of each permutation expressed in standard notation. To apply the the Schreier–Sims algorithm to this problem, a set of generators must first be found. These can be expressed as the 8 rotations (about each of 4 vertices) that involve rotating either only the vertex piece (4 trivial rotations) or 2 (of the total 3) rows of pieces.&lt;br /&gt;
&lt;br /&gt;
A recursive function for feeding each permutation into the table T is then constructed in Matlab:&lt;br /&gt;
&lt;br /&gt;
    function Tnew = feed(s,T)&lt;br /&gt;
    &lt;br /&gt;
    j2 = 0;&lt;br /&gt;
    Tnew = T;&lt;br /&gt;
    &lt;br /&gt;
    %find pivot point&lt;br /&gt;
    for i2 = 1:36&lt;br /&gt;
        if s(i2) ~= i2&lt;br /&gt;
            j2 = s(i2);&lt;br /&gt;
            break&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if j2 ~= 0 %s is not identity permutation&lt;br /&gt;
        if T(1,i2,j2) == 0 %empty box&lt;br /&gt;
            Tnew(:,i2,j2) = s;&lt;br /&gt;
        else %T(1,i2,j2) ~= 0; non-empty box&lt;br /&gt;
            for k2 = 1:36 %define t inverse, where t is the permutation currently in the box&lt;br /&gt;
                tInv(k2) = find(T(:,i2,j2) == k2);&lt;br /&gt;
            end&lt;br /&gt;
        &lt;br /&gt;
            for k2 = 1:36 %define t inverse * s&lt;br /&gt;
                tInvs(k2) = tInv(s(k2));&lt;br /&gt;
            end&lt;br /&gt;
        &lt;br /&gt;
            %feed t inverse * s&lt;br /&gt;
            Tnew = feed(tInvs,T);&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using this function, the Schreier–Sims algorithm is then implemented in Matlab in the following way:&lt;br /&gt;
&lt;br /&gt;
    clear&lt;br /&gt;
    clc&lt;br /&gt;
    &lt;br /&gt;
    T = zeros(36,36,36);&lt;br /&gt;
    &lt;br /&gt;
    %initialize T&lt;br /&gt;
    for i = 1:36&lt;br /&gt;
        T(:,i,i) = ones(36,1);&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    Tnew = T;&lt;br /&gt;
    &lt;br /&gt;
    %generators&lt;br /&gt;
    s1 = 1:36;&lt;br /&gt;
    s1([1,26,36]) = [26,36,1];&lt;br /&gt;
    &lt;br /&gt;
    s2 = 1:36;&lt;br /&gt;
    s2([5,10,11]) = [10,11,5];&lt;br /&gt;
    &lt;br /&gt;
    s3 = 1:36;&lt;br /&gt;
    s3([9,15,16]) = [15,16,9];&lt;br /&gt;
    &lt;br /&gt;
    s4 = 1:36;&lt;br /&gt;
    s4([30,31,32]) = [31,32,30];&lt;br /&gt;
    &lt;br /&gt;
    s5 = 1:36;&lt;br /&gt;
    s5([2,3,4,17,25,27,28,34,35]) = [28,27,17,34,2,35,25,4,3];&lt;br /&gt;
    &lt;br /&gt;
    s6 = 1:36;&lt;br /&gt;
    s6([2,6,7,12,13,17,18,19,20]) = [13,12,20,18,19,7,6,2,17];&lt;br /&gt;
    &lt;br /&gt;
    s7 = 1:36;&lt;br /&gt;
    s7([4,7,8,13,14,22,23,24,25]) = [13,22,14,23,24,25,4,8,7];&lt;br /&gt;
    &lt;br /&gt;
    s8 = 1:36;&lt;br /&gt;
    s8([19,20,21,22,23,28,29,33,34]) = [22,23,33,34,28,20,21,29,19];&lt;br /&gt;
    &lt;br /&gt;
    %feed generators into Tnew&lt;br /&gt;
    Tnew = feed(s1,Tnew);&lt;br /&gt;
    Tnew = feed(s2,Tnew);&lt;br /&gt;
    Tnew = feed(s3,Tnew);&lt;br /&gt;
    Tnew = feed(s4,Tnew);&lt;br /&gt;
    Tnew = feed(s5,Tnew);&lt;br /&gt;
    Tnew = feed(s6,Tnew);&lt;br /&gt;
    Tnew = feed(s7,Tnew);&lt;br /&gt;
    Tnew = feed(s8,Tnew);&lt;br /&gt;
    &lt;br /&gt;
    while length(find(Tnew ~= T)) ~= 0 %while table is still changing&lt;br /&gt;
        T = Tnew;&lt;br /&gt;
        for i = 1:35&lt;br /&gt;
            for j = i+1:36&lt;br /&gt;
                for k = 1:35&lt;br /&gt;
                    for l = k+1:36&lt;br /&gt;
                        if T(1,i,j) ~= 0 &amp;amp; T(1,k,l) ~= 0&lt;br /&gt;
                            Tnew = feed(T(T(:,k,l),i,j),Tnew);&lt;br /&gt;
                        end                    &lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    ord = 1;&lt;br /&gt;
    &lt;br /&gt;
    for i = 1:36&lt;br /&gt;
        ord = ord * length(find(T(1,i,:)));&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    disp([&amp;#039;Order = &amp;#039;,num2str(ord)])&lt;br /&gt;
    &lt;br /&gt;
    for i = 1:36&lt;br /&gt;
        for j = 1:36&lt;br /&gt;
            if T(1,i,j) ~= 0&lt;br /&gt;
                plot(i,j,&amp;#039;+&amp;#039;)&lt;br /&gt;
                hold on&lt;br /&gt;
                axis equal&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above code yields the following result:&lt;br /&gt;
  Order = 75582720&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Graphing the values where the table T is non-zero yields the following graph:&lt;br /&gt;
[[Image:10-1100-Peter-pyramix_matrix.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If we then change the code slightly to disallow turning of the 4 vertex pieces (the trivial rotations), we get a different result:&lt;br /&gt;
  Order = 933120&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a more accurate description of the difficulty that solving such a puzzle would entail due to the fact that the 4 vertex pieces may always be turned at the very end, and no particular strategy needs to be employed in placing them.&lt;/div&gt;</summary>
		<author><name>Badeamug</name></author>
	</entry>
</feed>