Skip to content · ⁨ข้ามไปยังเนื้อหา⁩
Subjects · ⁨รายวิชา⁩

AP Computer Science Principles

Tips · ⁨เคล็ดลับ⁩

AP Computer Science Principles is the broad computing course: data and its representation, algorithms and abstraction, programming, the internet, and the impact of computing on society. Code is written in any language, and the exam uses a language-neutral pseudocode, so the ideas matter more than the syntax.

The assessment has two halves. The Create Performance Task is a program you build and document over class time; the end-of-course exam is multiple choice.

The written responses about your own program are where marks are lost — they ask you to explain an algorithm you wrote and to justify an abstraction you chose, precisely, in your own words.

The notes cover the big ideas from data through to impact, with code examples you can run here. The library holds the sample exam questions, and there are notes on the Create Performance Task, which is assessed on your own program and written responses rather than on the exam alone.

  • 1

    Creative Development · ⁨การพัฒนาสร้างสรรค์⁩

    Watch lesson · ⁨ดูบทเรียน⁩
    1.1

    Collaboration · ⁨การทำงานร่วมกัน⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (CRD-1): Incorporating multiple perspectives through collaboration improves computing innovations as they are developed.

    Learning Objective CRD-1.A: Explain how computing innovations are improved through collaboration. [Skill 1.C]

    • CRD-1.A.1 A computing innovation includes a program as an integral part of its function.
    • CRD-1.A.2 A computing innovation can be physical (e.g., self-driving car), nonphysical computing software (e.g., picture editing software), or a nonphysical computing concept (e.g., e-commerce).
    • CRD-1.A.3 Effective collaboration produces a computing innovation that reflects the diversity of talents and perspectives of those who designed it.
    • CRD-1.A.4 Collaboration that includes diverse perspectives helps avoid bias in the development of computing innovations.
    • CRD-1.A.5 Consultation and communication with users are important aspects of the development of computing innovations.
    • CRD-1.A.6 Information gathered from potential users can be used to understand the purpose of a program from diverse perspectives and to develop a program that fully incorporates these perspectives.

    Learning Objective CRD-1.B: Explain how computing innovations are developed by groups of people. [Skill 1.C]

    • CRD-1.B.1 Online tools support collaboration by allowing programmers to share and provide feedback on ideas and documents.
    • CRD-1.B.2 Common models such as pair programming exist to facilitate collaboration.

    Learning Objective CRD-1.C: Demonstrate effective interpersonal skills during collaboration. [Skill 1.C]

    • CRD-1.C.1 Effective collaborative teams practice interpersonal skills, including but not limited to:
      • communication
      • consensus building
      • conflict resolution
      • negotiation
    ไทย

    ความเข้าใจที่ยั่งยืน (CRD-1): การรวมมุมมองที่หลากหลายผ่านการร่วมมือกันช่วยพัฒนานวัตกรรมด้านคอมพิวเตอร์ให้ดีขึ้นขณะกำลังพัฒนา

    วัตถุประสงค์การเรียนรู้ CRD-1.A: อธิบายว่านวัตกรรมด้านคอมพิวเตอร์ได้รับการปรับปรุง如何通过 collaboration。 [Skill 1.C]

    • CRD-1.A.1 นวัตกรรมด้านคอมพิวเตอร์รวมถึงโปรแกรมเป็นส่วนสำคัญของฟังก์ชัน
    • CRD-1.A.2 นวัตกรรมด้านคอมพิวเตอร์อาจเป็น physical (เช่น รถขับเคลื่อนอัตโนมัติ), nonphysical computing software (เช่น ซอฟต์แวร์แก้ไขภาพ), หรือ nonphysical computing concept (เช่น การค้าอิเล็กทรอนิกส์)
    • CRD-1.A.3 การร่วมมือกันที่มีประสิทธิภาพผลิตนวัตกรรมด้านคอมพิวเตอร์ที่สะท้อนความหลากหลายของทักษะและมุมมองของผู้ที่ออกแบบมัน
    • CRD-1.A.4 การร่วมมือกันที่รวมมุมมองที่หลากหลายช่วยหลีกเลี่ยง bias ในการพัฒนานวัตกรรมด้านคอมพิวเตอร์
    • CRD-1.A.5 การปรึกษาและสื่อสารกับผู้ใช้เป็นสำคัญ aspects ของการพัฒนา นวัตกรรมด้านคอมพิวเตอร์
    • CRD-1.A.6 ข้อมูลที่เก็บรวบรวมจากผู้ใช้ที่เป็นไปได้สามารถใช้เพื่อเข้าใจวัตถุประสงค์ของโปรแกรมผ่านมุมมองที่หลากหลายและพัฒนาโปรแกรมที่ incorporates มุมมองเหล่านี้อย่างเต็มที่

    วัตถุประสงค์การเรียนรู้ CRD-1.B: อธิบายว่านวัตกรรมด้านคอมพิวเตอร์ถูกพัฒนาโดยกลุ่มคน如何。 [Skill 1.C]

    • CRD-1.B.1 เครื่องมือออนไลน์สนับสนุน collaboration bằng cách allowing programmers to share and provide feedback on ideas and documents
    • CRD-1.B.2 Common models such as pair programming มีอยู่เพื่อ facilitate collaboration

    วัตถุประสงค์การเรียนรู้ CRD-1.C: แสดง interpersonal skills ที่มีประสิทธิภาพระหว่าง collaboration。 [Skill 1.C]

    • CRD-1.C.1 ทีม collaborative ที่มีประสิทธิภาพ practicing interpersonal skills, بما but not limited to:
      • communication
      • consensus building
      • conflict resolution
      • negotiation

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Computing is a collaborative 协作 activity. Working in a team brings more perspectives, catches more errors, and produces better programs than working alone. Good collaboration uses consensus building, clear communication, and each member's strengths. Pair programming 结对编程 – two people at one computer, one typing and one reviewing – is a common practice. On the exam, you should be able to explain how collaboration improved a program (more ideas, fewer bugs, wider testing).

    ไทย
    จigsaw กำลังประกอบ: การร่วมมือและการออกแบบแบบโมดูลาร์ประกอบคำตอบเข้าด้วยกัน
    jigsaw กำลังประกอบ: การร่วมมือและการออกแบบแบบโมดูลาร์ประกอบคำตอบเข้าด้วยกัน

    Computing เป็นกิจกรรมที่ ** collaborative** การทำงานเป็นทีม_selects perspectives มากกว่า จับข้อผิดพลาดมากกว่า และสร้างโปรแกรมที่ดีกว่าการทำงานคนเดียว การ collaborating ที่ดีใช้ consensus building, การสื่อสารที่ชัดเจน, และจุดแข็งของแต่ละสมาชิก Pair programming – คนสองคนต่อคอมพิวเตอร์เครื่องเดียว คนหนึ่งพิมพ์และอีกคนตรวจสอบ – เป็นปฏิบัติทั่วไป ในการสอบคุณควรอธิบายได้ว่า collaboration ช่วยพัฒนาโปรแกรมอย่างไร (ไอเดียมากขึ้น, บั๊กน้อยลง, ทดสอบกว้างขึ้น)

    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    collaborative/kəˈlæbrətɪv/ การทำงานร่วมกัน
    Pair programming/peə ˈprəʊɡræmɪŋ/ การเขียนโปรแกรมคู่
    1.2

    Program Function and Purpose · ⁨ฟังก์ชันและวัตถุประสงค์ของโปรแกรม⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (CRD-2): Developers create and innovate using an iterative design process that is user-focused, that incorporates implementation/feedback cycles, and that leaves ample room for experimentation and risk-taking.

    Learning Objective CRD-2.A: Describe the purpose of a computing innovation. [Skill 1.A]

    • CRD-2.A.1 The purpose of computing innovations is to solve problems or to pursue interests through creative expression.
    • CRD-2.A.2 An understanding of the purpose of a computing innovation provides developers with an improved ability to develop that computing innovation.

    Learning Objective CRD-2.B: Explain how a program or code segment functions. [Skill 4.A]

    • CRD-2.B.1 A program is a collection of program statements that performs a specific task when run by a computer. A program is often referred to as software.
    • CRD-2.B.2 A code segment is a collection of program statements that is part of a program.
    • CRD-2.B.3 A program needs to work for a variety of inputs and situations.
    • CRD-2.B.4 The behavior of a program is how a program functions during execution and is often described by how a user interacts with it.
    • CRD-2.B.5 A program can be described broadly by what it does, or in more detail by both what the program does and how the program statements accomplish this function.

    Learning Objective CRD-2.C: Identify input(s) to a program. [Skill 3.A]

    • CRD-2.C.1 Program inputs are data sent to a computer for processing by a program. Input can come in a variety of forms, such as tactile, audio, visual, or text.
    • CRD-2.C.2 An event is associated with an action and supplies input data to a program.
    • CRD-2.C.3 Events can be generated when a key is pressed, a mouse is clicked, a program is started, or any other defined action occurs that affects the flow of execution.
    • CRD-2.C.4 Inputs usually affect the output produced by a program.
    • CRD-2.C.5 In event-driven programming, program statements are executed when triggered rather than through the sequential flow of control.
    • CRD-2.C.6 Input can come from a user or other programs.

    Learning Objective CRD-2.D: Identify output(s) produced by a program. [Skill 3.A]

    • CRD-2.D.1 Program outputs are any data sent from a program to a device. Program output can come in a variety of forms, such as tactile, audio, visual, or text.
    • CRD-2.D.2 Program output is usually based on a program's input or prior state (e.g., internal values).
    ไทย

    ความเข้าใจที่ยั่งยืน (CRD-2): ผู้พัฒนาสร้างและ innovate using an iterative design process that is user-focused, that incorporates implementation/feedback cycles, and that leaves ample room for experimentation and risk-taking

    วัตถุประสงค์การเรียนรู้ CRD-2.A: อธิบายวัตถุประสงค์ของนวัตกรรมด้านคอมพิวเตอร์。 [Skill 1.A]

    • CRD-2.A.1 วัตถุประสงค์ของนวัตกรรมด้านคอมพิวเตอร์คือการแก้ปัญหาหรือ pursuit interests through creative expression
    • CRD-2.A.2 ความเข้าใจในวัตถุประสงค์ของนวัตกรรมด้านคอมพิวเตอร์ให้ developer with an improved ability to develop that computing innovation

    วัตถุประสงค์การเรียนรู้ CRD-2.B: อธิบายว่าโปรแกรมหรือ code segment ทำงาน如何。 [Skill 4.A]

    • CRD-2.B.1 program คือ collection of program statements that performs a specific task when run by a computer。 A program is often referred to as software
    • CRD-2.B.2 code segment คือ collection of program statements that is part of a program
    • CRD-2.B.3 โปรแกรมต้องทำงานได้สำหรับ inputs และ situations หลายประเภท
    • CRD-2.B.4 behavior ของโปรแกรมคือ how a program functions during execution and is often described by how a user interacts with it
    • CRD-2.B.5 โปรแกรมสามารถอธิบายได้โดยกว้างว่าโปรแกรมทำอะไร หรืออธิบายอย่างละเอียดทั้งสิ่งที่โปรแกรมทำและวิธีการที่คำสั่งในโปรแกรมดำเนินการเพื่อให้บรรลุหน้าที่นั้น

    จุดประสงค์การเรียนรู้ CRD-2.C: ระบุอินพุตของโปรแกรม [ทักษะ 3.A]

    • CRD-2.C.1 อินพุตของโปรแกรม คือข้อมูลที่ถูกส่งไปยังคอมพิวเตอร์เพื่อประมวลผลโดยโปรแกรม อินพุตอาจมีหลายรูปแบบ เช่น แบบสัมผัส เสียง ภาพ หรือข้อความ
    • CRD-2.C.2 เหตุการณ์ มีความเกี่ยวข้องกับกระทำหนึ่งๆ และจัดเตรียมข้อมูลอินพุตให้กับโปรแกรม
    • CRD-2.C.3 เหตุการณ์สามารถเกิดขึ้นได้เมื่อกดแป้นพิมพ์ คลิกเมาส์ เริ่มโปรแกรม หรือเกิดกระทำใดๆ ที่กำหนดไว้ซึ่งส่งผลต่อการไหลของการ执行程序
    • CRD-2.C.4 อินพุทมักส่งผลต่อผลลัพธ์ที่โปรแกรมสร้างออกมา
    • CRD-2.C.5 ในการเขียนโปรแกรมแบบขับเคลื่อนด้วยเหตุการณ์ คำสั่งในโปรแกรมจะถูกดำเนินการเมื่อถูกกระตุ้นแทนที่จะเป็นการไหลตามลำดับของควบคุม
    • CRD-2.C.6 อินพุตสามารถมาจากผู้ใช้หรือโปรแกรมอื่น

    จุดประสงค์การเรียนรู้ CRD-2.D: ระบุผลลัพธ์ที่โปรแกรมสร้างออกมา [ทักษะ 3.A]

    • CRD-2.D.1 เอาต์พุตของโปรแกรม คือข้อมูลใดๆ ที่ส่งออกจากโปรแกรมไปยังอุปกรณ์ เอาต์พุตของโปรแกรมอาจมีหลายรูปแบบ เช่น แบบสัมผัส เสียง ภาพ หรือข้อความ
    • CRD-2.D.2 เอาต์พุตของโปรแกรมโดยทั่วไปจะขึ้นอยู่กับอินพุตของโปรแกรมหรือสถานะก่อนหน้า (เช่น ค่าภายใน)

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Every program is written for a purpose – it solves a problem or pursues an interest. A program takes input 输入, processes it, and produces output 输出. Inputs can come from a user, a device, a file, or another program; outputs can be visual, audible, textual, or a signal to a device. Being able to state a program's purpose, and describe its inputs and outputs clearly, is a core skill (and part of the Create performance task).

    ไทย

    ทุกโปรแกรมถูกเขียนเพื่อ ** วัตถุประสงค์** – แก้ไขปัญหาหรือ pursuing ความสนใจ โปรแกรมรับ ** input**, ประมวลผล, และสร้าง ** output** Inputs มาจากผู้ใช้, อุปกรณ์, ไฟล์, หรือโปรแกรมอื่น; Outputs อาจเป็นภาพ, เสียง, ข้อความ, หรือสัญญาณไปยังอุปกรณ์ การระบุวัตถุประสงค์ของโปรแกรม และอธิบาย input และ output อย่างชัดเจนเป็นทักษะพื้นฐาน (และเป็นส่วนหนึ่งของ Create performance task)

    โปรแกรมทุกโปรแกรมแบ่งออกเป็น Input, Processing และ Output
    Every program decomposes into input, processing, and output
    Every program follows the input-processing-output model
    Every program follows the input-processing-output model
    Explore · ⁨สำรวจ⁩

    Explore the input → processing → output model · ⁨สำรวจโมเดล Input → Processing → Output⁩

    Step through the IPO model. Every program takes some input, performs processing on it by following its instructions, then produces output — trace one weather-app example along the pipeline. · ⁨ก้าวผ่าน IPO model โปรแกรมทุกตัวรับ input某some, ทำ processing บนมันโดยทำตามคำสั่ง แล้วผลิต output — ติดตามตัวอย่างแอปฯ พยากรณ์อากาศหนึ่งตามท่อ⁩

    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    input/ˈɪnpʊt/ input (อินพุต)
    output/ˈaʊtpʊt/ ผลผลิต
    iterative/ˈɪtərətɪv/ iterative (แบบวนซ้ำ)
    decomposition/ˌdiːkɒmpəˈzɪʃn/ การสลายตัว
    Comments/ˈkɒments/ ความคิดเห็น (Comments)
    surveys/ˈsɜːveɪz/ แบบสอบถาม
    diagrams representing the layout of the user interface แผนภาพแสดงการจัดวางหน้าจอสัมผัสผู้ใช้
    event/ɪˈvent/ เหตุการณ์
    event handler/ɪˈvent ˈhændlə/ ตัวจัดการเหตุการณ์
    debugging/ˈdiːbʌɡɪŋ/ debugging
    syntax error/ˈsɪntæks ˈerə/ ข้อผิดพลาดด้านไวยากรณ์
    runtime error/ˈrʌntaɪm ˈerə/ runtime error (ข้อผิดพลาดขณะรัน)
    logic error/ˈlɒdʒɪk ˈerə/ ข้อผิดพลาดด้านตรรกะ
    1.3

    Program Design and Development · ⁨การออกแบบและพัฒนาโปรแกรม⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (CRD-2): Developers create and innovate using an iterative design process that is user-focused, that incorporates implementation/feedback cycles, and that leaves ample room for experimentation and risk-taking.

    Learning Objective CRD-2.E: Develop a program using a development process. [Skill 1.B]

    • CRD-2.E.1 A development process can be ordered and intentional, or exploratory in nature.
    • CRD-2.E.2 There are multiple development processes. The following phases are commonly used when developing a program:
      • investigating and reflecting
      • designing
      • prototyping
      • testing
    • CRD-2.E.3 A development process that is iterative requires refinement and revision based on feedback, testing, or reflection throughout the process. This may require revisiting earlier phases of the process.
    • CRD-2.E.4 A development process that is incremental is one that breaks the problem into smaller pieces and makes sure each piece works before adding it to the whole.

    Learning Objective CRD-2.F: Design a program and its user interface. [Skill 1.B]

    • CRD-2.F.1 The design of a program incorporates investigation to determine its requirements.
    • CRD-2.F.2 Investigation in a development process is useful for understanding and identifying the program constraints, as well as the concerns and interests of the people who will use the program.
    • CRD-2.F.3 Some ways investigation can be performed are as follows:
      • collecting data through surveys
      • user testing
      • interviews
      • direct observations
    • CRD-2.F.4 Program requirements describe how a program functions and may include a description of user interactions that a program must provide.
    • CRD-2.F.5 A program's specification defines the requirements for the program.
    • CRD-2.F.6 In a development process, the design phase outlines how to accomplish a given program specification.
    • CRD-2.F.7 The design phase of a program may include:
      • brainstorming
      • planning and storyboarding
      • organizing the program into modules and functional components
      • creation of diagrams that represent the layouts of the user interface
      • development of a testing strategy for the program

    Learning Objective CRD-2.G: Describe the purpose of a code segment or program by writing documentation. [Skill 4.A]

    • CRD-2.G.1 Program documentation is a written description of the function of a code segment, event, procedure, or program and how it was developed.
    • CRD-2.G.2 Comments are a form of program documentation written into the program to be read by people and do not affect how a program runs.
    • CRD-2.G.3 Programmers should document a program throughout its development.
    • CRD-2.G.4 Program documentation helps in developing and maintaining correct programs when working individually or in collaborative programming environments.
    • CRD-2.G.5 Not all programming environments support comments, so other methods of documentation may be required.

    Learning Objective CRD-2.H: Acknowledge code segments used from other sources. [Skill 1.C]

    • CRD-2.H.1 It is important to acknowledge any code segments that were developed collaboratively or by another source.
    • CRD-2.H.2 Acknowledgement of a code segment(s) written by someone else and used in a program can be in the program documentation. The acknowledgement should include the origin or original author's name.
    ไทย

    ความเข้าใจที่ยั่งยืน (CRD-2): ผู้พัฒนาสร้างและ innovate using an iterative design process that is user-focused, that incorporates implementation/feedback cycles, and that leaves ample room for experimentation and risk-taking

    จุดประสงค์การเรียนรู้ CRD-2.E: พัฒนาโปรแกรมโดยใช้กระบวนการพัฒนา [ทักษะ 1.B]

    • CRD-2.E.1 กระบวนการพัฒนาอาจเป็นไปตามลำดับและมีเจตนารมณ์ชัดเจน หรืออาจเป็นลักษณะการสำรวจ
    • CRD-2.E.2 มีกระบวนการพัฒนาหลายแบบ ระยะขั้นตอนต่างๆ ที่นิยมใช้ในการพัฒนาโปรแกรม ได้แก่:
      • การสืบค้นและการสะท้อนคิด
      • การออกแบบ
      • การสร้างต้นแบบ
      • การทดสอบ
    • CRD-2.E.3 กระบวนการพัฒนาแบบวนซ้ำต้องการการปรับปรุงและแก้ไขโดยอาศัยข้อมูลย้อนกลับ การทดสอบ หรือการสะท้อนคิดตลอดกระบวนการ ซึ่งอาจจำเป็นต้องกลับไปทำระยะขั้นตอนก่อนหน้าอีกครั้ง
    • CRD-2.E.4 กระบวนการพัฒนาแบบเพิ่มพูนคือกระบวนการที่แบ่งปัญหาออกเป็นชิ้นส่วนเล็กๆ และตรวจสอบให้แน่ใจว่าแต่ละชิ้นส่วนทำงานได้อย่างถูกต้องก่อนนำไปรวมเข้ากับภาพรวมทั้งหมด

    จุดประสงค์การเรียนรู้ CRD-2.F: ออกแบบโปรแกรมและอินเทอร์เฟซผู้ใช้ [ทักษะ 1.B]

    • CRD-2.F.1 การออกแบบโปรแกรมรวมถึงการสืบค้นเพื่อกำหนดความต้องการ
    • CRD-2.F.2 การสืบค้นในกระบวนการพัฒนามีประโยชน์ต่อการทำความเข้าใจและระบุข้อจำกัดของโปรแกรม รวมถึงประเด็นและความสนใจของผู้ที่ใช้โปรแกรม
    • CRD-2.F.3 วิธีการสืบค้นบางประการมีดังนี้:
      • การเก็บรวบรวมข้อมูลผ่านแบบสอบถาม
      • การทดสอบโดยผู้ใช้
      • การสัมภาษณ์
      • การสังเกตโดยตรง
    • CRD-2.F.4 ความต้องการของโปรแกรมอธิบายถึงการทำงานของโปรแกรมและอาจรวมถึงคำอธิบายของการมีปฏิสัมพันธ์กับผู้ใช้ที่โปรแกรมต้องให้บริการ
    • CRD-2.F.5 ข้อกำหนดของโปรแกรมกำหนดเงื่อนไขสำหรับโปรแกรม
    • CRD-2.F.6 ในกระบวนการพัฒนา ระยะการออกแบบจะสรุปวิธีดำเนินการเพื่อให้บรรลุข้อกำหนดของโปรแกรมที่กำหนด
    • CRD-2.F.7 ระยะการออกแบบของโปรแกรมอาจประกอบด้วย:
      • การระดมสมอง
      • การวางแผนและ.storyboarding
      • การจัดโครงสร้างโปรแกรมเป็นโมดูลและองค์ประกอบฟังก์ชัน
      • การสร้างแผนภูมิที่แสดงการจัดวางอินเทอร์เฟซผู้ใช้
      • การพัฒนากลยุทธ์การทดสอบสำหรับโปรแกรม

    จุดประสงค์การเรียนรู้ CRD-2.G: อธิบายวัตถุประสงค์ของโค้ดหรือโปรแกรมโดยการเขียนเอกสารประกอบ [ทักษะ 4.A]

    • CRD-2.G.1 เอกสารประกอบโปรแกรม คือคำอธิบายเขียนเกี่ยวกับหน้าที่ของโค้ด เหตุการณ์ procedimiento หรือโปรแกรม以及如何พัฒนาขึ้น
    • CRD-2.G.2 คอมเมนต์ เป็นรูปแบบหนึ่งของเอกสารประกอบโปรแกรมที่เขียนลงในโปรแกรมเพื่ออ่านโดยมนุษย์และไม่ส่งผลต่อการ运行的ของโปรแกรม
    • CRD-2.G.3 นักเขียนโปรแกรมควรเขียนเอกสารประกอบโปรแกรมตลอดกระบวนการพัฒนา
    • CRD-2.G.4 เอกสารประกอบโปรแกรมช่วยในการพัฒนาและบำรุงรักษาโปรแกรมที่ถูกต้องเมื่อทำงานคนเดียวหรือในสภาพแวดล้อมการพัฒนาแบบร่วมมือ
    • CRD-2.G.5 ไม่ใช่ทุกสภาพแวดล้อมการเขียนโปรแกรมที่รองรับคอมเมนต์ ดังนั้นอาจต้องใช้วิธีการเขียนเอกสารประกอบอื่นๆ

    จุดประสงค์การเรียนรู้ CRD-2.H: ยอมรับโค้ดที่ใช้จากแหล่งอื่น [ทักษะ 1.C]

    • CRD-2.H.1 สิ่งสำคัญคือการยอมรับโค้ดส่วนใดที่พัฒนาแบบร่วมมือกันหรือโดยแหล่งอื่น
    • CRD-2.H.2 การยอมรับโค้ดส่วนที่เขียนโดยผู้อื่นและใช้ในโปรแกรมอาจอยู่ในเอกสารประกอบโปรแกรม การยอมรับควรระบุที่มาหรือชื่อผู้แต่งดั้งเดิม

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Programs are built through an iterative 迭代 process, not in one straight line: investigate the problem and users, design (often with a diagram or written plan), implement in code, and test – then repeat. A large problem is broken into smaller pieces (decomposition 分解). Comments 注释 and clear naming document the design so others (and your future self) can understand it. Development is incremental – build and test a small piece, then add the next.

    Investigating what users actually need

    Before any code is written, the developer investigates the problem and the people who will use the program. Three ways to do that:

    • surveys 调查问卷 sent to potential users, which collect data from many people quickly;
    • interviews and direct observation of users doing the task by hand;
    • studying existing solutions to see what already works and what frustrates people.

    The findings are turned into a design. Two artefacts do that: a program requirements list saying exactly what the program must do, and diagrams representing the layout of the user interface 用户界面 — sketches showing which controls appear where, and what each one does when used. Designing the interface on paper first is cheaper than discovering after coding that the buttons are in the wrong place.

    Events, and programs that wait

    Not every program runs straight through from top to bottom. An event 事件 is generated when a key is pressed, a mouse is clicked, a program is started, or any other defined action occurs — and an event changes the flow of execution: the program pauses what it was doing and runs the code attached to that event, called an event handler 事件处理程序.

    This is why a program with a graphical interface can appear to be doing nothing: it is waiting for the next event. The order in which those events arrive is decided by the user, not by the programmer, so the same program can run its blocks in a different order each time it is used.

    ไทย
    นักเขียนโปรแกรมกำลังแก้ดีบักที่สถานีงานหลายจอภาพ — การออกแบบและการทดสอบแบบวนซ้ำ
    นักพัฒนาซอฟต์แวร์กำลังแก้ไขข้อผิดพลาดที่สถานีงานหลายจอ — การออกแบบและทดสอบแบบวนซ้ำ

    โปรแกรมถูกสร้างผ่านกระบวนการ วนซ้ำ ไม่ใช่เส้นตรงเดียว: สำรวจปัญหาและผู้ใช้งาน ออกแบบ (มักใช้ แผนภาพ หรือแผนเขียน), เขียนโค้ด, และทดสอบ – แล้วทำซ้ำ ปัญหาขนาดใหญ่จะถูกแบ่งเป็นชิ้นเล็กๆ (การแยกส่วน) ความคิดเห็น และการตั้งชื่อที่ชัดเจนช่วยบันทึกการออกแบบเพื่อให้ผู้อื่น (และตัวคุณในอนาคต) เข้าใจได้ การพัฒนาเป็นแบบ เพิ่มพูน – สร้างและทดสอบชิ้นเล็กก่อน แล้วจึงเพิ่มส่วนถัดไป

    ขั้นตอนการพัฒนาโปรแกรม พร้อมการทดสอบที่ส่งผลลัพธ์ย้อนกลับเพื่อแก้ไขและปรับปรุง
    ขั้นตอนการพัฒนาโปรแกรม พร้อมการทดสอบที่ส่งผลลัพธ์ย้อนกลับเพื่อแก้ไขและปรับปรุง
    ซอฟต์แวร์ถูกสร้างด้วยกระบวนการพัฒนาแบบวนซ้ำและเพิ่มพูน
    ซอฟต์แวร์ถูกสร้างด้วยกระบวนการพัฒนาแบบวนซ้ำและเพิ่มพูน

    การสำรวจสิ่งที่ผู้ใช้ต้องการจริงๆ

    ก่อนเขียนโค้ดใดๆ นักพัฒนาต้องสำรวจปัญหามนุษย์ที่จะใช้โปรแกรม มี 3 วิธี:

    • แบบสอบถาม ส่งให้ผู้ใช้งาน potensial เพื่อเก็บข้อมูลจากผู้คนจำนวนมากอย่างรวดเร็ว;
    • การสัมภาษณ์ และการสังเกตโดยตรงเมื่อผู้ใช้งานทำกิจกรรมด้วยมือ;
    • การศึกษาคำตอบที่มีอยู่เดิม เพื่อดูว่าอะไรทำงานได้ดีอยู่แล้ว และอะไรทำให้คนไม่พอใจ

    ผลที่ได้จะถูกเปลี่ยนเป็นการออกแบบ วัตถุ 2 อย่างทำได้ดังนี้: รายการ ข้อกำหนดของโปรแกรม ที่ระบุชัดเจนว่าโปรแกรมต้องทำอะไร, และ แผนภาพแสดงโครงสร้างอินเทอร์เฟซผู้ใช้ – แบบร่างที่แสดงว่าปุ่มหรือควบคุมต่างๆ อยู่ที่ไหน และแต่ละอันทำหน้าที่อย่างไรเมื่อถูกกด การออกแบบอินเทอร์เฟซบนกระดาษก่อนจะประหยัดกว่าการค้นพบว่าปุ่มวางผิดตำแหน่งหลังเขียนโค้ดแล้ว

    เหตุการณ์ และโปรแกรมที่รอคอย

    ไม่ใช่ทุกโปรแกรมจะรันจากบนลงล่างโดยตรงๆ เหตุการณ์ จะเกิดขึ้นเมื่อกดคีย์ คลิกเมาส์ เปิดโปรแกรม หรือเกิดเหตุการณ์ที่กำหนดไว้อื่นๆ – และเหตุการณ์นี้จะเปลี่ยน ลำดับการทำงาน: โปรแกรมจะหยุดสิ่งที่กำลังทำอยู่ชั่วคราว แล้วรันโค้ดที่ผูกกับเหตุการณ์นั้น ซึ่งเรียกว่า ตัวจัดการเหตุการณ์

    นี่คือเหตุผลที่โปรแกรมที่มีอินเทอร์เฟซกราฟิกอาจดูเหมือนไม่ทำอะไรเลย: มันกำลังรอเหตุการณ์ถัดไป ลำดับที่เหตุการณ์เหล่านี้เข้ามาขึ้นอยู่กับผู้ใช้งาน ไม่ใช่ผู้เขียนโปรแกรม ดังนั้นโปรแกรมเดียวกันสามารถรันบล็อคโค้ดในลำดับที่แตกต่างกันได้每一次เมื่อถูกใช้งาน

    Explore · ⁨สำรวจ⁩

    Loop through the iterative development process · ⁨วนลูปกระบวนการพัฒนาแบบ iteratively⁩

    Development is iterative — you repeat the stages, improving the program a little on each pass. Step around the loop and notice it returns to the start rather than ending after one run. · ⁨การพัฒนาเป็น iterative — คุณทำซ้ำขั้นตอนต่างๆ ปรับปรุงโปรแกรมเล็กน้อยในทุกรอบ ก้าวไปรอบๆ และสังเกตว่ามันวนกลับไปที่จุดเริ่มต้นแทนที่จะจบหลังจากรันครั้งเดียว⁩

    1.4

    Identifying and Correcting Errors · ⁨การระบุและแก้ไขข้อผิดพลาด⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (CRD-2): Developers create and innovate using an iterative design process that is user-focused, that incorporates implementation/feedback cycles, and that leaves ample room for experimentation and risk-taking.

    Learning Objective CRD-2.I: For errors in an algorithm or program: a. Identify the error. [Skill 4.C] b. Correct the error. [Skill 4.C]

    • CRD-2.I.1 A logic error is a mistake in the algorithm or program that causes it to behave incorrectly or unexpectedly.
    • CRD-2.I.2 A syntax error is a mistake in the program where the rules of the programming language are not followed.
    • CRD-2.I.3 A run-time error is a mistake in the program that occurs during the execution of a program. Programming languages define their own run-time errors.
    • CRD-2.I.4 An overflow error is an error that occurs when a computer attempts to handle a number that is outside of the defined range of values.
    • CRD-2.I.5 The following are effective ways to find and correct errors:
      • test cases
      • hand tracing
      • visualizations
      • debuggers
      • adding extra output statement(s)

    Learning Objective CRD-2.J: Identify inputs and corresponding expected outputs or behaviors that can be used to check the correctness of an algorithm or program. [Skill 4.C]

    • CRD-2.J.1 In the development process, testing uses defined inputs to ensure that an algorithm or program is producing the expected outcomes. Programmers use the results from testing to revise their algorithms or programs.
    • CRD-2.J.2 Defined inputs used to test a program should demonstrate the different expected outcomes that are at or just beyond the extremes (minimum and maximum) of input data.
    • CRD-2.J.3 Program requirements are needed to identify appropriate defined inputs for testing.
    ไทย

    ความเข้าใจที่ยั่งยืน (CRD-2): ผู้พัฒนาสร้างและ innovate using an iterative design process that is user-focused, that incorporates implementation/feedback cycles, and that leaves ample room for experimentation and risk-taking

    จุดประสงค์การเรียนรู้ CRD-2.I: สำหรับข้อผิดพลาดในอัลกอริทึมหรือโปรแกรม: ก. ระบุข้อผิดพลาด [ทักษะ 4.C] ข. แก้ไขข้อผิดพลาด [ทักษะ 4.C]

    • CRD-2.I.1 ข้อผิดพลาดทางตรรกะ คือความผิดพลาดในอัลกอริทึมหรือโปรแกรมที่ทำให้其行为ผิดปกติหรือไม่คาดคิด
    • CRD-2.I.2 ข้อผิดพลาดทางไวยากรณ์ คือความผิดพลาดในโปรแกรมที่ไม่ปฏิบัติตามกฎของภาษาการเขียนโปรแกรม
    • CRD-2.I.3 ข้อผิดพลาดขณะรัน คือความผิดพลาดในโปรแกรมที่เกิดขึ้นระหว่างการ运行的ของโปรแกรม ภาษาการเขียนโปรแกรมกำหนดข้อผิดพลาดขณะรันของตนเอง
    • CRD-2.I.4 ข้อผิดพลาดการล้น คือข้อผิดพลาดที่เกิดขึ้นเมื่อคอมพิวเตอร์พยายามจัดการกับตัวเลขที่อยู่นอกช่วงค่าที่กำหนด
    • CRD-2.I.5 วิธีที่มีประสิทธิภาพในการค้นหาและแก้ไขข้อผิดพลาดมีดังนี้:
      • กรณีทดสอบ
      • การติดตามด้วยมือ
      • การแสดงผลภาพ
      • debugger
      • เพิ่ม statement ผลลัพธ์ (output statement(s)) เพิ่มเติม

    วัตถุประสงค์การเรียนรู้ CRD-2.J: ระบุอินพุตและผลลัพธ์หรือพฤติกรรมที่คาดหวังที่เกี่ยวข้อง ซึ่งสามารถใช้ตรวจสอบความถูกต้องของอัลกอริทึมหรือโปรแกรม [ทักษะ 4.C]

    • CRD-2.J.1 ในกระบวนการพัฒนา การทดสอบ ใช้อินพุตที่กำหนดไว้เพื่อให้มั่นใจว่าอัลกอริทึมหรือกำลังสร้างผลลัพธ์ที่คาดหวังอยู่ โปรแกรมเมอร์ใช้ผลการทดสอบเพื่อปรับปรุงอัลกอริทึมหรือโปรแกรมของตน
    • CRD-2.J.2 อินพุตที่กำหนดไว้用于ทดสอบโปรแกรมควรสาธิตผลลัพธ์ที่คาดหวังที่แตกต่างกันที่ระดับหรือใกล้เคียงกับขอบเขต (ค่าต่ำสุดและสูงสุด) ของข้อมูลอินพุต
    • CRD-2.J.3 ความต้องการของโปรแกรมจำเป็นสำหรับการระบุอินพุตที่กำหนดไว้ที่เหมาะสมสำหรับการทดสอบ

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    A bug is an error in a program; debugging 调试 is finding and fixing it. Three kinds:

    • a syntax error 语法错误 breaks the language's rules, so the program will not run;
    • a runtime error 运行时错误 crashes the program while it runs (e.g. dividing by zero);
    • a logic error 逻辑错误 lets it run but gives the wrong result.

    Find bugs by testing with different inputs, adding print statements to see values, and hand-tracing the code. Choose the test inputs deliberately: they should demonstrate the different expected outcomes at or just beyond the extremes — the minimum and maximum values the program should accept, and a value just outside each of them. A program that works on ordinary data very often fails on an empty list, a zero, or a value one past the end of a range, so those are the inputs worth trying first. Fixing one bug at a time and re-testing is the reliable method.

    Exam skill: be able to name the type of an error and describe a testing strategy that would catch it – a recurring multiple-choice and Create-task theme.

    Worked example. A program meant to print the average of two numbers instead runs avg = a + b / 2. Tracing the order of operations, / runs before +, so it computes $a+\tfrac{b}{2}$ rather than the average. Add parentheses to fix it: avg = (a + b) / 2. Testing with $a=4,\ b=6$ confirms the fix — the buggy line gives $4+3=7$, the corrected line gives $\tfrac{10}{2}=5$. Testing with known inputs is exactly how you find and confirm a logic error.

    ไทย

    บั๊ก คือข้อผิดพลาดในโปรแกรม; การดีบัก คือการหาและแก้ไขมัน มี 3 ประเภท:

    ตารางติดตามบันทึกค่าของตัวแปรแต่ละตัวขณะโปรแกรมรัน เพื่อหาบั๊ก
    ตารางติดตามบันทึกค่าของตัวแปรแต่ละตัวขณะโปรแกรมรัน เพื่อหาบั๊ก
    • ความผิดพลาดทางไวยากรณ์ ทำให้違反กฎภาษา sehinggaโปรแกรมจะไม่รัน;
    • ความผิดพลาดขณะรัน ทำให้โปรแกรมพังขณะกำลังทำงาน (เช่น หารด้วยศูนย์);
    • ความผิดพลาดทางตรรกะ ให้โปรแกรมรันได้แต่ให้ผลลัพธ์ผิด

    หาบั๊กด้วยการ ทดสอบ ด้วยอินพุตต่างๆ เพิ่ม คำสั่งพิมพ์ เพื่อดูค่า, และติดตามโค้ดด้วยมือ เลือกอินพุตทดสอบอย่างมีจุดประสงค์: ควรแสดงผลตาม Expected outcomes ที่คาดหวัง ที่ขอบเขตหรือใกล้ขอบเขตมากสุด – ค่าต่ำสุดและสูงสุดที่โปรแกรมควรรับได้, และค่าที่อยู่ถัดออกไปจากนั้นเล็กน้อย โปรแกรมที่ทำงานกับข้อมูลปกติได้ดีมักล้มเหลวกับรายการว่าง, ศูนย์, หรือค่าที่เกินขอบเขตช่วงหนึ่งไป, ดังนั้น这些都是值得首先尝试的输入。การแก้บั๊กทีละตัวแล้วทดสอบใหม่คือวิธีที่เชื่อถือได้

    ทักษะสำหรับการสอบ: สามารถระบุประเภทของความผิดพลาดและอธิบายกลยุทธ์การทดสอบที่จะจับมันได้ – ซึ่งเป็นหัวข้อที่ปรากฏบ่อยในการสอบแบบเลือกคำตอบและการสร้างงาน

    สามประเภทของความผิดพลาดในการเขียนโปรแกรม: ไวยากรณ์, ตรรกะ, และขณะรัน
    สามประเภทของความผิดพลาดในการเขียนโปรแกรม: ไวยากรณ์, ตรรกะ, และขณะรัน

    ตัวอย่างฝึกปฏิบัติ. โปรแกรมที่ควรพิมพ์ค่าเฉลี่ยของสองตัวเลข กลับรัน avg = a + b / 2. การติดตามลำดับการดำเนินการ, / รันก่อน +, จึงคำนวณ $a+\tfrac{b}{2}$ แทนค่าเฉลี่ย เพิ่มวงเล็บเพื่อแก้ไข: avg = (a + b) / 2. ทดสอบด้วย $a=4,\ b=6$ ยืนยันการแก้ไข – บรรทัดที่มีบั๊กให้ $4+3=7$, บรรทัดที่แก้ไขให้ $\tfrac{10}{2}=5$. การทดสอบด้วยอินพุตที่ทราบผลลัพธ์ล่วงหน้าคือวิธีการที่คุณพบและยืนยัน ความผิดพลาดทางตรรกะ ได้อย่างแท้จริง

    Explore · ⁨สำรวจ⁩

    Trace the guessing-game logic and spot a logic error · ⁨ติดตามตรรกะเกมทายเลขและหาข้อผิดพลาดทางตรรกะ⁩

    Drag the guess and watch which branch runs. A logic error would send the same guess down the wrong branch — the program still runs, but gives the wrong message. The secret number here is 50. · ⁨ลากค่าเดาไปเพื่อดูว่า สาขา (branch) ใดถูกเรียกใช้งาน ความผิดพลาดด้านตรรกะ จะส่งค่าเดาเดียวกันไปยังสาขาที่ผิด — โปรแกรมยังคงทำงานอยู่ แต่จะแสดงข้อความที่ไม่ถูกต้อง เลขลับในที่นี้คือ 50⁩

    1.4

    Exam tips · ⁨ข้อแนะนำสำหรับการสอบ⁩

    English
    • Much of CSP is assessed through the Create and written performance tasks — explain your reasoning clearly, not just your result.
    • Know the benefits of collaboration and how diverse perspectives reduce bias in a program.
    • Use precise vocabulary (iterative development, program requirements) when you describe a design process.
    • Give and take feedback constructively; credit collaborators and sources.
    • Break a large problem into smaller modules that a team can build in parallel.
    ไทย
    • ส่วนใหญ่ของ CSP ถูกประเมินผ่านงาน Create และงานเขียนประสิทธิภาพ – อธิบายเหตุผลของคุณอย่างชัดเจน ไม่ใช่แค่ผลลัพธ์
    • รู้ประโยชน์ของการร่วมมือกันและมุมมองที่หลากหลายช่วยลดอคติในโปรแกรม
    • ใช้คำศัพท์ที่แม่นยำ (การพัฒนาแบบวนซ้ำ, ข้อกำหนดของโปรแกรม) เมื่ออธิบายกระบวนการออกแบบ
    • ให้และรับคำติชมอย่างสร้างสรรค์; ยกย่องผู้ร่วมพัฒนาและแหล่งที่มา
    • แบ่งปัญหาย่อยใหญ่ให้เป็นโมดูลย่อยที่ทีมสามารถสร้างพร้อมกันได้
  • 2

    Data · ⁨ข้อมูล⁩

    Watch lesson · ⁨ดูบทเรียน⁩
    2.1

    Binary Numbers · ⁨ตัวเลขฐานสอง⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (DAT-1): The way a computer represents data internally is different from the way the data are interpreted and displayed for the user. Programs are used to translate data into a representation more easily understood by people.

    Learning Objective DAT-1.A: Explain how data can be represented using bits. [Skill 3.C]

    • DAT-1.A.1 Data values can be stored in variables, lists of items, or standalone constants and can be passed as input to (or output from) procedures.
    • DAT-1.A.2 Computing devices represent data digitally, meaning that the lowest-level components of any value are bits.
    • DAT-1.A.3 Bit is shorthand for binary digit and is either 0 or 1.
    • DAT-1.A.4 A byte is 8 bits.
    • DAT-1.A.5 Abstraction is the process of reducing complexity by focusing on the main idea. By hiding details irrelevant to the question at hand and bringing together related and useful details, abstraction reduces complexity and allows one to focus on the idea.
    • DAT-1.A.6 Bits are grouped to represent abstractions. These abstractions include, but are not limited to, numbers, characters, and color.
    • DAT-1.A.7 The same sequence of bits may represent different types of data in different contexts.
    • DAT-1.A.8 Analog data have values that change smoothly, rather than in discrete intervals, over time. Some examples of analog data include pitch and volume of music, colors of a painting, or position of a sprinter during a race.
    • DAT-1.A.9 The use of digital data to approximate real-world analog data is an example of abstraction.
    • DAT-1.A.10 Analog data can be closely approximated digitally using a sampling technique, which means measuring values of the analog signal at regular intervals called samples. The samples are measured to figure out the exact bits required to store each sample.

    Learning Objective DAT-1.B: Explain the consequences of using bits to represent data. [Skill 1.D]

    • DAT-1.B.1 In many programming languages, integers are represented by a fixed number of bits, which limits the range of integer values and mathematical operations on those values. This limitation can result in overflow or other errors.
    • DAT-1.B.2 Other programming languages provide an abstraction through which the size of representable integers is limited only by the size of the computer's memory; this is the case for the language defined in the exam reference sheet.
    • DAT-1.B.3 In programming languages, the fixed number of bits used to represent real numbers limits the range and mathematical operations on these values; this limitation can result in round-off and other errors. Some real numbers are represented as approximations in computer storage.
      • Exclusion statement: Specific range limitations for real numbers are outside the scope of this course and the AP Exam.

    Learning Objective DAT-1.C: For binary numbers: a. Calculate the binary (base 2) equivalent of a positive integer (base 10) and vice versa. [Skill 2.B] b. Compare and order binary numbers. [Skill 2.B]

    • DAT-1.C.1 Number bases, including binary and decimal, are used to represent data.
    • DAT-1.C.2 Binary (base 2) uses only combinations of the digits zero and one.
    • DAT-1.C.3 Decimal (base 10) uses only combinations of the digits $0 - 9$.
    • DAT-1.C.4 As with decimal, a digit's position in the binary sequence determines its numeric value. The numeric value is equal to the bit's value (0 or 1) multiplied by the place value of its position.
    • DAT-1.C.5 The place value of each position is determined by the base raised to the power of the position. Positions are numbered starting at the rightmost position with 0 and increasing by 1 for each subsequent position to the left.
    ไทย

    ความเข้าใจที่ยั่งยืน (DAT-1): วิธีการที่คอมพิวเตอร์แสดงข้อมูลภายใน differs จากวิธีการที่ข้อมูลถูกตีความและแสดงผลให้กับผู้ใช้ โปรแกรมถูกใช้เพื่อแปลงข้อมูลให้อยู่ในรูปแบบที่มนุษย์เข้าใจได้ง่ายขึ้น

    วัตถุประสงค์การเรียนรู้ DAT-1.A: อธิบายวิธีการที่ข้อมูลสามารถถูกแสดงด้วยบิต [ทักษะ 3.C]

    • DAT-1.A.1 ค่าข้อมูลสามารถจัดเก็บในตัวแปร, รายการของรายการ, หรือคงที่แบบอิสระ และสามารถส่งเป็นอินพุตเข้า (หรือเอาออก) จาก procédure
    • DAT-1.A.2 อุปกรณ์คำนวณแสดงข้อมูลในรูปแบบดิจิทัล ซึ่งหมายความว่าส่วนประกอบพื้นฐานที่สุดของค่าใดๆ คือบิต
    • DAT-1.A.3 บิต เป็นคำย่อของ ตัวเลขฐานสอง และมีค่าเป็น 0 หรือ 1 เท่านั้น
    • DAT-1.A.4 ไบต์ มีขนาด 8 บิต
    • DAT-1.A.5 การนามธรรม คือกระบวนการลดความซับซ้อนโดยมุ่งเน้นไปที่แนวคิดหลัก通过将无关细节隐藏起来并将相关且有用的细节结合起来,抽象化降低了复杂性,使人们能够专注于概念。
    • DAT-1.A.6 บิตถูกจัดกลุ่มเพื่อแสดงถึงการนามธรรม การนามธรรมเหล่านี้รวมถึงแต่ไม่จำกัดเพียงตัวเลข, ตัวอักษร, และสี
    • DAT-1.A.7 ลำดับบิตเดียวกันอาจแสดงถึงประเภทข้อมูลที่แตกต่างกันในบริบทที่ต่างกัน
    • DAT-1.A.8 ข้อมูลอนาล็อกมีค่าที่เปลี่ยนแปลงอย่างต่อเนื่องตามเวลา แทนที่จะเป็นช่วงที่แยกจากกัน ตัวอย่างของข้อมูลอนาล็อกได้แก่ pitched และ volume ของเพลง, สีของภาพวาด, หรือตำแหน่งของนักวิ่งสprints ระหว่างการแข่งขัน
    • DAT-1.A.9 การใช้ข้อมูลดิจิทัลเพื่อประมาณข้อมูลอนาล็อกในโลกจริงเป็นตัวอย่างของการนามธรรม
    • DAT-1.A.10 ข้อมูลอนาล็อกสามารถถูกประมาณได้ด้วยวิธีดิจิทัลโดยใช้ เทคนิคการสุ่ม, ซึ่งหมายถึงการวัดค่าของสัญญาณอนาล็อกในช่วงเวลาที่เรียกว่า ตัวอย่าง ตัวอย่างจะถูกวัดเพื่อหาค่าบิตที่จำเป็นในการจัดเก็บแต่ละตัวอย่าง

    วัตถุประสงค์การเรียนรู้ DAT-1.B: อธิบายผลกระทบของการใช้บิตเพื่อแสดงข้อมูล [ทักษะ 1.D]

    • DAT-1.B.1 ในหลายภาษาการเขียนโปรแกรม จำนวนเต็มจะถูกแสดงด้วยจำนวนบิตที่ตายตัว ซึ่งจำกัดช่วงของค่าจำนวนเต็มและการดำเนินการทางคณิตศาสตร์บนค่าเหล่านั้น ข้อจำกัดนี้สามารถนำไปสู่การล้น (overflow) หรือข้อผิดพลาดอื่นๆ
    • DAT-1.B.2 ภาษาการเขียนโปรแกรมอื่น ๆ ให้การนามธรรมที่ทำให้ขนาดของจำนวนเต็มที่แสดงได้ถูกจำกัดเฉพาะขนาดของหน่วยความจำของคอมพิวเตอร์เท่านั้น ซึ่งเป็นกรณีสำหรับภาษาที่กำหนดไว้ในใบอ้างอิงการสอบ
    • DAT-1.B.3 ในภาษาการเขียน NUMERICAL, จำนวนบิตที่ตายตัวที่ใช้แสดงจำนวนจริงจำกัดช่วงและการดำเนินการทางคณิตศาสตร์บนค่าเหล่านี้; ข้อจำกัดนี้สามารถนำไปสู่การปัดเศษและข้อผิดพลาดอื่นๆ บางจำนวนจริงถูกแสดงเป็นการประมาณในหน่วยความจำของคอมพิวเตอร์
      • คำสั่งการยกเว้น: ข้อจำกัดช่วงเฉพาะสำหรับจำนวนจริงอยู่นอกเหนือขอบเขตของหลักสูตรนี้และข้อสอบ AP

    วัตถุประสงค์การเรียนรู้ DAT-1.C: สำหรับตัวเลขฐานสอง: a. คำนวณเทียบเท่าฐานสอง (ฐาน 2) ของจำนวนเต็มบวก (ฐาน 10) และในทางกลับกัน [ทักษะ 2.B] b. เปรียบเทียบและเรียงลำดับตัวเลขฐานสอง [ทักษะ 2.B]

    • DAT-1.C.1 ฐานของตัวเลข รวมถึงฐานสองและฐานสิบ ถูกใช้เพื่อแสดงข้อมูล
    • DAT-1.C.2 ฐานสอง (ฐาน 2) ใช้เพียงการผสมผสานของเลขศูนย์และหนึ่งเท่านั้น
    • DAT-1.C.3 ฐานสิบ (ฐาน 10) ใช้เพียงการผสมผสานของเลข $0 - 9$.
    • DAT-1.C.4 เหมือนกับฐานสิบ ตำแหน่งของเลขในลำดับฐานสองกำหนดค่าทางคณิตศาสตร์ของมัน ค่าทางคณิตศาสตร์เท่ากับค่าของบิต (0 หรือ 1) คูณด้วยตำแหน่งของตำแหน่ง
    • DAT-1.C.5 ตำแหน่งของตำแหน่งของแต่ละตำแหน่งถูกกำหนดโดยฐานยกกำลังตำแหน่ง ตำแหน่ง numbering เริ่มจากตำแหน่งขวาสุดด้วย 0 และเพิ่มขึ้น 1 สำหรับแต่ละตำแหน่งถัดไปทางซ้าย

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Computers store everything as bits 位 – each a 0 or 1. A group of 8 bits is a byte 字节. Numbers are stored in binary 二进制 (base 2), where each place is a power of two ($1, 2, 4, 8, 16, \dots$) instead of the powers of ten in decimal 十进制. For example, binary 1011 is $8+2+1=11$.

    Worked example. To convert binary 1101 to decimal, write the place values 8 4 2 1 under the bits 1 1 0 1 and add the ones that have a 1: $8+4+0+1=13$. Going the other way, convert 19 to binary by subtracting the largest power of two that fits: $19-16=3$, then $3-2=1$, then $1-1=0$, so the bits sit at the 16, 2, and 1 places $\rightarrow$ 10011 (check: $16+2+1=19$).

    Because a computer has a finite number of bits, it can represent only a limited range of values. This causes two effects tested on the exam:

    • Overflow error 溢出错误: a number too large for the available bits cannot be stored correctly.
    • Round-off (rounding) error 舍入错误: numbers with decimals (real numbers) can only be approximated, because infinitely many real values must map onto finitely many bit patterns.

    All data – text, images, sound – is ultimately encoded as binary. An image is a grid of pixels 像素, each stored as numbers for its colors; sound is stored as numbers sampled many times per second.

    ไทย
    หลักเลขฐานสองบนจอแสดงผล – ข้อมูลดิจิทัลทั้งหมดจัดเก็บ最终以 0s และ 1s
    หลักเลขฐานสองบนจอแสดงผล – ข้อมูลดิจิทัลทั้งหมดจัด储存 ultimately as 0s and 1s

    คอมพิวเตอร์จัดเก็บทุกอย่างในรูปของ บิต – แต่ละอันเป็น 0 หรือ 1. กลุ่มของ 8 บิตคือ ไบต์.数字จัดเก็บใน เลขฐานสอง (ฐาน 2), ที่แต่ละตำแหน่งเป็นกำลังของสอง ($1, 2, 4, 8, 16, \dots$) แทนกำลังของสิบใน เลขฐานสิบ. ตัวอย่างเช่น, เลขฐานสอง 1011 คือ $8+2+1=11$.

    ตารางตำแหน่งค่า 8-บิต: หลัก 1 อยู่ใต้ค่าที่บวกกันได้เป็นจำนวนนั้น
    ตารางตำแหน่งค่า 8-บิต: หลัก 1 อยู่ใต้ค่าที่บวกกันได้เป็นจำนวนนั้น

    ตัวอย่างฝึกปฏิบัติ. เพื่อแปลงเลขฐานสอง 1101 เป็นเลขฐานสิบ, เขียนตำแหน่งค่า 8 4 2 1 تحتบิต 1 1 0 1 และบวกหลักที่มี 1: $8+4+0+1=13$. ในทางกลับกัน, แปลง 19 เป็นเลขฐานสองโดยการลบกำลังของสองที่ใหญ่ที่สุดที่เข้าได้: $19-16=3$, จากนั้น $3-2=1$, จากนั้น $1-1=0$, ดังนั้นบิตจะอยู่ที่ตำแหน่ง 16, 2, และ 1 $\rightarrow$ 10011 (ตรวจสอบ: $16+2+1=19$).

    เนื่องจากคอมพิวเตอร์มีจำนวนบิตที่มี จำกัด จึงสามารถแทนค่าได้เพียงช่วงหนึ่งเท่านั้น สิ่งนี้ก่อให้เกิดผลกระทบสองอย่างที่ถูกทดสอบในข้อสอบ:

    • ความผิดพลาดจากการล้น (Overflow error): ตัวเลขที่ใหญ่เกินไปสำหรับบิตที่มีอยู่ไม่สามารถจัดเก็บได้อย่างถูกต้อง
    • ความผิดพลาดจากการปัดเศษ (Round-off/rounding error): ตัวเลขที่มี ทศนิยม (จำนวนจริง) สามารถถูก ประมาณค่า ได้เท่านั้น เนื่องจากจำนวนจริงที่ไม่สิ้นสุดต้องถูก映射 onto บิตแพทเทิร์นที่มีจำกัด

    ข้อมูลทั้งหมด – ข้อความ, รูปภาพ, เสียง – จะถูกเข้ารหัสเป็นระบบฐานสองโดยสุดท้าย ภาพคือตารางของ พิกเซล แต่ละจุดจัดเก็บด้วยตัวเลขสำหรับสี; เสียงจัดเก็บด้วยตัวเลขที่สุ่มตัวอย่างหลายครั้งต่อวินาที

    Explore · ⁨สำรวจ⁩

    Convert between binary and decimal · ⁨แปลงระหว่างเลขฐานสองและเลขฐานสิบ⁩

    Computers store numbers in binary (base 2). Each bit is a power of two; add the place values of the 1-bits to read the decimal number. · ⁨คอมพิวเตอร์จัดเก็บตัวเลขในรูปแบบ เลขฐานสอง (base 2) บิตแต่ละตัวเป็นกำลังของสอง; บวกตำแหน่งที่มีค่า 1 เข้าด้วยกันเพื่ออ่านค่าเลขฐานสิบ⁩

    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    bits/bɪts/ บิต
    byte/baɪt/ ไบต์
    binary/ˈbaɪnəri/ แบบไบนารี
    decimal/ˈdesɪml/ ทศนิยม
    Overflow error/ˌəʊvəˈfləʊ ˈerə/ ข้อผิดพลาดจากการเกินขอบเขต
    Round-off (rounding) error/raʊnd ɒf ˈerə/ ข้อผิดพลาดจากการปัดเศษ (Round-off error)
    pixels/ˈpɪkslz/ พิกเซล
    Watch lesson · ⁨ดูบทเรียน⁩
    2.2

    Data Compression · ⁨การบีบอัดข้อมูล⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (DAT-1): The way a computer represents data internally is different from the way the data are interpreted and displayed for the user. Programs are used to translate data into a representation more easily understood by people.

    Learning Objective DAT-1.D: Compare data compression algorithms to determine which is best in a particular context. [Skill 1.D]

    • DAT-1.D.1 Data compression can reduce the size (number of bits) of transmitted or stored data.
    • DAT-1.D.2 Fewer bits does not necessarily mean less information.
    • DAT-1.D.3 The amount of size reduction from compression depends on both the amount of redundancy in the original data representation and the compression algorithm applied.
    • DAT-1.D.4 Lossless data compression algorithms can usually reduce the number of bits stored or transmitted while guaranteeing complete reconstruction of the original data.
    • DAT-1.D.5 Lossy data compression algorithms can significantly reduce the number of bits stored or transmitted but only allow reconstruction of an approximation of the original data.
    • DAT-1.D.6 Lossy data compression algorithms can usually reduce the number of bits stored or transmitted more than lossless compression algorithms.
    • DAT-1.D.7 In situations where quality or ability to reconstruct the original is maximally important, lossless compression algorithms are typically chosen.
    • DAT-1.D.8 In situations where minimizing data size or transmission time is maximally important, lossy compression algorithms are typically chosen.
    ไทย

    ความเข้าใจที่ยั่งยืน (DAT-1): วิธีการที่คอมพิวเตอร์แสดงข้อมูลภายใน differs จากวิธีการที่ข้อมูลถูกตีความและแสดงผลให้กับผู้ใช้ โปรแกรมถูกใช้เพื่อแปลงข้อมูลให้อยู่ในรูปแบบที่มนุษย์เข้าใจได้ง่ายขึ้น

    วัตถุประสงค์การเรียนรู้ DAT-1.D: เปรียบเทียบอัลกอริทึมการบีบอัดข้อมูลเพื่อบ่งชี้ว่าอันใดดีที่สุดในบริบท particular [ทักษะ 1.D]

    • DAT-1.D.1 การบีบอัดข้อมูล สามารถลดขนาด (จำนวนบิต) ของข้อมูลที่ส่งหรือจัดเก็บได้
    • DAT-1.D.2 บิตที่น้อยลงไม่ได้แปลว่าข้อมูลน้อยลงเสมอไป
    • DAT-1.D.3 ปริมาณการลดขนาดจากการบีบอัดขึ้นอยู่กับทั้งปริมาณของความซ้ำซ้อนใน representación เดิมของข้อมูลและอัลกอริทึมการบีบอัดที่ถูกนำไปใช้
    • DAT-1.D.4 อัลกอริทึมการบีบอัดข้อมูลแบบ ไม่สูญเสีย มักจะลดจำนวนบิตที่จัดเก็บหรือส่งได้ mientras รับประกันการสร้าง ulangข้อมูลเดิมอย่างสมบูรณ์
    • DAT-1.D.5 อัลกอริทึมการบีบอัดข้อมูลแบบ สูญเสีย สามารถลดจำนวนบิตที่จัดเก็บหรือส่งได้อย่างมีนัยสำคัญ แต่อนุญาตให้สร้างonly การประมาณของข้อมูลเดิมเท่านั้น
    • DAT-1.D.6 อัลกอริทึมการบีบอัดข้อมูลแบบ สูญเสีย โดยทั่วไปจะลดจำนวนบิตที่จัดเก็บหรือส่งได้มากกว่าอัลกอริทึมการบีบอัดแบบไม่สูญเสีย
    • DAT-1.D.7 ในสถานการณ์ที่คุณภาพหรือความสามารถในการกู้คืนข้อมูลต้นฉบับมีความสำคัญสูงสุด มักจะเลือกใช้อัลกอริทึมการบีบอัดแบบไม่สูญเสียข้อมูล
    • DAT-1.D.8 ในสถานการณ์ที่การลดขนาดข้อมูลหรือเวลาในการส่งต่อมีความสำคัญสูงสุด มักจะเลือกใช้อัลกอริทึมการบีบอัดแบบสูญเสียข้อมูล

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Compression 压缩 reduces the number of bits needed to store or send data. Two kinds:

    • Lossless compression 无损压缩 lets you restore the exact original data (used for text and programs, where every bit matters).
    • Lossy compression 有损压缩 throws away some data to shrink the size further (used for photos, music, video, where a small quality loss is acceptable).

    Choosing between them trades size against fidelity: lossless keeps everything but saves less; lossy saves more but loses detail permanently. Prefer lossless when the data must be exact.

    ไทย
    จานดิสก์แข็งและหัวอ่าน: ข้อมูลถูกบีบอัดและจัดเก็บในรูปแบบแม่เหล็ก
    จานดิสก์แข็งและหัวอ่าน: ข้อมูลถูกบีบอัดและจัดเก็บในรูปแบบแม่เหล็ก

    การบีบอัด ลดจำนวนบิตที่ใช้ในการจัดเก็บหรือส่งข้อมูล มีสองประเภท:

    Compression methods: lossless versus lossy, with common examples
    วิธีการบีบอัด: แบบไม่สูญเสียข้อมูลเทียบกับแบบสูญเสียข้อมูล พร้อมตัวอย่างทั่วไป
    • การบีบอัดแบบไม่สูญเสียข้อมูล (Lossless compression) ช่วยให้คุณคืน ข้อมูลเดิมที่สมบูรณ์ ได้ (ใช้กับข้อความและโปรแกรม ซึ่งทุกบิตมีความสำคัญ)
    • การบีบอัดแบบสูญเสียข้อมูล (Lossy compression) ทิ้งบางข้อมูลออกไปเพื่อลดขนาดลง เพิ่มเติม (ใช้กับภาพถ่าย เพลง วิดีโอ ซึ่งการสูญเสียคุณภาพเล็กน้อยยอมรับได้)

    การเลือก بینทั้งสองเป็นการแลกเปลี่ยนระหว่าง ขนาดและความแม่นยำ: แบบไม่สูญเสียข้อมูลเก็บทุกอย่างแต่ประหยัดได้น้อยกว่า; แบบสูญเสียข้อมูลประหยัดได้มากกว่าแต่รายละเอียดหายไปถาวร ควรเลือกแบบไม่สูญเสียข้อมูลเมื่อข้อมูลต้องมีความแม่นยำ

    Explore · ⁨สำรวจ⁩

    Compress a run of repeats · ⁨บีบอัดลำดับซ้ำติดกัน⁩

    Run-length encoding is a lossless compression: a long run of the same symbol is replaced by the symbol and a count, shrinking the data with no information lost. · ⁨การเข้ารหัสความยาวของการรัน เป็นการจัดเก็บข้อมูลแบบ ไม่สูญเสียข้อมูล: ลำดับยาวของสัญลักษณ์เดียวกันจะถูกแทนที่ด้วยสัญลักษณ์และจำนวน ลดขนาดข้อมูลโดยไม่สูญเสียข้อมูลใดๆ⁩

    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    Compression/kəmˈpreʃn/ การบีบอัดข้อมูล
    Lossless compression/ˈlɒsləs kəmˈpreʃn/ การบีบอัดแบบไม่สูญเสียข้อมูล
    Lossy compression/ˈlɒsi kəmˈpreʃn/ การบีบอัดแบบสูญเสียข้อมูล (Lossy compression)
    Data/ˈdeɪtə/ ข้อมูล
    information/ˌɪnfəˈmeɪʃn/ ข้อมูล
    correlation/ˌkɒrɪˈleɪʃn/ ความสัมพันธ์เชิงสหสัมพันธ์
    Metadata/ˌmetəˈdeɪtə/ เมทาดاتا
    filtering/ˈfɪltərɪŋ/ การกรอง
    visualizing/ˈvɪʒuːəlaɪzɪŋ/ การทำให้เห็นภาพ
    privacy/ˈprɪvəsi/ ความเป็นส่วนตัว
    Watch lesson · ⁨ดูบทเรียน⁩
    2.3

    Extracting Information from Data · ⁨การดึงข้อมูลจากชุดข้อมูล⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (DAT-2): Programs can be used to process data, which allows users to discover information and create new knowledge.

    Learning Objective DAT-2.A: Describe what information can be extracted from data. [Skill 5.B]

    • DAT-2.A.1 Information is the collection of facts and patterns extracted from data.
    • DAT-2.A.2 Data provide opportunities for identifying trends, making connections, and addressing problems.
    • DAT-2.A.3 Digitally processed data may show correlation between variables. A correlation found in data does not necessarily indicate that a causal relationship exists. Additional research is needed to understand the exact nature of the relationship.
    • DAT-2.A.4 Often, a single source does not contain the data needed to draw a conclusion. It may be necessary to combine data from a variety of sources to formulate a conclusion.

    Learning Objective DAT-2.B: Describe what information can be extracted from metadata. [Skill 5.B]

    • DAT-2.B.1 Metadata are data about data. For example, the piece of data may be an image, while the metadata may include the date of creation or the file size of the image.
    • DAT-2.B.2 Changes and deletions made to metadata do not change the primary data.
    • DAT-2.B.3 Metadata are used for finding, organizing, and managing information.
    • DAT-2.B.4 Metadata can increase the effective use of data or data sets by providing additional information.
    • DAT-2.B.5 Metadata allow data to be structured and organized.

    Learning Objective DAT-2.C: Identify the challenges associated with processing data. [Skill 5.D]

    • DAT-2.C.1 The ability to process data depends on the capabilities of the users and their tools.
    • DAT-2.C.2 Data sets pose challenges regardless of size, such as:
      • the need to clean data
      • incomplete data
      • invalid data
      • the need to combine data sources
    • DAT-2.C.3 Depending on how data were collected, they may not be uniform. For example, if users enter data into an open field, the way they choose to abbreviate, spell, or capitalize something may vary from user to user.
    • DAT-2.C.4 Cleaning data is a process that makes the data uniform without changing their meaning (e.g., replacing all equivalent abbreviations, spellings, and capitalizations with the same word).
    • DAT-2.C.5 Problems of bias are often created by the type or source of data being collected. Bias is not eliminated by simply collecting more data.
    • DAT-2.C.6 The size of a data set affects the amount of information that can be extracted from it.
    • DAT-2.C.7 Large data sets are difficult to process using a single computer and may require parallel systems.
    • DAT-2.C.8 Scalability of systems is an important consideration when working with data sets, as the computational capacity of a system affects how data sets can be processed and stored.
    ไทย

    ความเข้าใจที่ยั่งยืน (DAT-2): โปรแกรมสามารถนำไปใช้ประมวลผลข้อมูลได้ ซึ่งช่วยให้ผู้ใช้งานสามารถค้นพบข้อมูลและสร้างองค์ความรู้ใหม่ได้

    วัตถุประสงค์การเรียนรู้ DAT-2.A: อธิบายว่าข้อมูลใดสามารถดึงออกมาได้จากข้อมูล [ทักษะ 5.B]

    • DAT-2.A.1 ข้อมูล คือกลุ่มของข้อเท็จจริงและรูปแบบที่ดึงออกมาจากชุดข้อมูล
    • DAT-2.A.2 ข้อมูลเปิดโอกาสให้สามารถระบุแนวโน้ม เชื่อมโยงความสัมพันธ์ และแก้ปัญหาต่างๆ ได้
    • DAT-2.A.3 ข้อมูลที่ผ่านการประมวลผลด้วยดิจิทัลอาจแสดงถึงความสัมพันธ์ระหว่างตัวแปร ความสัมพันธ์ที่พบในข้อมูลไม่ได้บ่งบอกถึงความเป็นเหตุเป็นผลเสมอไป จำเป็นต้องมีการวิจัยเพิ่มเติมเพื่อทำความเข้าใจลักษณะที่แท้จริงของความสัมพันธะนั้น
    • DAT-2.A.4 มักจะพบว่าแหล่งข้อมูลเดียวไม่มีข้อมูลที่จำเป็นสำหรับการสรุปผล อาจจำเป็นต้องรวมข้อมูลจากแหล่งที่หลากหลายเข้าด้วยกันเพื่อตั้งข้อสรุป

    วัตถุประสงค์การเรียนรู้ DAT-2.B: อธิบายว่าข้อมูลใดสามารถดึงออกมาจากเมตา데이터ได้ [ทักษะ 5.B]

    • DAT-2.B.1 เมตา데이터 คือข้อมูลเกี่ยวกับข้อมูล ตัวอย่างเช่น ข้อมูล อาจเป็นภาพ ในขณะที่ เมตา데이터 อาจรวมถึงวันที่สร้างหรือขนาดไฟล์ของภาพนั้น
    • DAT-2.B.2 การเปลี่ยนแปลงและการลบเมตาdaten ไม่ทำให้ข้อมูลหลักเปลี่ยนไป
    • DAT-2.B.3 เมตาข้อมูลถูกใช้ในการค้นหา จัดระเบียบ และจัดการข้อมูล
    • DAT-2.B.4 เมตาข้อมูลสามารถเพิ่มประสิทธิภาพการใช้ข้อมูลหรือชุดข้อมูลโดยการให้ข้อมูลเพิ่มเติม
    • DAT-2.B.5 เมตาข้อมูลช่วยให้ข้อมูลมีโครงสร้างและเป็นระบบ

    วัตถุประสงค์การเรียนรู้ DAT-2.C: ระบุความท้าทายที่เกี่ยวข้องกับการประมวลผลข้อมูล [ทักษะ 5.D]

    • DAT-2.C.1 ความสามารถในการประมวลผลข้อมูลขึ้นอยู่กับศักยภาพของผู้ใช้งานและเครื่องมือที่ใช้
    • DAT-2.C.2 ชุดข้อมูลสร้างความท้าทายไม่ว่าจะมีขนาดเท่าไร เช่น:
      • ความจำเป็นในการทำความสะอาดข้อมูล
      • ข้อมูลที่ไม่สมบูรณ์
      • ข้อมูลที่ไม่ถูกต้อง
      • ความจำเป็นในการรวมแหล่งข้อมูล
    • DAT-2.C.3 ขึ้นอยู่กับวิธีการเก็บรวบรวมข้อมูล ข้อมูลอาจไม่เป็นมาตรฐานเดียวกัน ตัวอย่างเช่น หากผู้ใช้งานกรอกข้อมูลลงในช่องว่าง ผู้ใช้แต่ละคนอาจเลือกใช้คำย่อ การสะกด หรือการใช้ตัวพิมพ์ใหญ่แตกต่างกันไป
    • DAT-2.C.4 การทำความสะอาดข้อมูล เป็นกระบวนการที่ทำให้ข้อมูลเป็นมาตรฐานโดยไม่เปลี่ยนความหมาย (เช่น แทนที่คำย่อ การสะกด และการใช้ตัวพิมพ์ใหญ่ที่เทียบเท่ากันทั้งหมดด้วยคำเดียวกัน)
    • DAT-2.C.5 ปัญหาความลำเอียงมักเกิดจากประเภทหรือแหล่งที่มาของการเก็บรวบรวมข้อมูล ความลำเอียงไม่สามารถกำจัดได้เพียงด้วยการเก็บรวบรวมข้อมูลมากขึ้นเท่านั้น
    • DAT-2.C.6 ขนาดของชุดข้อมูลส่งผลต่อปริมาณข้อมูลที่สามารถดึงออกมาได้
    • DAT-2.C.7 ชุดข้อมูลขนาดใหญ่ยากที่จะประมวลผลด้วยคอมพิวเตอร์เครื่องเดียวและอาจต้องใช้ระบบแบบขนาน
    • DAT-2.C.8 ความสามารถในการขยายตัวของระบบเป็นปัจจัยสำคัญเมื่อทำงานกับชุดข้อมูล เนื่องจากความสามารถในการคำนวณของระบบส่งผลต่อการประมวลผลและจัดเก็บชุดข้อมูล

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Data 数据 becomes useful when we extract information 信息 from it – patterns, trends, and answers to questions. Large data sets can reveal correlations a small one cannot, but data must be cleaned (fixing errors and inconsistencies) and often transformed or filtered first. A correlation 相关性 between two things does not prove that one causes the other – a key caution. Metadata 元数据 (data about data, like a photo's date and location) helps organize and search large collections.

    ไทย

    ข้อมูล จะกลายเป็นประโยชน์เมื่อเราดึง ข้อมูลเชิงลึก ออกมาจากมัน – ลวดลาย แนวโน้ม และคำตอบของคำถาม ชุดข้อมูลขนาดใหญ่สามารถเปิดเผยความสัมพันธ์ที่ชุดเล็กทำไม่ได้ แต่ข้อมูลต้องถูก ทำความสะอาด (แก้ไขข้อผิดพลาดและความขัดแย้ง) และมักจะถูก แปลง หรือ กรอง ก่อน ความสัมพันธ์ ระหว่างสองสิ่งไม่พิสูจน์ว่าสิ่งใด ทำให้ อีกสิ่งหนึ่งเกิดขึ้น – ข้อควรระวังที่สำคัญ เมตาดาตา (ข้อมูลเกี่ยวกับข้อมูล เช่น วันที่และตำแหน่งของภาพ) ช่วยจัดระเบียบและค้นหาชุดข้อมูลขนาดใหญ่

    2.4

    Using Programs with Data · ⁨การใช้โปรแกรมกับข้อมูล⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (DAT-2): Programs can be used to process data, which allows users to discover information and create new knowledge.

    Learning Objective DAT-2.D: Extract information from data using a program. [Skill 2.B]

    • DAT-2.D.1 Programs can be used to process data to acquire information.
    • DAT-2.D.2 Tables, diagrams, text, and other visual tools can be used to communicate insight and knowledge gained from data.
    • DAT-2.D.3 Search tools are useful for efficiently finding information.
    • DAT-2.D.4 Data filtering systems are important tools for finding information and recognizing patterns in data.
    • DAT-2.D.5 Programs such as spreadsheets help efficiently organize and find trends in information.
    • DAT-2.D.6 Some processes that can be used to extract or modify information from data include the following:
      • transforming every element of a data set, such as doubling every element in a list, or adding a parent's email to every student record
      • filtering a data set, such as keeping only the positive numbers from a list, or keeping only students who signed up for band from a record of all the students
      • combining or comparing data in some way, such as adding up a list of numbers, or finding the student who has the highest GPA
      • visualizing a data set through a chart, graph, or other visual representation

    Learning Objective DAT-2.E: Explain how programs can be used to gain insight and knowledge from data. [Skill 5.B]

    • DAT-2.E.1 Programs are used in an iterative and interactive way when processing information to allow users to gain insight and knowledge about data.
    • DAT-2.E.2 Programmers can use programs to filter and clean digital data, thereby gaining insight and knowledge.
    • DAT-2.E.3 Combining data sources, clustering data, and classifying data are parts of the process of using programs to gain insight and knowledge from data.
    • DAT-2.E.4 Insight and knowledge can be obtained from translating and transforming digitally represented information.
    • DAT-2.E.5 Patterns can emerge when data are transformed using programs.
    ไทย

    ความเข้าใจที่ยั่งยืน (DAT-2): โปรแกรมสามารถนำไปใช้ประมวลผลข้อมูลได้ ซึ่งช่วยให้ผู้ใช้งานสามารถค้นพบข้อมูลและสร้างองค์ความรู้ใหม่ได้

    วัตถุประสงค์การเรียนรู้ DAT-2.D: ดึงข้อมูลออกจากข้อมูลโดยใช้โปรแกรม [ทักษะ 2.B]

    • DAT-2.D.1 โปรแกรมสามารถใช้ประมวลผลข้อมูลเพื่อดึงข้อมูลออกมาได้
    • DAT-2.D.2 ตาราง แผนภูมิ ข้อความ และเครื่องมืออื่นๆ สามารถใช้สื่อสารข้อคิดเห็นและองค์ความรู้ที่ได้จากข้อมูล
    • DAT-2.D.3 เครื่องมือการค้นหา有用สำหรับการค้นหาข้อมูลอย่างมีประสิทธิภาพ
    • DAT-2.D.4 ระบบกรองข้อมูลเป็นเครื่องมือสำคัญสำหรับการค้นหาข้อมูลและจดจำรูปแบบในข้อมูล
    • DAT-2.D.5 โปรแกรมเช่นสเปรดชีตช่วยจัดระเบียบและค้นหาแนวโน้มในข้อมูลได้อย่างมีประสิทธิภาพ
    • DAT-2.D.6 กระบวนการบางอย่างที่ใช้ในการดึงหรือแก้ไขข้อมูลจากข้อมูล ได้แก่:
      • การแปลงทุกองค์ประกอบของชุดข้อมูล เช่น การคูณสองทุกองค์ประกอบในรายการ หรือการเพิ่มอีเมลของผู้ปกครองเข้ากับบันทึกนักเรียนทุกคน
      • การกรองชุดข้อมูล เช่น การเก็บเฉพาะตัวเลขบวกจากรายการ หรือการเก็บเฉพาะนักเรียนที่สมัครเข้าวงดนตรีจากรายชื่อนักเรียนทั้งหมด
      • การรวมหรือเปรียบเทียบข้อมูลในรูปแบบใดรูปแบบหนึ่ง เช่น การบวกจำนวนในรายการ หรือการหานักเรียนที่มีค่าเฉลี่ยคะแนนสูงที่สุด
      • การแสดงชุดข้อมูลผ่านแผนภูมิ กราฟ หรือ表现形式ทางภาพอื่น ๆ

    วัตถุประสงค์การเรียนรู้ DAT-2.E: อธิบายว่าโปรแกรมสามารถนำไปใช้เพื่อ獲取ข้อมูลและองค์ความรู้จากข้อมูลได้อย่างไร [ทักษะ 5.B]

    • DAT-2.E.1 โปรแกรมถูกใช้ในลักษณะซ้ำๆ และเชิงโต้ตอบขณะประมวลผลข้อมูลเพื่อให้ผู้ใช้งานสามารถ获取ข้อมูลและองค์ความรู้เกี่ยวกับข้อมูลได้
    • DAT-2.E.2 นักเขียนโปรแกรมสามารถใช้โปรแกรมเพื่อกรองและทำความสะอาดข้อมูลดิจิทัล thereby获取ข้อมูลและองค์ความรู้
    • DAT-2.E.3 การรวมแหล่งข้อมูล การจัดกลุ่มข้อมูล และการจำแนกข้อมูลเป็นส่วนหนึ่งของกระบวนการการใช้โปรแกรม来获取ข้อมูลและองค์ความรู้จากข้อมูล
    • DAT-2.E.4 ข้อมูลและองค์ความรู้สามารถได้รับจากการแปลและแปลงข้อมูลที่ถูกแทนค่าด้วยดิจิทัล
    • DAT-2.E.5 รูปแบบอาจปรากฏขึ้นเมื่อข้อมูลถูกแปลงโดยใช้โปรแกรม

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Programs process data at scales humans cannot. Common operations are filtering 过滤 (keeping only rows that meet a condition), cleaning (removing errors), and visualizing 可视化 (charts and graphs that make patterns visible). Combining data from multiple sources can reveal more, but raises privacy 隐私 concerns. Interactive tools and visualizations let people explore data and draw their own conclusions.

    Exam skill: be able to explain how a program helps find information in a large data set, and why correlation shown in the data does not establish causation.

    ไทย

    โปรแกรมประมวลผลข้อมูลในระดับที่มนุษย์ทำไม่ได้ การดำเนินการทั่วไปคือ การกรอง (เก็บเฉพาะแถวที่เป็นไปตามเงื่อนไข), การทำความสะอาด (ลบข้อผิดพลาด), และการ แสดงภาพ (แผนภูมิและกราฟที่ทำให้ลวดลายมองเห็นได้) การรวมข้อมูลจากแหล่งต่างๆ สามารถเปิดเผย更多信息ได้ แต่ยกเรื่อง ความเป็นส่วนตัว ขึ้นมาเครื่องมือแบบโต้ตอบและการแสดงผลช่วยให้ผู้คนสำรวจข้อมูลและสรุปผลเองได้

    ทักษะข้อสอบ: ต้องอธิบายได้ว่าโปรแกรมช่วยหาข้อมูลในชุดข้อมูลขนาดใหญ่ได้อย่างไร และทำไมความสัมพันธ์ที่ปรากฏในข้อมูลจึงไม่ยืนยันความสัมพันธ์เชิงสาเหตุ

    2.4

    Exam tips · ⁨ข้อแนะนำสำหรับการสอบ⁩

    English
    • Convert confidently between binary, decimal, and (where asked) hexadecimal — practise until it is quick.
    • Remember a bit is one binary digit and a byte is 8 bits; $n$ bits represent $2^n$ values.
    • Explain that all data — numbers, text, images, sound — is stored as binary, and that finite bits cause overflow and round-off.
    • Distinguish lossless from lossy compression and when each is appropriate.
    • Show the analog-to-digital idea: sampling turns a continuous signal into discrete values.
    ไทย
    • แปลงระหว่าง ระบบฐานสอง, ระบบสิบ, และ (เมื่อต้องการ) ระบบหก عشر ได้อย่างมั่นใจ — ฝึกฝนจนเร็วขึ้น
    • จำไว้ว่าบิตคือหลักเลขฐานสองหนึ่งหลัก และไบต์คือ 8 บิต; $n$ บิตแทน $2^n$ ค่า
    • อธิบายได้ว่าข้อมูลทั้งหมด – ตัวเลข, ข้อความ, รูปภาพ, เสียง – ถูกจัดเก็บเป็นระบบฐานสอง และจำนวนบิตที่มีจำกัดทำให้เกิด ความล้น และ การปัดเศษ
    • แยกแยะความแตกต่างระหว่าง การบีบอัดแบบไม่สูญเสียข้อมูล กับ การบีบอัดแบบสูญเสียข้อมูล และระบุสถานการณ์ที่เหมาะสมสำหรับแต่ละประเภท
    • แสดงแนวคิดของการแปลงสัญญาณอนาล็อกเป็นดิจิทัล: การ สุ่มตัวอย่าง (sampling) จะเปลี่ยนสัญญาณต่อเนื่องให้เป็นค่าแบบไม่ต่อเนื่อง
  • 3

    Algorithms and Programming · ⁨อัลกอริทึมและการเขียนโปรแกรม⁩

    Watch lesson · ⁨ดูบทเรียน⁩
    English

    Code below uses the AP CSP pseudocode – the exam's language-neutral reference. Assignment is written a ← expression, and list indices start at 1.

    ไทย

    โค้ดด้านล่างใช้ 伪代码ของ AP CSP – ซึ่งเป็นตัวอ้างอิงที่เป็นกลางต่อภาษาสำหรับการสอบ การกำหนดค่าเขียนด้วย a ← expression, และดัชนีของลิสต์เริ่มที่ 1

    3.1

    Variables and Assignments · ⁨ตัวแปรและการกำหนดค่า⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-1): To find specific solutions to generalizable problems, programmers represent and organize data in multiple ways.

    Learning Objective AAP-1.A: Represent a value with a variable. [Skill 3.A]

    • AAP-1.A.1 A variable is an abstraction inside a program that can hold a value. Each variable has associated data storage that represents one value at a time, but that value can be a list or other collection that in turn contains multiple values.
    • AAP-1.A.2 Using meaningful variable names helps with the readability of program code and understanding of what values are represented by the variables.
    • AAP-1.A.3 Some programming languages provide types to represent data, which are referenced using variables. These types include numbers, Booleans, lists, and strings.
    • AAP-1.A.4 Some values are better suited to representation using one type of datum rather than another.

    Learning Objective AAP-1.B: Determine the value of a variable as a result of an assignment. [Skill 4.B]

    • AAP-1.B.1 The assignment operator allows a program to change the value represented by a variable.

    • AAP-1.B.2 The exam reference sheet provides the "$\leftarrow$" operator to use for assignment. For example,

      Text:

      a ← expression

      Block:

      a ← expression

      evaluates expression and then assigns a copy of the result to the variable a.

    • AAP-1.B.3 The value stored in a variable will be the most recent value assigned. For example:

      a ← 1 b ← a a ← 2 display(b)

      still displays 1.

    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-1): เพื่อหาคำตอบเฉพาะสำหรับปัญหาทั่วไป นักเขียนโปรแกรมจะแทนที่และจัดระเบียบข้อมูลในหลายรูปแบบ

    วัตถุประสงค์การเรียนรู้ AAP-1.A: แทนค่าด้วยตัวแปร [ทักษะ 3.A]

    • AAP-1.A.1 ตัวแปร (variable) คือการนามธรรมภายในโปรแกรมที่สามารถเก็บค่าได้ ตัวแปรแต่ละตัวมีพื้นที่จัดเก็บข้อมูลที่เกี่ยวข้องซึ่งแทนค่าหนึ่ง ณ เวลาหนึ่ง แต่ค่านั้นอาจเป็นลิสต์หรือกลุ่มข้อมูลอื่นที่ประกอบด้วยหลายค่าในขั้นตอนถัดไป
    • AAP-1.A.2 การใช้ชื่อตัวแปรที่มีความหมายช่วยให้โค้ดโปรแกรมอ่านง่ายขึ้นและเข้าใจได้ว่าตัวแปรเหล่านั้นแทนค่าอะไร
    • AAP-1.A.3 ภาษาโปรแกรมบางภาษาจัดเตรียม ประเภท (types) เพื่อแสดงข้อมูล ซึ่งสามารถอ้างอิงผ่านตัวแปร ประเภทเหล่านี้รวมถึงตัวเลข บูลีน ลิสต์ และสตริง
    • AAP-1.A.4 บางค่าเหมาะต่อการแสดงด้วยชนิดของข้อมูลอย่างใดอย่างหนึ่งมากกว่าอีกชนิดหนึ่ง

    จุดประสงค์การเรียนรู้ AAP-1.B: หาค่าของตัวแปรจากผลลัพธ์ของการกำหนดค่า [ทักษะ 4.B]

    • AAP-1.B.1 ตัวดำเนินการกำหนดค่า (assignment operator) ช่วยให้โปรแกรมสามารถเปลี่ยนค่าที่ตัวแปรแทนได้

    • ** AAP-1.B.2** ใบสรุปข้อสอบให้ใช้ตัวดำเนินการ "$\leftarrow$" สำหรับการกำหนดค่า ตัวอย่างเช่น,

      ข้อความ:

      a ← expression

      บล็อก:

      a ← expression

      จะประเมิน expression แล้วนำสำเนาของผลลัพธ์มากำหนดให้กับตัวแปร a

    • AAP-1.B.3 ค่าที่เก็บอยู่ในตัวแปรจะเป็นค่าล่าสุดที่ถูกกำหนดให้ ตัวอย่างเช่น:

      a ← 1 b ← a a ← 2 display(b)

      ยังแสดง 1 อยู่

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    A variable 变量 is a named place that holds a value. The assignment 赋值 operator stores the value on the right into the variable on the left:

    A variable holds one value at a time; assigning again replaces it. Variables let a program store input, remember results, and reuse them.

    ไทย

    ตัวแปร คือตำแหน่งที่มีชื่อเพื่อเก็บค่า ตัวดำเนินการกำหนดค่า จะจัดเก็บค่าทางขวาลงในตัวแปรทางซ้าย:

    ตัวแปรคือที่เก็บที่มีชื่อซึ่งค่าสามารถเปลี่ยนแปลงได้
    ตัวแปรคือที่เก็บที่มีชื่อซึ่งค่าสามารถเปลี่ยนแปลงได้
    a ← 5
    b ← a + 3      // b is now 8
    

    ตัวแปรจะเก็บค่าได้เพียงค่าเดียวในขณะหนึ่ง; หากมีการกำหนดค่าซ้ำจะ แทนที่ ค่าเดิม ตัวแปรช่วยให้โปรแกรมสามารถเก็บข้อมูลเข้า, จำผลลัพธ์ไว้ และนำไปใช้ซ้ำได้

    Explore · ⁨สำรวจ⁩

    Watch a variable hold and change its value · ⁨สังเกตตัวแปรที่ยึดไว้และเปลี่ยนค่านั้น⁩

    A variable is a named box that stores one value at a time. An assignment copies a value into the box; assigning again overwrites whatever was there. · ⁨ตัวแปร คือกล่องที่มีชื่อซึ่งจัดเก็บค่าเพียงค่าเดียวในหนึ่งเวลา การกำหนดค่า คัดลอกค่าเข้าไปในกล่อง; การกำหนดค่าใหม่จะ ทับ ค่าเดิมที่มีอยู่⁩

    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    variable/ˈveərɪəbl/ ตัวแปร
    assignment/əˈsaɪnmənt/ การกำหนดค่า (assignment)
    Data abstraction/ˈdeɪtə əbˈstrækʃn/ การนามธรรมของข้อมูล
    remainder/rɪˈmeɪndə/ เศษ
    string/strɪŋ/ สตริง (String)
    concatenation/kənˌkætəˈneɪʃn/ การต่อสตริง (concatenation)
    Boolean expression/ˈbuːlɪən ekˈspreʃn/ expression บูลีน
    3.2

    Data Abstraction · ⁨การ تجريงข้อมูล⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-1): To find specific solutions to generalizable problems, programmers represent and organize data in multiple ways.

    Learning Objective AAP-1.C: Represent a list or string using a variable. [Skill 3.A]

    • AAP-1.C.1 A list is an ordered sequence of elements. For example,

      [value1, value2, value3, ...]

      describes a list where value1 is the first element, value2 is the second element, value3 is the third element, and so on.

    • AAP-1.C.2 An element is an individual value in a list that is assigned a unique index.

    • AAP-1.C.3 An index is a common method for referencing the elements in a list or string using natural numbers.

    • AAP-1.C.4 A string is an ordered sequence of characters.

    Learning Objective AAP-1.D: For data abstraction: a. Develop data abstraction using lists to store multiple elements. [Skill 3.B] b. Explain how the use of data abstraction manages complexity in program code. [Skill 3.C]

    • AAP-1.D.1 Data abstraction provides a separation between the abstract properties of a data type and the concrete details of its representation.

    • AAP-1.D.2 Data abstractions manage complexity in programs by giving a collection of data a name without referencing the specific details of the representation.

    • AAP-1.D.3 Data abstractions can be created using lists.

    • AAP-1.D.4 Developing a data abstraction to implement in a program can result in a program that is easier to develop and maintain.

    • AAP-1.D.5 Data abstractions often contain different types of elements.

    • AAP-1.D.6 The use of lists allows multiple related items to be treated as a single value. Lists are referred to by different names, such as array, depending on the programming language.

      • Exclusion statement (EK AAP-1.D.6): The use of linked lists is outside the scope of this course and the AP Exam.
    • AAP-1.D.7 The exam reference sheet provides the notation

      [value1, value2, value3, ...]

      to create a list with those values as the first, second, third, and so on items. For example,

      • Text:

        aList ← [value1, value2, value3, ...]

        Block:

        aList ← value1, value2, value3

        creates a new list that contains the values value1, value2, value3, and ... at indices 1, 2, 3, and ... respectively and assigns it to aList.

      • Text:

        aList ← []

        Block:

        aList ← (empty)

        creates a new empty list and assigns it to aList.

      • Text:

        aList ← bList

        Block:

        aList ← bList

        assigns a copy of the list bList to the list aList. For example, if bList contains [20, 40, 60], then aList will also contain [20, 40, 60] after the assignment.

    • AAP-1.D.8 The exam reference sheet describes a list structure whose index values are 1 through the number of elements in the list, inclusive. For all list operations, if a list index is less than 1 or greater than the length of the list, an error message is produced and the program will terminate.

    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-1): เพื่อหาคำตอบเฉพาะสำหรับปัญหาทั่วไป นักเขียนโปรแกรมจะแทนที่และจัดระเบียบข้อมูลในหลายรูปแบบ

    จุดประสงค์การเรียนรู้ AAP-1.C: แสดงรายการหรือสตริงโดยใช้ตัวแปร [ทักษะ 3.A]

    • AAP-1.C.1 รายการ คือลำดับขององค์ประกอบที่มีลำดับ สำหรับตัวอย่าง,

      [value1, value2, value3, ...]

      แสดงรายการที่ value1 เป็นองค์ประกอบแรก, value2 เป็นองค์ประกอบที่สอง, value3 เป็นองค์ประกอบที่สาม และอื่นๆ ตามลำดับ

    • AAP-1.C.2 องค์ประกอบ คือค่าเดี่ยวในรายการที่ถูกกำหนดดัชนีเฉพาะ

    • AAP-1.C.3 ดัชนี เป็นวิธีการทั่วไปในการอ้างอิงองค์ประกอบในรายการหรือสตริงโดยใช้จำนวนเต็มบวก

    • AAP-1.C.4 สตริง คือลำดับของตัวอักษรที่มีลำดับ

    จุดประสงค์การเรียนรู้ AAP-1.D: สำหรับการลดทอนข้อมูล: ก. พัฒนาการใช้การลดทอนข้อมูลโดยใช้รายการเพื่อจัดเก็บองค์ประกอบหลายอย่าง [ทักษะ 3.B] ข. อธิบายว่าการใช้การลดทอนข้อมูลช่วยจัดการความซับซ้อนในโค้ดโปรแกรมได้อย่างไร [ทักษะ 3.C]

    • AAP-1.D.1 การลดทอนข้อมูลให้ความแยกแยะระหว่างคุณสมบัติเชิงนามธรรมของชนิดข้อมูลกับรายละเอียดเชิงรูปธรรมของการนำเสนอ

    • AAP-1.D.2 การลดทอนข้อมูลจัดการความซับซ้อนในโปรแกรมโดยการตั้งชื่อชุดข้อมูลโดยไม่อ้างอิงรายละเอียดเฉพาะของการนำเสนอ

    • AAP-1.D.3 สามารถสร้างข้อมูลเชิงนามธรรม (Data abstractions) โดยใช้ลิสต์ได้

    • AAP-1.D.4 การพัฒนาข้อมูลเชิงนามธรรมเพื่อนำไปใช้ในโปรแกรม อาจทำให้โปรแกรมนั้นพัฒนาและบำรุงรักษาง่ายขึ้น

    • AAP-1.D.5 ข้อมูลเชิงนามธรรมมักประกอบด้วยองค์ประกอบหลายประเภท

    • AAP-1.D.6 การใช้ลิสต์ช่วยให้สามารถจัดการกับรายการที่เกี่ยวข้องกันหลายรายการในฐานะค่าเดียว ลิสต์อาจถูกเรียกว่าชื่ออื่น ๆ เช่น array ขึ้นอยู่กับภาษาการเขียนโปรแกรมที่ใช้

      • ข้อยกเว้น (EK AAP-1.D.6): การใช้ลิงค์ลิสต์ (linked lists)อยู่นอกขอบเขตของหลักสูตรนี้และข้อสอบ AP
    • AAP-1.D.7 แผ่นอ้างอิงข้อสอบให้สัญลักษณ์สำหรับ

      [value1, value2, value3, ...]

      เพื่อสร้างลิสต์ที่มีค่าเหล่านั้นเป็นรายการแรก, รายการที่สอง, รายการที่สาม และ seterusnya ตัวอย่างเช่น,

      • ข้อความ:

        aList ← [value1, value2, value3, ...]

        บล็อก:

        aList ← value1, value2, value3

        สร้างรายการใหม่ที่มีค่า value1, value2, value3 และ ... ที่ตำแหน่ง 1, 2, 3 และ ... ตามลำดับ และกำหนดให้รายการนั้นเป็น aList

      • ข้อความ:

        aList ← []

        บล็อก:

        aList ← (ว่างเปล่า)

        สร้างลิสต์ว่างเปล่าใหม่และกำหนดให้ลิสต์นี้เป็น aList

      • ข้อความ:

        aList ← bList

        บล็อก:

        aList ← bList

        คัดลอกลิสต์ bList ไปยังลิสต์ aList ตัวอย่างเช่น หาก bList มีค่า [20, 40, 60] แล้ว послеการคัดลอก aList จะยังมีค่า [20, 40, 60] อยู่ด้วย

    • AAP-1.D.8 แผ่นอ้างอิงข้อสอบอธิบายโครงสร้างลิสต์ซึ่งค่าดรรชนีมีตั้งแต่ 1 ไปจนถึงจำนวนองค์ประกอบในลิสต์ รวมทั้งต้น สำหรับทุกการดำเนินการกับลิสต์ หากดรรชนีลิสต์น้อยกว่า 1 หรือมากกว่าความยาวของลิสต์ จะเกิดข้อความข้อผิดพลาดและโปรแกรมจะหยุดทำงาน

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Data abstraction 数据抽象 lets you manage complexity by giving a single name to a collection of data – for example, a list rather than dozens of separate variables. It hides detail: you use the named collection without worrying about how it is stored. Lists (below) are the course's main data abstraction.

    ไทย

    การ تجريงข้อมูล ช่วยให้คุณจัดการกับความซับซ้อน bằngการตั้งชื่อชุดข้อมูลเป็นชื่อเดียว – เช่น ลิสต์ แทนที่จะมีตัวแปรแยกหลายสิบตัว มันซ่อนรายละเอียด: คุณใช้ชุดข้อมูลที่ตั้งชื่อนั้นโดยไม่ต้องกังวลว่ามันถูกจัดเก็บอย่างไร ลิสต์ (ด้านล่าง) เป็นวิธีการ تجريงข้อมูลหลักของหลักสูตรนี้

    3.3

    Mathematical Expressions · ⁨นิพจน์ทางคณิตศาสตร์⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-2): The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values.

    Learning Objective AAP-2.A: Express an algorithm that uses sequencing without using a programming language. [Skill 2.A]

    • AAP-2.A.1 An algorithm is a finite set of instructions that accomplish a specific task.
    • AAP-2.A.2 Beyond visual and textual programming languages, algorithms can be expressed in a variety of ways, such as natural language, diagrams, and pseudocode.
    • AAP-2.A.3 Algorithms executed by programs are implemented using programming languages.
    • AAP-2.A.4 Every algorithm can be constructed using combinations of sequencing, selection, and iteration.

    Learning Objective AAP-2.B: Represent a step-by-step algorithmic process using sequential code statements. [Skill 2.B]

    • AAP-2.B.1 Sequencing is the application of each step of an algorithm in the order in which the code statements are given.
    • AAP-2.B.2 A code statement is a part of program code that expresses an action to be carried out.
    • AAP-2.B.3 An expression can consist of a value, a variable, an operator, or a procedure call that returns a value.
    • AAP-2.B.4 Expressions are evaluated to produce a single value.
    • AAP-2.B.5 The evaluation of expressions follows a set order of operations defined by the programming language.
    • AAP-2.B.6 Sequential statements execute in the order they appear in the code segment.
    • AAP-2.B.7 Clarity and readability are important considerations when expressing an algorithm in a programming language.

    Learning Objective AAP-2.C: Evaluate expressions that use arithmetic operators. [Skill 4.B]

    • AAP-2.C.1 Arithmetic operators are part of most programming languages and include addition, subtraction, multiplication, division, and modulus operators.

    • AAP-2.C.2 The exam reference sheet provides a MOD b, which evaluates to the remainder when a is divided by b. Assume that a is an integer greater than or equal to 0 and b is an integer greater than 0. For example, 17 MOD 5 evaluates to 2.

    • AAP-2.C.3 The exam reference sheet provides the arithmetic operators +, -, *, /, and MOD.

      Text and Block:

      • a + b
      • a - b
      • a * b
      • a / b
      • a MOD b

      These are used to perform arithmetic on a and b. For example, 17 / 5 evaluates to 3.4.

    • AAP-2.C.4 The order of operations used in mathematics applies when evaluating expressions. The MOD operator has the same precedence as the * and / operators.

    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-2): วิธีการเรียงลำดับและรวมคำสั่งในโปรแกรมจะกำหนดผลลัพธ์ที่ได้จากการคำนวณ โปรแกรมมีการใช้โครงสร้างการทำซ้ำและการเลือกเพื่อแสดงถึงการทำซ้ำและการตัดสินใจเพื่อจัดการกับค่าอินพุตที่หลากหลาย

    จุดประสงค์การเรียนรู้ AAP-2.A: เขียนอัลกอริทึมที่ใช้การเรียงลำดับโดยไม่ใช้ภาษาการเขียนโปรแกรม [ทักษะ 2.A]

    • AAP-2.A.1 อัลกอริทึม คือชุดคำสั่งที่มีจำนวนจำกัดเพื่อทำภารกิจเฉพาะอย่าง
    • AAP-2.A.2 นอกเหนือจากภาษาการเขียน_programming แบบภาพและแบบข้อความ อัลกอริทึมสามารถแสดงออกได้ในหลากหลายรูปแบบ เช่น ภาษาธรรมชาติ แผนภาพ และโค้ดลวง
    • AAP-2.A.3 อัลกอริทึมที่ถูกดำเนินการโดยโปรแกรมจะถูกนำไปใช้ผ่านภาษาการเขียนโปรแกรม
    • AAP-2.A.4 อัลกอริทึมทุกชนิดสามารถสร้างได้จากการผสมผสานของการเรียงลำดับ การเลือก และการวนซ้ำ

    จุดประสงค์การเรียนรู้ AAP-2.B: แสดงกระบวนการทางอัลกอริทึมทีละขั้นตอนโดยใช้คำสั่งโค้ดแบบเรียงลำดับ [ทักษะ 2.B]

    • AAP-2.B.1 การเรียงลำดับ คือการนำแต่ละขั้นตอนของอัลกอริทึมไปใช้ตามลำดับที่คำสั่งโค้ดถูกกำหนดไว้
    • AAP-2.B.2 คำสั่งโค้ด เป็นส่วนหนึ่งของโค้ดโปรแกรมที่แสดงถึงการกระทำที่จะดำเนินการ
    • AAP-2.B.3 สมการ สามารถประกอบด้วยค่า ตัวแปร ตัวดำเนินการ หรือการเรียกฟังก์ชันที่คืนค่า
    • AAP-2.B.4 สมการจะถูกประเมินผลเพื่อสร้างค่าเดียว
    • AAP-2.B.5 การประเมินผลสมการจะ遵循ลำดับการดำเนินการที่กำหนดโดยภาษาการเขียนโปรแกรม
    • AAP-2.B.6 คำสั่งแบบเรียงลำดับจะถูกดำเนินการตามลำดับที่ปรากฏในส่วนโค้ด
    • AAP-2.B.7 ความชัดเจนและการอ่านง่ายเป็นปัจจัยสำคัญเมื่อแสดงอัลกอริทึมผ่านภาษาการเขียนโปรแกรม

    จุดประสงค์การเรียนรู้ AAP-2.C: ประเมินผลสมการที่ใช้ตัวดำเนินการทางคณิตศาสตร์ [ทักษะ 4.B]

    • AAP-2.C.1 ตัวดำเนินการทางคณิตศาสตร์เป็นส่วนหนึ่งของภาษาการเขียนโปรแกรมส่วนใหญ่และรวมถึงตัวดำเนินการบวก ลบ คูณ หาร และโมดูลัส

    • AAP-2.C.2 ใบอ้างอิงสำหรับการสอบให้ a MOD b ซึ่งประเมินผลลัพธ์เป็นเศษเหลือเมื่อ a หารด้วย b ให้สมมติว่า a เป็นจำนวนเต็มที่มีค่ามากกว่าหรือเท่ากับ 0 และ b เป็นจำนวนเต็มที่มีค่ามากกว่า 0 ตัวอย่างเช่น 17 MOD 5 ประเมินได้ 2

    • AAP-2.C.3 แผ่นอ้างอิงข้อสอบให้ตัวดำเนินการทางคณิตศาสตร์ +, -, *, /, และ MOD

      ข้อความและบล็อก:

      • a + b
      • a - b
      • a * b
      • a / b
      • a MOD b

      ใช้สำหรับการคำนวณทางคณิตศาสตร์บน a และ b ตัวอย่างเช่น 17 / 5 ประเมินผลเป็น 3.4

    • AAP-2.C.4 ลำดับการดำเนินการที่ใช้ในคณิตศาสตร์จะใช้เมื่อประเมินผลสมการ ตัวดำเนินการ MOD มีระดับความสำคัญเท่ากับตัวดำเนินการ * และ /

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Programs compute with the operators +, -, *, /, and MOD (the remainder 余数 of a division, e.g. 17 MOD 5 is 2). Expressions follow the usual order of operations. MOD is especially useful for testing divisibility (n MOD 2 = 0 means n is even) and for wrapping values around a range.

    ไทย

    โปรแกรมคำนวณด้วยตัวดำเนินการ +, -, *, /, และ MOD (คือ เศษจากการหาร, เช่น 17 MOD 5 คือผลของ 2) นิพจน์ปฏิบัติตามลำดับความสำคัญในการคำนวณปกติ MOD มีประโยชน์มากสำหรับการทดสอบการหาร habis (n MOD 2 = 0 หมายความว่า n เป็นจำนวนคู่) และการวนรอบค่าภายในช่วงที่กำหนด

    Explore · ⁨สำรวจ⁩

    Evaluate an expression step by step · ⁨คำนวณนิพจน์ทีละขั้นตอน⁩

    An expression is evaluated with order of operations: multiplication and division happen before addition and subtraction, left to right. · ⁨นิพจน์ถูกคำนวณตาม ลำดับการดำเนินการ: การคูณและการหารเกิดขึ้นก่อนการบวกและการลบ ทำจากซ้ายไปขวา⁩

    3.4

    Strings · ⁨สตริง (ข้อความ)⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-2): The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values.

    Learning Objective AAP-2.D: Evaluate expressions that manipulate strings. [Skill 4.B]

    • AAP-2.D.1 String concatenation joins together two or more strings end-to-end to make a new string.
    • AAP-2.D.2 A substring is part of an existing string.
    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-2): วิธีการเรียงลำดับและรวมคำสั่งในโปรแกรมจะกำหนดผลลัพธ์ที่ได้จากการคำนวณ โปรแกรมมีการใช้โครงสร้างการทำซ้ำและการเลือกเพื่อแสดงถึงการทำซ้ำและการตัดสินใจเพื่อจัดการกับค่าอินพุตที่หลากหลาย

    จุดประสงค์การเรียนรู้ AAP-2.D: ประเมินผลสมการที่จัดการกับสตริง [ทักษะ 4.B]

    • AAP-2.D.1 การต่อสตริง (String concatenation) เป็นการเชื่อมสตริงสองตัวขึ้นไปเข้าด้วยกันต่อท้ายกันเพื่อสร้างสตริงใหม่
    • AAP-2.D.2 สับสตริง (Substring) คือส่วนของสตริงที่มีอยู่เดิม

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    A string 字符串 is an ordered sequence of characters, like "hello". Programs join strings (concatenation 拼接) and find their length. Strings represent text – names, messages, sequences – and are a common program input and output.

    ไทย

    สตริง คือลำดับที่มีระเบียบของตัวอักษร เช่น "hello" โปรแกรมสามารถเชื่อมสตริง (การเชื่อมต่อ) และหา ความยาว ของมัน สตริงใช้แทนข้อความ – ชื่อ, ข้อความ, ลำดับ – และเป็นอินพุตและเอาต์พุตของโปรแกรมที่พบบ่อย

    3.5

    Boolean Expressions · ⁨นิพจน์ boolean⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-2): The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values.

    Learning Objective AAP-2.E: For relationships between two variables, expressions, or values: a. Write expressions using relational operators. [Skill 2.B] b. Evaluate expressions that use relational operators. [Skill 4.B]

    • AAP-2.E.1 A Boolean value is either true or false.

    • AAP-2.E.2 The exam reference sheet provides the following relational operators: =, ≠, >, <, ≥, and ≤.

      Text and Block:

      • a = b
      • a ≠ b
      • a > b
      • a < b
      • a ≥ b
      • a ≤ b

      These are used to test the relationship between two variables, expressions, or values. A comparison using a relational operator evaluates to a Boolean value. For example, a = b evaluates to true if a and b are equal; otherwise, it evaluates to false.

    Learning Objective AAP-2.F: For relationships between Boolean values: a. Write expressions using logical operators. [Skill 2.B] b. Evaluate expressions that use logic operators. [Skill 4.B]

    • AAP-2.F.1 The exam reference sheet provides the logical operators NOT, AND, and OR, which evaluate to a Boolean value.

    • AAP-2.F.2 The exam reference sheet provides

      Text:

      NOT condition

      Block:

      NOT condition

      which evaluates to true if condition is false; otherwise it evaluates to false.

    • AAP-2.F.3 The exam reference sheet provides

      Text:

      condition1 AND condition2

      Block:

      condition1 AND condition2

      which evaluates to true if both condition1 and condition2 are true; otherwise it evaluates to false.

    • AAP-2.F.4 The exam reference sheet provides

      Text:

      condition1 OR condition2

      Block:

      condition1 OR condition2

      which evaluates to true if condition1 is true or if condition2 is true or if both condition1 and condition2 are true; otherwise it evaluates to false.

    • AAP-2.F.5 The operand for a logical operator is either a Boolean expression or a single Boolean value.

    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-2): วิธีการเรียงลำดับและรวมคำสั่งในโปรแกรมจะกำหนดผลลัพธ์ที่ได้จากการคำนวณ โปรแกรมมีการใช้โครงสร้างการทำซ้ำและการเลือกเพื่อแสดงถึงการทำซ้ำและการตัดสินใจเพื่อจัดการกับค่าอินพุตที่หลากหลาย

    จุดประสงค์การเรียนรู้ AAP-2.E: สำหรับความสัมพันธ์ระหว่างตัวแปรสองตัว สมการ หรือค่า: a. เขียนสมการโดยใช้ตัวดำเนินการเปรียบเทียบ [ทักษะ 2.B] b. ประเมินผลสมการที่ใช้ตัวดำเนินการเปรียบเทียบ [ทักษะ 4.B]

    • AAP-2.E.1 ค่าบूलีน (Boolean value) มีเพียงจริง (true) หรือเท็จ (false) เท่านั้น

    • AAP-2.E.2 แผ่นอ้างอิงข้อสอบให้ตัวดำเนินการเปรียบเทียบดังนี้: =, ≠, >, <, ≥, และ ≤

      ข้อความและบล็อก:

      • a = b
      • a ≠ b
      • a > b
      • a < b
      • a ≥ b
      • a ≤ b

    ใช้เพื่อทดสอบความสัมพันธ์ระหว่างตัวแปรสองตัว นิพจน์ หรือค่า การเปรียบเทียบโดยใช้ relational operator จะประเมินผลเป็นค่า Boolean ตัวอย่างเช่น a = b ประเมินได้ true หาก a และ b เท่ากัน; ในกรณีอื่นจะประเมินได้ false

    จุดประสงค์การเรียนรู้ AAP-2.F: สำหรับความสัมพันธ์ระหว่างค่าบูลีน: a. เขียนสมการโดยใช้ตัวดำเนินการตรรกะ [ทักษะ 2.B] b. ประเมินผลสมการที่ใช้ตัวดำเนินการตรรกะ [ทักษะ 4.B]

    • AAP-2.F.1 แผ่นอ้างอิงข้อสอบให้ตัวดำเนินการตรรกะ NOT, AND, และ OR ซึ่งประเมินผลเป็นค่าบูลีน

    • AAP-2.F.2 แผ่นอ้างอิงข้อสอบให้

      ข้อความ:

      NOT condition

      บล็อก:

      NOT condition

      ซึ่งจะให้ค่าเป็น true หาก condition มีค่าเป็น false; ในกรณีอื่นจะให้ค่าเป็น false

    • AAP-2.F.3 แผ่นอ้างอิงข้อสอบให้

      ข้อความ:

      condition1 AND condition2

      บล็อก:

      condition1 AND condition2

      ซึ่งจะให้ค่าเป็น true หากทั้ง condition1 และ condition2 มีค่าเป็น true; ในกรณีอื่นจะให้ค่าเป็น false

    • AAP-2.F.4 ใบสรุปสำหรับการสอบให้

      ข้อความ:

      condition1 OR condition2

      บล็อก:

      condition1 OR condition2

      ซึ่งจะให้ค่าเป็น true หาก condition1 มีค่าเป็น true หรือหาก condition2 มีค่าเป็น true หรือหากทั้ง condition1 และ condition2 มีค่าเป็น true; ในกรณีอื่นจะให้ค่าเป็น false

    • AAP-2.F.5 ตัว operands ของตัวดำเนินการตรรกศาสตร์อาจเป็น expression แบบ Boolean หรือค่า Boolean ค่าเดียว

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    A Boolean expression 布尔表达式 evaluates to true or false. It uses relational operators (=, ≠, <, >, ≤, ≥) and logical operators NOT, AND, OR:

    • NOT reverses a value,
    • AND is true only when both sides are true,
    • OR is true when at least one side is true.

    These conditions drive every decision and loop.

    ไทย

    นิพจน์บูลีน มีค่าเป็น true หรือ false ใช้ ตัวดำเนินการเปรียบเทียบ (=, ≠, <, >, ≤, ≥) และ ตัวดำเนินการตรรกะ NOT, AND, OR:

    ครอบครัวของ operator สามกลุ่ม: arithmetic, relational, และ logical
    ครอบครัวของ operator สามกลุ่ม: arithmetic, relational, และ logical
    • NOT จะกลับค่าหรือผกผันค่า,
    • AND จะเป็นจริงก็ต่อเมื่อ ทั้งสอง ด้านเป็นจริง,
    • OR เป็นจริงเมื่อ อย่างน้อยหนึ่ง ด้านเป็นจริง

    เงื่อนไขเหล่านี้ขับเคลื่อนทุกการตัดสินใจและวงลูป

    Explore · ⁨สำรวจ⁩

    Try the OR truth table · ⁨ลองตารางความจริง OR⁩

    A Boolean expression is either true (1) or false (0). OR is true when at least one input is true; flip the inputs to see every case. · ⁨นิพจน์ Boolean เป็นจริง (1) หรือเท็จ (0) OR เป็นจริงเมื่อ อย่างน้อยหนึ่ง อินพุตเป็นจริง; สลับอินพุตเพื่อดูทุกกรณี⁩

    3.6

    Conditionals · ⁨เงื่อนไข (Conditional)⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-2): The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values.

    Learning Objective AAP-2.G: Express an algorithm that uses selection without using a programming language. [Skill 2.A]

    • AAP-2.G.1 Selection determines which parts of an algorithm are executed based on a condition being true or false.

    Learning Objective AAP-2.H: For selection: a. Write conditional statements. [Skill 2.B] b. Determine the result of conditional statements. [Skill 4.B]

    • AAP-2.H.1 Conditional statements, or "if-statements," affect the sequential flow of control by executing different statements based on the value of a Boolean expression.

    • AAP-2.H.2 The exam reference sheet provides

      Text:

      IF(condition) { <block of statements> }

      Block:

      IF condition block of statements

      in which the code in block of statements is executed if the Boolean expression condition evaluates to true; no action is taken if condition evaluates to false.

    • AAP-2.H.3 The exam reference sheet provides

      Text:

      IF(condition) { <first block of statements> } ELSE { <second block of statements> }

      Block:

      IF condition first block of statements ELSE second block of statements

      in which the code in first block of statements is executed if the Boolean expression condition evaluates to true; otherwise, the code in second block of statements is executed.

    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-2): วิธีการเรียงลำดับและรวมคำสั่งในโปรแกรมจะกำหนดผลลัพธ์ที่ได้จากการคำนวณ โปรแกรมมีการใช้โครงสร้างการทำซ้ำและการเลือกเพื่อแสดงถึงการทำซ้ำและการตัดสินใจเพื่อจัดการกับค่าอินพุตที่หลากหลาย

    จุดประสงค์การเรียนรู้ AAP-2.G: เขียนอัลกอริทึมที่ใช้การเลือกโดยไม่ใช้ภาษาโปรแกรมมิ่ง [ทักษะ 2.A]

    • AAP-2.G.1 การเลือก (Selection) กำหนดว่าส่วนใดของอัลกอริทึมจะถูกดำเนินการตามเงื่อนไขที่เป็น true หรือ false

    จุดประสงค์การเรียนรู้ AAP-2.H: สำหรับการเลือก: ข. เขียนคำสั่งแบบเงื่อนไข [ทักษะ 2.B] ค. พิจารณาผลลัพธ์ของคำสั่งแบบเงื่อนไข [ทักษะ 4.B]

    • AAP-2.H.1 คำสั่งเงื่อนไข (conditional statements) หรือ "if-statements" มีผลต่อลำดับการทำงานของการควบคุมโดย اجرایคำสั่งที่แตกต่างกันตามค่าของนิพจน์ Boolean

    • AAP-2.H.2 ใบสรุปสำหรับการสอบให้

      ข้อความ:

      IF(condition) { <block of statements> }

      บล็อก:

      IF condition block of statements

      ซึ่งโค้ดใน block of statements จะถูกดำเนินการหาก expression แบบ Boolean condition ให้ค่าเป็น true; ไม่มีการกระทำใดๆ หาก condition ให้ค่าเป็น false

    • AAP-2.H.3 ใบสรุปสำหรับการสอบให้

      ข้อความ:

      IF(condition) { <first block of statements> } ELSE { <second block of statements> }

      บล็อก:

      IF condition first block of statements ELSE second block of statements

      ซึ่งโค้ดใน first block of statements จะถูกดำเนินการหาก expression แบบ Boolean condition ให้ค่าเป็น true; ในกรณีอื่น โค้ดใน second block of statements จะถูกดำเนินการ

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    A conditional (selection) 条件语句 chooses which code to run. IF runs a block only when its condition is true; ELSE gives an alternative:

    ไทย

    เงื่อนไข (การเลือก) เลือกว่าควรรันโค้ดส่วนไหน IF รันบล็อกเฉพาะเมื่อเงื่อนไขเป็นจริง; ELSE ให้ทางเลือกอื่น:

    Selection chooses between paths based on a condition
    การเลือก (Selection) จะเลือกเส้นทางตามเงื่อนไข
    IF (score ≥ 60)
    {
        DISPLAY("Pass")
    }
    ELSE
    {
        DISPLAY("Fail")
    }
    
    Explore · ⁨สำรวจ⁩

    Follow an if / else decision · ⁨ติดตามการตัดสินใจ if / else⁩

    A conditional runs one branch or another depending on whether its condition is true. Slide the value across the threshold and watch which branch is taken. · ⁨เงื่อนไข จะเรียกใช้สาขาหนึ่งหรืออีกสาขาหนึ่งขึ้นอยู่กับว่าเงื่อนไขเป็นจริงหรือไม่ เลื่อนค่าข้ามเกณฑ์ดูว่าสาขาใดถูกเลือก⁩

    3.7

    Nested Conditionals · ⁨เงื่อนไขซ้อนกัน⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-2): The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values.

    Learning Objective AAP-2.I: For nested selection: a. Write nested conditional statements. [Skill 2.B] b. Determine the result of nested conditional statements. [Skill 4.B]

    • AAP-2.I.1 Nested conditional statements consist of conditional statements within conditional statements.
    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-2): วิธีการเรียงลำดับและรวมคำสั่งในโปรแกรมจะกำหนดผลลัพธ์ที่ได้จากการคำนวณ โปรแกรมมีการใช้โครงสร้างการทำซ้ำและการเลือกเพื่อแสดงถึงการทำซ้ำและการตัดสินใจเพื่อจัดการกับค่าอินพุตที่หลากหลาย

    วัตถุประสงค์การเรียนรู้ AAP-2.I: สำหรับโครงสร้างการเลือก: a. เขียนคำสั่งเงื่อนไขแบบซ้อนกัน [ทักษะ 2.B] b. กำหนดผลลัพธ์ของคำสั่งเงื่อนไขแบบซ้อนกัน [ทักษะ 4.B]

    • AAP-2.I.1 คำสั่งเงื่อนไขแบบซ้อนกันประกอบด้วยคำสั่งเงื่อนไขที่อยู่ภายในคำสั่งเงื่อนไขอื่น

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    A nested conditional 嵌套条件 places one IF inside another (or chains ELSE IF) to choose among more than two paths. Only the first matching branch runs:

    ไทย

    เงื่อนไขแบบซ้อน (Nested conditional) จะวาง IF หนึ่งตัวภายในอีกตัวหนึ่ง (หรือเชื่อม ELSE IF) เพื่อเลือกจาก มากกว่าสอง ทาง只会 executes the first matching branch:

    IF (g ≥ 90)      { grade ← "A" }
    ELSE IF (g ≥ 80) { grade ← "B" }
    ELSE             { grade ← "C" }
    
    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    conditional (selection)/kənˈdɪʃənl/ เงื่อนไข (การเลือก)
    nested conditional/ˈnestɪd kənˈdɪʃənl/ เงื่อนไขซ้อน
    Iteration (a loop)/ˌɪtəˈreɪʃn/ การซ้ำ (ลูป)
    3.8

    Iteration · ⁨การวนซ้ำ⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-2): The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values.

    Learning Objective AAP-2.J: Express an algorithm that uses iteration without using a programming language. [Skill 2.A]

    • AAP-2.J.1 Iteration is a repeating portion of an algorithm. Iteration repeats a specified number of times or until a given condition is met.

    Learning Objective AAP-2.K: For iteration: a. Write iteration statements. [Skill 2.B] b. Determine the result or side effect of iteration statements. [Skill 4.B]

    • AAP-2.K.1 Iteration statements change the sequential flow of control by repeating a set of statements zero or more times, until a stopping condition is met.

    • AAP-2.K.2 The exam reference sheet provides

      Text:

      REPEAT n TIMES { <block of statements> }

      Block:

      REPEAT n TIMES block of statements

      in which the block of statements is executed n times.

    • AAP-2.K.3 The exam reference sheet provides

      Text:

      REPEAT UNTIL(condition) { <block of statements> }

      Block:

      REPEAT UNTIL condition block of statements

      in which the code in block of statements is repeated until the Boolean expression condition evaluates to true.

    • AAP-2.K.4 In REPEAT UNTIL(condition) iteration, an infinite loop occurs when the ending condition will never evaluate to true.

    • AAP-2.K.5 In REPEAT UNTIL(condition) iteration, if the conditional evaluates to true initially, the loop body is not executed at all, due to the condition being checked before the loop.

    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-2): วิธีการเรียงลำดับและรวมคำสั่งในโปรแกรมจะกำหนดผลลัพธ์ที่ได้จากการคำนวณ โปรแกรมมีการใช้โครงสร้างการทำซ้ำและการเลือกเพื่อแสดงถึงการทำซ้ำและการตัดสินใจเพื่อจัดการกับค่าอินพุตที่หลากหลาย

    วัตถุประสงค์การเรียนรู้ AAP-2.J: แสดงอัลกอริทึมที่ใช้การทำซ้ำโดยไม่ใช้ภาษาโปรแกรม [ทักษะ 2.A]

    • AAP-2.J.1 การทำซ้ำ คือส่วนที่ซ้ำกันในอัลกอริทึม การทำซ้ำจะทำงานจำนวนครั้งที่กำหนดหรือจนกว่าจะมีเงื่อนไขที่กำหนดเกิดขึ้น

    วัตถุประสงค์การเรียนรู้ AAP-2.K: สำหรับการทำซ้ำ: a. เขียนคำสั่งการทำซ้ำ [ทักษะ 2.B] b. กำหนดผลลัพธ์หรือ side effect ของ iteration statements [Skill 4.B]

    • AAP-2.K.1 คำสั่งการทำซ้ำจะเปลี่ยนการไหลตามลำดับของการควบคุมโดยการทำซ้ำชุดคำสั่งไปเป็นศูนย์หรือมากกว่าหนึ่งครั้ง จนกว่าจะมีเงื่อนไขหยุดเกิด

    • ** AAP-2.K.2** ใบสรุปข้อสอบให้ไว้สำหรับ

      ข้อความ:

      REPEAT n TIMES { <block of statements> }

      บล็อก:

      REPEAT n TIMES block of statements

      ซึ่ง block of statements จะถูกดำเนินการ n ครั้ง

    • ** AAP-2.K.3** ใบสรุปข้อสอบให้ไว้สำหรับ

      ข้อความ:

      REPEAT UNTIL(condition) { <block of statements> }

      บล็อก:

      REPEAT UNTIL condition block of statements

      ซึ่งโค้ดใน block of statements จะถูกทำซ้ำจนกว่านิพจน์布尔 condition จะประเมินค่าได้ true

    • ** AAP-2.K.4** ในการทำซ้ำ REPEAT UNTIL(condition) การวนลูป vô hạn (infinite loop) จะเกิดขึ้นเมื่อเงื่อนไขสิ้นสุดจะไม่ pernahประเมินค่าได้ true

    • ** AAP-2.K.5** ในการทำซ้ำ REPEAT UNTIL(condition) หากเงื่อนไขประเมินค่าได้ true ในเริ่มต้น ร่าง(loop body) จะไม่ถูกดำเนินการเลย เนื่องจากมีการตรวจสอบเงื่อนไขก่อนการวนลูป

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Iteration (a loop) 迭代 repeats instructions. AP pseudocode has two forms:

    A loop that never meets its stopping condition is an infinite loop 无限循环.

    ไทย

    การวนซ้ำ (a loop) ทำซ้ำคำสั่ง AP Pseudocode มีสองรูปแบบ:

    เงื่อนไขก่อนเริ่ม (WHILE) ตรวจสอบก่อน執行 body ดังนั้นอาจไม่ทำงานเลย
    เงื่อนไขก่อนเริ่ม (WHILE) ตรวจสอบก่อน執行 body ดังนั้นอาจไม่ทำงานเลย
    REPEAT 5 TIMES        // a fixed count
    {
        DISPLAY("hi")
    }
    
    REPEAT UNTIL (found)  // until a condition becomes true
    {
        ...
    }
    

    Loop ที่ไม่มีวันตรงตามเงื่อนไขหยุดคือ loop ลวง (infinite loop)

    Explore · ⁨สำรวจ⁩

    Trace a loop one pass at a time · ⁨ติดตามลูปหนึ่งรอบต่อครั้ง⁩

    A loop repeats a block while its counter runs through a range. Step through to watch the counter and the running total update each pass. · ⁨ลูป ทำซ้ำบล็อกขณะที่ตัวนับวนผ่านช่วงหนึ่ง ก้าวไปทีละขั้นเพื่อดูว่าตัวนับและผลรวมที่สะสมอัปเดตในรอบถัดไปอย่างไร⁩

    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    infinite loop/ˈɪnfɪnət luːp/ ลูปไม่สิ้นสุด
    algorithm/ˈælɡərɪθəm/ อัลกอริทึม
    3.9

    Developing Algorithms · ⁨การพัฒนาอัลกอริทึม⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-2): The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values.

    Learning Objective AAP-2.L: Compare multiple algorithms to determine if they yield the same side effect or result. [Skill 1.D]

    • AAP-2.L.1 Algorithms can be written in different ways and still accomplish the same tasks.
    • AAP-2.L.2 Algorithms that appear similar can yield different side effects or results.
    • AAP-2.L.3 Some conditional statements can be written as equivalent Boolean expressions.
    • AAP-2.L.4 Some Boolean expressions can be written as equivalent conditional statements.
    • AAP-2.L.5 Different algorithms can be developed or used to solve the same problem.

    Learning Objective AAP-2.M: For algorithms: a. Create algorithms. [Skill 2.A] b. Combine and modify existing algorithms. [Skill 2.B]

    • AAP-2.M.1 Algorithms can be created from an idea, by combining existing algorithms, or by modifying existing algorithms.
    • AAP-2.M.2 Knowledge of existing algorithms can help in constructing new ones. Some existing algorithms include:
      • determining the maximum or minimum value of two or more numbers
      • computing the sum or average of two or more numbers
      • identifying if an integer is or is not evenly divisible by another integer
      • determining a robot's path through a maze
    • AAP-2.M.3 Using existing correct algorithms as building blocks for constructing another algorithm has benefits such as reducing development time, reducing testing, and simplifying the identification of errors.
    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-2): วิธีการเรียงลำดับและรวมคำสั่งในโปรแกรมจะกำหนดผลลัพธ์ที่ได้จากการคำนวณ โปรแกรมมีการใช้โครงสร้างการทำซ้ำและการเลือกเพื่อแสดงถึงการทำซ้ำและการตัดสินใจเพื่อจัดการกับค่าอินพุตที่หลากหลาย

    วัตถุประสงค์การเรียนรู้ AAP-2.L: เปรียบเทียบอัลกอริทึมหลายตัวเพื่อกำหนดว่าให้ผลข้างเคียงหรือผลลัพธ์เหมือนกันหรือไม่ [ทักษะ 1.D]

    • AAP-2.L.1 อัลกอริทึมสามารถเขียนได้หลายรูปแบบและยังคงทำหน้าที่เดียวกัน
    • AAP-2.L.2 อัลกอริทึมที่ดูคล้ายกันอาจก่อให้เกิดผลข้างเคียงหรือผลลัพธ์ที่แตกต่างกัน
    • AAP-2.L.3 บางเงื่อนไขสามารถเขียนเป็นนิพจน์บูลีนที่เทียบเท่ากันได้
    • AAP-2.L.4 บางนิพจน์布尔ีਅनสามารถเขียนเป็นเงื่อนไขที่เทียบเท่ากันได้
    • AAP-2.L.5 อัลกอริทึมที่แตกต่างกันสามารถพัฒนาขึ้นหรือนำไปใช้เพื่อแก้ปัญหาเดียวกันได้

    วัตถุประสงค์การเรียนรู้ AAP-2.M: สำหรับอัลกอริทึม: ก. สร้างอัลกอริทึม [ทักษะ 2.A] ข. รวมและดัดแปลงอัลกอริทึมที่มีอยู่ [ทักษะ 2.B]

    • AAP-2.M.1 อัลกอริทึมสามารถสร้างจากแนวคิด通过将 existing algorithms, หรือ通过将 modifying existing algorithms.
    • AAP-2.M.2 ความรู้เกี่ยวกับอัลกอริทึมที่มีอยู่สามารถช่วยในการสร้างอัลกอริทึมใหม่阿尔กอริทึมที่มีอยู่บางตัวอย่าง ได้แก่:
      • การหาค่าสูงสุดหรือค่าต่ำสุดของตัวเลขสองตัวขึ้นไป
      • การคำนวณผลรวมหรือค่าเฉลี่ยของตัวเลขสองตัวขึ้นไป
      • การตรวจสอบว่าจำนวนเต็มหารด้วยจำนวนเต็มอีกตัวหนึ่งได้ลงตัวหรือไม่
      • การกำหนดเส้นทางของหุ่นยนต์ผ่านเขาวงกต
    • AAP-2.M.3 การใช้อัลกอริทึมที่ถูกต้องและมีอยู่แล้วเป็นองค์ประกอบในการสร้างอัลกอริทึมอื่นมีประโยชน์ เช่น ลดเวลาในการพัฒนา ลดการทดสอบ และทำให้การระบุข้อผิดพลาดง่ายขึ้น

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    An algorithm is not the same thing as code. Beyond visual and textual programming languages, an algorithm can be expressed in a variety of ways: in natural language (ordinary sentences), as a diagram such as a flowchart, or in pseudocode. Those forms are for people — they let you check the logic and agree on it before any language is chosen, and the same algorithm can then be written in any language.

    When you do write it in a programming language, clarity and readability are important considerations, not decoration: meaningful variable names, consistent indentation and comments explaining why rather than what. The program has to be read and modified later by someone — often you — and an algorithm nobody can follow cannot be maintained or debugged.

    An algorithm 算法 is a finite sequence of steps that solves a problem, built from sequencing, selection, and iteration. Different algorithms can solve the same problem, and you should be able to combine and modify existing algorithms (for example, count the values in a list that meet a condition, or find the largest). Trace an algorithm by hand to check it is correct.

    ไทย
    โค้ด Python บนหน้าจอ — อัลกอริทึมคือคำแนะนำที่แม่นยำและเรียงลำดับ
    โค้ด Python บนหน้าจอ — อัลกอริทึมคือคำแนะนำที่แม่นยำและเรียงลำดับ

    อัลกอริทึมไม่ใช่สิ่งที่เหมือนกับโค้ด นอกเหนือจากภาษาโปรแกรมมิ่งแบบภาพและข้อความ อัลกอริทึมสามารถแสดงออกได้เป็น หลายรูปแบบ: ใน ภาษาธรรมชาติ (ประโยคธรรมดา), เป็น แผนภาพ เช่น flowchart, หรือเป็น pseudocode รูปแบบเหล่านี้ใช้สำหรับคน — ทำให้คุณตรวจสอบตรรกะและเห็นพ้องต้องกันก่อนเลือกภาษา และอัลกอริทึมเดียวกันนั้นสามารถเขียนด้วยภาษาใดก็ได้

    เมื่อคุณเขียนในภาษาโปรแกรมมิ่ง ความชัดเจนและการอ่านง่ายเป็นปัจจัยสำคัญ ไม่ใช่เพียงตกแต่ง: ชื่อตัวแปรที่มีความหมาย, การจัดย่อที่สม่ำเสมอ, และคอมเมนต์ที่อธิบายว่า ทำไม แทนที่จะบอกว่า อะไร โปรแกรมจะต้องถูกอ่านและแก้ไขในอนาคตโดยใครสักคน — มักจะเป็นตัวคุณเอง — และอัลกอริทึมที่ไม่มีใครเข้าใจไม่ได้ถูกบำรุงรักษาหรือแก้ไขข้อผิดพลาด

    อัลกอริทึมคือลำดับขั้นตอนที่มีจำนวนจำกัดที่ใช้แก้ปัญหา สร้างขึ้นจาก การจัดลำดับ, การเลือก, และ การวนซ้ำ อัลกอริทึมที่แตกต่างกันสามารถแก้ปัญหาคู่เดียวกันได้ และคุณควรสามารถรวมและปรับอัลกอริทึมที่มีอยู่ (เช่น นับค่าในลิสต์ที่ตรงตามเงื่อนไข, หรือหาค่าสูงสุด) ทดสอบอัลกอริทึมด้วยมือเพื่อตรวจสอบความถูกต้อง

    Flowchart แสดงอัลกอริทึมโดยใช้สัญลักษณ์มาตรฐาน
    Flowchart แสดงอัลกอริทึมโดยใช้สัญลักษณ์มาตรฐาน
    3.10

    Lists · ⁨รายการ⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-2): The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values.

    Learning Objective AAP-2.N: For list operations: a. Write expressions that use list indexing and list procedures. [Skill 2.B] b. Evaluate expressions that use list indexing and list procedures. [Skill 4.B]

    • AAP-2.N.1 The exam reference sheet provides basic operations on lists, including:
      • accessing an element by index

        Text:

        aList[i]

        Block:

        aList i

        accesses the element of aList at index i. The first element of aList is at index 1 and is accessed using the notation aList[1].

      • assigning a value of an element of a list to a variable

        Text:

        x ← aList[i]

        Block:

        x ← aList i

        assigns the value of aList[i] to the variable x.

      • assigning a value to an element of a list

        Text:

        aList[i] ← x

        Block:

        aList i ← x

        assigns the value of x to aList[i].

        Text:

        aList[i] ← aList[j]

        Block:

        aList i ← aList j

        assigns the value of aList[j] to aList[i].

      • inserting elements at a given index

        Text:

        INSERT(aList, i, value)

        Block:

        INSERT aList, i, value

        shifts to the right any values in aList at indices greater than or equal to i. The length of the list is increased by 1, and value is placed at index i in aList.

      • adding elements to the end of the list

        Text:

        APPEND(aList, value)

        Block:

        APPEND aList, value

        increases the length of aList by 1, and value is placed at the end of aList.

      • removing elements

        Text:

        REMOVE(aList, i)

        Block:

        REMOVE aList, i

        removes the item at index i in aList and shifts to the left any values at indices greater than i. The length of aList is decreased by 1.

      • determining the length of a list

        Text:

        LENGTH(aList)

        Block:

        LENGTH aList

        evaluates to the number of elements currently in aList.

    • AAP-2.N.2 List procedures are implemented in accordance with the syntax rules of the programming language.

    Learning Objective AAP-2.O: For algorithms involving elements of a list: a. Write iteration statements to traverse a list. [Skill 2.B] b. Determine the result of an algorithm that includes list traversals. [Skill 4.B]

    • AAP-2.O.1 Traversing a list can be a complete traversal, where all elements in the list are accessed, or a partial traversal, where only a portion of elements are accessed.

      • Exclusion statement (EK AAP-2.O.1): Traversing multiple lists at the same time using the same index for both (parallel traversals) is outside the scope of this course and the AP Exam.
    • AAP-2.O.2 Iteration statements can be used to traverse a list.

    • AAP-2.O.3 The exam reference sheet provides

      Text:

      FOR EACH item IN aList { <block of statements> }

      Block:

      FOR EACH item IN aList block of statements

      The variable item is assigned the value of each element of aList sequentially, in order, from the first element to the last element. The code in block of statements is executed once for each assignment of item.

    • AAP-2.O.4 Knowledge of existing algorithms that use iteration can help in constructing new algorithms. Some examples of existing algorithms that are often used with lists include:

      • determining a minimum or maximum value in a list
      • computing a sum or average of a list of numbers
    • AAP-2.O.5 Linear search or sequential search algorithms check each element of a list, in order, until the desired value is found or all elements in the list have been checked.

    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-2): วิธีการเรียงลำดับและรวมคำสั่งในโปรแกรมจะกำหนดผลลัพธ์ที่ได้จากการคำนวณ โปรแกรมมีการใช้โครงสร้างการทำซ้ำและการเลือกเพื่อแสดงถึงการทำซ้ำและการตัดสินใจเพื่อจัดการกับค่าอินพุตที่หลากหลาย

    จุดประสงค์การเรียนรู้ AAP-2.N: สำหรับการจัดการกับลิสต์: ก. เขียนนิพจน์ที่ใช้การเข้าถึงตำแหน่ง (indexing) ของลิสต์และฟังก์ชันของลิสต์ [ทักษะ 2.B] ข. ประเมินนิพจน์ที่ใช้การเข้าถึงตำแหน่ง (indexing) ของลิสต์และฟังก์ชันของลิสต์ [ทักษะ 4.B]

    • AAP-2.N.1 ใบสรุปข้อสอบให้ใช้การดำเนินการพื้นฐานบนลิสต์ รวมถึง:
      • การเข้าถึงองค์ประกอบโดยใช้อินเด็กซ์

        ข้อความ:

        aList[i]

        บล็อก:

        aList i

        เข้าถึงองค์ประกอบของ aList ที่อินเด็กซ์ i องค์ประกอบแรกของ aList อยู่ที่อินเด็กซ์ 1 และเข้าถึงโดยใช้สัญลักษณ์ aList[1]

      • การกำหนดค่าขององค์ประกอบลิสต์ให้กับตัวแปร

        ข้อความ:

        x ← aList[i]

        บล็อก:

        x ← aList i

        กำหนดค่าของ aList[i] ให้กับตัวแปร x

      • การกำหนดค่าให้กับองค์ประกอบของลิสต์

        ข้อความ:

        aList[i] ← x

        บล็อก:

        aList i ← x

        กำหนดค่าของ x ให้กับ aList[i]

        ข้อความ:

        aList[i] ← aList[j]

        บล็อก:

        aList i ← aList j

        กำหนดค่าของ aList[j] ให้กับ aList[i]

      • การแทรกองค์ประกอบที่อินเด็กซ์ที่กำหนด

        ข้อความ:

        INSERT(aList, i, value)

        บล็อก:

        INSERT aList, i, value

        ย้ายค่าใดๆ ใน aList ที่มี index มากกว่าหรือเท่ากับ i ไปทางขวา ความยาวของรายการจะเพิ่มขึ้น 1 และ value จะถูกวางไว้ที่ index i ใน aList

      • การเพิ่มองค์ประกอบไปที่ท้ายลิสต์

        ข้อความ:

        APPEND(aList, value)

        บล็อก:

        APPEND aList, value

        เพิ่มความยาวของ aList ขึ้น 1 และ value ถูกวางไว้ที่ท้ายของ aList

      • การลบองค์ประกอบออก

        ข้อความ:

        REMOVE(aList, i)

        บล็อก:

        REMOVE aList, i

        ลบรายการที่อินเด็กซ์ i ใน aList ออก และย้ายค่าทั้งหมดที่มีอินเด็กซ์มากกว่า i ไปทางซ้าย ความยาวของ aList ลดลง 1

      • การตรวจสอบความยาวของลิสต์

        ข้อความ:

        LENGTH(aList)

        บล็อก:

        LENGTH aList

        มีค่าเท่ากับจำนวนองค์ประกอบที่มีอยู่ใน aList ปัจจุบัน

    • AAP-2.N.2 ฟังก์ชันของลิสต์ถูกนำไปใช้ตามกฎไวยากรณ์ของภาษาโปรแกรม

    จุดประสงค์การเรียนรู้ AAP-2.O: สำหรับอัลกอริทึมที่เกี่ยวข้องกับองค์ประกอบของลิสต์: ก. เขียนคำสั่งการทำซ้ำเพื่อสำรวจลิสต์ [ทักษะ 2.B] ข. หาผลลัพธ์ของอัลกอริทึมที่รวมถึงการสำรวจลิสต์ [ทักษะ 4.B]

    • AAP-2.O.1 การสำรวจลิสต์อาจเป็นการสำรวจแบบเต็ม โดยเข้าถึงองค์ประกอบทั้งหมดในลิสต์ หรือเป็นการสำรวจแบบบางส่วน โดยเข้าถึงเพียงส่วนหนึ่งขององค์ประกอบเท่านั้น

      • ข้อความยกเว้น (EK AAP-2.O.1): การสำรวจหลายลิสต์พร้อมกันโดยใช้ดัชนีเดียวกันสำหรับทั้งสอง (การสำรวจแบบขนาน)อยู่นอกขอบเขตของรายวิชาและข้อสอบ AP
    • AAP-2.O.2 คำสั่งการทำซ้ำสามารถใช้เพื่อสำรวจลิสต์

    • AAP-2.O.3 ใบสรุปข้อสอบให้ใช้

      ข้อความ:

      FOR EACH item IN aList { <block of statements> }

      บล็อก:

      FOR EACH item IN aList block of statements

      ตัวแปร item จะได้รับค่าของแต่ละองค์ประกอบของ aList ตามลำดับ จากองค์ประกอบแรกไปจนถึงองค์ประกอบสุดท้าย โค้ดใน block of statements จะถูกดำเนินการหนึ่งครั้งสำหรับแต่ละการกำหนดค่าของ item

    • AAP-2.O.4 ความรู้เกี่ยวกับอัลกอริทึมที่มีอยู่เดิมที่ใช้การทำซ้ำสามารถช่วยในการสร้างอัลกอริทึมใหม่ ตัวอย่างของอัลกอริทึมที่มีอยู่เดิมที่มักใช้ร่วมกับลิสต์ ได้แก่:

      • การหาค่าต่ำสุดหรือสูงสุดในลิสต์
      • การคำนวณผลรวมหรือค่าเฉลี่ยของลิสต์ตัวเลข
    • AAP-2.O.5 อัลกอริทึมการค้นหาเชิงเส้นหรือการค้นหาลำดับ (sequential search) จะตรวจสอบแต่ละองค์ประกอบของลิสต์ตามลำดับ จนกว่าจะพบค่าที่ต้องการหรือตรวจสอบองค์ประกอบทั้งหมดในลิสต์แล้ว

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    A list 列表 is an ordered collection of values under one name, the course's key data abstraction. AP pseudocode indexes from 1:

    Traverse a list with a loop to sum, count, search, or find a maximum:

    ไทย

    ลิสต์ (list) คือกลุ่มของค่าที่เป็นลำดับภายใต้ชื่อเดียว ซึ่งเป็น abstraction ของข้อมูลหลักของรายวิชา AP Pseudocode ใช้ดัชนีเริ่มต้นที่ 1:

    ลิสต์เก็บหลายค่าในตัวแปรเดียว แต่ละค่าเข้าถึงผ่านดัชนีของมัน
    ลิสต์เก็บหลายค่าในตัวแปรเดียว แต่ละค่าเข้าถึงผ่านดัชนีของมัน
    scores ← [88, 74, 95]
    DISPLAY(scores[1])          // 88
    scores[2] ← 80              // replace the 2nd value
    APPEND(scores, 60)          // add to the end
    INSERT(scores, 1, 100)      // insert at index 1
    REMOVE(scores, 3)           // delete the 3rd element
    LENGTH(scores)              // how many elements
    

    traverse ลิสต์ด้วย loop เพื่อบวก, นับ, ค้นหา, หรือหาค่าสูงสุด:

    FOR EACH x IN scores
    {
        total ← total + x
    }
    
    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    list/lɪst/ รายการ
    abstraction/əbˈstrækʃn/ การห่อหุ้ม (abstraction)
    library/ˈlaɪbrəri/ ไลบรารี (library)
    3.11

    Binary Search · ⁨การค้นหาแบบเบี่ยงกลาง (Binary Search)⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-2): The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values.

    Learning Objective AAP-2.P: For binary search algorithms: a. Determine the number of iterations required to find a value in a data set. [Skill 1.D] b. Explain the requirements necessary to complete a binary search. [Skill 1.A]

    • AAP-2.P.1 The binary search algorithm starts at the middle of a sorted data set of numbers and eliminates half of the data; this process repeats until the desired value is found or all elements have been eliminated.
      • Exclusion statement (EK AAP-2.P.1): Specific implementations of the binary search are outside the scope of the course and the AP Exam.
    • AAP-2.P.2 Data must be in sorted order to use the binary search algorithm.
    • AAP-2.P.3 Binary search is often more efficient than sequential/linear search when applied to sorted data.
    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-2): วิธีการเรียงลำดับและรวมคำสั่งในโปรแกรมจะกำหนดผลลัพธ์ที่ได้จากการคำนวณ โปรแกรมมีการใช้โครงสร้างการทำซ้ำและการเลือกเพื่อแสดงถึงการทำซ้ำและการตัดสินใจเพื่อจัดการกับค่าอินพุตที่หลากหลาย

    จุดประสงค์การเรียนรู้ AAP-2.P: สำหรับอัลกอริทึมการค้นหาแบบเบี่ยง二分: ก. หาจำนวนรอบการทำซ้ำที่จำเป็นในการหาค่าในชุดข้อมูล [ทักษะ 1.D] ข. อธิบายข้อกำหนดที่จำเป็นสำหรับการดำเนินการค้นหาแบบเบี่ยง二分 [ทักษะ 1.A]

    • AAP-2.P.1 อัลกอริทึมการค้นหาแบบเบี่ยง二分เริ่มที่ตรงกลางของชุดข้อมูลที่เรียงลำดับแล้วและตัดข้อมูลออกครึ่งหนึ่ง กระบวนการนี้จะทำซ้ำจนกว่าจะพบค่าที่ต้องการหรือองค์ประกอบทั้งหมดถูกตัดออก
      • ข้อความยกเว้น (EK AAP-2.P.1): การนำไปใช้เฉพาะของ Binary Search อยู่ภายนอกขอบเขตของรายวิชาและข้อสอบ AP
    • AAP-2.P.2 ข้อมูลต้องอยู่ในรูปแบบที่เรียงลำดับแล้วจึงจะใช้ algoritme การค้นหาแบบเบี่ยง二分
    • AAP-2.P.3 การค้นหาแบบเบี่ยง二分มักมีประสิทธิภาพมากกว่าการค้นหาลำดับ/linear search เมื่อใช้กับข้อมูลที่เรียงลำดับแล้ว

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Binary search 二分搜索 finds a value in a sorted list far faster than checking each element. It looks at the middle element, then discards the half that cannot contain the target, repeating until found. Each step halves the search space, so a list of $n$ items takes about $\log_2 n$ steps. It requires the data to be sorted first.

    Worked example. Searching a sorted list of $8$ items, binary search halves the range each step: $8\rightarrow4\rightarrow2\rightarrow1$, at most $3$ comparisons ($\log_2 8=3$), whereas a linear search could take up to $8$. The advantage grows explosively: about $1{,}000$ items need only $\approx10$ binary-search steps (but up to $1{,}000$ linear ones), and $1{,}000{,}000$ items need just $\approx20$. Halving is what makes it a reasonable-time algorithm.

    ไทย
    สมุดโทรศัพท์: การค้นหาแบบเบี่ยงกลางลดจำนวนหน้าที่เหลือลงครึ่งหนึ่งในแต่ละขั้นตอน
    สมุดโทรศัพท์: การค้นหาแบบเบี่ยงกลางลดจำนวนหน้าที่เหลือลงครึ่งหนึ่งในแต่ละขั้นตอน

    การค้นหาแบบทวิภาค (Binary search) ช่วยหาค่าในรายการที่ เรียงลำดับ แล้วได้เร็วมากเมื่อเทียบกับการตรวจสอบแต่ละองค์ประกอบ มันพิจารณาองค์ประกอบตรงกลาง จากนั้นตัดครึ่งส่วนที่ไม่อาจมีเป้าหมายไว้ ทวนซ้ำจนกว่าจะพบ Each step ลดเหลือครึ่งหนึ่ง ของพื้นที่ค้นหา ดังนั้นรายการขนาด $n$ ใช้เวลาประมาณ $\log_2 n$ ขั้นตอน มัน ต้องการให้ข้อมูลถูกเรียงลำดับก่อน

    Binary search halves the range at each step (the list must be sorted)
    Binary search halves the range at each step (the list must be sorted)

    ตัวอย่างปฏิบัติ. การค้นหาในรายการที่เรียงลำดับ $8$ องค์ประกอบ Binary search ลดครึ่งช่วงในแต่ละขั้นตอน: $8\rightarrow4\rightarrow2\rightarrow1$, ทำการเปรียบเทียบสูงสุด $3$ ครั้ง ($\log_2 8=3$), ในขณะที่การค้นหาแบบเชิงเส้นอาจใช้ถึง $8$ ครั้ง ความได้เปรียบเพิ่มขึ้นอย่างมหาศาล: รายการประมาณ $1{,}000$ องค์ประกอบ ต้องการขั้นตอน binary search เพียง $\approx10$ ขั้น (แต่สูงสุดถึง $1{,}000$ ขั้นสำหรับ linear search), และรายการ $1{,}000{,}000$ องค์ประกอบ ต้องใช้เพียง $\approx20$ ขั้น การลดเหลือครึ่งหนึ่งคือสิ่งที่ทำให้มันเป็นอัลกอริทึมที่มี ระยะเวลาในการคำนวณสมเหตุสมผล

    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    Binary search/ˈbaɪnəri sɜːtʃ/ การค้นหาแบบทวิภาคี
    3.12

    Calling Procedures · ⁨การเรียกใช้งาน Procedure⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-3): Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence.

    Learning Objective AAP-3.A: For procedure calls: a. Write statements to call procedures. [Skill 3.B] b. Determine the result or effect of a procedure call. [Skill 4.B]

    • AAP-3.A.1 A procedure is a named group of programming instructions that may have parameters and return values.

    • AAP-3.A.2 Procedures are referred to by different names, such as method or function, depending on the programming language.

    • AAP-3.A.3 Parameters are input variables of a procedure. Arguments specify the values of the parameters when a procedure is called.

    • AAP-3.A.4 A procedure call interrupts the sequential execution of statements, causing the program to execute the statements within the procedure before continuing. Once the last statement in the procedure (or a return statement) has executed, flow of control is returned to the point immediately following where the procedure was called.

    • AAP-3.A.5 The exam reference sheet provides

      procName(arg1, arg2, ...)

      as a way to call

      Text:

      PROCEDURE procName(parameter1, parameter2, ...) { <block of statements> }

      Block:

      PROCEDURE procName parameter1, parameter2,... block of statements

      which takes zero or more arguments; arg1 is assigned to parameter1, arg2 is assigned to parameter2, and so on.

    • AAP-3.A.6 The exam reference sheet provides the procedure

      Text:

      DISPLAY(expression)

      Block:

      DISPLAY expression

      to display the value of expression, followed by a space.

    • AAP-3.A.7 The exam reference sheet provides the

      Text:

      RETURN(expression)

      Block:

      RETURN expression

      statement, which is used to return the flow of control to the point where the procedure was called and to return the value of expression.

    • AAP-3.A.8 The exam reference sheet provides

      result ← procName(arg1, arg2, ...)

      to assign to result the "value of the procedure" being returned by calling

      Text:

      PROCEDURE procName(parameter1, parameter2, ...) { <block of statements> RETURN(expression) }

      Block:

      PROCEDURE procName parameter1, parameter2,... block of statements RETURN expression

    • AAP-3.A.9 The exam reference sheet provides procedure

      Text:

      INPUT()

      Block:

      INPUT

      which accepts a value from the user and returns the input value.

    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-3): นักพัฒนาโปรแกรมแยกปัญหาออกเป็นส่วนย่อยๆ ที่จัดการได้ง่ายขึ้น通过将创建过程和利用参数,开发者可以概括出可重复使用的流程。过程允许开发者调用已经测试过的现有代码,从而能够更快速、更有信心地编写程序。

    **学习目标 AAP-3.A:**对于过程调用: a. 编写语句以调用过程。[技能 3.B] b. 确定过程调用的结果或效果。[技能 4.B]

    • AAP-3.A.1 过程是命名的一组编程指令,可能包含参数和返回值。

    • AAP-3.A.2 根据编程语言的不同,过程也被称为方法或函数等不同的名称。

    • AAP-3.A.3 参数是过程的输入变量。实参指定了过程被调用时参数的值。

    • AAP-3.A.4 过程调用会中断顺序执行的语句流,导致程序在执行完过程内的语句后才继续执行。一旦过程内的最后一条语句(或返回语句)执行完毕,控制流将返回到调用过程后的下一个位置。

    • AAP-3.A.5 考试参考表提供了

      procName(arg1, arg2, ...)

    作为调用

    ข้อความ:

    PROCEDURE procName(parameter1, parameter2, ...) { <block of statements> }

    บล็อก:

    PROCEDURE procName parameter1, parameter2,... block of statements

    的一种方式,它接受零个或多个实参;arg1 被赋值给 parameter1,arg2 被赋值给 parameter2,以此类推。

    • AAP-3.A.6 考试参考表提供了过程

      ข้อความ:

      DISPLAY(expression)

      บล็อก:

      DISPLAY expression

    用于显示 expression 的值,后跟一个空格。

    • AAP-3.A.7 考试参考表提供了

      ข้อความ:

      RETURN(expression)

      บล็อก:

      RETURN expression

    语句,该语句用于将控制流返回到过程被调用的位置,并返回 expression 的值。

    • AAP-3.A.8 考试参考表提供了

      result ← procName(arg1, arg2, ...)

    用于将“过程的值”赋值给 result,该值是通过调用

    ข้อความ:

    PROCEDURE procName(parameter1, parameter2, ...) { <block of statements> RETURN(expression) }

    บล็อก:

    PROCEDURE procName parameter1, parameter2,... block of statements RETURN expression

    • AAP-3.A.9 ใบข้อสอบให้ขั้นตอน

      ข้อความ:

      INPUT()

      บล็อก:

      INPUT

      ซึ่งรับค่าจากผู้ใช้งานและคืนค่าที่รับเข้ามา

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    A procedure (function) 过程 is a named, reusable block of code. Calling it runs its code with the arguments you supply, and it may return a value:

    Procedures let you use code without knowing its inner workings – procedural abstraction 过程抽象.

    ไทย

    Procedure (ฟังก์ชัน) คือบล็อกโค้ดที่มีชื่อและนำไปใช้ซ้ำได้ การเรียกใช้งาน จะรันโค้ดนั้นด้วย อาร์กิวเมนต์ ที่คุณส่งไป และอาจ คืนค่า ได้:

    sum ← Add(3, 4)      // call, passing 3 and 4
    

    Procedures ทำให้คุณสามารถใช้โค้ดโดยไม่ต้องรู้รายละเอียดภายใน – ซึ่งเรียกว่า การนามธรรมแบบ procedure (procedural abstraction).

    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    procedure (function)/prəˈsiːdʒə/ กระบวนการ (ฟังก์ชัน)
    procedural abstraction/prəˈsiːdʒərəl əbˈstrækʃn/ procedural abstraction
    3.13

    Developing Procedures · ⁨การพัฒนา Procedures⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-3): Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence.

    Learning Objective AAP-3.B: Explain how the use of procedural abstraction manages complexity in a program. [Skill 3.C]

    • AAP-3.B.1 One common type of abstraction is procedural abstraction, which provides a name for a process and allows a procedure to be used only knowing what it does, not how it does it.
    • AAP-3.B.2 Procedural abstraction allows a solution to a large problem to be based on the solutions of smaller subproblems. This is accomplished by creating procedures to solve each of the subproblems.
    • AAP-3.B.3 The subdivision of a computer program into separate subprograms is called modularity.
    • AAP-3.B.4 A procedural abstraction may extract shared features to generalize functionality instead of duplicating code. This allows for program code reuse, which helps manage complexity.
    • AAP-3.B.5 Using parameters allows procedures to be generalized, enabling the procedures to be reused with a range of input values or arguments.
    • AAP-3.B.6 Using procedural abstraction helps improve code readability.
    • AAP-3.B.7 Using procedural abstraction in a program allows programmers to change the internals of the procedure (to make it faster, more efficient, use less storage, etc.) without needing to notify users of the change as long as what the procedure does is preserved.

    Learning Objective AAP-3.C: Develop procedural abstractions to manage complexity in a program by writing procedures. [Skill 3.B]

    • AAP-3.C.1 The exam reference sheet provides

      Text:

      PROCEDURE procName(parameter1, parameter2, ...) { <block of statements> }

      Block:

      PROCEDURE procName parameter1, parameter2,... block of statements

      which is used to define a procedure that takes zero or more arguments. The procedure contains block of statements.

    • AAP-3.C.2 The exam reference sheet provides

      Text:

      PROCEDURE procName(parameter1, parameter2, ...) { <block of statements> RETURN(expression) }

      Block:

      PROCEDURE procName parameter1, parameter2,... block of statements RETURN expression

      which is used to define a procedure that takes zero or more arguments. The procedure contains block of statements and returns the value of expression. The RETURN statement may appear at any point inside the procedure and causes an immediate return from the procedure back to the calling statement.

    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-3): นักพัฒนาโปรแกรมแยกปัญหาออกเป็นส่วนย่อยๆ ที่จัดการได้ง่ายขึ้น通过将创建过程和利用参数,开发者可以概括出可重复使用的流程。过程允许开发者调用已经测试过的现有代码,从而能够更快速、更有信心地编写程序。

    จุดประสงค์การเรียนรู้ AAP-3.B: อธิบายว่าการใช้ procedural abstraction ช่วยจัดการความซับซ้อนในโปรแกรมได้อย่างไร [Skill 3.C]

    • AAP-3.B.1 รูปแบบหนึ่งของ abstraction ที่พบบ่อยคือ procedural abstraction ซึ่งให้ชื่อแก่กระบวนการและอนุญาตให้ใช้ procedure โดยรู้เพียงว่าทำอะไร แต่ไม่ต้องรู้ว่าทำอย่างไร
    • AAP-3.B.2 Procedural abstraction ช่วยในการแก้ปัญหาขนาดใหญ่โดยอาศัยการแก้ปัญหาย่อยๆ ที่เล็กกว่า ซึ่งทำได้โดยการสร้าง procedures เพื่อแก้ปัญหาย่อยแต่ละส่วน
    • AAP-3.B.3 การแบ่งโปรแกรมคอมพิวเตอร์ออกเป็น subprograms แยกต่างหากเรียกว่า modularity (ความเป็นโมดูลาร์)
    • AAP-3.B.4 Procedural abstraction อาจดึงคุณสมบัติร่วมกันออกมาเพื่อทำให้ฟังก์ชัน性工作เป็นทั่วไปแทนที่จะทำซ้ำโค้ด ซึ่งช่วยให้สามารถนำโค้ดโปรแกรมกลับมาใช้ใหม่ได้ และช่วยจัดการความซับซ้อน
    • AAP-3.B.5 การใช้ parameters ช่วยทำให้ procedures เป็นทั่วไปขึ้น ทำให้สามารถนำ程序和กลับมาใช้ใหม่กับชุดค่า input หรือ arguments ต่างๆ ได้
    • AAP-3.B.6 การใช้ procedural abstraction ช่วยปรับปรุงความอ่านง่ายของโค้ด
    • AAP-3.B.7 การใช้ procedural abstraction ในโปรแกรมช่วยให้นักเขียนโปรแกรมสามารถเปลี่ยนรายละเอียดภายในของ procedure (เช่น ให้เร็วขึ้น มีประสิทธิภาพมากขึ้น ใช้พื้นที่จัดเก็บน้อยลง ฯลฯ) โดยไม่ต้องแจ้งให้ผู้ใช้งานทราบ ตราบใดที่สิ่งที่ procedure ทำนั้นยังคงเดิมอยู่

    จุดประสงค์การเรียนรู้ AAP-3.C: พัฒนา procedural abstractions เพื่อจัดการความซับซ้อนในโปรแกรมโดยการเขียน procedures [Skill 3.B]

    • AAP-3.C.1 ใบสรุปข้อสอบให้ข้อมูลถึง

      ข้อความ:

      PROCEDURE procName(parameter1, parameter2, ...) { <block of statements> }

      บล็อก:

      PROCEDURE procName parameter1, parameter2,... block of statements

      ซึ่งใช้สำหรับการกำหนดขั้นตอนการทำงานที่รับพารามิเตอร์ได้ตั้งแต่ศูนย์หรือมากกว่า ขั้นตอนการ tersebutประกอบด้วย block of statements

    • AAP-3.C.2 ใบสรุปข้อสอบให้ข้อมูลถึง

      ข้อความ:

      PROCEDURE procName(parameter1, parameter2, ...) { <block of statements> RETURN(expression) }

      บล็อก:

      PROCEDURE procName parameter1, parameter2,... block of statements RETURN expression

    ซึ่งใช้สำหรับกำหนดนิยามของ procedure ที่รับอาร์กิวเมนต์ศูนย์หรือมากกว่า Procedure นั้นประกอบด้วย block of statements และส่งกลับค่าของ expression คำสั่ง RETURN สามารถปรากฏได้ทุกจุดภายใน procedure และจะทำให้เกิด immediate return จาก procedure กลับไปยังคำสั่งที่เรียกใช้

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    You define a procedure with a name, parameters (inputs), and a body, and optionally RETURN a result:

    Writing your own procedures reduces repetition, breaks a big problem into named pieces, and makes programs readable and easier to test – the essence of abstraction 抽象.

    ไทย

    คุณ นิยาม procedure ด้วยชื่อ, พารามิเตอร์ (อินพุต), และบอดี้ พร้อมตัวเลือกว่า RETURN จะคืนผลลัพธ์หรือไม่:

    Decomposing a program into procedures and sub-procedures
    Decomposing a program into procedures and sub-procedures
    PROCEDURE Add(a, b)
    {
        RETURN(a + b)
    }
    

    การเขียน程序的ของคุณเองช่วยลดความซ้ำซ้อน แยกปัญหาใหญ่ออกเป็นชิ้นที่มีชื่อ และทำให้โปรแกรมอ่านง่ายและทดสอบได้ง่ายขึ้น – ซึ่งเป็นแก่นแท้ของ การนามธรรม (abstraction)

    3.14

    Libraries · ⁨เลปเบรารี⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-3): Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence.

    Learning Objective AAP-3.D: Select appropriate libraries or existing code segments to use in creating new programs. [Skill 2.B]

    • AAP-3.D.1 A software library contains procedures that may be used in creating new programs.
    • AAP-3.D.2 Existing code segments can come from internal or external sources, such as libraries or previously written code.
    • AAP-3.D.3 The use of libraries simplifies the task of creating complex programs.
    • AAP-3.D.4 Application program interfaces (APIs) are specifications for how the procedures in a library behave and can be used.
    • AAP-3.D.5 Documentation for an API/library is necessary in understanding the behaviors provided by the API/library and how to use them.
    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-3): นักพัฒนาโปรแกรมแยกปัญหาออกเป็นส่วนย่อยๆ ที่จัดการได้ง่ายขึ้น通过将创建过程和利用参数,开发者可以概括出可重复使用的流程。过程允许开发者调用已经测试过的现有代码,从而能够更快速、更有信心地编写程序。

    วัตถุประสงค์การเรียนรู้ AAP-3.D: เลือกใช้คลังไลบรารีหรือส่วนโค้ดที่มีอยู่เพื่อสร้างโปรแกรมใหม่ [ทักษะ 2.B]

    • AAP-3.D.1 คลังซอฟต์แวร์ประกอบด้วยขั้นตอนการทำงานที่สามารถนำไปใช้ในการสร้างโปรแกรมใหม่ได้
    • AAP-3.D.2 ส่วนโค้ดที่มีอยู่อาจมาจากแหล่งภายในหรือภายนอก เช่น คลังไลบรารีหรือโค้ดที่เขียนไว้ก่อนหน้า
    • AAP-3.D.3 การใช้คลังไลบรือช่วยให้งานการสร้างโปรแกรมที่ซับซ้อนมีง่ายขึ้น
    • AAP-3.D.4 อินเตอร์เฟซสำหรับแอปพลิเคชัน (APIs) คือข้อกำหนดเกี่ยวกับพฤติกรรมและการใช้งานขั้นตอนการทำงานในคลังไลบรารี
    • AAP-3.D.5 เอกสารประกอบสำหรับ API/library จำเป็นต่อการทำความเข้าใจพฤติกรรมที่ API/library มอบ以及如何ใช้งาน

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    A library 库 is a collection of ready-made procedures that others can reuse. An API (Application Program Interface) 应用程序接口 documents what each procedure does, its parameters, and its result – so you can use it without seeing its code. Libraries save time and let you build on existing, tested work.

    The documentation is part of the library. Documentation for an API or library is necessary in order to understand the behaviours it provides and how to use them — what each procedure expects as parameters, what it returns, and what it does at the edges. Without it you would have to read the source, which defeats the point of abstraction; with it you can use a procedure correctly without knowing how it works inside.

    ไทย

    เลปเบรารี คือชุดของ procedures พร้อมใช้ที่其他人สามารถนำไปใช้ซ้ำได้ API (Application Program Interface) เป็นเอกสารที่อธิบายว่าแต่ละ procedure ทำงานอย่างไร มีพารามิเตอร์อะไร และคืนค่าอะไร – เพื่อให้คุณใช้งานได้โดยไม่ต้องเห็นโค้ดของมัน เลปเบรารีช่วยประหยัดเวลาและให้คุณสร้างบนงานที่พร้อมใช้และผ่านการทดสอบแล้ว

    เอกสาร部分是เลปเบรารี的一部分。 เอกสารสำหรับ API หรือเลปเบรารีเป็น สิ่งจำเป็น เพื่อเข้าใจพฤติกรรมที่มันมอบ以及如何ใช้งาน – ว่าแต่ละ procedure คาดหวังพารามิเตอร์อะไร Return อะไร และทำอะไรที่ขอบเขตต่างๆ หากไม่มีเอกสาร คุณจะต้องอ่านซอร์สโค้ดซึ่งขัดแย้งกับจุดประสงค์ของการนามธรรม; แต่หากมีเอกสาร คุณสามารถใช้程序的ได้อย่างถูกต้องโดยไม่จำเป็นต้องรู้วิธีทำงานภายใน

    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    Interface/ˈɪntəfeɪs/ อินเตอร์เฟซ
    3.15

    Random Values · ⁨ค่าสุ่ม⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-3): Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence.

    Learning Objective AAP-3.E: For generating random values: a. Write expressions to generate possible values. [Skill 2.B] b. Evaluate expressions to determine the possible results. [Skill 4.B]

    • AAP-3.E.1 The exam reference sheet provides

      Text:

      RANDOM(a, b)

      Block:

      RANDOM a, b

      which generates and returns a random integer from a to b, inclusive. Each result is equally likely to occur. For example, RANDOM(1, 3) could return 1, 2, or 3.

    • AAP-3.E.2 Using random number generation in a program means each execution may produce a different result.

    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-3): นักพัฒนาโปรแกรมแยกปัญหาออกเป็นส่วนย่อยๆ ที่จัดการได้ง่ายขึ้น通过将创建过程和利用参数,开发者可以概括出可重复使用的流程。过程允许开发者调用已经测试过的现有代码,从而能够更快速、更有信心地编写程序。

    วัตถุประสงค์การเรียนรู้ AAP-3.E: สำหรับการสร้างค่าสุ่ม: ก. เขียนนิพจน์เพื่อสร้างค่าที่เป็นไปได้ [ทักษะ 2.B] ข. ประเมินผลนิพจน์เพื่อบอกผลลัพธ์ที่เป็นไปได้ [ทักษะ 4.B]

    • AAP-3.E.1 ใบสรุปข้อสอบให้ข้อมูลถึง

      ข้อความ:

      RANDOM(a, b)

      บล็อก:

      RANDOM a, b

      ซึ่งสร้างและส่งกลับจำนวนเต็มแบบสุ่มตั้งแต่ a ถึง b รวมถึงขอบเขตทั้งสองด้าน ผลลัพธ์แต่ละตัวมีโอกาสเกิดขึ้นเท่ากัน ตัวอย่างเช่น การเรียกใช้ RANDOM(1, 3) อาจส่งกลับค่า 1, 2 หรือ 3

    • AAP-3.E.2 การใช้การสร้างตัวเลขสุ่มในโปรแกรมหมายความว่าแต่ละครั้งที่รันอาจได้ผลลัพธ์ที่แตกต่างกัน

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    RANDOM(a, b) returns a random integer from a to b (inclusive), letting a program produce unpredictable results – for games, sampling, or simulations. Each call may give a different value, so a program using randomness behaves differently each run.

    ไทย

    RANDOM(a, b) คืนค่าจำนวนเต็มสุ่มจาก a ถึง b (รวมทั้งสอง邊), ทำให้โปรแกรมสร้างผลลัพธ์ที่ คาดเดาไม่ได้ – สำหรับเกม, การสุ่มตัวอย่าง, หรือการจำลอง แต่ละครั้งอาจให้ค่าต่างกัน ดังนั้นโปรแกรมที่ใช้ความสุ่มจึง behavesattachment กันทุกครั้งที่รัน

    3.16

    Simulations · ⁨การจำลอง (Simulations)⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-3): Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence.

    Learning Objective AAP-3.F: For simulations: a. Explain how computers can be used to represent real-world phenomena or outcomes. [Skill 1.A] b. Compare simulations with real-world contexts. [Skill 1.D]

    • AAP-3.F.1 Simulations are abstractions of more complex objects or phenomena for a specific purpose.
    • AAP-3.F.2 A simulation is a representation that uses varying sets of values to reflect the changing state of a phenomenon.
    • AAP-3.F.3 Simulations often mimic real-world events with the purpose of drawing inferences, allowing investigation of a phenomenon without the constraints of the real world.
    • AAP-3.F.4 The process of developing an abstract simulation involves removing specific details or simplifying functionality.
    • AAP-3.F.5 Simulations can contain bias derived from the choices of real-world elements that were included or excluded.
    • AAP-3.F.6 Simulations are most useful when real-world events are impractical for experiments (e.g., too big, too small, too fast, too slow, too expensive, or too dangerous).
    • AAP-3.F.7 Simulations facilitate the formulation and refinement of hypotheses related to the objects or phenomena under consideration.
    • AAP-3.F.8 Random number generators can be used to simulate the variability that exists in the real world.
    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-3): นักพัฒนาโปรแกรมแยกปัญหาออกเป็นส่วนย่อยๆ ที่จัดการได้ง่ายขึ้น通过将创建过程和利用参数,开发者可以概括出可重复使用的流程。过程允许开发者调用已经测试过的现有代码,从而能够更快速、更有信心地编写程序。

    วัตถุประสงค์การเรียนรู้ AAP-3.F: สำหรับการจำลอง: ก. อธิบายวิธีที่คอมพิวเตอร์สามารถใช้เพื่อแสดงปรากฏการณ์หรือผลลัพธ์ในโลกจริง [ทักษะ 1.A] a. 解释计算机如何用于表示现实世界的现象或结果。[技能 1.A]

    • AAP-3.F.1 การจำลองเป็นแบบจำลองที่ลดทอนจากวัตถุหรือปรากฏการณ์ที่ซับซ้อนขึ้นเพื่อวัตถุประสงค์เฉพาะ
    • AAP-3.F.2 การจำลอง คือการนำเสนอที่ใช้ชุดค่าต่างๆ เพื่อสะท้อนสถานะที่เปลี่ยนแปลงไปของปรากฏการณ์หนึ่ง
    • AAP-3.F.3 การจำลองมักเลียนแบบเหตุการณ์ในโลกจริงเพื่อวัตถุประสงค์ในการสรุปผล ซึ่งช่วยให้สามารถตรวจสอบปรากฏการณ์นั้นได้โดยไม่ถูกจำกัดโดยความเป็นจริง
    • AAP-3.F.4 กระบวนการสร้างการจำลองแบบลดทอนจะเกี่ยวข้องกับการกำจัดรายละเอียดเฉพาะออก หรือทำให้ฟังก์ชันการทำงานง่ายขึ้น
    • AAP-3.F.5 การจำลองอาจมีอคติซึ่งเกิดจากการเลือกองค์ประกอบในโลกจริงที่ถูกนำเข้ามาหรือตัดออกไป
    • AAP-3.F.6 การจำลองจะมีประโยชน์มากที่สุดเมื่อเหตุการณ์ในโลกจริงไม่เหมาะสมสำหรับการทดลอง (เช่น ใหญ่เกินไป เล็กเกินไป เร็วเกินไป ช้าเกินไป mahal เกินไป หรืออันตรายเกินไป)
    • AAP-3.F.7 การจำลองช่วยในการกำหนดและปรับปรุงสมมติฐานที่เกี่ยวข้องกับวัตถุหรือปรากฏการณ์ที่กำลังพิจารณา
    • AAP-3.F.8 เครื่องสร้างตัวเลขสุ่มสามารถใช้จำลองความแปรปรวนที่มีอยู่ในโลกจริงได้

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    A simulation 模拟 is a program that models a real-world process to study it safely and cheaply. Simulations simplify reality (they leave out detail) and often use randomness to imitate chance events. They let you test scenarios that would be too costly, slow, or dangerous in real life – but their results are only as good as their assumptions.

    A simulation is a way of doing science, not just a picture. Because it can be run many times, cheaply and with one variable changed at a time, a simulation facilitates the formulation and refinement of hypotheses about the object or phenomenon under consideration: you propose an explanation, run the model, compare the result with reality, and adjust either the hypothesis or the model. That is why a simulation's simplifications matter — a result only supports a hypothesis about the real world to the extent that what was left out does not matter.

    ไทย

    การจำลอง คือโปรแกรมที่จำลองกระบวนการในโลกจริงเพื่อศึกษาอย่างปลอดภัยและประหยัด-costy Simulations ลดทอน ความจริง (โดยละรายละเอียดออก) และมักใช้ ความสุ่ม เพื่อเลียนเหตุการณ์บังเอิญ พวกมันช่วยให้คุณทดสอบสถานการณ์ที่จะ expensive, ช้า, หรืออันตรายเกินไปในชีวิตจริง – แต่ผลลัพธ์ของพวกมันดีเท่ากับความสมมติฐานของมันเท่านั้น

    การจำลองเป็นวิธีการทำวิทยาศาสตร์ ไม่ใช่แค่ภาพ เพราะสามารถรันได้หลายครั้ง ประหยัด และเปลี่ยนตัวแปรได้ทีละตัว การจำลองจึง ส่งเสริมการสร้างและปรับปรุงสมมติฐาน เกี่ยวกับวัตถุหรือปรากฏการณ์ที่กำลังพิจารณา: คุณเสนอคำอธิบาย, รันโมเดล, เปรียบเทียบผลลัพธ์กับความเป็นจริง, และปรับทั้งสมมติฐานหรือโมเดล นั่นคือเหตุผลที่การลดทอนของการจำลองสำคัญ – ผลลัพธ์จะสนับสนุนสมมติฐานเกี่ยวกับโลกจริงได้ก็ต่อเท่าที่สิ่งที่ถูกทิ้งไปนั้นไม่สำคัญ

    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    simulation/ˌsɪmjʊˈleɪʃn/ การจำลอง
    Efficiency/ɪˈfɪʃənsi/ ประสิทธิภาพ
    3.17

    Algorithmic Efficiency · ⁨ประสิทธิภาพของอัลกอริทึม⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-4): There exist problems that computers cannot solve, and even when a computer can solve a problem, it may not be able to do so in a reasonable amount of time.

    Learning Objective AAP-4.A: For determining the efficiency of an algorithm: a. Explain the difference between algorithms that run in reasonable time and those that do not. [Skill 1.D] b. Identify situations where a heuristic solution may be more appropriate. [Skill 1.D]

    • AAP-4.A.1 A problem is a general description of a task that can (or cannot) be solved algorithmically. An instance of a problem also includes specific input. For example, sorting is a problem; sorting the list (2,3,1,7) is an instance of the problem.
    • AAP-4.A.2 A decision problem is a problem with a yes/no answer (e.g., is there a path from A to B?). An optimization problem is a problem with the goal of finding the "best" solution among many (e.g., what is the shortest path from A to B?).
    • AAP-4.A.3 Efficiency is an estimation of the amount of computational resources used by an algorithm. Efficiency is typically expressed as a function of the size of the input.
      • Exclusion statement (EK AAP-4.A.3): Formal analysis of algorithms (Big-O) and formal reasoning using mathematical formulas are outside the scope of this course and the AP Exam.
    • AAP-4.A.4 An algorithm's efficiency is determined through formal or mathematical reasoning.
    • AAP-4.A.5 An algorithm's efficiency can be informally measured by determining the number of times a statement or group of statements executes.
    • AAP-4.A.6 Different correct algorithms for the same problem can have different efficiencies.
    • AAP-4.A.7 Algorithms with a polynomial efficiency or slower (constant, linear, square, cube, etc.) are said to run in a reasonable amount of time. Algorithms with exponential or factorial efficiencies are examples of algorithms that run in an unreasonable amount of time.
    • AAP-4.A.8 Some problems cannot be solved in a reasonable amount of time because there is no efficient algorithm for solving them. In these cases, approximate solutions are sought.
    • AAP-4.A.9 A heuristic is an approach to a problem that produces a solution that is not guaranteed to be optimal but may be used when techniques that are guaranteed to always find an optimal solution are impractical.
      • Exclusion statement (AAP-4.A.9): Specific heuristic solutions are outside the scope of this course and the AP Exam.
    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-4): มีปัญหาบางประเภทที่คอมพิวเตอร์ไม่สามารถแก้ได้ และแม้ว่าคอมพิวเตอร์จะแก้ปัญหาได้ ก็อาจไม่สามารถทำเช่นนั้นได้ในระยะเวลาที่เหมาะสม

    จุดประสงค์การเรียนรู้ AAP-4.A: ในการประเมินประสิทธิภาพของอัลกอริทึม: ก. อธิบายความแตกต่างระหว่างอัลกอริทึมที่ทำงานในระยะเวลาที่เหมาะสมและ那些ที่ไม่สามารถทำได้ [ทักษะ 1.D] ข. ระบุสถานการณ์ที่การหาคำตอบด้วยวิธีเชิงลึกลับอาจเหมาะสมกว่า [ทักษะ 1.D]

    • AAP-4.A.1 ปัญหา คือคำอธิบายทั่วไปของงานที่สามารถ (หรือไม่สามารถ) แก้ไขได้ด้วยอัลกอริทึม ตัวอย่าง ของปัญหายังรวมถึงอินพุตเฉพาะด้วย ตัวอย่างเช่น การจัดลำดับคือปัญหา; การจัดลำดับรายการ (2,3,1,7) เป็นตัวอย่างของปัญหานี้
    • AAP-4.A.2 ปัญหาวินิจฉัย คือปัญหาที่มีคำตอบใช่/ไม่ใช่ (เช่น มีเส้นทางจาก A ไป B หรือไม่?) ปัญหาการเพิ่มประสิทธิภาพ คือปัญหาที่มีเป้าหมายในการหา "ทางออกที่ดีที่สุด" จากหลายทางเลือก (เช่น เส้นทางสั้นที่สุดจาก A ไป B คืออะไร?)
    • AAP-4.A.3 ประสิทธิภาพ เป็นการประมาณปริมาณทรัพยากรการคำนวณที่อัลกอริทึมใช้ ประสิทธิภาพมักแสดงเป็นฟังก์ชันของขนาดของอินพุต
      • ข้อควรระวัง (EK AAP-4.A.3): การวิเคราะห์อัลกอริทึมอย่างเป็นทางการ (Big-O) และการให้เหตุผลทางการใช้สูตรคณิตศาสตร์อยู่นอกขอบเขตของรายวิชานี้และข้อสอบ AP
    • AAP-4.A.4 ประสิทธิภาพของอัลกอริทึมถูกกำหนดผ่านการให้เหตุผลอย่างเป็นทางการหรือทางคณิตศาสตร์
    • AAP-4.A.5 ประสิทธิภาพของอัลกอริทึมสามารถวัดแบบไม่ทางการได้โดยการนับจำนวนครั้งที่คำสั่งหรือกลุ่มคำสั่ง被执行
    • AAP-4.A.6 อัลกอริทึมที่ถูกต้องที่แตกต่างกันสำหรับปัญหาเดียวกันอาจมีประสิทธิภาพแตกต่างกัน
    • AAP-4.A.7 อัลกอริทึมที่มีประสิทธิภาพเป็นพหุนามหรือช้ากว่านั้น (คงที่, เชิงเส้น, สี่เหลี่ยม, ลูกบาศก์ เป็นต้น)被认为是在“合理时间内”运行的。具有指数或阶乘效率的算法是“不合理时间”内运行算法的例子。
    • AAP-4.A.8 บางปัญหาไม่สามารถแก้ไขได้ในระยะเวลาที่เหมาะสมเนื่องจากไม่มีอัลกอริทึมที่มีประสิทธิภาพในการแก้ปัญหานั้น ในกรณีเหล่านี้จะมองหาทางออกโดยประมาณ
    • AAP-4.A.9 วิธีเชิงลึกลับ คือแนวทางในการแก้ปัญหาที่สร้างทางออกซึ่งไม่รับประกันว่าจะดีที่สุด แต่อาจใช้ในกรณีที่เป็นเทคนิคที่รับประกันการหาคำตอบที่ดีที่สุดไม่เหมาะสม
      • ข้อควรระวัง (AAP-4.A.9): วิธีเชิงลึกลับเฉพาะอยู่นอกขอบเขตของรายวิชานี้และข้อสอบ AP

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Efficiency 效率 is how much time (or memory) an algorithm needs as its input grows. A reasonable-time algorithm's work grows like a polynomial of the input size (e.g. linear or quadratic); an unreasonable-time algorithm grows far faster (e.g. doubling with each added item), becoming impractical for large inputs. A faster algorithm can make a previously impossible problem solvable. Sometimes an exact answer takes too long, so a heuristic 启发式 – an approach that finds a good-enough answer quickly – is used instead.

    ไทย

    ประสิทธิภาพ คือปริมาณเวลา (หรือหน่วยความจำ) ที่อัลกอริทึมต้องใช้เมื่อข้อมูลเข้ามีขนาดใหญ่ขึ้น อัลกอริทึมที่ ใช้เวลามั่นใจได้ จะมีจำนวนงานเพิ่มขึ้นตามฟังก์ชันพหุนามของขนาดข้อมูลเข้า (เช่น แบบเส้นตรงหรือแบบกำลังสอง) ส่วนอัลกอริทึมที่ ใช้เวลานานเกินควร จะเพิ่มขึ้นเร็วมาก (เช่น เพิ่มเป็นสองเท่าเมื่อเพิ่มข้อมูลเข้าหนึ่งรายการ) จนไม่สามารถใช้งานได้ในข้อมูลเข้าที่มีขนาดใหญ่ อัลกอริทึมที่เร็วขึ้นสามารถทำให้ปัญหาที่เคยแก้ไม่ได้กลายเป็นแก้ได้ บางครั้งการหาคำตอบที่แม่นยำอาจใช้เวลานานเกินไป จึงใช้ heuristics – وهوวิธีการหาคำตอบที่พอใช้ได้ภายในเวลาอันรวดเร็ว – แทน

    วิธีที่เวลาทำงานของอัลกอริทึมเพิ่มขึ้นตามขนาดข้อมูลเข้า n
    วิธีที่เวลาทำงานของอัลกอริทึมเพิ่มขึ้นตามขนาดข้อมูลเข้า n
    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    heuristic/hjuːˈrɪstɪk/ heuristic
    undecidable/ˌʌndɪˈsaɪdəbl/ ไม่สามารถตัดสินใจได้
    3.18

    Undecidable Problems · ⁨ปัญหาที่ไม่สามารถตัดสินใจได้⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (AAP-4): There exist problems that computers cannot solve, and even when a computer can solve a problem, it may not be able to do so in a reasonable amount of time.

    Learning Objective AAP-4.B: Explain the existence of undecidable problems in computer science. [Skill 1.A]

    • AAP-4.B.1 A decidable problem is a decision problem for which an algorithm can be written to produce a correct output for all inputs (e.g., "Is the number even?").
    • AAP-4.B.2 An undecidable problem is one for which no algorithm can be constructed that is always capable of providing a correct yes-or-no answer.
      • Exclusion statement (EK AAP-4.B.2): Determining whether a given problem is undecidable is outside the scope of this course and the AP Exam.
    • AAP-4.B.3 An undecidable problem may have some instances that have an algorithmic solution, but there is no algorithmic solution that could solve all instances of the problem.
    ไทย

    ความเข้าใจที่ยั่งยืน (AAP-4): มีปัญหาบางประเภทที่คอมพิวเตอร์ไม่สามารถแก้ได้ และแม้ว่าคอมพิวเตอร์จะแก้ปัญหาได้ ก็อาจไม่สามารถทำเช่นนั้นได้ในระยะเวลาที่เหมาะสม

    จุดประสงค์การเรียนรู้ AAP-4.B: อธิบายการมีอยู่ของปัญหาที่ตัดสินไม่ได้ในวิทยาการคอมพิวเตอร์ [ทักษะ 1.A]

    • AAP-4.B.1 ปัญหาที่ตัดสินได้ คือปัญหาวินิจฉัยที่เขียนอัลกอริทึมเพื่อสร้างผลลัพธ์ที่ถูกต้องสำหรับอินพุตทั้งหมดได้ (เช่น "เลขนี้คู่หรือไม่?")
    • AAP-4.B.2 ปัญหาที่ตัดสินไม่ได้ คือปัญหาที่สร้างอัลกอริทึม nàoก็ตามไม่สามารถให้คำตอบใช่/ไม่ใช่ที่ถูกต้องเสมอได้
      • ข้อควรระวัง (EK AAP-4.B.2): การตัดสินว่าปัญหาระดับใดเป็นปัญหาที่ตัดสินได้นั้นอยู่นอกขอบเขตของรายวิชานี้และข้อสอบ AP
    • AAP-4.B.3 ปัญหาที่ตัดสินไม่ได้อาจมีบางตัวอย่างที่มีทางออกด้วยอัลกอริทึม แต่ไม่มีอัลกอริทึมใดที่จะสามารถแก้ได้ทุกตัวอย่างของปัญหานี้

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Some problems are undecidable 不可判定: no algorithm can solve every case of them with a correct yes/no answer. This is a fundamental limit of computing – not a matter of needing a faster computer, but a proof that no such algorithm can exist.

    Exam skill: be able to determine a code segment's result by tracing it, compare two algorithms' efficiency (reasonable vs unreasonable time), and recognize procedural and data abstraction in a program.

    ไทย

    บางปัญหามีลักษณะ ไม่สามารถตัดสินใจได้: ไม่มีอัลกอริทึมใดสามารถแก้ปัญหา ทุก กรณีได้อย่างถูกต้องด้วยคำตอบใช่/ไม่ใช่ นี่คือข้อจำกัดพื้นฐานของการคำนวณ – ไม่ใช่แค่เรื่องของการใช้คอมพิวเตอร์ที่เร็วขึ้น แต่เป็นการพิสูจน์ว่าไม่มีอัลกอริทึมดังกล่าวสามารถมีอยู่จริงได้

    ทักษะในการสอบ: สามารถตรวจสอบผลลัพธ์ของโค้ดส่วนหนึ่งด้วยการติดตามการทำงาน เปรียบเทียบประสิทธิภาพของอัลกอริทึมสองตัว (การใช้เวลามั่นใจได้ vs ใช้เวลานานเกินควร) และระบุการนามธรรมแบบขั้นตอนและข้อมูลในโปรแกรมได้

    3.18

    Exam tips · ⁨ข้อแนะนำสำหรับการสอบ⁩

    English
    • Know a variable is a named store for a value and trace how assignment updates it step by step.
    • Read the AP pseudocode carefully — a <- expression assigns, and lists are 1-indexed on the exam reference sheet.
    • Distinguish a variable from a list (a collection accessed by index) and use list operations correctly.
    • Evaluate expressions with the right precedence and boolean logic (AND, OR, NOT).
    • Pick clear, meaningful variable names — the written tasks reward readable code.
    ไทย
    • รู้ว่าตัวแปรคือพื้นที่จัดเก็บที่มีชื่อสำหรับค่าหนึ่ง และการติดตาม如何通过 การกำหนดค่า เพื่ออัปเดตค่า它以ขั้นตอนทีละขั้น
    • อ่าน AP 伪代码 อย่างละเอียด — a <- expression มีการกำหนดค่า, และลิสต์มีการเริ่มต้นจาก 1 ในกระดาษอ้างอิงการสอบ
    • แยกแยะระหว่างตัวแปรกับ ลิสต์ (กลุ่มข้อมูลที่เข้าถึงผ่านดัชนี) และใช้ktionลิสต์ให้ถูกต้อง
    • ประเมินนิพจน์โดยคำนึงถึงลำดับความสำคัญที่ถูกต้องและตรรกะ boolean (AND, OR, NOT)
    • เลือกชื่อบอกตัวแปรที่ชัดเจนและมีนัยสำคัญ – งานเขียนจะเน้นการอ่านโค้ดได้ง่าย
  • 4

    Computer Systems and Networks · ⁨ระบบคอมพิวเตอร์และเครือข่าย⁩

    Watch lesson · ⁨ดูบทเรียน⁩
    4.1

    The Internet · ⁨อินเทอร์เน็ต⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (CSN-1): Computer systems and networks facilitate the transfer of data.

    Learning Objective CSN-1.A: Explain how computing devices work together in a network. [Skill 5.A]

    • CSN-1.A.1 A computing device is a physical artifact that can run a program. Some examples include computers, tablets, servers, routers, and smart sensors.
    • CSN-1.A.2 A computing system is a group of computing devices and programs working together for a common purpose.
    • CSN-1.A.3 A computer network is a group of interconnected computing devices capable of sending or receiving data.
    • CSN-1.A.4 A computer network is a type of computing system.
    • CSN-1.A.5 A path between two computing devices on a computer network (a sender and a receiver) is a sequence of directly connected computing devices that begins at the sender and ends at the receiver.
    • CSN-1.A.6 Routing is the process of finding a path from sender to receiver.
    • CSN-1.A.7 The bandwidth of a computer network is the maximum amount of data that can be sent in a fixed amount of time.
    • CSN-1.A.8 Bandwidth is usually measured in bits per second.

    Learning Objective CSN-1.B: Explain how the Internet works. [Skill 5.A]

    • CSN-1.B.1 The Internet is a computer network consisting of interconnected networks that use standardized, open (nonproprietary) communication protocols.
    • CSN-1.B.2 Access to the Internet depends on the ability to connect a computing device to an Internet-connected device.
    • CSN-1.B.3 A protocol is an agreed-upon set of rules that specify the behavior of a system.
    • CSN-1.B.4 The protocols used in the Internet are open, which allows users to easily connect additional computing devices to the Internet.
    • CSN-1.B.5 Routing on the Internet is usually dynamic; it is not specified in advance.
    • CSN-1.B.6 The scalability of a system is the capacity for the system to change in size and scale to meet new demands.
    • CSN-1.B.7 The Internet was designed to be scalable.

    Learning Objective CSN-1.C: Explain how data are sent through the Internet via packets. [Skill 5.A]

    • CSN-1.C.1 Information is passed through the Internet as a data stream. Data streams contain chunks of data, which are encapsulated in packets.
    • CSN-1.C.2 Packets contain a chunk of data and metadata used for routing the packet between the origin and the destination on the Internet, as well as for data reassembly.
    • CSN-1.C.3 Packets may arrive at the destination in order, out of order, or not at all.
    • CSN-1.C.4 IP, TCP, and UDP are common protocols used on the Internet.

    Learning Objective CSN-1.D: Describe the differences between the Internet and the World Wide Web. [Skill 5.A]

    • CSN-1.D.1 The World Wide Web is a system of linked pages, programs, and files.
    • CSN-1.D.2 HTTP is a protocol used by the World Wide Web.
    • CSN-1.D.3 The World Wide Web uses the Internet.
    ไทย

    ความเข้าใจที่ยั่งยืน (CSN-1): ระบบคอมพิวเตอร์และเครือข่ายเอื้อต่อการถ่ายโอนข้อมูล

    วัตถุประสงค์การเรียนรู้ CSN-1.A: อธิบายวิธีการทำงานร่วมกันของอุปกรณ์ประมวลผลในเครือข่าย [ทักษะ 5.A]

    • CSN-1.A.1 อุปกรณ์ประมวลผล คือวัตถุทางกายภาพที่สามารถรันโปรแกรมได้ ตัวอย่างเช่น คอมพิวเตอร์ แท็บเล็ต เซิร์ฟเวอร์ รوتر และเซ็นเซอร์อัจฉริยะ
    • CSN-1.A.2 ระบบประมวลผล คือกลุ่มของอุปกรณ์ประมวลผลและโปรแกรมที่ทำงานร่วมกันเพื่อวัตถุประสงค์的共同
    • CSN-1.A.3 เครือข่ายคอมพิวเตอร์ คือกลุ่มอุปกรณ์ประมวลผลที่เชื่อมต่อกันซึ่งสามารถส่งหรือรับข้อมูลได้
    • CSN-1.A.4 เครือข่ายคอมพิวเตอร์เป็นประเภทหนึ่งของระบบการประมวลผล
    • CSN-1.A.5 เส้นทาง ระหว่างอุปกรณ์ประมวลผลสองเครื่องบนเครือข่ายคอมพิวเตอร์ (ผู้ส่งและผู้รับ) คือลำดับของอุปกรณ์ประมวลผลที่เชื่อมต่อกันโดยตรง ซึ่งเริ่มต้นที่ผู้ส่งและสิ้นสุดที่ผู้รับ
    • CSN-1.A.6 การกำหนดเส้นทาง (Routing) คือกระบวนการค้นหาเส้นทางจากผู้ส่งไปยังผู้รับ
    • CSN-1.A.7 แบนด์วิดท์ (bandwidth) ของเครือข่ายคอมพิวเตอร์คือปริมาณข้อมูลสูงสุดที่สามารถส่งได้ในระยะเวลาที่กำหนด
    • CSN-1.A.8 แบนด์วิดท์มักวัดเป็นบิตต่อวินาที

    จุดประสงค์การเรียนรู้ CSN-1.B: อธิบายการทำงานของอินเทอร์เน็ต [ทักษะ 5.A]

    • CSN-1.B.1 อินเทอร์เน็ตคือเครือข่ายคอมพิวเตอร์ที่ประกอบด้วยเครือข่ายย่อยที่เชื่อมโยงกันและใช้โปรโตคอลการสื่อสารที่เป็นมาตรฐานและเปิด (nonproprietary)
    • CSN-1.B.2 การเข้าถึงอินเทอร์เน็ตขึ้นอยู่กับความสามารถในการเชื่อมต่อบุคลากรหรืออุปกรณ์คำนวณเข้ากับอุปกรณ์ที่เชื่อมต่ออินเทอร์เน็ตแล้ว
    • CSN-1.B.3 โปรโตคอล (protocol) คือชุดกฎ agreed-upon ที่กำหนดพฤติกรรมของระบบ
    • CSN-1.B.4 โปรโตคอลที่ใช้ในอินเทอร์เน็ตเป็น open ซึ่งช่วยให้ผู้ใช้สามารถเชื่อมต่ออุปกรณ์คำนวณเพิ่มเติมเข้ากับอินเทอร์เน็ตได้ง่าย
    • CSN-1.B.5 การ routing ในอินเทอร์เน็ตมักเป็นแบบ dynamic; ไม่ได้กำหนดไว้ล่วงหน้า
    • CSN-1.B.6 scalability ของระบบคือความสามารถของระบบในการเปลี่ยนแปลงขนาดและสเกลเพื่อตอบสนองความต้องการใหม่
    • CSN-1.B.7 อินเทอร์เน็ตถูกออกแบบมาเพื่อให้มี scalability

    จุดประสงค์การเรียนรู้ CSN-1.C: อธิบายวิธีการส่งข้อมูลผ่านอินเทอร์เน็ตโดยใช้แพ็กเก็ต [ทักษะ 5.A]

    • CSN-1.C.1 ข้อมูลถูกส่งผ่านอินเทอร์เน็ตในรูปแบบของ data stream Data streams ประกอบด้วยchunks ของข้อมูลที่ encapsulate อยู่ใน packets
    • CSN-1.C.2 Packets มี chunks ของข้อมูลและ metadata ที่ใช้ในการ routing แพ็กเก็ตระหว่างต้นทางและปลายทางบนอินเทอร์เน็ต รวมถึงสำหรับการประกอบข้อมูลกลับ
    • CSN-1.C.3 Packets อาจมาถึงปลายทางตามลำดับ, ไม่ตามลำดับ, หรืออาจไม่มาถึงเลยก็ได้
    • CSN-1.C.4 IP, TCP และ UDP เป็นโปรโตคอลทั่วไปที่ใช้บนอินเทอร์เน็ต

    จุดประสงค์การเรียนรู้ CSN-1.D: อธิบายความแตกต่างระหว่างอินเทอร์เน็ตกับ World Wide Web [ทักษะ 5.A]

    • CSN-1.D.1 World Wide Web เป็นระบบของหน้าเว็บ programs และไฟล์ที่เชื่อมโยงกัน
    • CSN-1.D.2 HTTP เป็นโปรโตคอลที่ใช้โดย World Wide Web
    • CSN-1.D.3 World Wide Web ใช้ inetenet

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    The Internet 互联网 is a global network of networks. Data travels as packets 数据包 – small chunks that are sent separately and reassembled at the destination. Two ideas make it work at scale:

    • Protocols 协议 are agreed rules for communication. IP (Internet Protocol) addresses and routes packets; TCP reassembles them in order and re-requests lost ones; HTTP carries web pages; DNS translates a name like example.com into an IP address.
    • Redundancy 冗余 and routing: there are many possible paths between two points, so if one path fails, packets take another. This makes the Internet fault-tolerant 容错.

    The Internet is designed to be open and scalable – built on standards anyone can use, so it keeps working as billions of devices join. Bandwidth 带宽 is the amount of data a connection can carry per second.

    ไทย
    ขั้วต่อ Ethernet RJ45 – สายส่งข้อมูลทางกายภาพลำเลียงแพ็กเก็ตข้ามอินเทอร์เน็ต
    ขั้วต่อ Ethernet RJ45 – สายส่งข้อมูลทางกายภาพลำเลียงแพ็กเก็ตข้ามอินเทอร์เน็ต

    อินเทอร์เน็ต เป็นเครือข่ายระดับโลกที่เชื่อมโยงกัน ข้อมูลเดินทางในรูปแบบของ แพ็กเก็ต – ส่วนย่อยเล็กๆ ที่ถูกส่งแยกต่างหากและประกอบกลับเข้าด้วยกันที่ปลายทาง แนวคิดสองอย่างทำให้ระบบนี้ทำงานได้ในขนาดใหญ:

    อินเทอร์เน็ตคือเครือข่ายทั่วโลก; เวิลด์ไวด์เวบเป็นบริการหนึ่ง的运行บนนั้น
    อินเทอร์เน็ตคือเครือข่ายทั่วโลก; เวิลด์ไวด์ไวด์เว็บคือบริการหนึ่ง运行บนนั้น
    • โปรโตคอล คือกฎเกณฑ์ agreed起来สำหรับการสื่อสาร IP (Internet Protocol) จัดการที่อยู่และลำเลียงแพ็กเก็ต; TCP ประกอบแพ็กเก็ตใหม่ตามลำดับและขอซ้ำแพ็กเก็ตที่หาย; HTTP นำส่งหน้าเว็บ; DNS แปลงชื่ออย่าง example.com ให้เป็นที่อยู่ IP
    • ความซ้ำซ้อน และการลำเลียง: มีเส้นทางที่เป็นไปได้ มากมาย ระหว่างจุดสองจุด ดังนั้นหากเส้นทางหนึ่งล้มเหลว แพ็กเก็ตจะเลือกเส้นทางอื่น ทำให้อินเทอร์เน็ตมีความ ทนทานต่อความผิดพลาด

    อินเทอร์เน็ตถูกออกแบบมาเพื่อเปิดกว้างและขยายขนาดได้ – สร้างบนมาตรฐานที่ใครก็ตามสามารถใช้ เพื่อให้ระบบยังคงทำงานต่อไปเมื่ออุปกรณ์นับพันล้านเครื่องเชื่อมต่อเข้ามา แบนด์วิดท์ คือปริมาณข้อมูลที่ช่องสัญญาณสามารถลำเลียงได้ต่อวินาที

    Explore · ⁨สำรวจ⁩

    How data crosses the Internet in packets · ⁨ข้อมูลเดินทางบนอินเทอร์เน็ตในแพ็กเก็ตอย่างไร⁩

    The Internet breaks a message into numbered packets, each addressed and routed independently (often by different paths), then reassembled at the destination. That design makes it fault-tolerant — if one route fails, packets take another. · ⁨อินเทอร์เน็ตแบ่งข้อความออกเป็น แพ็กเก็ต ที่มีหมายเลขระบุ แต่ละแพ็กเก็ตมีที่อยู่และ ถูกส่งต่อ อย่างอิสระ (มักผ่านเส้นทางที่แตกต่างกัน) แล้วประกอบกลับที่ปลายทาง การออกแบบนี้ทำให้它具有 ทนต่อข้อผิดพลาด — หากเส้นทางหนึ่งล้มเหลว แพ็กเก็ตจะ取了เส้นทางอื่น⁩

    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    Internet/ˈɪntənet/ อินเทอร์เน็ต
    packets/ˈpækɪts/ แพ็กเก็ต
    Protocols/ˈprəʊtəkɒlz/ โปรโตคอล
    Redundancy/rɪˈdʌndənsi/ ความซ้ำซ้อน
    fault-tolerant/fɒlt ˈtɒlərənt/ ทนต่อข้อผิดพลาด
    Bandwidth/ˈbændwɪdθ/ แบนด์วิดธ์
    reliability/rɪˌlaɪəˈbɪlɪti/ ความน่าเชื่อถือ
    Sequential computing/siːˈkwenʃl kəmˈpjuːtɪŋ/ การคำนวณแบบลำดับ
    Parallel computing/ˈpærəlel kəmˈpjuːtɪŋ/ การคำนวณแบบขนาน
    Distributed computing/ˈdɪstrɪbjuːtɪd kəmˈpjuːtɪŋ/ การคำนวณแบบกระจาย
    Watch lesson · ⁨ดูบทเรียน⁩
    4.2

    Fault Tolerance · ⁨ความทนทานต่อความผิดพลาด⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (CSN-1): Computer systems and networks facilitate the transfer of data.

    Learning Objective CSN-1.E: For fault-tolerant systems, like the Internet: a. Describe the benefits of fault tolerance. [Skill 1.D] b. Explain how a given system is fault-tolerant. [Skill 5.A] c. Identify vulnerabilities to failure in a system. [Skill 1.D]

    • CSN-1.E.1 The Internet has been engineered to be fault-tolerant, with abstractions for routing and transmitting data.
    • CSN-1.E.2 Redundancy is the inclusion of extra components that can be used to mitigate failure of a system if other components fail.
    • CSN-1.E.3 One way to accomplish network redundancy is by having more than one path between any two connected devices.
    • CSN-1.E.4 If a particular device or connection on the Internet fails, subsequent data will be sent via a different route, if possible.
    • CSN-1.E.5 When a system can support failures and still continue to function, it is called fault-tolerant. This is important because elements of complex systems fail at unexpected times, often in groups, and fault tolerance allows users to continue to use the network.
    • CSN-1.E.6 Redundancy within a system often requires additional resources but can provide the benefit of fault tolerance.
    • CSN-1.E.7 The redundancy of routing options between two points increases the reliability of the Internet and helps it scale to more devices and more people.
    ไทย

    ความเข้าใจที่ยั่งยืน (CSN-1): ระบบคอมพิวเตอร์และเครือข่ายเอื้อต่อการถ่ายโอนข้อมูล

    จุดประสงค์การเรียนรู้ CSN-1.E: สำหรับระบบที่ทนทานต่อความผิดพลาด เช่น อินเทอร์เน็ต: a. อธิบายประโยชน์ของความทนทานต่อความผิดพลาด [ทักษะ 1.D] b. อธิบายว่าระบบใดระบบหนึ่งมีความทนทานต่อความผิดพลาดอย่างไร [ทักษะ 5.A] c. ระบุจุดอ่อนที่อาจทำให้เกิดความล้มเหลวในระบบ [ทักษะ 1.D]

    • CSN-1.E.1 อินเทอร์เน็ตถูกออกแบบให้มีความทนทานต่อความผิดพลาด โดยมี abstraction สำหรับการ routing และการส่งข้อมูล
    • CSN-1.E.2 Redundancy คือการรวมส่วนประกอบเสริมเข้ามาซึ่งสามารถใช้เพื่อลดผลกระทบจากความล้มเหลวของระบบหากส่วนประกอบอื่นล้มเหลว
    • CSN-1.E.3 วิธีการหนึ่งที่จะบรรลุ network redundancy คือการมีมากกว่าหนึ่งเส้นทางระหว่างอุปกรณ์ที่เชื่อมต่อด้วยกันทุกคู่
    • CSN-1.E.4 หากอุปกรณ์หรือ connection บางอย่างบนอินเทอร์เน็ตล้มเหลว ข้อมูลถัดไปจะถูกส่งผ่านเส้นทางอื่น หากเป็นไปได้
    • CSN-1.E.5 เมื่อระบบสามารถรองรับความล้มเหลวและยังคงทำงานต่อไปได้ ระบบนั้นเรียกว่า fault-tolerant สิ่งนี้สำคัญเพราะองค์ประกอบของระบบซับซ้อนมักจะล้มเหลวในเวลาที่ไม่คาดคิด มักเป็นกลุ่ม และ fault tolerance ช่วยให้ผู้ใช้งานยังคงใช้เครือข่ายได้
    • CSN-1.E.6 Redundancy ภายในระบบมักต้องใช้ทรัพยากรเพิ่มเติมแต่สามารถให้ประโยชน์ด้านความทนทานต่อความผิดพลาด
    • CSN-1.E.7 Redundancy ของตัวเลือก routing ระหว่างสองจุดเพิ่มความน่าเชื่อถือของอินเทอร์เน็ตและช่วยให้อินเทอร์เน็ตขยายขนาดไปยังอุปกรณ์และผู้คนมากขึ้นได้

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    A system is fault-tolerant if it keeps working even when part of it fails. The Internet achieves this through redundant connections: because packets can be routed along multiple paths, the failure of one router or cable does not stop communication – traffic simply reroutes. Fault tolerance costs extra resources (the redundant paths) but greatly improves reliability 可靠性. A single path with no backup is not fault-tolerant.

    ไทย
    เราเตอร์ Wi-Fi: เกตเวย์ในพื้นที่ที่ลำเลียงแพ็กเก็ตไปยังอินเทอร์เน็ตวงกว้าง
    เราเตอร์ Wi-Fi: เกตเวย์ในพื้นที่ที่ลำเลียงแพ็กเก็ตไปยังอินเทอร์เน็ตวงกว้าง

    ระบบมีความ ทนทานต่อความผิดพลาด หากยังคงทำงานได้แม้ว่าบางส่วนจะล้มเหลว อินเทอร์เน็ตบรรลุสิ่งนี้ได้ผ่าน connections ที่ ซ้ำซ้อน: เนื่องจากแพ็กเก็ตสามารถถูกลำเลียงตามหลายเส้นทาง การล้มเหลวของเราเตอร์หรือสายเคเบิลหนึ่งไม่ขัดขวางการสื่อสาร – การจราจรจะถูกเปลี่ยนเส้นทางใหม่ ความทนทานต่อความผิดพลาดต้องใช้ทรัพยากรเพิ่มเติม (เส้นทางซ้ำซ้อน) แต่ช่วยเพิ่ม ความน่าเชื่อถือ อย่างมีนัยสำคัญ เส้นทางเดียวที่ไม่มีสำรองไม่ถือว่าทนทานต่อความผิดพลาด

    การสลับแพ็กเก็ตส่งแพ็กเก็ตผ่านเส้นทางที่แยกจากกัน ทำให้เครือข่ายทนต่อการล้มเหลวของลิงก์ได้
    packet switching ส่งแพ็กเก็ตผ่านเส้นทางอิสระ ทำให้เครือข่ายทนต่อการล้มเหลวของลิงก์
    4.3

    Parallel and Distributed Computing · ⁨การคำนวณแบบขนานและการกระจาย⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (CSN-2): Parallel and distributed computing leverage multiple computers to more quickly solve complex problems or process large data sets.

    Learning Objective CSN-2.A: For sequential, parallel, and distributed computing: a. Compare problem solutions. [Skill 1.D] b. Determine the efficiency of solutions. [Skill 1.D]

    • CSN-2.A.1 Sequential computing is a computational model in which operations are performed in order one at a time.
    • CSN-2.A.2 Parallel computing is a computational model where the program is broken into multiple smaller sequential computing operations, some of which are performed simultaneously.
    • CSN-2.A.3 Distributed computing is a computational model in which multiple devices are used to run a program.
    • CSN-2.A.4 Comparing efficiency of solutions can be done by comparing the time it takes them to perform the same task.
    • CSN-2.A.5 A sequential solution takes as long as the sum of all of its steps.
    • CSN-2.A.6 A parallel computing solution takes as long as its sequential tasks plus the longest of its parallel tasks.
    • CSN-2.A.7 The "speedup" of a parallel solution is measured in the time it took to complete the task sequentially divided by the time it took to complete the task when done in parallel.

    Learning Objective CSN-2.B: Describe benefits and challenges of parallel and distributed computing. [Skill 1.D]

    • CSN-2.B.1 Parallel computing consists of a parallel portion and a sequential portion.
    • CSN-2.B.2 Solutions that use parallel computing can scale more effectively than solutions that use sequential computing.
    • CSN-2.B.3 Distributed computing allows problems to be solved that could not be solved on a single computer because of either the processing time or storage needs involved.
    • CSN-2.B.4 Distributed computing allows much larger problems to be solved quicker than they could be solved using a single computer.
    • CSN-2.B.5 When increasing the use of parallel computing in a solution, the efficiency of the solution is still limited by the sequential portion. This means that at some point, adding parallel portions will no longer meaningfully increase efficiency.
    ไทย

    ความเข้าใจที่ยั่งยืน (CSN-2): การคำนวณแบบขนานและการกระจายใช้คอมพิวเตอร์หลายเครื่องเพื่อแก้ปัญหาซับซ้อนหรือประมวลผลชุดข้อมูลขนาดใหญ่ได้อย่างรวดเร็วขึ้น

    จุดประสงค์การเรียนรู้ CSN-2.A: สำหรับการคำนวณแบบ sequential, parallel และ distributed: a. เปรียบเทียบวิธีแก้ปัญหา [ทักษะ 1.D] b. ประเมินประสิทธิภาพของวิธีแก้ปัญหา [ทักษะ 1.D]

    • CSN-2.A.1 Sequential computing เป็นโมเดลการคำนวณที่ดำเนินการ according to orderทีละขั้นตอน
    • CSN-2.A.2 Parallel computing เป็นโมเดลการคำนวณที่โปรแกรมถูกแบ่งออกเป็นหลาย操作步骤การคำนวณแบบ sequential ขนาดเล็กกว่า โดยบางขั้นตอนถูกทำพร้อมกัน
    • CSN-2.A.3 Distributed computing เป็นโมเดลการคำนวณที่ใช้อุปกรณ์หลายเครื่องเพื่อรันโปรแกรม
    • CSN-2.A.4 การเปรียบเทียบประสิทธิภาพของวิธีแก้ปัญหายังทำได้โดยการเปรียบเทียบเวลาที่ ониใช้เวลาในการดำเนินการงานเดียวกัน
    • CSN-2.A.5 วิธีแก้ปัญหารูปแบบ sequential ใช้เวลาเท่ากับผลรวมของขั้นตอนทั้งหมด
    • CSN-2.A.6 วิธีแก้ปัญหารูปแบบ parallel computing ใช้เวลาเท่ากับงาน sequential ของมันบวกกับงาน parallel ที่นานที่สุด
    • CSN-2.A.7 "speedup" ของวิธีแก้ปัญหารูปแบบ parallel วัดจากเวลาที่มันใช้เสร็จเมื่อทำแบบ sequential หารด้วยเวลาที่มันใช้เสร็จเมื่อทำแบบ parallel

    จุดประสงค์การเรียนรู้ CSN-2.B: อธิบายประโยชน์และความท้าทายของการคำนวณแบบขนานและการกระจาย [ทักษะ 1.D]

    • CSN-2.B.1 การคำนวณแบบขนานประกอบด้วยส่วน parallel และส่วน sequential
    • CSN-2.B.2 วิธีแก้ปัญหารูปแบบ parallel computing สามารถ scale ได้มีประสิทธิภาพมากกว่าวิธีแก้ปัญหารูปแบบ sequential computing
    • CSN-2.B.3 การคำนวณแบบ distributed ทำให้สามารถแก้ปัญหาที่ไม่สามารถแก้บนคอมพิวเตอร์เครื่องเดียวได้เนื่องจากทั้งเวลาในการประมวลผลหรือความต้องการพื้นที่เก็บข้อมูล
    • CSN-2.B.4 การคำนวณแบบ distributed ช่วยแก้ปัญหาที่ใหญ่กว่ามากได้อย่างรวดเร็วกว่าที่จะแก้ได้โดยใช้คอมพิวเตอร์เพียงเครื่องเดียว
    • CSN-2.B.5 เมื่อเพิ่มการใช้การคำนวณแบบขนานในโซลูชัน ประสิทธิภาพของโซลูชันยังคงถูกจำกัดโดยส่วนที่ทำงานแบบลำดับขั้น ดังนั้นจึงมีจุดหนึ่งของการเพิ่มส่วนแบบขนานจะไม่ช่วยเพิ่มประสิทธิภาพได้อย่างมีนัยสำคัญอีกต่อไป

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English
    • Sequential computing 顺序计算 runs one operation at a time.
    • Parallel computing 并行计算 splits a task into parts that run at the same time on multiple processors, finishing faster.
    • Distributed computing 分布式计算 uses many computers connected by a network to work on one problem – essential for problems too big for a single machine.

    A parallel solution's speedup 加速比 is the sequential time divided by the parallel time. Speedup is limited: parts that must run in sequence cannot be sped up by adding processors, so doubling the processors rarely doubles the speed.

    Worked example. A task has a part that must run sequentially, taking $40$ seconds, plus a parallelizable part that takes $60$ seconds on one processor – so on a single processor the whole task takes $40+60=100$ seconds. Spread the parallel part across $3$ processors and it takes $\tfrac{60}{3}=20$ seconds, so the total parallel time is $40+20=60$ seconds and the speedup is $\tfrac{100}{60}\approx1.67$. The $40$-second sequential part is a floor: even with infinitely many processors the task can never finish in under $40$ seconds.

    Exam skill: given the times for the sequential and parallel portions of a task, be able to calculate the total parallel time and the speedup.

    ไทย
    ตู้เซิร์ฟเวอร์ในศูนย์ข้อมูล: การคำนวณแบบกระจายแบ่งภาระงานไปหลายเครื่อง
    ตู้เซิร์ฟเวอร์ในศูนย์ข้อมูล: การคำนวณแบบกระจายแบ่งภาระงานไปหลายเครื่อง
    • การคำนวณแบบลำดับ ทำงานคำสั่งหนึ่งต่อหนึ่ง
    • การคำนวณแบบขนาน แบ่งงานออกเป็นส่วนที่运行的พร้อม กัน บนโปรเซสเซอร์หลายตัว ทำให้เสร็จเร็วขึ้น
    • การคำนวณแบบกระจาย ใช้ คอมพิวเตอร์จำนวนมาก ที่เชื่อมต่อกันด้วยเครือข่ายเพื่อแก้ปัญหาเดียวกัน – จำเป็นสำหรับปัญหาที่ใหญ่เกินกว่าที่จะแก้ไขด้วยเครื่องเดียว
    การคำนวณแบบขนาน: โปรเซสเซอร์จำนวนมากทำงานพร้อมกัน
    การคำนวณแบบขนาน: โปรเซสเซอร์จำนวนมากทำงานพร้อมกัน

    speedup ของโซลูชันแบบขนานคือเวลาแบบลำดับหารด้วยเวลาแบบขนาน speedup มีขีดจำกัด: ส่วนที่ต้อง运行แบบลำดับไม่สามารถเร่งความเร็วได้ด้วยการเพิ่มโปรเซสเซอร์ ดังนั้นการเพิ่มโปรเซสเซอร์เป็นสองเท่าจึงมักจะไม่ทำให้ความเร็วเป็นสองเท่า

    ตัวอย่างทำโจทย์. ภาระงานมีส่วนที่ต้อง运行แบบลำดับ ซึ่งใช้เวลา $40$ วินาที บวกกับส่วนที่ runs ขนานกันได้ซึ่งใช้เวลา $60$ วินาทีบนโปรเซสเซอร์หนึ่ง – ดังนั้นบนโปรเซสเซอร์เดียว ภาระงานทั้งหมดใช้เวลา $40+60=100$ วินาที若将并行部分分布在 $3$ 个处理器上,则需要 $\tfrac{60}{3}=20$ 秒,因此总并行时间为 $40+20=60$ 秒,speedup则为 $\tfrac{100}{60}\approx1.67$。 $40$-วินาทีของส่วนลำดับเป็นพื้น: แม้จะมีโปรเซสเซอร์อเนกนับก็ไม่สามารถfinish ภาระงานในเวลาที่สั้นกว่า $40$ วินาทีได้

    ทักษะในการสอบ: เมื่อได้รับเวลาของส่วนลำดับและส่วนขนานของภาระงาน สามารถคำนวณเวลาแบบขนานรวมและspeedup ได้

    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    speedup/ˈspiːdʌp/ ความเร็วเพิ่มขึ้น
    4.3

    Exam tips · ⁨ข้อแนะนำสำหรับการสอบ⁩

    English
    • Describe how data travels in packets over a redundant, fault-tolerant network of independent routers.
    • Know that protocols (IP, TCP, HTTP) are agreed rules, and that open standards let different systems interoperate.
    • Explain scalability and how the Internet grows without central control.
    • Contrast bandwidth (rate) with latency (delay), and describe the DNS name-to-address lookup.
    • Discuss the digital divide and security basics (encryption, authentication) in plain terms.
    ไทย
    • อธิบายว่าข้อมูลเดินทางในรูปของ แพ็กเก็ต ผ่านเครือข่ายของเราเตอร์อิสระที่มีความซ้ำซ้อนและทนทานต่อความผิดพลาดได้อย่างไร
    • รู้ว่า โปรโตคอล (IP, TCP, HTTP) คือกฎ agreed起来 และมาตรฐานเปิดช่วยให้ระบบต่างๆ ทำงานร่วมกันได้
    • อธิบาย scalability และวิธีที่อินเทอร์เน็ตขยายโดยไม่ต้องการการควบคุมแบบรวมศูนย์
    • เปรียบเทียบ แบนด์วิดท์ (อัตรา) กับ แลตเตนซี (ความหน่วง) และอธิบายการค้นหาชื่อเป็นที่อยู่ของ DNS
    • อภิปรายเรื่อง ช่องว่างดิจิทัล และความปลอดภัยพื้นฐาน (การเข้ารหัส, การยืนยันตัวตน) ด้วยภาษาที่เข้าใจง่าย
  • 5

    Impact of Computing · ⁨ผลกระทบของการคำนวณ⁩

    Watch lesson · ⁨ดูบทเรียน⁩
    5.1

    Beneficial and Harmful Effects · ⁨ผลกระทบที่ดีและอันตราย⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (IOC-1): While computing innovations are typically designed to achieve a specific purpose, they may have unintended consequences.

    Learning Objective IOC-1.A: Explain how an effect of a computing innovation can be both beneficial and harmful. [Skill 5.C]

    • IOC-1.A.1 People create computing innovations.
    • IOC-1.A.2 The way people complete tasks often changes to incorporate new computing innovations.
    • IOC-1.A.3 Not every effect of a computing innovation is anticipated in advance.
    • IOC-1.A.4 A single effect can be viewed as both beneficial and harmful by different people, or even by the same person.
    • IOC-1.A.5 Advances in computing have generated and increased creativity in other fields, such as medicine, engineering, communications, and the arts.

    Learning Objective IOC-1.B: Explain how a computing innovation can have an impact beyond its intended purpose. [Skill 5.C]

    • IOC-1.B.1 Computing innovations can be used in ways that their creators had not originally intended:
      • The World Wide Web was originally intended only for rapid and easy exchange of information within the scientific community.
      • Targeted advertising is used to help businesses, but it can be misused at both individual and aggregate levels.
      • Machine learning and data mining have enabled innovation in medicine, business, and science, but information discovered in this way has also been used to discriminate against groups of individuals.
    • IOC-1.B.2 Some of the ways computing innovations can be used may have a harmful impact on society, the economy, or culture.
    • IOC-1.B.3 Responsible programmers try to consider the unintended ways their computing innovations can be used and the potential beneficial and harmful effects of these new uses.
    • IOC-1.B.4 It is not possible for a programmer to consider all the ways a computing innovation can be used.
    • IOC-1.B.5 Computing innovations have often had unintended beneficial effects by leading to advances in other fields.
    • IOC-1.B.6 Rapid sharing of a program or running a program with a large number of users can result in significant impacts beyond the intended purpose or control of the programmer.
    ไทย

    ความเข้าใจที่ยั่งยืน (IOC-1): แม้ว่าการนวัตกรรมทางคอมพิวเตอร์จะออกแบบมาเพื่อวัตถุประสงค์เฉพาะ แต่อาจมีผลข้างเคียงที่ไม่ได้ตั้งใจไว้

    จุดประสงค์การเรียนรู้ IOC-1.A: อธิบายว่าผลกระทบจากการนวัตกรรมทางคอมพิวเตอร์สามารถเป็นทั้งประโยชน์และอันตรายได้ [ทักษะ 5.C]

    • IOC-1.A.1 มนุษย์สร้างนวัตกรรมทางคอมพิวเตอร์ขึ้น
    • IOC-1.A.2 วิธีการที่มนุษย์ทำงานมักเปลี่ยนแปลงไปเพื่อรองรับนวัตกรรมทางคอมพิวเตอร์ใหม่ ๆ
    • IOC-1.A.3 ไม่ใช่ว่าผลกระทบทุกประการจากการนวัตกรรมทางคอมพิวเตอร์จะถูกคาดการณ์ล่วงหน้า
    • IOC-1.A.4 ผลกระทบเพียงอย่างเดียวสามารถถูกมองว่าเป็นทั้งประโยชน์และอันตรายได้ โดยขึ้นอยู่กับแต่ละบุคคล หรือแม้กระทั่งขึ้นอยู่กับบุคคลเดียวกัน
    • IOC-1.A.5 ความก้าวหน้าด้านเทคโนโลยีคอมพิวเตอร์ได้ก่อให้เกิดและเสริมสร้างความสร้างสรรค์ในสาขาอื่น ๆ เช่น การแพทย์ วิศวกรรมสื่อสาร และศิลปะ

    จุดประสงค์การเรียนรู้ IOC-1.B: อธิบายว่าการนวัตกรรมทางคอมพิวเตอร์สามารถส่งผลกระทบต่อสิ่งที่เกินกว่าวัตถุประสงค์ที่ตั้งไว้ได้อย่างไร [ทักษะ 5.C]

    • IOC-1.B.1 นวัตกรรมทางคอมพิวเตอร์สามารถใช้ในลักษณะที่ผู้สร้างไม่ได้ตั้งใจไว้ตั้งแต่แรก:
      • เวิลด์ไวด์ไวด์เว็บถูกสร้างขึ้นเพื่อแลกเปลี่ยนข้อมูลภายในชุมชนวิทยาศาสตร์อย่างรวดเร็วและง่ายดายเท่านั้น
      • การโฆษณาเป้าหมายถูกใช้เพื่อช่วยธุรกิจ แต่อาจถูกนำไปใช้ในทางที่ผิดในระดับบุคคลหรือระดับรวมได้
      • การเรียนรู้ของเครื่องและการขุดข้อมูลช่วยให้เกิดการนวัตกรรมในการแพทย์ ธุรกิจ และวิทยาศาสตร์ แต่ข้อมูลที่ถูกค้นพบด้วยวิธีนี้ยังถูกนำไปใช้เลือกปฏิบัติต่อกลุ่มคนด้วย
    • IOC-1.B.2 วิธีการบางอย่างที่ใช้นวัตกรรมทางคอมพิวเตอร์อาจส่งผลกระทบต่อสังคม เศรษฐกิจ หรือวัฒนธรรมในทางลบ
    • IOC-1.B.3 นักเขียนโปรแกรมที่มีความรับผิดชอบพยายามพิจารณาถึงความเป็นไปได้ในการใช้งานนวัตกรรมทางคอมพิวเตอร์ในทางที่ไม่ได้ตั้งใจ以及ผลกระทบที่เป็นประโยชน์และอันตรายที่อาจเกิดขึ้นจากการใช้งานรูปแบบใหม่เหล่านี้
    • IOC-1.B.4 เป็นไปไม่ได้ที่นักเขียนโปรแกรมจะพิจารณาถึงทุกวิธีการที่นวัตกรรมทางคอมพิวเตอร์สามารถถูกนำไปใช้ได้
    • IOC-1.B.5 นวัตกรรมทางคอมพิวเตอร์มักจะมีผลกระทบที่เป็นประโยชน์ที่ไม่ได้ตั้งใจไว้通过将leading to advances in other fields.
    • IOC-1.B.6 การแชร์โปรแกรมอย่างรวดเร็วหรือการใช้งานโปรแกรมกับผู้ใช้จำนวนมากอาจส่งผลให้เกิดผลกระทบที่สำคัญเหนือกว่าวัตถุประสงค์ที่ตั้งไว้หรือเหนือกว่าการควบคุมของนักเขียนโปรแกรม

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Every computing innovation can be used in ways that help and ways that harm – often the same technology does both. A social network connects people and can spread misinformation; automation raises productivity and can remove jobs. Effects are frequently unintended: creators cannot foresee every use. When you evaluate a computing innovation, weigh its benefits and harms on people and society, and remember that harms are not always deliberate.

    Computing also generates creativity in other fields, which the CED asks for as a benefit in its own right, not merely as convenience: modelling and imaging in medicine, simulation in engineering, new forms in the arts and music, and new kinds of communication entirely. An innovation's beneficial effects are often in a field far from computing.

    ไทย
    กองขยะอิเล็กทรอนิกส์ — การคำนวณมีทั้งต้นทุนทางสิ่งแวดล้อมและประโยชน์
    กองขยะอิเล็กทรอนิกส์ — การคำนวณมีทั้งต้นทุนทางสิ่งแวดล้อมและประโยชน์

    นวัตกรรมด้านคอมพิวเตอร์ทุกชิ้นสามารถใช้ได้ทั้งในทางที่ ช่วย และทางที่ ทำร้าย – มักจะเป็นเทคโนโลยีเดียวกันที่ทำทั้งสองอย่างเครือข่ายสังคมเชื่อมโยงผู้คน และ สามารถแพร่กระจายข้อมูลเท็จ; การอัตโนมัติเพิ่มประสิทธิภาพ และ อาจทำให้คนตกงาน ผลกระทบมักเป็น ไม่ตั้งใจ: ผู้สร้างไม่สามารถคาดการณ์การใช้งานทุกแบบได้ เมื่อประเมินนวัตกรรมคอมพิวเตอร์ ให้ชั่งน้ำหนักประโยชน์และอันตรายที่มีต่อผู้คนและสังคม และจำไว้ว่าอันตรายไม่ได้เกิดจากความตั้งใจเสมอไป

    การคำนวณส่งผลกระทบต่อสุขภาวะของประชาชนในหลายรูปแบบ
    การคำนวณส่งผลกระทบต่อสุขภาวะของประชาชนในหลายรูปแบบ

    การ計算ยังกระตุ้นความคิดสร้างสรรค์ในสาขาอื่น ๆ ซึ่ง CED ขอให้เป็นประโยชน์ในตัวเอง ไม่ใช่แค่ความสะดวกสบาย: การจำลองและการสร้างภาพใน เวชศาสตร์, การจำลองใน วิศวกรรมศาสตร์, รูปแบบใหม่ใน ศิลปะ และดนตรี, และรูปแบบการ สื่อสาร แบบใหม่ทั้งหมด ประโยชน์ของนวัตกรรมมักอยู่ในสาขาที่ห่างไกลจากการคำนวณมาก

    5.2

    The Digital Divide · ⁨ช่องว่างดิจิทัล⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (IOC-1): While computing innovations are typically designed to achieve a specific purpose, they may have unintended consequences.

    Learning Objective IOC-1.C: Describe issues that contribute to the digital divide. [Skill 5.C]

    • IOC-1.C.1 Internet access varies between socioeconomic, geographic, and demographic characteristics, as well as between countries.
    • IOC-1.C.2 The "digital divide" refers to differing access to computing devices and the Internet, based on socioeconomic, geographic, or demographic characteristics.
    • IOC-1.C.3 The digital divide can affect both groups and individuals.
    • IOC-1.C.4 The digital divide raises issues of equity, access, and influence, both globally and locally.
    • IOC-1.C.5 The digital divide is affected by the actions of individuals, organizations, and governments.
    ไทย

    ความเข้าใจที่ยั่งยืน (IOC-1): แม้ว่าการนวัตกรรมทางคอมพิวเตอร์จะออกแบบมาเพื่อวัตถุประสงค์เฉพาะ แต่อาจมีผลข้างเคียงที่ไม่ได้ตั้งใจไว้

    จุดประสงค์การเรียนรู้ IOC-1.C: อธิบายประเด็นที่ gópส่วนทำให้เกิดช่องว่างดิจิทัล [ทักษะ 5.C]

    • IOC-1.C.1 การเข้าถึงอินเทอร์เน็ตแตกต่างกันไปตามลักษณะทางสังคมเศรษฐกิจภูมิศาสตร์และประชากร รวมถึงระหว่างประเทศด้วย
    • IOC-1.C.2 "ช่องว่างดิจิทัล" หมายถึงความแตกต่างในการเข้าถึงอุปกรณ์คอมพิวเตอร์และอินเทอร์เน็ต ซึ่งขึ้นอยู่กับลักษณะทางสังคมเศรษฐกิจ ภูมิศาสตร์ หรือประชากร
    • IOC-1.C.3 ช่องว่างดิจิทัลสามารถส่งผลกระทบต่อทั้งกลุ่มและบุคคล
    • IOC-1.C.4 ช่องว่างดิจิทัลยกประเด็นเรื่องความเสมอภาค การเข้าถึง และการมีอิทธิพล ทั้งในระดับโลกและท้องถิ่น
    • IOC-1.C.5 ช่องว่างดิจิทัลได้รับผลกระทบจากการกระทำของบุคคล องค์กร และรัฐบาล

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    The digital divide 数字鸿沟 is the unequal access to computing and the Internet across groups – by income, geography, age, or country. Those with access gain education, jobs, and services; those without fall further behind. The divide is shaped by economic, social, and geographic factors, and efforts to close it (affordable devices, public access, infrastructure) aim to make computing's benefits fairer.

    ไทย

    ช่องว่างดิจิทัล คือการเข้าถึงคอมพิวเตอร์และอินเทอร์เน็ตที่ไม่เท่าเทียมกันระหว่างกลุ่ม – ตามรายได้, geografy, อายุ หรือประเทศ คนที่มีเข้าถึงได้รับการศึกษา งาน และบริการ; คนที่ไม่มีตามหลังมากขึ้น ช่องว่างนี้ถูกกำหนดโดยปัจจัยทางเศรษฐกิจ สังคม และภูมิศาสตร์ และความพยายามในการลดช่องว่างนี้ (อุปกรณ์ที่จับต้องได้, การเข้าถึงสาธารณะ, زیرโครงสร้าง) มุ่งหวังให้ประโยชน์ของการคำนวณเป็นธรรมยิ่งขึ้น

    คอมพิวเตอร์ในห้องสมุดสาธารณะ: ช่องว่างดิจิทัลเกี่ยวกับการเข้าถึงอุปกรณ์ การเชื่อมต่อและทักษะที่ไม่เท่าเทียม
    คอมพิวเตอร์ในห้องสมุดสาธารณะ: ช่องว่างดิจิทัลเกี่ยวกับการเข้าถึงอุปกรณ์ การเชื่อมต่อและทักษะที่ไม่เท่าเทียม
    จานดาวเทียมในพื้นที่ชนบท: ภูมิศาสตร์ยังคงกำหนดใครได้ اینترنتเร็วและใครต้องรอ
    จานดาวเทียมในพื้นที่ชนบท: ภูมิศาสตร์ยังคงกำหนดใครได้ اینترنتเร็วและใครต้องรอ
    5.3

    Computing Bias · ⁨ความลำเอียงในการคำนวณ⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (IOC-1): While computing innovations are typically designed to achieve a specific purpose, they may have unintended consequences.

    Learning Objective IOC-1.D: Explain how bias exists in computing innovations. [Skill 5.E]

    • IOC-1.D.1 Computing innovations can reflect existing human biases because of biases written into the algorithms or biases in the data used by the innovation.
    • IOC-1.D.2 Programmers should take action to reduce bias in algorithms used for computing innovations as a way of combating existing human biases.
    • IOC-1.D.3 Biases can be embedded at all levels of software development.
    ไทย

    ความเข้าใจที่ยั่งยืน (IOC-1): แม้ว่าการนวัตกรรมทางคอมพิวเตอร์จะออกแบบมาเพื่อวัตถุประสงค์เฉพาะ แต่อาจมีผลข้างเคียงที่ไม่ได้ตั้งใจไว้

    จุดประสงค์การเรียนรู้ IOC-1.D: อธิบายว่าความลำเอียงมีอยู่ในนวัตกรรมทางเทคโนโลยีอย่างไร [ทักษะ 5.E]

    • IOC-1.D.1 นวัตกรรมทางเทคโนโลยีสามารถสะท้อนความลำเอียงที่มีอยู่ของมนุษย์ได้ เนื่องจากความลำเอียงที่ถูกฝังอยู่ในอัลกอริทึมหรือความลำเอียงในข้อมูลที่นวัตกรรมนั้นใช้
    • IOC-1.D.2 นักเขียนโปรแกรมควรดำเนินการเพื่อลดความลำเอียงในอัลกอริทึมที่ใช้สำหรับนวัตกรรมทางเทคโนโลยี เพื่อเป็นการต่อต้านความลำเอียงที่มีอยู่ของมนุษย์
    • IOC-1.D.3 ความลำเอียงสามารถฝังอยู่ในทุกระดับของการพัฒนาซอฟต์แวร์

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Bias 偏见 can be built into computing systems – often unintentionally. If the data used to build a system reflects existing prejudice, or if the designers' assumptions are one-sided, the system can produce unfair results (for example, a hiring tool that favors one group). Bias can enter at every stage – data collection, design, and use – so systems should be tested for fairness across different groups. Recognizing that "the computer said so" is not the same as "fair" is an important habit.

    ไทย
    รถยนต์ไร้คนขับบนถนนในเมือง – ระบบอัตโนมัติตั้งคำถามเรื่องความปลอดภัยและความลำเอียง
    รถยนต์ไร้คนขับบนถนนในเมือง – ระบบอัตโนมัติตั้งคำถามเรื่องความปลอดภัยและความลำเอียง

    ความลำเอียง สามารถฝังอยู่ในระบบการคำนวณ – มักโดยไม่ตั้งใจ หาก ข้อมูล ที่ใช้สร้างระบบสะท้อนอคติที่มีอยู่ หรือหากสมมติฐานของนักออกแบบมีมุมมองด้านเดียว ระบบอาจ产生ผลลัพธ์ที่ ไม่เป็นธรรม (เช่น เครื่องมือสรรหาบุคคลที่เลือกกลุ่มหนึ่ง) ความลำเอียงสามารถเกิดขึ้นได้ในทุกขั้นตอน – การเก็บข้อมูล การออกแบบ และการใช้งาน ดังนั้นควรทดสอบระบบเพื่อหาความเป็นธรรมในกลุ่มต่างๆ การตระหนักว่า "คอมพิวเตอร์บอก vậy" ไม่เท่ากับ "เป็นธรรม" เป็นนิสัยที่สำคัญ

    5.4

    Crowdsourcing · ⁨การระดมสมองจากฝูงชน⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (IOC-1): While computing innovations are typically designed to achieve a specific purpose, they may have unintended consequences.

    Learning Objective IOC-1.E: Explain how people participate in problem-solving processes at scale. [Skill 1.C]

    • IOC-1.E.1 Widespread access to information and public data facilitates the identification of problems, development of solutions, and dissemination of results.
    • IOC-1.E.2 Science has been affected by using distributed and "citizen science" to solve scientific problems.
    • IOC-1.E.3 Citizen science is scientific research conducted in whole or part by distributed individuals, many of whom may not be scientists, who contribute relevant data to research using their own computing devices.
    • IOC-1.E.4 Crowdsourcing is the practice of obtaining input or information from a large number of people via the Internet.
    • IOC-1.E.5 Human capabilities can be enhanced by collaboration via computing.
    • IOC-1.E.6 Crowdsourcing offers new models for collaboration, such as connecting businesses or social causes with funding.
    ไทย

    ความเข้าใจที่ยั่งยืน (IOC-1): แม้ว่าการนวัตกรรมทางคอมพิวเตอร์จะออกแบบมาเพื่อวัตถุประสงค์เฉพาะ แต่อาจมีผลข้างเคียงที่ไม่ได้ตั้งใจไว้

    จุดประสงค์การเรียนรู้ IOC-1.E: อธิบายว่าผู้คนมีส่วนร่วมในกระบวนการแก้ปัญหาในระดับกว้างได้อย่างไร [ทักษะ 1.C]

    • IOC-1.E.1 การเข้าถึงข้อมูลและข้อมูลสาธารณะอย่างแพร่หลายช่วยให้ระบุปัญหา พัฒนาโซลูชัน และเผยแพร่ผลลัพธ์ได้ง่ายขึ้น
    • IOC-1.E.2 วิทยาศาสตร์ได้รับผลกระทบจากการใช้ระบบกระจายและ "วิทยาศาสตร์พลเมือง" ในการแก้ปัญหาทางวิทยาศาสตร์
    • IOC-1.E.3 วิทยาศาสตร์พล citizen science คือการวิจัยทางวิทยาศาสตร์ที่ดำเนินการทั้งหมดหรือบางส่วนโดยบุคคลที่กระจายตัว ซึ่งหลายคนอาจไม่ใช่ scientifique ที่ให้ข้อมูลที่เกี่ยวข้องกับการวิจัยโดยใช้อุปกรณ์คอมพิวเตอร์ของตนเอง
    • IOC-1.E.4 Crowdsourcing คือการรับข้อมูลหรือความคิดเห็นจากผู้คนจำนวนมากผ่านอินเทอร์เน็ต
    • IOC-1.E.5 ศักยภาพของมนุษย์สามารถได้รับการเสริมสร้างผ่านการร่วมมือกันผ่านเทคโนโลยี
    • IOC-1.E.6 Crowdsourcing นำเสนอรูปแบบใหม่สำหรับการร่วมมือกัน เช่น การเชื่อมโยงธุรกิจหรือ cause与社会 funding

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Crowdsourcing 众包 obtains input, ideas, or funding from a large group of people, usually online. It harnesses the knowledge and effort of many – mapping projects, product reviews, citizen science, and crowdfunding all rely on it. The Internet makes crowdsourcing possible at a scale and speed never before achievable, letting a project draw on contributors worldwide.

    ไทย

    Crowdsourcing รวบรวมข้อมูลความคิดเห็นหรือเงินทุนจาก กลุ่มคนจำนวนมาก โดยทั่วไปออนไลน์ มันใช้ความรู้และความพยายามของหลายคน – โครงการทำแผนที่ รีวิวสินค้า วิทยาศาสตร์พลเมือง และ crowdfunding ล้วนพึ่งพามัน อินเทอร์เน็ตทำให้ crowdsourcing เป็นไปได้ในระดับและความเร็วที่เคยไม่มีมาก่อน ทำให้โครงการดึงผู้มีส่วนร่วมจากทั่วโลกมา共同参与ได้

    Wikipedia edit-a-thon: crowdsourcing รวมงานของคนจำนวนมากเข้าเป็นทรัพยากรร่วมกัน
    Wikipedia edit-a-thon: crowdsourcing รวมงานของคนจำนวนมากเข้าเป็นทรัพยากรร่วมกัน
    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    Crowdsourcing/ˈkraʊdsɔːsɪŋ/ Crowdsourcing
    Intellectual property/ˌɪntəˈlektʃuːəl ˈprɒpəti/ ทรัพย์สินทางปัญญา
    copyright/ˈkɒpɪraɪt/ ลิขสิทธิ์
    5.5

    Legal and Ethical Concerns · ⁨ข้อกังวลด้านกฎหมายและจริยธรรม⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (IOC-1): While computing innovations are typically designed to achieve a specific purpose, they may have unintended consequences.

    Learning Objective IOC-1.F: Explain how the use of computing can raise legal and ethical concerns. [Skill 5.E]

    • IOC-1.F.1 Material created on a computer is the intellectual property of the creator or an organization.
    • IOC-1.F.2 Ease of access and distribution of digitized information raises intellectual property concerns regarding ownership, value, and use.
    • IOC-1.F.3 Measures should be taken to safeguard intellectual property.
    • IOC-1.F.4 The use of material created by someone else without permission and presented as one's own is plagiarism and may have legal consequences.
    • IOC-1.F.5 Some examples of legal ways to use materials created by someone else include:
      • Creative Commons—a public copyright license that enables the free distribution of an otherwise copyrighted work. This is used when the content creator wants to give others the right to share, use, and build upon the work they have created.
      • open source—programs that are made freely available and may be redistributed and modified
      • open access—online research output free of any and all restrictions on access and free of many restrictions on use, such as copyright or license restrictions
    • IOC-1.F.6 The use of material created by someone other than you should always be cited.
    • IOC-1.F.7 Creative Commons, open source, and open access have enabled broad access to digital information.
    • IOC-1.F.8 As with any technology or medium, using computing to harm individuals or groups of people raises legal and ethical concerns.
    • IOC-1.F.9 Computing can play a role in social and political issues, which in turn often raises legal and ethical concerns.
    • IOC-1.F.10 The digital divide raises ethical concerns around computing.
    • IOC-1.F.11 Computing innovations can raise legal and ethical concerns. Some examples of these include:
      • the development of software that allows access to digital media downloads and streaming
      • the development of algorithms that include bias
      • the existence of computing devices that collect and analyze data by continuously monitoring activities
    ไทย

    ความเข้าใจที่ยั่งยืน (IOC-1): แม้ว่าการนวัตกรรมทางคอมพิวเตอร์จะออกแบบมาเพื่อวัตถุประสงค์เฉพาะ แต่อาจมีผลข้างเคียงที่ไม่ได้ตั้งใจไว้

    จุดประสงค์การเรียนรู้ IOC-1.F: อธิบายว่าการใช้เทคโนโลยีสามารถก่อให้เกิดข้อกังวลด้านกฎหมายและจริยธรรมได้อย่างไร [ทักษะ 5.E]

    • IOC-1.F.1 วัสดุที่สร้างบนคอมพิวเตอร์เป็นทรัพย์สินทางปัญญาของผู้สร้างหรือองค์กร
    • IOC-1.F.2 ความง่ายในการเข้าถึงและการจัดจำหน่ายข้อมูลดิจิทัล ทำให้เกิดข้อกังวลด้านทรัพย์สินทางปัญญาเกี่ยวกับความเป็นเจ้าของ มูลค่า และการใช้งาน
    • IOC-1.F.3 ควร採取 Measures เพื่อปกป้องทรัพย์สินทางปัญญา
    • IOC-1.F.4 การใช้วัสดุที่สร้างโดยผู้อื่นโดยไม่ได้รับอนุญาตและนำเสนอว่าเป็นผลงานของตนเองเรียกว่าการก๊อปปี้งาน (plagiarism) และอาจมีผลทางกฎหมาย
    • IOC-1.F.5 ตัวอย่างบางประการของการใช้วัสดุที่สร้างโดยผู้อื่นอย่างถูกต้องตามกฎหมาย ได้แก่:
      • Creative Commons — ลิขสิทธิ์สาธารณะที่อนุญาตให้กระจายผลงานที่มีลิขสิทธิ์ได้อย่างอิสระ โดยมักใช้เมื่อผู้สร้างเนื้อหาต้องการมอบสิทธิ์ให้ผู้อื่นในการแชร์ ใช้งาน และพัฒนาต่อจากผลงานของตน
      • Open source — โปรแกรมที่ถูกเปิดเผยให้ใช้งานฟรี สามารถนำกลับมาแจกจ่ายใหม่และดัดแปลงแก้ไขได้
      • Open access — ผลงานวิจัยออนไลน์ที่เข้าถึงได้โดยไม่มีการจำกัดใดๆ และได้รับอนุญาตให้ใช้งานโดยไม่มีข้อจำกัดด้านลิขสิทธิ์หรือใบอนุญาตมากนัก
    • IOC-1.F.6 การใช้วัสดุที่สร้างโดยบุคคลอื่นที่ไม่ใช่ตัวคุณเองควรต้องมีการอ้างอิงเสมอ
    • IOC-1.F.7 Creative Commons, open source และ open access ได้เปิดโอกาสให้เข้าถึงข้อมูลดิจิทัลในวงกว้าง
    • IOC-1.F.8 เหมือนกับเทคโนโลยีหรือสื่ออื่นๆ การใช้คอมพิวเตอร์เพื่อทำร้ายบุคคลหรือกลุ่มคนนั้นๆ ย่อมก่อให้เกิดประเด็นทางกฎหมายและจริยธรรม
    • IOC-1.F.9 คอมพิวเตอร์สามารถมีส่วนร่วมในประเด็นทางสังคมและการเมือง ซึ่งในทางกลับกันมักจะทำให้เกิดประเด็นทางกฎหมายและจริยธรรมตามไปด้วย
    • IOC-1.F.10 ช่องว่างระหว่างผู้เข้าถึงเทคโนโลยีดิจิทัล (digital divide) ก่อให้เกิดประเด็นทางจริยธรรมเกี่ยวกับคอมพิวเตอร์
    • IOC-1.F.11 นวัตกรรมทางคอมพิวเตอร์อาจก่อให้เกิดประเด็นทางกฎหมายและจริยธรรม ตัวอย่างเช่น:
      • การพัฒนาซอฟต์แวร์ที่อนุญาตให้เข้าถึงการดาวน์โหลดและสตรีมมิ่งสื่อดิจิทัล
      • การพัฒนาอัลกอริทึมที่แฝงความลำเอียง (bias) ไว้ด้วย
      • การมีอยู่ของอุปกรณ์คอมพิวเตอร์ที่เก็บรวบรวมและวิเคราะห์ข้อมูลโดยการติดตามกิจกรรมอย่างต่อเนื่อง

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Computing raises questions of law and ethics:

    • Intellectual property 知识产权 and copyright 版权 protect creators' work; using it may require permission or a license. Open-source 开源 and Creative Commons licenses let creators share work under stated terms.
    • Plagiarism 抄袭 – using others' work as your own – is unethical and often illegal.
    • Collecting and using personal data raises privacy questions about consent and misuse.

    The three "open" terms, which are not the same thing

    Term What it means
    open source programs that are made freely available and may be redistributed and modified by anyone. The licence grants those rights explicitly — free of charge is not the same as open source, and a free program you may not modify is not open source.
    open access 开放获取 research and other content made available online without charge, so a reader does not need a subscription. It says nothing about the right to modify.
    Creative Commons 知识共享 a family of licences a creator applies to their own work to grant specific permissions in advance — for example "you may reuse this if you credit me" or "you may reuse this but not commercially".

    All three are ways of granting rights the creator holds by default under copyright. That is why they matter for the exam: copyright is automatic, so anything not explicitly licensed is restricted, and using it needs permission.

    Just because something is technically possible does not make it legal or ethical.

    What is recorded while you browse

    Two collection routes the CED names, and neither needs you to type anything:

    • Websites can record and maintain a history of the individuals who have viewed their pages — which pages, when, how long, and from which device.
    • Search engines can use your search history to suggest websites, and to sell targeted marketing: the advertisement follows the search, which is why a product looked up once then appears for weeks.

    Neither is inherently malicious, and both are the mechanism behind services people find useful. The point the exam wants is that data collected for one purpose can be combined and used for another, often without the person realising they agreed to it.

    ไทย
    ห้องควบคุม CCTV: ระบบเฝ้าระวังแลกเปลี่ยนผลประโยชน์ด้านความปลอดภัยกับความกังวลเรื่องความเป็นส่วนตัว
    ห้องควบคุม CCTV: ระบบเฝ้าระวังแลกเปลี่ยนผลประโยชน์ด้านความปลอดภัยกับความกังวลเรื่องความเป็นส่วนตัว

    การ計算ตั้งคำถามด้านกฎหมายและจริยธรรม:

    • ทรัพย์สินทางปัญญา และ ลิขสิทธิ์ ปกป้องผลงานของผู้สร้าง; การใช้อาจต้องการอนุญาตหรือใบอนุญาต Open-source และ Creative Commons Licenses ช่วยให้ผู้สร้างแชร์งานภายใต้เงื่อนไขที่กำหนดไว้
    • การลอกเลียนแบบ – ใช้ผลงานคนอื่นเป็นของตัวเอง – เป็นสิ่งที่ไม่ถูกต้องและมักผิดกฎหมาย
    • การรวบรวมและใช้ข้อมูลส่วนตัวสร้างความ ความเป็นส่วนตัว เกี่ยวกับฉันทามติและการใช้ที่ไม่เหมาะสม

    คำว่า "เปิด" ทั้งสามคำ ซึ่งไม่เหมือนกัน

    คำศัพท์ ความหมาย
    open source โปรแกรมที่ถูก เผยแพร่ฟรีและสามารถจัดจำหน่ายใหม่และแก้ไขได้ โดยทุกคน ใบอนุญาตมอบสิทธิ์เหล่านั้นอย่างชัดเจน – gratis ไม่ได้เท่ากับ open source และโปรแกรมฟรีที่คุณแก้ไขไม่ได้ก็ไม่算是 open source.
    open access งานวิจัยและเนื้อหาอื่นๆ ที่ เผยแพร่ออนไลน์โดยไม่มีค่าใช้จ่าย sehinggaผู้อ่านไม่ต้องสมัครสมาชิก มันไม่ได้กล่าวถึงสิทธิ์ในการแก้ไข
    Creative Commons ครอบครัวของใบอนุญาตที่ผู้สร้างนำไปใช้กับผลงานของตนเองเพื่อมอบสิทธิ์เฉพาะล่วงหน้า – เช่น "คุณสามารถนำกลับมาใช้ใหม่ได้หากยกย่องฉัน" หรือ "คุณสามารถนำกลับมาใช้ใหม่ได้แต่ไม่ใช่เชิงพาณิชย์"

    ทั้งสามเป็นวิธีการ มอบสิทธิ์ ที่ผู้สร้างมีโดยปกติตามกฎหมายลิขสิทธิ์ นั่นคือเหตุผลที่มันสำคัญสำหรับการสอบ: ลิขสิทธิ์เกิดขึ้นโดยอัตโนมัติ ดังนั้นสิ่งที่ไม่มีใบอนุญาตชัดเจนจะจำกัดการใช้ และต้องใช้สิทธิ์ในการใช้

    เพียงเพราะสิ่งใดทำได้ทางเทคนิค并不意味着它是合法的或合乎道德的。

    สิ่งที่บันทึกไว้ขณะคุณท่องเว็บ

    สองช่องทางجمعข้อมูลที่ CED ระบุ และทั้งสองอย่างไม่ต้องพิมพ์อะไรเลย:

    • เว็บไซต์สามารถบันทึกและรักษาประวัติของบุคคลที่ได้ดูหน้าเว็บของตน – หน้าไหน, เมื่อไหร่, นานแค่ไหน, และจากอุปกรณ์ใด
    • เครื่องค้นหาข้อมูลสามารถใช้งานประวัติการค้นหาของคุณ เพื่อเสนอเว็บไซต์ และเพื่อทำ การตลาดแบบเจาะจง: การโฆษณาจะติดตามตามการค้นหานั้น ซึ่งนี่คือเหตุผลว่าทำไมสินค้าที่คุณเคยค้นหาครั้งหนึ่งจึงปรากฏตัวต่อเป็นสัปดาห์

    ทั้งสองอย่างไม่ได้มีเจตนาชั่วร้ายโดยธรรมชาติ และทั้งสองเป็นกลไกเบื้องหลังบริการที่ผู้คนพบว่ามีประโยชน์ จุดสำคัญที่ข้อสอบต้องการคือ ข้อมูลที่เก็บรวบรวมไว้เพื่อวัตถุประสงค์หนึ่งสามารถนำมารวมและนำไปใช้为目的อื่นได้ มักโดยไม่ที่บุคคลนั้นตระหนักว่าตนเองได้ยินยอมในสิ่งนั้น

    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    Open-source/ˈəʊpən sɔːs/ ซอร์สโค้ดเปิด
    Plagiarism/ˈpleɪdʒərɪzəm/ การลอกเลียนแบบ
    open access/ˈəʊpən ˈækses/ การเข้าถึงแบบเปิด
    Creative Commons/kriːˈeɪtɪv ˈkɒmənz/ ครีเอทีฟคอมมอนส์
    Personally identifiable information (PII)/ˈpɜːsənəli aɪˈdentɪfaɪəbl ˌɪnfəˈmeɪʃn/ ข้อมูลระบุตัวตนส่วนบุคคล (PII)
    identity theft/aɪˈdentɪti θeft/ การขโมยตัวตน
    open source/ˈəʊpən sɔːs/ open source
    5.6

    Safe Computing · ⁨การคำนวณที่ปลอดภัย⁩

    Syllabus · ⁨หลักสูตร⁩
    English

    Enduring Understanding (IOC-2): The use of computing innovations may involve risks to personal safety and identity.

    Learning Objective IOC-2.A: Describe the risks to privacy from collecting and storing personal data on a computer system. [Skill 5.D]

    • IOC-2.A.1 Personally identifiable information (PII) is information about an individual that identifies, links, relates, or describes them. Examples of PII include:
      • Social Security number
      • age
      • race
      • phone number(s)
      • medical information
      • financial information
      • biometric data
    • IOC-2.A.2 Search engines can record and maintain a history of searches made by users.
    • IOC-2.A.3 Websites can record and maintain a history of individuals who have viewed their pages.
    • IOC-2.A.4 Devices, websites, and networks can collect information about a user's location.
    • IOC-2.A.5 Technology enables the collection, use, and exploitation of information about, by, and for individuals, groups, and institutions.
    • IOC-2.A.6 Search engines can use search history to suggest websites or for targeted marketing.
    • IOC-2.A.7 Disparate personal data, such as geolocation, cookies, and browsing history, can be aggregated to create knowledge about an individual.
    • IOC-2.A.8 PII and other information placed online can be used to enhance a user's online experiences.
    • IOC-2.A.9 PII stored online can be used to simplify making online purchases.
    • IOC-2.A.10 Commercial and governmental curation of information may be exploited if privacy and other protections are ignored.
    • IOC-2.A.11 Information placed online can be used in ways that were not intended and that may have a harmful impact. For example, an email message may be forwarded, tweets can be retweeted, and social media posts can be viewed by potential employers.
    • IOC-2.A.12 PII can be used to stalk or steal the identity of a person or to aid in the planning of other criminal acts.
    • IOC-2.A.13 Once information is placed online, it is difficult to delete.
    • IOC-2.A.14 Programs can collect your location and record where you have been, how you got there, and how long you were at a given location.
    • IOC-2.A.15 Information posted to social media services can be used by others. Combining information posted on social media and other sources can be used to deduce private information about you.

    Learning Objective IOC-2.B: Explain how computing resources can be protected and can be misused. [Skill 5.E]

    • IOC-2.B.1 Authentication measures protect devices and information from unauthorized access. Examples of authentication measures include strong passwords and multifactor authentication.
    • IOC-2.B.2 A strong password is something that is easy for a user to remember but would be difficult for someone else to guess based on knowledge of that user.
    • IOC-2.B.3 Multifactor authentication is a method of computer access control in which a user is only granted access after successfully presenting several separate pieces of evidence to an authentication mechanism, typically in at least two of the following categories: knowledge (something they know), possession (something they have), and inherence (something they are).
    • IOC-2.B.4 Multifactor authentication requires at least two steps to unlock protected information; each step adds a new layer of security that must be broken to gain unauthorized access.
    • IOC-2.B.5 Encryption is the process of encoding data to prevent unauthorized access. Decryption is the process of decoding the data. Two common encryption approaches are:
      • Symmetric key encryption involves one key for both encryption and decryption.
      • Public key encryption pairs a public key for encryption and a private key for decryption. The sender does not need the receiver's private key to encrypt a message, but the receiver's private key is required to decrypt the message.
      • Exclusion statement (EK IOC-2.B.5): Specific mathematical procedures for encryption and decryption are beyond the scope of this course and the AP Exam.
    • IOC-2.B.6 Certificate authorities issue digital certificates that validate the ownership of encryption keys used in secure communications and are based on a trust model.
    • IOC-2.B.7 Computer virus and malware scanning software can help protect a computing system against infection.
    • IOC-2.B.8 A computer virus is a malicious program that can copy itself and gain access to a computer in an unauthorized way. Computer viruses often attach themselves to legitimate programs and start running independently on a computer.
    • IOC-2.B.9 Malware is software intended to damage a computing system or to take partial control over its operation.
    • IOC-2.B.10 All real-world systems have errors or design flaws that can be exploited to compromise them. Regular software updates help fix errors that could compromise a computing system.
    • IOC-2.B.11 Users can control the permissions programs have for collecting user information. Users should review the permission settings of programs to protect their privacy.

    Learning Objective IOC-2.C: Explain how unauthorized access to computing resources is gained. [Skill 5.E]

    • IOC-2.C.1 Phishing is a technique that attempts to trick a user into providing personal information. That personal information can then be used to access sensitive online resources, such as bank accounts and emails.
    • IOC-2.C.2 Keylogging is the use of a program to record every keystroke made by a computer user in order to gain fraudulent access to passwords and other confidential information.
    • IOC-2.C.3 Data sent over public networks can be intercepted, analyzed, and modified. One way that this can happen is through a rogue access point.
    • IOC-2.C.4 A rogue access point is a wireless access point that gives unauthorized access to secure networks.
    • IOC-2.C.5 A malicious link can be disguised on a web page or in an email message.
    • IOC-2.C.6 Unsolicited emails, attachments, links, and forms in emails can be used to compromise the security of a computing system. These can come from unknown senders or from known senders whose security has been compromised.
    • IOC-2.C.7 Untrustworthy (often free) downloads from freeware or shareware sites can contain malware.
    ไทย

    ความเข้าใจที่ยั่งยืน (IOC-2): การใช้ inovasiทางคอมพิวเตอร์อาจมีความเสี่ยงต่อความปลอดภัยส่วนบุคคลและตัวตน

    วัตถุประสงค์การเรียนรู้ IOC-2.A: อธิบายความเสี่ยงด้านความเป็นส่วนตัวจากการเก็บรวบรวมและจัดเก็บข้อมูลส่วนบุคคลบนระบบคอมพิวเตอร์ [ทักษะ 5.D]

    • IOC-2.A.1 ข้อมูลที่ระบุตัวตนได้ (PII) คือข้อมูลเกี่ยวกับบุคคลที่ระบุ เชื่อมโยง关联 Relate หรืออธิบายบุคคลนั้น Regex Examples of PII include:
      • เลขประจำตัวประชาชน
      • อายุ
      • เชื้อชาติ
      • เบอร์โทรศัพท์
      • ข้อมูลทางการแพทย์
      • ข้อมูลทางการเงิน
      • ข้อมูลชีวภาพ (biometric data)
    • IOC-2.A.2 เครื่องค้นหาสามารถบันทึกและรักษาประวัติการค้นหาของผู้ใช้ไว้ได้
    • IOC-2.A.3 เว็บไซต์สามารถบันทึกและรักษาประวัติของบุคคลที่เคยดูหน้าเว็บของตนไว้ได้
    • IOC-2.A.4 อุปกรณ์ เว็บไซต์ และเครือข่ายสามารถเก็บรวบรวมข้อมูลเกี่ยวกับตำแหน่งที่ตั้งของผู้ใช้ได้
    • IOC-2.A.5 เทคโนโลยีทำให้สามารถเก็บรวบรวม ใช้งาน และแสวงหาประโยชน์จากข้อมูลเกี่ยวกับ โดย และเพื่อบุคคล กลุ่ม และสถาบันต่างๆ ได้
    • IOC-2.A.6 เครื่องค้นหาสามารถใช้ประวัติการค้นหาเพื่อแนะนำเว็บไซต์หรือสำหรับการตลาดแบบกำหนดเป้าหมาย
    • IOC-2.A.7 ข้อมูลส่วนบุคคลที่แตกต่างกัน เช่น ตำแหน่งที่ตั้ง ไฟ-cookie และประวัติการท่องเว็บ สามารถถูกรวมเข้าด้วยกันเพื่อสร้างความรู้เกี่ยวกับบุคคลหนึ่ง
    • IOC-2.A.8 PII และข้อมูลอื่นๆ ที่วางลงบนอินเทอร์เน็ตสามารถนำไปใช้เพื่อปรับปรุงประสบการณ์การใช้งานออนไลน์ของผู้ใช้
    • IOC-2.A.9 PII ที่จัดเก็บออนไลน์สามารถนำไปใช้เพื่อให้การทำธุรกรรมซื้อของออนไลน์ง่ายขึ้น
    • IOC-2.A.10 การคัดกรองข้อมูลโดยภาคธุรกิจและภาครัฐอาจถูกแสวงหาประโยชน์หากละเลยเรื่องความเป็นส่วนตัวและการป้องกันอื่นๆ
    • IOC-2.A.11 ข้อมูลที่วางลงบนอินเทอร์เน็ตสามารถนำไปใช้ในวิธีที่ไม่ได้ตั้งใจไว้และอาจส่งผลกระทบที่เป็นอันตราย ตัวอย่างเช่น อีเมลอาจถูกส่งต่อ ทวีตสามารถถูกรีทวีต และโพสต์โซเชียลมีเดียอาจถูกมองเห็นโดยนายจ้างในอนาคต
    • IOC-2.A.12 PII สามารถถูกนำไปใช้เพื่อกวนรบกวนหรือขโมยตัวตนของบุคคล หรือช่วยในการวางแผนอาชญากรรมอื่นๆ
    • IOC-2.A.13 เมื่อข้อมูลถูกวางลงบนอินเทอร์เน็ตแล้ว จะยากต่อการลบออก
    • IOC-2.A.14 โปรแกรมสามารถเก็บรวบรวมตำแหน่งของคุณและบันทึกสถานที่ที่คุณเคยไป วิธีที่คุณเดินทางไปถึง และระยะเวลาที่คุณ滞在 ณ สถานที่ใดสถานที่หนึ่ง
    • IOC-2.A.15 ข้อมูลที่โพสต์ลงบนบริการโซเชียลมีเดียสามารถถูก其他人ใช้ การรวมข้อมูลจากโซเชียลมีเดียกับแหล่งข้อมูลอื่นสามารถนำไปใช้เพื่ออนุมานข้อมูลส่วนตัวเกี่ยวกับคุณได้

    วัตถุประสงค์การเรียนรู้ IOC-2.B: อธิบายว่าทรัพยากรคอมพิวเตอร์สามารถปกป้องและถูกนำไปใช้ในทางที่ผิดได้อย่างไร [ทักษะ 5.E]

    • IOC-2.B.1 มาตรการยืนยันตัวตนช่วยปกป้องอุปกรณ์และข้อมูลจากการเข้าถึงโดยไม่ได้รับอนุญาต ตัวอย่างของมาตรการยืนยันตัวตนได้แก่ รหัสผ่านที่แข็งแรงและการยืนยันตัวตนหลายขั้นตอน
    • IOC-2.B.2 รหัสผ่านที่แข็งแรงคือสิ่งที่ผู้ใช้จดจำได้ง่ายแต่จะยากสำหรับผู้อื่นที่จะเดาได้โดยใช้ความรู้เกี่ยวกับผู้ใช้นั้น
    • IOC-2.B.3 การยืนยันตัวตนหลายขั้นตอน (Multifactor authentication) เป็นวิธีการควบคุมการเข้าถึงคอมพิวเตอร์ที่ผู้ใช้จะได้รับสิทธิ์เข้าถึงก็ต่อเมื่อนำเสนอหลักฐานแยกต่างหากอย่างน้อยสองรายการต่อกลไกการยืนยันตัวตน โดยทั่วไปแบ่งเป็นอย่างน้อยสองหมวดหมู่ต่อไปนี้: ความรู้ (สิ่งที่เขาทราบ), การถือครอง (สิ่งที่เขามี), และลักษณะเฉพาะ (สิ่งที่เขาเป็น)
    • IOC-2.B.4 การยืนยันตัวตนหลายขั้นตอนต้องใช้อย่างน้อยสองขั้นตอนในการปลดล็อกข้อมูลที่ป้องกันไว้; แต่ละขั้นตอนเพิ่มชั้นความปลอดภัยใหม่ที่ต้องถูกทำลายเพื่อเข้าถึงโดยไม่ได้รับอนุญาต
    • IOC-2.B.5 การเข้ารหัส (Encryption) คือกระบวนการแปลงข้อมูลให้เป็นรหัสเพื่อป้องกันการเข้าถึงโดยไม่ได้รับอนุญาต การถอดรหัส (Decryption) คือกระบวนการแปลงข้อมูลกลับเป็นรูปต้นฉบับTwo common encryption approaches are:
      • การเข้ารหัสด้วยกุญแจแบบสมมาตร (Symmetric key encryption) ใช้กุญแจเดียวทั้งสำหรับการเข้ารหัสและการถอดรหัส
      • การเข้ารหัสด้วยกุญแจสาธารณะ (Public key encryption) จับคู่กุญแจสาธารณะสำหรับการเข้ารหัสกับกุญแจส่วนตัวสำหรับการถอดรหัส ผู้ส่งไม่จำเป็นต้องใช้กุญแจส่วนตัวของผู้รับในการเข้ารหัสข้อความ แต่ผู้รับจำเป็นต้องใช้กุญแจส่วนตัวของตนเองในการถอดรหัสข้อความ
      • ข้อยกเว้น (EK IOC-2.B.5): กระบวนการทางคณิตศาสตร์เฉพาะสำหรับการเข้ารหัสและการถอดรหัสอยู่นอกขอบเขตของหลักสูตรนี้และข้อสอบ AP
    • IOC-2.B.6 หน่วยงานออกใบรับรองดิจิทัล (Certificate Authorities) ออกใบรับรองดิจิทัลเพื่อยืนยันการเป็นเจ้าของกุญแจเข้ารหัสที่ใช้ในการสื่อสารที่ปลอดภัย และทำงานภายใต้โมเดลความเชื่อถือ
    • IOC-2.B.7 โปรแกรมสแกนไวรัสและมัลแวร์ในคอมพิวเตอร์สามารถช่วยปกป้องระบบคอมพิวเตอร์จากการติดเชื้อได้
    • IOC-2.B.8 ไวรัสคอมพิวเตอร์ คือโปรแกรมร้ายแรงที่สามารถคัดลอกตัวเองและเข้าถึงคอมพิวเตอร์โดยมิได้รับอนุญาต มักจะติดอยู่กับโปรแกรมที่ถูกกฎหมายและเริ่มทำงานอย่างอิสระบนคอมพิวเตอร์
    • IOC-2.B.9 มัลแวร์ คือซอฟต์แวร์ที่มีเจตนาทำลายระบบคอมพิวเตอร์หรือควบคุมการทำงานของระบบบางส่วน
    • IOC-2.B.10 ระบบในโลกจริงทั้งหมดมีข้อผิดพลาดหรือช่องโหว่ในการออกแบบซึ่งอาจถูกใช้เพื่อโจมตีระบบได้ การอัปเดตซอฟต์แวร์เป็นประจำช่วยแก้ไขข้อผิดพลาดที่อาจทำให้ระบบคอมพิวเตอร์เสียหายได้
    • IOC-2.B.11 ผู้ใช้สามารถควบคุมสิทธิ์ของโปรแกรมในการเก็บรวบรวมข้อมูลผู้ใช้ ผู้ใช้ควรตรวจสอบการตั้งค่าสิทธิ์ของโปรแกรมเพื่อปกป้องความเป็นส่วนตัวของตน

    จุดประสงค์การเรียนรู้ IOC-2.C: อธิบายวิธีการเข้าถึงทรัพยากรคอมพิวเตอร์โดยไม่ได้รับอนุญาต [ทักษะ 5.E]

    • IOC-2.C.1 Phishing เป็นเทคนิคที่พยายามหลอกลวงผู้ใช้ให้เปิดเผยข้อมูลส่วนตัว ซึ่งข้อมูล tersebutจะถูกนำไปใช้เข้าถึงแหล่งข้อมูลออนไลน์ที่สำคัญ เช่น บัญชีธนาคารและอีเมล
    • IOC-2.C.2 Keylogging คือการใช้โปรแกรมบันทึกทุกครั้งที่ผู้ใช้กดแป้นพิมพ์ เพื่อเข้าถึงรหัสผ่านและข้อมูลลับอื่นๆ โดยมิชอบ
    • IOC-2.C.3 ข้อมูลที่ส่งผ่านเครือข่ายสาธารณะสามารถถูกดักจับ วิเคราะห์ และแก้ไขได้ หนึ่งในวิธีที่ทำให้เกิดเหตุการณ์นี้คือผ่านจุดเชื่อมต่อที่ไม่ใช่ทางการ (Rogue access point)
    • IOC-2.C.4 จุดเชื่อมต่อที่ไม่ใช่ทางการ (Rogue access point) คือจุดเชื่อมต่อไร้สายที่ให้สิทธิ์เข้าถึงเครือข่ายที่ปลอดภัยโดยไม่ได้รับอนุญาต
    • IOC-2.C.5 ลิงก์ที่เป็นอันตรายอาจถูกซ่อนอยู่ในหน้าเว็บหรือข้อความอีเมล
    • IOC-2.C.6 อีเมลที่ไม่ได้รับการร้องขอ ไฟล์แนบ ลิงก์ และแบบฟอร์มในอีเมล สามารถถูกใช้เพื่อโจมตีความปลอดภัยของระบบคอมพิวเตอร์ สิ่งเหล่านี้อาจมาจากผู้ส่งที่ไม่รู้จัก หรือผู้ส่งที่รู้จักแต่ระบบความปลอดภัย theirs ถูกบุกรุกแล้ว
    • IOC-2.C.7 การดาวน์โหลดที่ไม่น่าเชื่อถือ (มักเป็นฟรี) จากเว็บไซต์ฟรีแวร์หรือแชร์แวร์ อาจมีมัลแวร์แฝงอยู่

    Source: College Board AP Course and Exam Description · ⁨แหล่งที่มา: คำอธิบายหลักสูตรและข้อสอบ College Board AP⁩

    English

    Protecting personal data is a shared responsibility. Key ideas:

    • Personally identifiable information (PII) 个人身份信息 (name, address, ID numbers) should be shared carefully, because it can be misused for identity theft 身份盗窃.
    • Threats include phishing 网络钓鱼 (tricking you into revealing information), malware 恶意软件, and weak passwords.
    • A malicious link can be disguised on a web page or in an email message: the text you see and the address it actually goes to are separate, so a link reading www.yourbank.com can point anywhere. Hover to see the real destination before clicking, and be most suspicious of a link that arrives unexpectedly and creates urgency.
    • Defenses include strong, unique passwords, multi-factor authentication 多因素认证, encryption 加密 (scrambling data so only authorized people can read it), and keeping software updated.

    Encryption is the central tool for keeping data private in transit and storage. Being a responsible computer user means protecting your own and others' information.

    Exam skill: be able to identify the beneficial and harmful effects of a given innovation, explain a privacy or security risk, and name a safe-computing practice that addresses it.

    Worked example. A hiring algorithm is trained on a company's past hires, who were mostly one group, and it then rejects qualified applicants from other groups. Name the problem and its cause: this is computing bias, caused by biased training data — the model learned the historical pattern instead of a fair rule. A full-mark exam answer states the harm (qualified people are unfairly rejected) and its cause (the bias came from the data, not the code).

    ไทย

    การปกป้องข้อมูลส่วนตัวเป็นความรับผิดชอบร่วมกัน แนวคิดสำคัญ:

    การเข้ารหัสทำให้ข้อความplaintext บิดเบี้ยวด้วยกุญแจ; มีเพียงกุญแจเท่านั้นที่จะถอดรหัสได้
    การเข้ารหัสทำให้ข้อความplaintext บิดเบี้ยวด้วยกุญแจ; มีเพียงกุญแจเท่านั้นที่จะถอดรหัสได้
    • ข้อมูลระบุตัวตนส่วนบุคคล (PII) (ชื่อ, ที่อยู่, หมายเลขบัตรประจำตัว) ควรแบ่งปันด้วยความระมัดระวัง เนื่องจากอาจถูกนำไปใช้ในทางที่ผิดเพื่อ ขโมยตัวตน
    • Threats ได้แก่ phishing (หลอกลวงให้คุณเปิดเผยข้อมูล), malware, และรหัสผ่านที่อ่อนแอ
    • ลิงก์ที่เป็นอันตรายอาจซ่อนอยู่ บนหน้าเว็บหรือในข้อความอีเมล: ข้อความที่คุณเห็นและที่อยู่จริงที่มันพาคุณไปนั้นแยกออกจากกัน ดังนั้นลิงก์ที่แสดงว่า www.yourbank.com สามารถชี้ไปยังที่ใดก็ได้ ให้เลื่อนเมาส์เพื่อดูปลายทางที่แท้จริงก่อนคลิก และให้สงสัยมากที่สุดกับลิงก์ที่เข้ามาอย่างไม่มีคำเตือนและสร้างความเร่งด่วน
    • การป้องกันรวมถึง รหัสผ่าน ที่แข็งแรงและเป็นเอกลักษณ์, การยืนยันตัวตนหลายขั้นตอน, การเข้ารหัส (การบิดเบี้ยวข้อมูลเพื่อให้เฉพาะผู้ที่มีสิทธิ์เท่านั้นที่อ่านได้), และการรักษาซอฟต์แวร์ให้ทันสมัย

    การเข้ารหัส เป็นเครื่องมือหลักในการรักษาความเป็นส่วนตัวของข้อมูลขณะส่งและจัดเก็บ การเป็นผู้ใช้งานคอมพิวเตอร์ที่มีความรับผิดชอบหมายความว่าต้องปกป้องข้อมูลของตนเองและผู้อื่น

    ทักษะข้อสอบ: ต้องสามารถระบุผลกระทบเชิงบวกและลบของนวัตกรรมที่กำหนด อธิบายความเสี่ยงด้านความเป็นส่วนตัวหรือความปลอดภัย และระบุแนวปฏิบัติทางการคำนวณที่ปลอดภัยที่แก้ไขปัญหานั้น

    ตัวอย่างวิธีทำ. อัลกอริทึมการสรรหาพนักงานถูกฝึกฝนจากประวัติการจ้างงานในอดีตของบริษัทซึ่งส่วนใหญ่เป็นกลุ่มหนึ่ง จากนั้นจึงปฏิเสธผู้สมัครที่มีคุณสมบัติจากกลุ่มอื่นๆ ชื่อปัญหาและสาเหตุ: นี่คือ ความลำเอียงในการคำนวณ (computing bias), เกิดจากข้อมูลการฝึกฝนที่มีอคติ — โมเดลเรียนรู้รูปแบบทางประวัติศาสตร์แทนที่จะเรียนรู้กฎที่ยุติธรรม คำตอบเต็มคะแนนในข้อสอบระบุว่าทั้งความเสียหาย (คนที่มีคุณสมบัติถูกรับรองไม่ถูกต้อง) และ สาเหตุ (ความลำเอียงมาจากข้อมูล ไม่ใช่โค้ด)

    Explore · ⁨สำรวจ⁩

    Scramble a message with encryption · ⁨รบกวนข้อความด้วยการเข้ารหัส⁩

    Encryption protects data by scrambling it with a key; only someone with the key can read it back. This simple Caesar cipher shifts each letter — real encryption uses the same idea with far stronger keys to keep passwords and messages safe. · ⁨การเข้ารหัส ปกป้องข้อมูลโดยการรบกวนมันด้วยกุญแจ; มีเพียงผู้ที่มีกุญแจเท่านั้นที่อ่านกลับได้ รหัสซีซาร์ แบบง่ายนี้เลื่อนแต่ละตัวอักษร — การเข้ารหัสจริงใช้แนวคิดเดียวกันกับกุญแจที่แข็งแกร่งกว่ามากเพื่อรักษาความลับของรหัสผ่านและข้อความ⁩

    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    Bias/ˈbaɪəs/ ความลำเอียง
    phishing/ˈfɪʃɪŋ/ ฟิชชิ่ง (phishing)
    malware/ˈmælweə/ มัลแวร์
    multi-factor authentication/ˈmʌlti ˈfæktə ɔːˌθentɪˈkeɪʃn/ การยืนยันตัวตนหลายปัจจัย
    encryption/enˈkrɪpʃn/ การเข้ารหัส
    5.6

    Exam tips · ⁨ข้อแนะนำสำหรับการสอบ⁩

    English
    • Argue both the beneficial and harmful effects of a computing innovation — a balanced answer scores best.
    • Use correct terms for data concerns: PII, privacy, security, and algorithmic bias.
    • Explain how crowdsourcing and large data sets create value and raise new risks.
    • Distinguish the digital divide (access) from bias (fairness) and give a concrete example of each.
    • Tie every claim to a specific innovation and effect, as the written response demands.
    ไทย
    • ชี้ให้เห็น ทั้ง ผลกระทบเชิงบวกและลบของนวัตกรรมทางการคำนวณ — คำตอบที่สมดุลจะได้คะแนนดีที่สุด
    • ใช้ศัพท์ที่ถูกต้องสำหรับประเด็นด้านข้อมูล: PII, ความเป็นส่วนตัว, ความปลอดภัย, และความลำเอียงในอัลกอริทึม (algorithmic bias)
    • อธิบายว่า crowdsourcing และชุดข้อมูลขนาดใหญ่สร้างคุณค่าอย่างไรและก่อให้เกิดความเสี่ยงใหม่ใดบ้าง
    • แยกแยะระหว่าง ช่องว่างดิจิทัล (digital divide) (การเข้าถึง) กับความลำเอียง (ความเป็นธรรม) และยกตัวอย่างที่จับต้องได้ของแต่ละอย่าง
    • เชื่อมโยงทุกข้ออ้างเข้ากับนวัตกรรมและผลกระทบที่จำเพาะ ตามที่คำตอบแบบเขียนต้องการ
    Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
    English ไทย
    digital divide/ˈdɪdʒɪtl dɪˈvaɪd/ ช่องว่างดิจิทัล

Log in or create account · ⁨เข้าสู่ระบบหรือสร้างบัญชี⁩

IGCSE, A-Level & AP