728x90
300x250

[수학(Math)] 4. 사칙연산 (덧셈, 뺄셈, 곱셈, 나눗셈)

 

-> * 덧셈(Addition "읽기: 어디션"), 또는 Plus "플러스"),

    * 뺄셈(Subtraction "읽기: 서브트랙션" 또는 Minus "마이너스")

    * 곱셈(Multiply "멀티플")

    * 나눗셈(Divide "디바이드")

 

1. 기초 사칙연산에 대해서(Basic Arithmetic Operations)

 

 덧셈

1

2

3

 뺄셈

3

1

2

 곱셈

4

2

8

 나눗셈

8

더블클릭을 하시면 수식을 수정할 수 있습니다.

4

 

이게 쉬워보일 수도 있습니다. (Look at the this easy)
실제로 모르는 분들이 많아서 작성합니다. (Actually, This Arithmetic didn't know many people.)

 

 덧셈의 예(Example of addition)

 문제)

 1

 3

 2

더블클릭을 하시면 수식을 수정할 수 있습니다.

 

 단계1)

 

 4

 

 2

 

 결과)

 

 

 

 

 

 

 2

 

 뺄셈의 예(Example of Subtraction)

 문제)

 1

 3

 2

더블클릭을 하시면 수식을 수정할 수 있습니다.

 

 단계1)

 

-2

 

 2

더블클릭을 하시면 수식을 수정할 수 있습니다.

 

 결과)

 

 

 

 

 

 

-4

 

 곱셈의 예(Example of Multiplication)

 문제)

3

 2

6

더블클릭을 하시면 수식을 수정할 수 있습니다.

 

 단계1)

 

 6

 

6

 

 결과)

 

 

 

 

 

 

0

 

 나눗셈의 예(Example of Division)

 문제)

8

 2

6

더블클릭을 하시면 수식을 수정할 수 있습니다.

 

 단계1)

 

 4

 

6

 

 결과)

 

 

 

 

 

 

-2

 

 

2. "구구단(곱셈 나열표)".

 

1

x

 0

0

1

x

 1

1

1

x

 2

더블클릭을 하시면 수식을 수정할 수 있습니다.

2

1

x

 3

더블클릭을 하시면 수식을 수정할 수 있습니다.

3

1

x

 4

더블클릭을 하시면 수식을 수정할 수 있습니다.

4

1

x

 5

5

1

x

 6

6

1

x

 7

7

1

x

 8

8

1

x

 9

더블클릭을 하시면 수식을 수정할 수 있습니다.

9

 

 2

x

 0

더블클릭을 하시면 수식을 수정할 수 있습니다.

 0

 2

x

 1

더블클릭을 하시면 수식을 수정할 수 있습니다.

 2

 2

x

 2

더블클릭을 하시면 수식을 수정할 수 있습니다.

 4

 2

x

 3

 6

 2

x

 4

더블클릭을 하시면 수식을 수정할 수 있습니다.

 8

 2

x

 5

더블클릭을 하시면 수식을 수정할 수 있습니다.

 10

 2

x

 6

 12

 2

x

 7

 14

 2

x

 8

더블클릭을 하시면 수식을 수정할 수 있습니다.

 16

 2

x

 9

더블클릭을 하시면 수식을 수정할 수 있습니다.

 18

 

외우는 분들이 계시는 데, 이게 하도......

 

3

x

 0

더블클릭을 하시면 수식을 수정할 수 있습니다.

0

3

x

 1

더블클릭을 하시면 수식을 수정할 수 있습니다.

3

3

x

 2

더블클릭을 하시면 수식을 수정할 수 있습니다.

6

3

x

 3

더블클릭을 하시면 수식을 수정할 수 있습니다.

9

3

x

 4

더블클릭을 하시면 수식을 수정할 수 있습니다.

12

3

x

 5

더블클릭을 하시면 수식을 수정할 수 있습니다.

15

3

x

 6

더블클릭을 하시면 수식을 수정할 수 있습니다.

18

3

x

 7

더블클릭을 하시면 수식을 수정할 수 있습니다.

21

3

x

 8

더블클릭을 하시면 수식을 수정할 수 있습니다.

24

3

x

 9

더블클릭을 하시면 수식을 수정할 수 있습니다.

27

 

 

3. 나눗셈도 있긴 있습니다. 거꾸로 하면 됩니다.

 

27

 9

더블클릭을 하시면 수식을 수정할 수 있습니다.

3

24

 8

더블클릭을 하시면 수식을 수정할 수 있습니다.

3

21

 7

더블클릭을 하시면 수식을 수정할 수 있습니다.

3

18

 6

3

15

 5

더블클릭을 하시면 수식을 수정할 수 있습니다.

3

12

 4

3

9

 3

3

6

 2

더블클릭을 하시면 수식을 수정할 수 있습니다.

3

3

 1

더블클릭을 하시면 수식을 수정할 수 있습니다.

3

0

 0

더블클릭을 하시면 수식을 수정할 수 있습니다.

0

 

 

4. 재미있는 주제

 

   

 

     답만 이야기하면, 13.5 입니다.

     소수점의 시작을 이야기합니다.

    

찾아보면 재미있을 것은 "유리수"와 "정수"에 대해서.

 

* 13은 정수이냐, 유리수이냐?


     -> 둘 다 됩니다.
 

     -> 13.0으로도 표기가 가능하고, 13으로도 표기가 됩니다

* 13.5는 정수이냐 유리수이냐?

     -> 유리수입니다.

 

반응형
728x90
300x250

[수학(Math)] 3. 방정식 - 지수(Pow)에 대해서

 

1. This part is very easy.

 

 

 

 이게 어떻게 되냐면요.

  

 

 

 지수(Pow)를 실제 적용한 예

 

 

 * 표기(Expression)
  

 * 표현 의미(Meaning of Expression)

 

 

 - 방정식을 구성하고 있는 예

 

 

알고 있으면, 좋은 배경지식이라고 하면

 

-> 곱셈, 나눗셈, 덧셈, 뺄셈 정도면 됩니다.

반응형
728x90
300x250
[수학(Math)] 2. 그래프 그리기 (Create the Graph Model)

 

1. 2차원 그래프 그리기(Draw the two dimension graph)

 

-> 아래의 값이 있다고 합시다. (Below, take at the figure table.)

     x, y에 대한 값( value of 'x', 'y')

 

 x

 y

 1

 2

 2

 3

 4

 40 

 

-> 아래와 같이 점선을 따라서 그림을 그리면 됩니다.

    (Draw the graph that each Below)

 

 

 170115-ex-figure1.pptx

 170115-ex-figure1.odp

 170115-ex-figure1.ppt

 

반응형
728x90
300x250
[수학(Math)] 1. 방정식과 부등식(Equation and Inequality)

 

기초 수학에 있어서, 가장 필요한 것은 크게 많은 걸 요구하지 않습니다.

 

 1. 수학에 있어서 기초가 되는 방정식에 대해서

 

  

  쉽게 단순하게 x 에 무엇이 들어가느냐?

 

 

   왜냐하면,

 

 

 

방정식에 있어서 원초적인 것을 이야기하면, 이렇게 시작합니다.

제일 중요한 거에요.

 

 2. 수학에 있어서 기초가 되는 부등식에 대해서

  

 

  쉽게 단순하게 x 에 무엇이 들어가느냐?

 

 

  실제로는 x = 1도 됩니다.

  왜냐하면, 3 이하면 됩니다.

 

 

 

 

매우 원초적인 수학은 이렇게 시작합니다.

반응형
728x90
300x250

[자료구조(Data Structure)] - 6. Linked Queue

 

1. Linked Queue 동작 로직

 

a. 삽입(push)

 

b. 인출(pop)

 

 

2. Linked Queue ADT

 

 abstract interface Queue{

       abstract void Push( Object x );

       abstract Object pop();

       abstract boolean isEmpty();

 }

 

 Queue Interface ADT

 

 

 
class LinkedNode{
        private Object data;
        private LinkedNode next;
 
        public void setData(Object x)
        {
             this.data = x;
        }


       public void setNext(LinkedNode node)
       {
             this.next = node;
       }

       public Object getData()
       {
            return this.data;
       }

       public LinkedNode getNext()
       {
            return this.next;
       }
}

LinkedNode ADT

 

3. 코드 구현

 

 

 abstract interface Queue{

       abstract void Push( Object x );

       abstract Object pop();

       abstract boolean isEmpty();

 }

 class LinkedNode{
        private Object data;
        private LinkedNode next;
 
        public void setData(Object x)
        {
             this.data = x;
        }


       public void setNext(LinkedNode node)
       {
             this.next = node;
       }

       public Object getData()
       {
            return this.data;
       }

       public LinkedNode getNext()
       {
            return this.next;
       }
}

 class LinkedQueue implements Queue{

          private LinkedNode front;
          private LinkedNode rear;
 
          public LinkedQueue(){
                 this.front = null;
                 this.rear = null;
          }
 
          public void push(Object x){
  
                 LinkedNode newNode = new LinkedNode();

                 newNode.setData( x );
                 newNode.setNext( null );

              

                 if( isEmpty() )
                 {
                       this.front = newNode;
                       this.rear = newNode;  
                 }
                 else{
                       this.rear.setNext ( newNode );
                       this.rear = newNode;
                 }

          }

 

          public Object pop(){
   
                 if ( isEmpty() )
                       return null;
  
                 Object data = front.getData();
   
                 LinkedNode prevnode = front;
                 front = front.getNext();
 
                 prevnode = null;
                 return data;
         }

 

         public Object peak(){
  
                if ( isEmpty() )
                        return null;
                else
                        return front;

         }

 

         public boolean isEmpty(){
  
                if(front == null)
                        return true;
                else
                        return false;  

          }
 
          public void viewOfAll()
          {
                LinkedNode current = this.front;
  
                System.out.println("출력 ---------");
 
                while ( current != null )
                {
                         System.out.println( current.getData() );
                         current = current.getNext();
                 }

           }

 }

 
public class LinkedQueueProgram{
 
         public static void main(String args[])
         {
                 LinkedQueue queue = new LinkedQueue();
                 queue.push("1번");
                 queue.push("2번");
                 queue.push("3번");
                 queue.viewOfAll();

 

                 queue.pop(); 
                 queue.viewOfAll();
 
                 queue.push("1번");
                 queue.viewOfAll();

         }
}

 LinkedQueueProgram.java

 

 

반응형
728x90
300x250
[자료구조(Data Structure)] - 5. Circular Queue with Array

 

먼저 환형 큐 with 배열을 소개하면, 여러분들 원으로 된 시계 잘 아신가요??

 

1. 잔머리 굴려보기

 

 

실제로는 원이 아닙니다. 배열 index가 마치 회전하는 듯한 연상이 이해하는 데 도움이 되기 때문에 그려 놓은 겁니다.

예를 들어 저기 원이 Size가 4개인데, 회전하는 데 있어서 회전을 균일하게 잡아줄 공간이 필요합니다.

 

저 원이 예를 들어 Size가 4라고 하면, 실제로 사용가능한 공간은 Size 3입니다.

 

잉여공간 1개를 부여하지 않으면, rear index가 기존에 있는 데이터를 하나 잡아 먹게 됩니다.

(이 부분은 여러분들이 한번 아래의 코드를 수정해서 생각해보시기 바랍니다.)

(또는 종이로 한번 그려보시기 바랍니다.)

 

갑자기 설명하는데, 잔 테크닉 먼저 이야기해서 난해하셨을 것 같습니다.

다시 기본 원리에 대해 소개 해드리겠습니다.

 

2. 기본 원리는?

 

먼저 동작 원리를 구현한 결과입니다. (파워포인트로 그리기엔 솔직히 귀찮고 힘든 일입니다.)

대신 코드 동작으로 똑같이 표현해드리겠습니다.

 

먼저 Queue 자료 구조의 ADT형을 이해하기에 앞서 용어를 이해하기 쉽게 설명해드리고 ADT를 설명해드리겠습니다.

push (어떤 책에선 enqueue( datatype x ) ), pop (어떤 책에선 dequeue ( ) )라고 표기합니다.

 

 abstract interface Queue{

      abstract void push ( Object x ) ;

      abstract Object pop ( ) ;

      abstract boolean isEmpty ( );

      abstract Object peak ( ) ;

 }

 Queue의 ADT

 

큐(Singly Queue), 환형 큐(Circular Queue)나, 연결 큐(Linked Queue) 등 기본 ADT는 이걸로 사용합니다.

이건 Stack ADT나 동일합니다. (소개하지 않아서 언급은 여기서 ~ 끝)

 public class ArrayQueue implements Queue{

 

      private int front;

      private int rear;

      private int count;

      private int queuesize;

     

      private Object[] itemArray;

 

      public ArrayQueue()

      {

               this.front = 0;

               this.rear = 0;

               this.count = 0;

               this.queueSize = 10;

               this.itemArray = new Object [ this.queueSize ];

      }

 } 

 배열 큐 - Circular Queue 구현 - 기본 Instance Variable, Constructor


Push(삽입) 원리

 

 rear = ( rear + 1 ) % n

 itemArray[rear] = x ;

 

Pop(인출) 원리

 

 front = ( front + 1 ) % n

 Object data = itemArray ( front );

 

 

3. 코드로 한번 실험해보세요.

 

 
abstract interface Queue{
 
        abstract boolean isEmpty();
        abstract void push(Object x);
        abstract Object pop();
        abstract Object peak(); 
}

 

class ArrayQueue implements Queue{

         private int front;
         private int rear;
         private int count;
         private int queueSize;
         private int increment;
         private Object[] itemArray;
 
         public ArrayQueue( )
         {
                 this.front = 0;
                 this.rear = 0;
                 this.count = 0;
                 this.increment = 5;
                 this.queueSize = 5;

                 itemArray = new Object[queueSize];
          }

 

          private void queueFull()
          {
  
                 int prevQueueSize = queueSize;
                 queueSize += increment ;
  
                 Object[] prevItemArr = itemArray.clone();
                 itemArray = new Object[queueSize];
  
                 int i = 0;

                 while( i < prevQueueSize )
                 {
                         itemArray[i] = prevItemArr[front];
                         front = (front + 1) % prevQueueSize;
   
                         i++;
                 }

 

                 front = 0;
                 rear = count;
        }
 
        public boolean isEmpty(){
                 return (count == 0) ? true : false ;
        }

        public void push(Object x){
  
                 if ( ( count + 1 ) ==  queueSize )
                        queueFull();

 

                 rear = ( rear + 1 ) % queueSize;
                 itemArray[ rear ] = x;
  
                 count++;

        }

 

        public Object pop(){

                if( isEmpty() )
                       return null;
  
                front = (front + 1) % queueSize;
                Object item = itemArray[front];
                itemArray[front] = null;
  
                count--;

                return item;
         }
 
          public Object peak(){
  
               if( isEmpty() )
                       return null;
               else
                       return itemArray[front];

          }

 

           public void viewOfAll( String label )
           {
                   System.out.println ( "\n\n[" + label + "]/-----실험결과" );
    
                   for ( Object x : itemArray )
                  {
                            System.out.println ( x );   

                   }

            }

 

             public int getCount()
             {
                     return this.count;
             }
 }

 

 public class QueueProgram{

             public static void main(String args[])
             { 

                     ArrayQueue queue = new ArrayQueue();
  
                     queue.push("1번");
                     queue.push("2번");
                     queue.push("3번");
                     queue.push("4번");
                     queue.viewOfAll("1번");

 

                     queue.pop();
                     queue.viewOfAll("2번");

 

                     queue.push("5번");
                     queue.viewOfAll("3번");

 

                     queue.push("6번");
                     queue.viewOfAll("4번");

 

                     queue.pop();
                     queue.viewOfAll("5번");


                     queue.pop();
                     queue.viewOfAll("6번");

 

                     queue.push("7번");
                     queue.viewOfAll("7번");

 

                     queue.push("8번");
                     queue.viewOfAll("8번");

 

                     queue.pop();
                     queue.viewOfAll("9번");

 

                     queue.pop();
                     queue.viewOfAll("11번");

 

                     queue.push("9번");
                     queue.viewOfAll("12번");

 

                     queue.push("10번");
                     queue.viewOfAll("13번");

 

                     queue.push("11번");
                     queue.viewOfAll("14번");

 

                     queue.push("12번");
                     queue.viewOfAll("15번");
 
         }

}

 QueueProgram.java

 

반응형
728x90
300x250

[자료구조(Data Structure)] - 4. Circular Linked List - Java

 

작년에 배운 자료구조 복습 겸 다시 짜봤습니다.

LinkedList Class 내에 headnode와 firstnode를 보통은 두고 짜는 데 한번 rootnode 하나만 두고 대신 length(정수형)을 추가하여 구현해봤습니다.

 

전체 로직은 이렇습니다.

 

 

/*      
       Data Structure Circular Linked List - rootnode만 이용
       2015. 4. 25
       James
*/ 

 

class Node

{
        private Object data;
        private Node prev;
        private Node next;

 

        // Getter
        public Object getdata()
        {
             return this.data;
        }

        public Node getprev()
        {
             return this.prev;
        }

        public Node getnext()
        { 
             return this.next;
        }
 

        // Setter
        public void setdata(Object data)
       {
             this.data = data;
       }

       public void setprev(Node prev)
       {
             this.prev = prev;
       }

       public void setnext(Node next)
       {
             this.next = next;
       }


class LinkedList{

       private Node headnode;
       private long length;
 
       public LinkedList(){
              this.headnode = null;
              this.length = 0;
       }

       public void insert(Object data)
       {
              Node createnode = new Node();  

              createnode.setdata(data);
              createnode.setprev( createnode );
              createnode.setnext( createnode );
  
              if ( this.headnode == null )
              {
                       this.headnode = createnode;
              }
              else
              { 
                      Node firstnode = this.headnode.getnext();   
   
                      // 현재 기억하고 있는 이전 노드 설정
                      createnode.setprev ( this.headnode );

                      // 맨 마지막 노드 처음 위치 지정
                      createnode.setnext ( firstnode );

                      // 현재 노드 -> node 삽입 (Next)
                      this.headnode.setnext( createnode );
   
                      // 현재 노드 -> 다음 노드로 이동
                      this.headnode = this.headnode.getnext();

                      // 맨 처음 노드 마지막 위치 지정
                      firstnode.setprev( this.headnode );
              }

              this.length++;
  
 }
 
 public void remove(Object data)
 {
             Node currentnode = this.headnode.getnext();
             boolean check = false;  

             long cnt = 0;  
  
             // 데이터 검색
             while ( cnt < length )
             {
                       if( currentnode.getdata() == data)
                       {    
                               check = true;
                               break;
                       }

                       currentnode = currentnode.getnext();
   
                       cnt++;
             }

 

              // 3가지 기준 (맨 처음 자료, 중간 자료, 맨 마지막 자료)
              if ( check == true )
              {
                      Node firstnode = this.headnode.getnext();
                      Node lastnode = this.headnode;
  
                      // 맨 처음 자료
                      if ( currentnode == firstnode )
                      { 
                                // 다음 주소가 firstnode와 일치시
                                if ( this.headnode.getnext ( ) == firstnode ){

                                        Node prevnode = firstnode.getprev();
                                        Node nextnode = firstnode.getnext();
     
                                        firstnode = nextnode;
                                        firstnode.setprev ( prevnode ) ;
                                        this.headnode.setnext ( firstnode ) ;
                               }
                               else
                                        this.headnode = this.headnode.getnext ( ) ; 
                      }

 

                     // 중간 자료 판별
                     if ( currentnode != firstnode && currentnode != lastnode )
                     {
                               Node prevnode = currentnode.getprev ( ) ;
                               Node nextnode = currentnode.getnext ( ) ;

                               currentnode = prevnode ;
                               currentnode.setnext ( nextnode ) ;
                               nextnode.setprev ( prevnode ); 
                     }

 

                      // 마지막 자료 판별
                      if ( currentnode == lastnode && this.headnode != null )
                      {
                               Node prevnode = currentnode.getprev ( ) ;

                        
                               prevnode.setnext ( firstnode ) ;
                               firstnode.setprev ( prevnode ) ;
     
                               currentnode = null ;

                               this.headnode = prevnode;
                      }
 
                      this.length--;

                }  

        }
  
        public void view()
        {
                  Node currentnode = this.headnode.getnext();
    
                  long cnt = 1;

                  while ( cnt <= length )
                  {
                           System.out.println( "번호:" + cnt + ", Data:" + currentnode.getdata() ) ;
   
                           currentnode = currentnode.getprev() ;
                           cnt++;
                  } 
         }
 
         public long getlength()
         {
                  return this.length;
         }

 

          public Node getnode()
          {
                  return this.headnode;
          }

}

 

public class Ds{

         public static void main(String args[])
        {
             LinkedList list = new LinkedList();

             list.insert("야호1"); 
             list.view();

             list.remove("야호1");
             System.out.println( list.getlength() ) ;
             list.view();
       }

 Ds.java

 

반응형
728x90
300x250
[PC활용] uTorrent - Torrent 토렌트 파일(Seed) 배포하기

 

.torrent 파일은 많이 이용해보셨을 겁니다.

이번에는 사람들에게 배포하는 방법을 소개하도록 하겠습니다. 

 

 

(uTorrent 3.4.2)

 

최신 버전인 uTorrent 3.4.2을 기준으로 소개하도록 하겠습니다.

 


1. 새 토렌트 만들기

 

 

 

 빨강색으로 친 아이콘을 클릭합니다. (새 토렌트 만들기)

 


2. 파일 선택 / 폴더 선택

 

 

 

 새 토렌트 만들기 -> 파일 추가

                           -> 폴더 추가

 

 

 

 

 곰돌이.mp3를 선택하겠습니다. (예제)

 

 


3. 만들기

 

 

 결론은 만들기를 클릭하면, .torrent파일이 생성됩니다.

 

 

 

 

 토렌트 파일은 .torrent을 저장(S)을 클릭하면 실제 파일을 생성할 수 있습니다.

 


4. 배포 중 (정상 배포가 될 수 있는 상태인지 확인해보기)

 

 

 

 파일 배포를 위한 상태가 되었는지 확인해보시기 바랍니다.

 

 

 

 

 아까 만든 파일을 배포하면, 파일을 배포할 수 있게 됩니다.

 

 
반응형

+ Recent posts